PageSourceSearch

https://getthecall.ai/_next/static/chunks/2qv10ijnfn2lg.js

js getthecall.ai collected 2026-10-05 14:18:45 UTC 514,856 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,446254,e=>{"use strict";let t,r,i,s,n,o,a;function l(e,t,r,i,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,s)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var n=e.apply(t,r);function o(e){l(n,i,s,o,a,"next",e)}function a(e){l(n,i,s,o,a,"throw",e)}o(void 0)})}}function c(){return(c=Object.assign.bind()).apply(null,arguments)}function d(e,t){if(null==e)return{};var r={};for(var i in e)if(({}).hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var h,p,_,g=["type"],v=Object.defineProperty,f=(e,t,r)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?v(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r},m=((t=m||{})[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),y=((r=y||{})[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r),b=((i=b||{})[i.MouseUp=0]="MouseUp",i[i.MouseDown=1]="MouseDown",i[i.Click=2]="Click",i[i.ContextMenu=3]="ContextMenu",i[i.DblClick=4]="DblClick",i[i.Focus=5]="Focus",i[i.Blur=6]="Blur",i[i.TouchStart=7]="TouchStart",i[i.TouchMove_Departed=8]="TouchMove_Departed",i[i.TouchEnd=9]="TouchEnd",i[i.TouchCancel=10]="TouchCancel",i),S=((s=S||{})[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s),w=((n=w||{})[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n),k=((o=k||{})[o.Play=0]="Play",o[o.Pause=1]="Pause",o[o.Seeked=2]="Seeked",o[o.VolumeChange=3]="VolumeChange",o[o.RateChange=4]="RateChange",o),x=((a=x||{})[a.Document=0]="Document",a[a.DocumentType=1]="DocumentType",a[a.Element=2]="Element",a[a.Text=3]="Text",a[a.CDATA=4]="CDATA",a[a.Comment=5]="Comment",a),C={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},I={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},E={};function T(e){if(E[e])return E[e];var t=((c=null==(u=null==(l=null==globalThis?void 0:globalThis.Zone)?void 0:l.__symbol__)?void 0:u.call(l,e))&&globalThis[c]?globalThis[c]:void 0)||globalThis[e],r=t.prototype,i=e in C?C[e]:void 0,s=!!(i&&i.every(e=>{var t,i;return!!(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))})),n=e in I?I[e]:void 0,o=!!(n&&n.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return E[e]=t.prototype,t.prototype;var a=document.createElement("iframe");a.style.display="none";var l,u,c,d,h=!1;try{document.body.appendChild(a);var p=a.contentWindow;if(!p)return t.prototype;var _=p[e].prototype;return _?((d=navigator.userAgent).includes("Safari")&&!d.includes("Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",e),h=!0),E[e]=_):r}catch(e){return r}finally{!h&&a.parentNode&&document.body.removeChild(a)}}var M={};function P(e,t,r){var i,s=e+"."+String(r);if(M[s])return M[s].call(t);var n=null==(i=Object.getOwnPropertyDescriptor(T(e),r))?void 0:i.get;return n?(M[s]=n,n.call(t)):t[r]}var R={};function F(e,t,r){var i=e+"."+String(r);if(R[i])return R[i].bind(t);var s=T(e)[r];return"function"!=typeof s?t[r]:(R[i]=s,s.bind(t))}function L(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],s={next:i},n=r(function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return s.next.apply(this,t)});return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:s}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===n)return void(i.next=s.next);r=i.next}else e[t]=s.next}}catch(e){return()=>{}}}var O=e=>P("Node",e,"childNodes"),D=e=>P("Node",e,"parentNode"),A=(e,t)=>
1F("Node",e,"contains")(t),N=e=>e&&"host"in e?P("ShadowRoot",e,"host"):null,q=e=>e&&"shadowRoot"in e?P("Element",e,"shadowRoot"):null;function B(e){return e.nodeType===e.ELEMENT_NODE}function H(e){var t=e&&"host"in e&&"mode"in e&&N(e)||null;return!!(t&&"shadowRoot"in t&&q(t)===e)}function $(e){return"[object ShadowRoot]"===({}).toString.call(e)}function z(e){var t;try{var r=e.rules||e.cssRules;if(!r)return null;var i=e.href;return!i&&e.ownerNode&&(i=e.ownerNode.baseURI),(t=Array.from(r,e=>U(e,i)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}}function U(e,t){if("styleSheet"in e){try{i=z(e.styleSheet)||function(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return X(i,e.styleSheet.href)}catch(e){}return i}var r,i,s=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(s=s.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?X(s,t):s}class W{constructor(){f(this,"idNodeMap",new Map),f(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return -1;var t,r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e)),B(e)){var r=q(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function j(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,s=e.type,n=e.maskInputFn,o=e.value||"",a=s&&V(s);return(r[i.toLowerCase()]||a&&r[a])&&(o=n?n(o,t):"*".repeat(o.length)),o}function V(e){return e.toLowerCase()}var G="__rrweb_original__";function Q(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?V(t):null}var Z=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,K=/^(?:[a-z+]+:)?\/\//i,Y=/^www\..*/i,J=/^(data:)([^,]*),(.*)/i;function X(e,t){return(e||"").replace(Z,(e,r,i,s,n,o)=>{var a=i||n||o,l=r||s||"";if(!a)return e;if(K.test(a)||Y.test(a)||J.test(a))return"url("+l+a+l+")";if("/"===a[0])return"url("+l+((t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]+a)+l+")";var u=t.split("/"),c=a.split("/");for(var d of(u.pop(),c))"."!==d&&(".."===d?u.pop():u.push(d));return"url("+l+u.join("/")+l+")"})}var ee,et,er=1,ei=RegExp("[^a-z0-9-_:]");function es(){return er++}var en=/^[^ \t\n\r\u000c]+/,eo=/^[, \t\n\r\u000c]+/,ea=new WeakMap;function el(e,t){return t&&""!==t.trim()?eu(e,t):t}function eu(e,t){var r=ea.get(e);if(r||(r=e.createElement("a"),ea.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ec(e,t){var r;return(null==t?void 0:t.maxBase64ImageLength)?(r=t.maxBase64ImageLength)&&e.length>r?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":e:e}function ed(e,t,r,i,s,n){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&s){var a=null==(o=s.sheet)?void 0:o.href;if(a)return a}var l=el(e,i);if(l.startsWith("data:")){if("img"===t&&s){var u=l;return((null==n?void 0:n.type)||void 0!==(null==n?void 0:n.quality))&&(u=function(e,t,r,i){if(!e.complete||0===e.naturalWi
1dth||e.naturalWidth>4096||e.naturalHeight>4096)return t;try{var s=document.createElement("canvas");s.width=e.naturalWidth,s.height=e.naturalHeight;var n=s.getContext("2d");return n?(n.drawImage(e,0,0),s.toDataURL(r||"image/webp",null!=i?i:.4)):t}catch(e){return t}}(s,l,n.type,n.quality)),ec(u,n)}if("image"===t)return ec(l,n)}return l}if("xlink:href"===r&&"#"!==i[0]){var c=el(e,i);return"image"===t&&c.startsWith("data:")?ec(c,n):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,s=e.exec(t.substring(r));return s?(r+=(i=s[0]).length,i):""}for(var s=[];i(eo),t.length>r;){var n=i(en);if(","===n.slice(-1))n=el(e,n.substring(0,n.length-1)),s.push(n);else{var o="";n=el(e,n);for(var a=!1;;){var l=t.charAt(r);if(""===l){s.push((n+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,s.push((n+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return s.join(", ")}(e,i):"style"===r?X(i,eu(e)):"object"===t&&"data"===r?el(e,i):i:el(e,i)}function eh(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ep(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ep(D(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&ep(D(e),t,r)}function e_(e,t,r,i){var s;if(B(e)){if(!O(s=e).length)return!1}else{if(null===P("Node",e,"parentElement"))return!1;s=P("Node",e,"parentElement")}try{if("string"==typeof t){if(i){if(s.closest("."+t))return!0}else if(s.classList.contains(t))return!0}else if(ep(s,t,i))return!0;if(r){if(i){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch(e){}return!1}function eg(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var ev=new Map;function ef(e,t){return Array.from(e.styleSheets).find(e=>e.href===t)}function em(e){return null==e?"":e.toLowerCase()}var ey=!1,eb=!1;function eS(e,t){var r=t.doc,i=t.mirror,s=t.blockClass,n=t.blockSelector,o=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,c=t.inlineStylesheet,d=void 0===c||c,h=t.maskInputOptions,p=void 0===h?{}:h,_=t.maskTextFn,g=t.maskInputFn,v=t.slimDOMOptions,f=t.dataURLOptions,m=void 0===f?{}:f,y=t.inlineImages,b=void 0!==y&&y,S=t.recordCanvas,w=void 0!==S&&S,k=t.onSerialize,C=t.onIframeLoad,I=t.iframeLoadTimeout,E=void 0===I?5e3:I,T=t.onIframeListenerRegistered,M=t.onStylesheetLoad,R=t.stylesheetLoadTimeout,F=void 0===R?5e3:R,L=t.keepIframeSrcFn,A=void 0===L?()=>!1:L,N=t.newlyAddedElement,U=t.depth,W=void 0===U?0:U,Z=t.maxDepth,K=void 0===Z?50:Z,Y=t.needsMask,J=t.preserveWhiteSpace,er=void 0===J||J;if(W>=K)return eb=!0,ey||(ey=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+K+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;Y||(Y=e_(e,o,a,void 0===Y));var en,eo=function(e,t){var r=t.doc,i=t.blockClass,s=t.blockSelector,n=t.needsMask,o=t.inlineStylesheet,a=t.maskInputOptions,l=t.maskTextFn,u=t.maskInputFn,c=t.dataURLOptions,d=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,_=t.newlyAddedElement,g=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:x.Document,childNodes:[],compatMode:e.compatMode}:{type:x.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:x.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return function(e,t){for(var r,i,s,n,o=t.doc,a=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,c=t.maskInputFn,d=t.dataURLOptions,h=void 0===d?{}:d,p=t.inlineImages,_=t.recordCanvas,g=t.keepIframeSrcFn,v=t.newlyAddedElement,f=t.rootId,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=V(e.tagName);return ei.test(t)?"div":t}(e),b={},S=e.attributes.length,w=0;S>w;w++){var k=e.attributes[w];eh(y,k.name)||(b[k.name]=ed(o,y,V(k.name),k.value,e,h))}if("link"===y&&a){var C=e.sheet;if(!C){var I=e.href;I&&!(C=ef(o,I))&&I.includes(".css")&&(C=ef(o,window.location.origin+"/"+I.replace(window.location.href,"")))}var E=null;
1C&&(E=z(C)),E&&(delete b.rel,delete b.href,b._cssText=E)}if("style"===y&&e.sheet&&!(e.innerText||P("Node",e,"textContent")||"").trim().length){var T=z(e.sheet);T&&(b._cssText=T)}if("input"===y||"textarea"===y||"select"===y){var M=e.value,R=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&M?b.value=j({element:e,type:Q(e),tagName:y,value:M,maskInputOptions:u,maskInputFn:c}):R&&(b.checked=R)}if("option"===y&&(e.selected&&!u.select?b.selected=!0:delete b.selected),"dialog"===y&&e.open)try{b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){b.rr_open_mode="modal",b.ph_rr_could_not_detect_modal=!0}if("canvas"===y&&_){if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var s=t.getImageData;if(new Uint32Array((G in s?s[G]:s).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(h.type,h.quality));else if(!("__context"in e)){var F=e.toDataURL(h.type,h.quality),L=o.createElement("canvas");L.width=e.width,L.height=e.height,F!==L.toDataURL(h.type,h.quality)&&(b.rr_dataURL=F)}}if("img"===y&&p){ee||(et=(ee=o.createElement("canvas")).getContext("2d"));var O=e.currentSrc||e.getAttribute("src")||"<unknown-src>",D=e.crossOrigin,A=()=>{eg(e,"load",A);try{ee.width=e.naturalWidth,ee.height=e.naturalHeight,et.drawImage(e,0,0),b.rr_dataURL=ee.toDataURL(h.type,h.quality)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?A():e.addEventListener("load",A));console.warn("Cannot inline img src="+O+"! Error: "+t)}"anonymous"===e.crossOrigin&&(D?b.crossOrigin=D:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?A():e.addEventListener("load",A)}if("audio"===y||"video"===y){var N=b;N.rr_mediaState=e.paused?"paused":"played",N.rr_mediaCurrentTime=e.currentTime,N.rr_mediaPlaybackRate=e.playbackRate,N.rr_mediaMuted=e.muted,N.rr_mediaLoop=e.loop,N.rr_mediaVolume=e.volume}if(void 0!==v&&v||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){var q=e.getBoundingClientRect(),B=q.width,H=q.height,$=q.left,U=q.top,W=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);b={class:b.class,rr_width:B+"px",rr_height:H+"px",rr_left:Math.floor($+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(U+((null==(s=o.defaultView)?void 0:s.scrollY)||0))+"px"},W&&(b.rr_position=W.position||"static",W.transform&&"none"!==W.transform&&(b.rr_transform=W.transform),W.dis
1play&&W.display.startsWith("inline")&&(b.rr_display=W.display))}"iframe"!==y||g(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(y)&&(n=!0)}catch(e){}return{type:x.Element,tagName:y,attributes:b,childNodes:[],isSVG:!!("svg"===e.tagName||e.ownerSVGElement)||void 0,needBlock:m,rootId:f,isCustom:n}}(e,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:o,maskInputOptions:void 0===a?{}:a,maskInputFn:u,dataURLOptions:void 0===c?{}:c,inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:void 0!==_&&_,rootId:g});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,s=t.maskTextFn,n=t.rootId,o=D(e),a=o&&o.tagName,l=P("Node",e,"textContent"),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=z(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=X(l,eu(t.doc))}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&i&&(l=s?s(l,P("Node",e,"parentElement")):l.replace(/[\S]/g,"*")),{type:x.Text,textContent:l||"",isStyle:u,rootId:n}}(e,{doc:r,needsMask:n,maskTextFn:l,rootId:g});case e.CDATA_SECTION_NODE:return{type:x.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:x.Comment,textContent:P("Node",e,"textContent")||"",rootId:g};default:return!1}}(e,{doc:r,mirror:i,blockClass:s,blockSelector:n,needsMask:Y,inlineStylesheet:d,maskInputOptions:p,maskTextFn:_,maskInputFn:g,dataURLOptions:m,inlineImages:b,recordCanvas:w,keepIframeSrcFn:A,newlyAddedElement:void 0!==N&&N});if(!eo)return console.warn(e,"not serialized"),null;en=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===x.Comment)return!0;if(e.type===x.Element&&(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e){try{r=new URL(e,window.location.href)}catch(e){return null}var t,r,i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(t=null==i?void 0:i[1])?t:null}(e.attributes.href))||t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(em(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===em(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(em(e.attributes.rel))))||"meta"===e.tagName&&(t.headMetaDescKeywords&&em(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(em(e.attributes.property).match(/^(og|twitter|fb):/)||em(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===em(e.attributes.name))||t.headMetaRobots&&["robots","googlebot","bingbot"].includes(em(e.attributes.name))||t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"]||t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(em(e.attributes.name))||em(e.attributes.property).match(/^article:/)||em(e.attributes.property).match(/^product:/))||t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(em(e.attributes.name)))))return!0;return!1}(eo,v)&&(er||eo.type!==x.Text||eo.isStyle||eo.textContent.replace(/^\s+|\s+$/gm,"").length)?es():-2;var ea=Object.assign(eo,{id:en});if(i.add(e,ea),-2===en)return null;k&&k(e);var el=!u;if(ea.type===x.Element){el=el&&!ea.needBlock,delete ea.needBlock;var ec=q(e);ec&&$(ec)&&(ea.isShadowHost=!0)}if((ea.type===x.Document||ea.type===x.Element)&&el){v.headWhitespace&&ea.type===x.Element&&"head"===ea.tagName&&(er=!1);var ep={doc:r,mirror:i,blockClass:s,blockSelector:n,needsMask:Y,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:p,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:m,inlineImages:b,recordCanvas:w,preserveWhiteSpace:er,onSerialize:k,onIframeLoad:C,iframeLoadTimeout:E,onIframeListenerRegistered:T,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:A,depth:W+1,maxDepth:K};if(ea.type===x.Element&&"textarea"===ea.tagName&&void 0!==ea.attributes.value);else for(var ew of Array.from(O(e))){var ek=eS(ew,ep);ek&&ea.childNodes.push(ek)}var ex=null;if(B(e)&&(ex=q(e)))for(var eC of Array.from(O(ex))){var eI=eS(eC,ep);eI&&($(ex)&&(eI.isShadow=!0),ea.childNodes.push(eI))}}var eE=D(e);if(eE&&H(eE)&&$(eE)&&(ea.isShadow=!0),ea.type===x.Element&&"iframe"===ea.tagName){var eT=function(e,t,r){var i,s=()=>{},n=e.contentWindow;if(!n)return s;try{i=n.document.readyState}catch(e){return s}var o=()=>t();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),eg(e,"load",c),e.addEventListener("load",o),t())},c=()=>u();return l=setTimeout(u,r),e.addEventListener("load",c),()=>{null!==l&&(clearTimeout(l),l=null),a?eg(e,"load",o):(a=!0,eg(e,"load",c)
1)}}var d,h="about:blank";try{d=n.location.href}catch(e){return s}if(d!==h||e.src===h||""===e.src){var p=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(p),eg(e,"load",o)}}return e.addEventListener("load",o),()=>{eg(e,"load",o)}}(e,()=>{var t=e.contentDocument;if(t&&C){var r=eS(t,{doc:t,mirror:i,blockClass:s,blockSelector:n,needsMask:Y,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:m,inlineImages:b,recordCanvas:w,preserveWhiteSpace:er,onSerialize:k,onIframeLoad:C,iframeLoadTimeout:E,onIframeListenerRegistered:T,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:A,depth:W+1,maxDepth:K});r&&C(e,r)}},E);null==T||T(e,eT)}return ea.type===x.Element&&"link"===ea.tagName&&"stylesheet"===ea.attributes.rel&&function(t,l){if(!ev.has(t)){var u;try{u=t.sheet}catch(e){return}if(!u){var c=new AbortController,h=!1,f=()=>{if(!h){h=!0;try{if(M){var l=eS(e,{doc:r,mirror:i,blockClass:s,blockSelector:n,needsMask:Y,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:m,inlineImages:b,recordCanvas:w,preserveWhiteSpace:er,onSerialize:k,onIframeLoad:C,iframeLoadTimeout:E,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:A,depth:W,maxDepth:K});l&&M(e,l)}}finally{ev.delete(t),c.abort()}}},y=setTimeout(f,l);c.signal.addEventListener("abort",()=>clearTimeout(y),{once:!0}),t.addEventListener("load",f,{signal:c.signal,once:!0}),ev.set(t,c)}}}(e,F),ea}function ew(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class ek{constructor(){f(this,"parentElement",null),f(this,"parentNode",null),f(this,"ownerDocument"),f(this,"firstChild",null),f(this,"lastChild",null),f(this,"previousSibling",null),f(this,"nextSibling",null),f(this,"ELEMENT_NODE",1),f(this,"TEXT_NODE",3),f(this,"nodeType"),f(this,"nodeName"),f(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof ek)||e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function ex(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>eC(r,e,t,i)}function eC(e,t,r,i){eI(()=>{var s=e.removeEventListener;"function"==typeof s&&(void 0!==i?s.call(e,t,r,i):s.call(e,t,r))})}function eI(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var eE="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.",eT={map:{},getId:()=>(console.error(eE),-1),getNode:()=>(console.error(eE),null),removeNodeFromMap(){console.error(eE)},has:()=>(console.error(eE),!1),reset(){console.error(eE)}};function eM(e,t,r){void 0===r&&(r={});var i=null,s=0;return function(){for(var n=arguments.length,o=Array(n),a=0;n>a;a++)o[a]=arguments[a];var l=Date.now();s||!1!==r.leading||(s=l);var u=t-(l-s),c=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),s=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout(()=>{s=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)},u))}}function eP(e,t,r,i,s){void 0===s&&(s=window);var n=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,i?r:{set(e){setTimeout(()=>{try{r.set.call(this,e)}catch(e){}},0),n&&n.set&&n.set.call(this,e)}}),()=>eP(e,t,n||{},!0)}"u">typeof window&&window.Proxy&&window.Reflect&&(eT=new Proxy(eT,{get:(e,t,r)=>("map"===t&&console.error(eE),Reflect.get(e,t,r))}));var eR=Date.now;function eF(e){var t,r,i,s,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=P("Node",n.body,"parentElement"))?void 0:t.scrollLeft)||(null==(r=null==n?void 0:n.body)?void 0:r.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(i=P("Node",n.body,"parentElement"))?void 0:i.scrollTop)||(null==(s=null==n?void 0:n.body)?void 0:s.scrollTop)||0}}function eL(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function eO(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eD(e){return e?e.nodeType===e.ELEMENT_NODE?e:P("Node",e,"parentElement"):null}
1function eA(e,t,r,i){if(!e)return!1;var s=eD(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t)||i&&null!==s.closest("."+t))return!0}else if(ep(s,t,i))return!0}catch(e){}return!!(r&&(s.matches(r)||i&&null!==s.closest(r)))||!1}function eN(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function eq(e){return!!e.changedTouches}function eB(e,t){return!!("IFRAME"===e.nodeName&&t.getMeta(e))}function eH(e,t){return!!("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function e$(e){return!!e&&(e instanceof ek&&"shadowRoot"in e?!!e.shadowRoot:!!q(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(eR=()=>(new Date).getTime());class ez{constructor(){f(this,"id",1),f(this,"styleIDMap",new WeakMap),f(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){var r;return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r)}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function eU(e){var t,r=null;return"getRootNode"in e&&(null==(t=F("Node",e,"getRootNode")())?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&N(F("Node",e,"getRootNode")())&&(r=N(F("Node",e,"getRootNode")())),r}function eW(e){var t,r,i=e.ownerDocument;return!!i&&(A(i,e)||!!(r=(t=e).ownerDocument)&&A(r,function(e){for(var t,r=e;t=eU(r);)r=t;return r}(t)))}class ej{constructor(){f(this,"length",0),f(this,"head",null),f(this,"tail",null)}get(e){if(e>=this.length)throw Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&"__ln"in e.previousSibling){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&"__ln"in e.nextSibling&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}class eV{constructor(){f(this,"frozen",!1),f(this,"locked",!1),f(this,"texts",[]),f(this,"attributes",[]),f(this,"attributeMap",new WeakMap),f(this,"removes",[]),f(this,"mapRemoves",[]),f(this,"movedMap",{}),f(this,"addedSet",new Set),f(this,"movedSet",new Set),f(this,"droppedSet",new Set),f(this,"removesSubTreeCache",new Set),f(this,"mutationCb"),f(this,"blockClass"),f(this,"blockSelector"),f(this,"maskTextClass"),f(this,"maskTextSelector"),f(this,"inlineStylesheet"),f(this,"maskInputOptions"),f(this,"maskTextFn"),f(this,"maskInputFn"),f(this,"keepIframeSrcFn"),f(this,"recordCanvas"),f(this,"inlineImages"),f(this,"slimDOMOptions"),f(this,"dataURLOptions"),f(this,"doc"),f(this,"mirror"),f(this,"iframeManager"),f(this,"stylesheetManager"),f(this,"shadowDomManager"),f(this,"canvasManager"),f(this,"processedNodeManager"),f(this,"unattachedDoc"),f(this,"canvasManagerReleased",!1),f(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),f(this,"emit",()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new ej,i=e=>{for(var t=e,r=-2;-2===r;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},s=s=>{var n=D(s);if(n&&eW(s)&&"TEXTAREA"!==n.tagName){var o=H(n)?this.mirror.getId(eU(s)):this.mirror.getId(n),a=i(s);if(-1===o||-1===a)return r.addNode(s);var l=eS(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inl
1ineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{eB(e,this.mirror)&&this.iframeManager.addIframe(e),eH(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),e$(s)&&this.shadowDomManager.addShadowRoot(q(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var n of this.movedSet)eQ(this.removesSubTreeCache,n)&&!this.movedSet.has(D(n))||s(n);for(var o of this.addedSet)eZ(this.droppedSet,o)||eQ(this.removesSubTreeCache,o)?eZ(this.movedSet,o)?s(o):this.droppedSet.add(o):s(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(D(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(D(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var _=D(h.value);if(_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=N(_);if(-1!==this.mirror.getId(g)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),s(l.value)}var v={texts:this.texts.map(e=>{var t=e.node,r=D(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{var t=e.attributes;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(v.texts.length||v.attributes.length||v.removes.length||v.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(v))}}),f(this,"bufferBelongsToIframe",e=>this.doc===e.contentDocument),f(this,"genTextAreaValueMutation",e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(O(e),e=>P("Node",e,"textContent")||"").join("");t.attributes.value=j({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Q(e),value:r,maskInputFn:this.maskInputFn})}),f(this,"processMutation",e=>{if(!eN(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=P("Node",e.target,"textContent");eA(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:e_(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,eD(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,s=e.target.getAttribute(i);if("value"===i){var n=Q(r);s=j({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:n,value:s,maskInputFn:this.maskInputFn})}if(eA(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!eh(r.tagName,i))if(o.attributes[i]=ed(this.doc,V(r.tagName),V(i),s,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&(a.style.cssText=e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===c?u:[u,c]:o._unchangedStyles[l]=[u,c]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(eA(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);
1e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{var r=this.mirror.getId(t),i=H(e.target)?this.mirror.getId(N(e.target)):this.mirror.getId(e.target);eA(e.target,this.blockClass,this.blockSelector,!1)||eN(t,this.mirror,this.slimDOMOptions)||-1===this.mirror.getId(t)||(this.addedSet.has(t)?(eG(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||function e(t,r){if(H(t))return!1;var i=r.getId(t);if(!r.has(i))return!0;var s=D(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[r+"@"+i]?eG(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!H(e.target)||!$(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),O(i).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),f(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(eN(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[this.mirror.getId(e)+"@"+r]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);eA(e,this.blockClass,this.blockSelector,!1)||(O(e).forEach(e=>this.genAdds(e)),e$(e)&&O(q(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]}),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 eG(e,t){e.delete(t),O(t).forEach(t=>eG(e,t))}function eQ(e,t,r){var i;return 0!==e.size&&!!(i=D(t))&&e.has(i)}function eZ(e,t){return 0!==e.size&&function e(t,r){var i=D(r);return!!i&&(!!t.has(i)||e(t,i))}(e,t)}var eK=e=>t_?function(){try{return e(...arguments)}catch(e){if(t_&&!0===t_(e))return;throw e}}:e,eY=[];function eJ(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function eX(e,t){var r=new eV;eY.push(r),r.init(e);var i=new(T("MutationObserver")).constructor(eK(r.processMutations.bind(r))),s={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(s.attributeFilter=e.attributeFilter),i.observe(t,s),{observer:i,buffer:r}}function e0(e){var t=e.scrollCb,r=e.doc,i=e.mirror,s=e.blockClass,n=e.blockSelector,o=e.sampling,a=new Map,l=e=>{var o=eJ(e);if(o&&!eA(o,s,n,!0)){var l,u,c=i.getId(o);if(o===r&&r.defaultView){var d=eF(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var h=l+","+u;a.get(c)!==h&&(a.set(c,h),t({id:c,x:l,y:u}))}},u=[ex("scroll",eK(eM(eK(e=>l(e)),o.scroll||100)),r)];return"onscrollend"in r&&u.push(ex("scrollend",eK(l),r)),()=>u.forEach(e=>e())}function e1(e,t){for(var r=eY.length-1;r>=0;r--){var i=eY[r];if(i){var s=i.bufferBelongsToIframe(e);!s&&t&&t.has(i.bufferDoc())&&(s=!0),s&&(i.reset(),eY.splice(r,1))}}}var e2=["INPUT","TEXTAREA","SELECT"],e5=new WeakMap;function e3(e){return function e(t,r){if(e7("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||e7("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||e7("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||e7("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var s=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(s)}return r}(e,[])}function e4(e,t,r){var i,s;return e?(e.ownerNode?i=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:i}):{}}function e8(e,t){var r,i,s,n,o=e.stylesheetManager;n=e.mirror.getId("#document"===t.nodeName?t:N(t));var a="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(s=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:s.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=l.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==n&&-1!==n)try{o.adoptStyleSheets(e,n)}catch(e){}return r}}),eK(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function e6(e,t){void 0===t&&(t={});var r,i,s,n,o,a,l,u,d,h,p,_,g,v,f,m,w,x,C=e.doc.defaultView;if(!C)return()=>{};if(E=t,T=e.mutationCb,M=e.mousemoveCb,R=e.mouseInteractionCb,F=e.scrollCb,O=e.viewportResizeCb,D=e.inputCb,A=e.mediaInteractionCb,N=e.styleSheetRuleCb,q=e.styleDeclarationCb,B=e.canvasMutationCb,H=e.fontCb,$=e.selectionCb,z=e.customElementCb,e.mutationCb=function(){E.mutation&&E.mutation(...arguments),T(...arguments)},e.mousemoveCb=function(){E.mousemove&&E.mousemove(...arguments),M(...arguments)},e.mouseInteractionCb=function(){E.mouseInteraction&&E.mouseInteraction(...arguments),R(...arguments)},e.scrollCb=function(){E.scroll&&E.scroll(...arguments),F(...arguments)},e.viewportResizeCb=function(){E.viewportResize&&E.viewportResize(...arguments),O(...arguments)},e.inputCb=function(){E.input&&E.input(...arguments),D(...arguments)},e.mediaInteractionCb=function(){E.mediaInteaction&&E.mediaInteaction(...arguments),A(...arguments)},e.styleSheetRuleCb=function(){E.styleSheetRule&&E.styleSheetRule(...arguments),N(...arguments)},e.styleDeclarationCb=function(){E.styleDeclaration&&E.styleDeclaration(...arguments),q(...arguments)},e.canvasMutationCb=function(){E.canvasMutation&&E.canvasMutation(...arguments),B(...arguments)},e.fontCb=function(){E.font&&E.font(...arguments),H(...arguments)},e.selectionCb=function(){E.selection&&E.selection(...arguments),$(...arguments)},e.customElementCb=function(){E.customElement&&E.customElement(...arguments),z(...arguments)},e.recordDOM){var I=eX(e,e.doc);w=I.observer,x=I.buffer}var E,T,M,R,F,O,D,A,N,q,B,H,$,z,U,W,G,Z,K,Y,J,X,ee,et,er,ei,es,en=function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,s=e.mirror;if(!1===r.mousemove)return()=>{};var n,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=eM(eK(e=>{var r=Date.now()-n;t(l.map(e=>(e.timeOffset-=r,e)),e),l=[],n=null}),a),c=eK(eM(eK(e=>{var t=eJ(e),r=eq(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;n||(n=eR()),l.push({x:i,y:o,id:s.getId(t),timeOffset:eR()-n}),u("u">typeof DragEvent&&e instanceof DragEvent?y.Drag:e instanceof MouseEvent?y.MouseMove:y.TouchMove)}),o,{trailing:!1})),d=[ex("mousemove",c,i),ex("touchmove",c,i),ex("drag",c,i)];return eK(()=>
1{d.forEach(e=>e())})}(e),eo=function(e){var t=e.mouseInteractionCb,r=e.doc,i=e.mirror,s=e.blockClass,n=e.blockSelector,o=e.sampling;if(!1===o.mouseInteraction)return()=>{};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[],u=null;return Object.keys(b).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(e=>{var o=V(e),a=r=>{var o=eJ(r);if(!eA(o,s,n,!0)){var a=null,l=e;if("pointerType"in r){switch(r.pointerType){case"mouse":a=S.Mouse;break;case"touch":a=S.Touch;break;case"pen":a=S.Pen}a===S.Touch&&(b[e]===b.MouseDown?l="TouchStart":b[e]===b.MouseUp&&(l="TouchEnd"))}else eq(r)&&(a=S.Touch);null!==a?(u=a,(l.startsWith("Touch")&&a===S.Touch||l.startsWith("Mouse")&&a===S.Mouse)&&(a=null)):b[e]===b.Click&&(a=u,u=null);var d=eq(r)?r.changedTouches[0]:r;if(d){var h=i.getId(o),p=d.clientX,_=d.clientY;eK(t)(c({type:b[l],id:h,x:p,y:_},null!==a&&{pointerType:a}))}}};if(window.PointerEvent)switch(b[e]){case b.MouseDown:case b.MouseUp:o=o.replace("mouse","pointer");break;case b.TouchStart:case b.TouchEnd:return}l.push(ex(o,a,r))}),eK(()=>{l.forEach(e=>e())})}(e),ea=e0(e),el=(U={win:C},W=e.viewportResizeCb,G=U.win,Z=-1,K=-1,ex("resize",eK(eM(eK(()=>{var e=eL(),t=eO();Z===e&&K===t||(W({width:Number(t),height:Number(e)}),Z=e,K=t)}),200)),G)),eu=function(e){var t=e.inputCb,r=e.doc,i=e.mirror,s=e.blockClass,n=e.blockSelector,o=e.ignoreClass,a=e.ignoreSelector,l=e.maskInputOptions,u=e.maskInputFn,d=e.userTriggeredOnInput;function h(e){var t=eJ(e),i=e.isTrusted,c=t&&t.tagName;if(t&&"OPTION"===c&&(t=P("Node",t,"parentElement")),t&&c&&e2.indexOf(c)>=0&&!eA(t,s,n,!0)&&!(t.classList.contains(o)||a&&t.matches(a))){var h=t.value,_=!1,g=Q(t)||"";"radio"===g||"checkbox"===g?_=t.checked:(l[c.toLowerCase()]||l[g])&&(h=j({element:t,maskInputOptions:l,tagName:c,type:g,value:h,maskInputFn:u})),p(t,d?{text:h,isChecked:_,userTriggered:i}:{text:h,isChecked:_});var v=t.name;"radio"===g&&v&&_&&r.querySelectorAll('input[type="radio"][name="'+v+'"]').forEach(e=>{if(e!==t){var r=e.value;p(e,d?{text:r,isChecked:!_,userTriggered:!1}:{text:r,isChecked:!_})}})}}function p(e,r){var s=e5.get(e);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){e5.set(e,r);var n=i.getId(e);eK(t)(c({},r,{id:n}))}}var _=("last"===e.sampling.input?["change"]:["input","change"]).map(e=>ex(e,eK(h),r)),g=r.defaultView;if(!g)return()=>{_.forEach(e=>e())};var v=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return v&&v.set&&_.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map(e=>eP(e[0],e[1],{set(){eK(h)({target:this,isTrusted:!1})}},!1,g))),eK(()=>{_.forEach(e=>e())})}(e),ec=(Y=e.mediaInteractionCb,J=e.blockClass,X=e.blockSelector,ee=e.mirror,et=e.sampling,er=e.doc,es=[ex("play",(ei=eK(e=>eM(eK(t=>{var r=eJ(t);if(r&&!eA(r,J,X,!0)){var i=r.currentTime,s=r.volume,n=r.muted,o=r.playbackRate,a=r.loop;Y({type:e,id:ee.getId(r),currentTime:i,volume:s,muted:n,playbackRate:o,loop:a})}}),et.media||500)))(k.Play),er),ex("pause",ei(k.Pause),er),ex("seeked",ei(k.Seeked),er),ex("volumechange",ei(k.VolumeChange),er),ex("ratechange",ei(k.RateChange),er)],eK(()=>{es.forEach(e=>e())})),ed=()=>{},eh=()=>{},ep=()=>{},e_=()=>{};e.recordDOM&&(ed=function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,s=e.stylesheetManager,n=t.win;if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};var o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:eK((e,t,n)=>{var o=n[0],a=n[1],l=e4(t,i,s.styleMirror),u=l.id,c=l.styleId;
1return(u&&-1!==u||c&&-1!==c)&&r({id:u,styleId:c,adds:[{rule:o,index:a}]}),e.apply(t,n)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),n.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:eK((e,t,n)=>{var o=n[0],a=e4(t,i,s.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),e.apply(t,n)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:eK((e,t,n)=>{var o=n[0],a=e4(t,i,s.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),e.apply(t,n)})})),n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:eK((e,t,n)=>{var o=n[0],a=e4(t,i,s.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),e.apply(t,n)})}));var c={};e9("CSSGroupingRule")?c.CSSGroupingRule=n.CSSGroupingRule:(e9("CSSMediaRule")&&(c.CSSMediaRule=n.CSSMediaRule),e9("CSSConditionRule")&&(c.CSSConditionRule=n.CSSConditionRule),e9("CSSSupportsRule")&&(c.CSSSupportsRule=n.CSSSupportsRule));var d={};return Object.entries(c).forEach(e=>{var t=e[0],n=e[1];d[t]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(d[t].insertRule,{apply:eK((e,t,n)=>{var o=n[0],a=n[1],l=e4(t.parentStyleSheet,i,s.styleMirror),u=l.id,c=l.styleId;
1return(u&&-1!==u||c&&-1!==c)&&r({id:u,styleId:c,adds:[{rule:o,index:[...e3(t),a||0]}]}),e.apply(t,n)})}),n.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:eK((e,t,n)=>{var o=n[0],a=e4(t.parentStyleSheet,i,s.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...e3(t),o]}]}),e.apply(t,n)})})}),eK(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=u,a&&(n.CSSStyleSheet.prototype.replace=a),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule})})}(e,{win:C}),eh=e8(e,e.doc),r=e.styleDeclarationCb,i=e.mirror,s=e.ignoreCSSAttributes,n=e.stylesheetManager,a=(o=({win:C}).win).CSSStyleDeclaration.prototype.setProperty,o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:eK((e,t,o)=>{var l,u=o[0],c=o[1],d=o[2];if(s.has(u))return a.apply(t,[u,c,d]);var h=e4(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,n.styleMirror),p=h.id,_=h.styleId;return(p&&-1!==p||_&&-1!==_)&&r({id:p,styleId:_,set:{property:u,value:c,priority:d},index:e3(t.parentRule)}),e.apply(t,o)})}),l=o.CSSStyleDeclaration.prototype.removeProperty,o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:eK((e,t,o)=>{var a,u=o[0];if(s.has(u))return l.apply(t,[u]);var c=e4(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,n.styleMirror),d=c.id,h=c.styleId;return(d&&-1!==d||h&&-1!==h)&&r({id:d,styleId:h,remove:{property:u},index:e3(t.parentRule)}),e.apply(t,o)})}),ep=eK(()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}),e.collectFonts&&(e_=function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var s=[],n=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return n.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=L(r.fonts,"add",function(e){return function(r){return setTimeout(eK(()=>{var e=n.get(r);e&&(t(e),n.delete(r))}),0),e.apply(this,[r])}});return s.push(()=>{i.FontFace=o}),s.push(a),eK(()=>{s.forEach(e=>e())})}(e)));var eg=(u=e.doc,d=e.mirror,h=e.blockClass,p=e.blockSelector,_=e.selectionCb,g=!0,(v=eK(()=>{var e=u.getSelection();if(!(!e||g&&(null==e?void 0:e.isCollapsed))){g=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,i=0;r>i;i++){var s=e.getRangeAt(i),n=s.startContainer,o=s.startOffset,a=s.endContainer,l=s.endOffset;eA(n,h,p,!0)||eA(a,h,p,!0)||t.push({start:d.getId(n),startOffset:o,end:d.getId(a),endOffset:l})}_({ranges:t})}}))(),ex("selectionchange",v)),ev=(f=e.customElementCb,(m=e.doc.defaultView)&&m.customElements?L(m.customElements,"define",function(e){return function(t,r,i){try{f({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,r,i])}}):()=>{}),ef=[];for(var em of e.plugins)ef.push(em.observer(em.callback,C,em.options));return eK(()=>{if(x){x.destroy(),x.reset();var t=eY.indexOf(x);-1!==t&&eY.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==w||w.disconnect(),en(),eo(),ea(),el(),eu(),ec(),ed(),eh(),ep(),e_(),eg(),ev(),ef.forEach(e=>e())})}function e7(e){return void 0!==window[e]}function e9(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class te{constructor(e){f(this,"iframeIdToRemoteIdMap",new WeakMap),f(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var s=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e),o=s.get(t);return o||(o=this.generateIdFn(),s.set(t,o),n.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,i))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class tt{constructor(e){f(this,"iframes",new WeakMap),f(this,"crossOriginIframeMap",new WeakMap),f(this,"crossOriginIframeMirror",new te(es)),f(this,"crossOriginIframeStyleMirror"),f(this,"crossOriginIframeRootIdMap",new WeakMap),f(this,"mirror"),f(this,"mutationCb"),f(this,"wrappedEmit"),f(this,"loadListener"),f(this,"pageHideListener"),f(this,"stylesheetManager"),f(this,"recordCrossOriginIframes"),f(this,"messageHandler"),f(this,"nestedIframeListeners",new Map),f(this,"attachedWindows",new WeakMap),f(this,"attachedDocuments",new WeakMap),f(this,"attachedIframes",new Map),f(this,"loadListenerDisposers",new WeakMap),f(this,"iframeElementsById",new Map),f(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=ne
1w te(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!=(t=null!=(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)?r:this.iframeElementsById.get(e))?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach(e=>eI(e)),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach(e=>{eC(e.win,"pagehide",e.handler)}),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var s=this.attachedDocuments.get(e);s||this.attachedDocuments.set(e,s=new Set),s.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var n=e.contentWindow;if(this.recordCrossOriginIframes&&n&&!this.nestedIframeListeners.has(n)){var o=this.handleMessage.bind(this);eI(()=>{n.addEventListener("message",o),this.nestedIframeListeners.set(n,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(n)})}eI(()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r){for(var i of r)if(i.win===t)return}var s=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",s),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:s})}}),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type&&e.origin===e.data.origin&&e.source){var t=this.crossOriginIframeMap.get(e.source);if(t){var r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case m.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:m.IncrementalSnapshot,data:{source:y.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case m.Meta:case m.Load:case m.DomContentLoaded:break;case m.Plugin:return t;case m.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case m.IncrementalSnapshot:switch(t.data.source){case y.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case y.Drag:case y.TouchMove:case y.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case y.ViewportResize:return!1;case y.MediaInteraction:case y.MouseInteraction:case y.Scroll:case y.CanvasMutation:case y.Input:return this.replaceIds(t.data,e,["id"]),t;case y.StyleSheetRule:case y.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case y.Font:return t;
1case y.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case y.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(var s of i)(Array.isArray(t[s])||"number"==typeof t[s])&&(t[s]=Array.isArray(t[s])?e.getIds(r,t[s]):e.getId(r,t[s]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===x.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,s=this.attachedWindows.get(r);s&&(s.forEach(e=>{var t=this.nestedIframeListeners.get(e);t&&(eC(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)}),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(eC(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var n=this.attachedDocuments.get(r);n&&(n.forEach(e=>{eI(()=>this.mirror.removeNodeFromMap(e))}),eI(()=>e1(r,n)),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach((t,r)=>{this.mirror.has(r)||e.push(r)}),e.forEach(e=>this.removeIframeById(e))}}reattachIframes(){this.attachedIframes.forEach((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)})}destroy(){this.recordCrossOriginIframes&&eC(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((e,t)=>{eC(t,"message",e)}),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach(t=>e.add(t)),this.attachedIframes.forEach(t=>e.add(t.element)),e.forEach(e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)}),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 tr{constructor(e){f(this,"shadowDoms",new WeakSet),f(this,"mutationCb"),f(this,"scrollCb"),f(this,"bypassOptions"),f(this,"mirror"),f(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var r,i;if($(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var s=null!=(r=null==(i=N(e))?void 0:i.ownerDocument)?r:t,n=eX(c({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),o=n.observer,a=n.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),a.destroy(),a.releaseCanvasManager();var e=eY.indexOf(a);-1!==e&&eY.splice(e,1)}}),this.restoreHandlers.push({doc:s,handler:e0(c({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(N(e))),this.restoreHandlers.push({doc:s,handler:e8({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})},0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:L(e.prototype,"attachShadow",function(e){return function(i){var s=e.call(this,i),n=q(this);return n&&eW(this)&&r.addShadowRoot(n,t),s}})})}
1reset(){this.restoreHandlers.forEach(e=>{var t=e.handler;try{t()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}for(var ti="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ts="u"<typeof Uint8Array?[]:new Uint8Array(256),tn=0;64>tn;tn++)ts[ti.charCodeAt(tn)]=tn;var to=new Map,ta=(e,t,r)=>{if(e&&(tu(e,t)||"object"==typeof e)){var i,s,n=(i=e.constructor.name,(s=to.get(r))||to.set(r,s=new Map),s.has(i)||s.set(i,[]),s.get(i)),o=n.indexOf(e);return -1===o&&(o=n.length,n.push(e)),o}},tl=(e,t,r,i)=>e.map(e=>(function e(t,r,i,s){return t instanceof Array?t.map(t=>e(t,r,i,s)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,s="";for(t=0;i>t;t+=3)s+=ti[r[t]>>2],s+=ti[(3&r[t])<<4|r[t+1]>>4],s+=ti[(15&r[t+1])<<2|r[t+2]>>6],s+=ti[63&r[t+2]];return i%3==2?s=s.substring(0,s.length-1)+"=":i%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[e(t.buffer,r,i,s),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(s.type,s.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[e(t.data,r,i,s),t.width,t.height]}:tu(t,r)||"object"==typeof t?{rr_type:t.constructor.name,index:ta(t,r,i)}:t})(e,t,r,i)),tu=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]).find(r=>e instanceof t[r]),tc=["webgl","webgl2"];function td(e){return"nodeType"in e}function th(e,t,r,i){var s=[];try{if(i){var n=function(e,t,r){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return L(i.prototype,"configure",function(i){return function(s){var n,o,a=(n=this.canvas)&&"object"==typeof n?n:null;if(!a||td(a)&&eA(a,t,r,!0))return i.call(this,s);!td(a)||"__context"in a||(a.__context="webgpu");var l=(o=e.GPUTextureUsage)?o.COPY_SRC|o.RENDER_ATTACHMENT:null;return i.call(this,null!==l&&s?c({},s,{usage:"number"==typeof s.usage?s.usage|l:l}):s)}})}(e,t,r);n&&s.push(n)}var o=L(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s){for(var n="experimental-webgl"===s?"webgl":s,o=arguments.length,a=Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!eA(this,t,r,!0)&&("__context"in this||(this.__context=n),i&&tc.includes(n)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[s,...a])}});s.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function tp(e,t,r,i,s,n,o){var a=[],l=Object.getOwnPropertyNames(e),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof e[l])return 0;var u=L(e,l,function(e){return function(){for(var a=arguments.length,u=Array(a),c=0;a>c;c++)u[c]=arguments[c];var d=e.apply(this,u);if(ta(d,n,this),"tagName"in this.canvas&&!eA(this.canvas,i,s,!0)){var h=tl(u,n,this,o);r(this.canvas,{type:t,property:l,args:h})}return d}});a.push(u)}catch(i){var c=eP(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(c)}};for(var c of l)u(c);return a}var t_,tg,tv,tf,tm='(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;
1 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  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 ("OffscreenCanvas" in globalThis) {\n      const {\n        id,\n        bitmap,\n        width,\n        height,\n        displayWidth,\n        displayHeight,\n        dataURLOptions\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        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          return worker.postMessage({ id });\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      } catch {\n        worker.postMessage({ id });\n      }\n    } else {\n      e.data.bitmap.close();\n      return worker.postMessage({ id: e.data.id });\n    }\n  };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-CZCeNtwG.js.map\n',ty="u">typeof self&&self.Blob&&new Blob([tm],{type:"text/javascript;charset=utf-8"});function tb(e){var t;try{if(!(t=ty&&(self.URL||self.webkitURL).createObjectURL(ty)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(tm),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class tS{constructor(e){f(this,"pendingCanvasMutations",new Map),f(this,"rafStamps",{latestId:0,invokeId:null}),f(this,"mirror"),f(this,"mutationCb"),f(this,"resetObservers"),f(this,"frozen",!1),f(this,"locked",!1),f(this,"rafIdTimestamp",null),f(this,"rafIdFlush",null),f(this,"refCount",0),f(this,"torndown",!1),f(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});var t=e.sampling,r=void 0===t?"all":t,i=e.win,s=e.blockClass,n=e.blockSelector,o=e.recordCanvas,a=e.dataURLOptions,l=e.resolutionScale;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,s,n,a),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,s,n,{dataURLOptions:a,resolutionScale:l})}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(e,t,r,i,s){var n=this;if("OffscreenCanvas"in t){var o,a="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,l=th(t,r,i,!0),c=new Map;try{o=new tb}catch(e){return}var d=!1;o.onerror=()=>{var e;d=!0,cancelAnimationFrame(h),null==(e=o.terminate)||e.call(o)},o.onmessage=e=>{var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,s=r.displayHeight;this.mutationCb({id:t,type:w["2D"],commands:[{property:"clearRect",args:[0,0,i,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,s]}],displayWidth:i,displayHeight:s})}};var h,p=1e3/e,_=0,g=e=>{var l,v,f;d||(_&&p>e-_||(_=e,(l=[],(v=e=>
1{try{e.querySelectorAll("canvas").forEach(e=>{eA(e,r,i,!0)||l.push(e)}),e.querySelectorAll("*").forEach(e=>{e.shadowRoot&&v(e.shadowRoot)})}catch(e){}})(t.document),l).forEach((f=u(function*(e){var t,r,i=n.mirror.getId(e);if(!c.get(i)&&0!==e.width&&0!==e.height){c.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var l=e.getContext(e.__context);if(null==(t=null==l?void 0:l.isContextLost)?void 0:t.call(l))return void c.set(i,!1);!1===(null==(r=null==l?void 0:l.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var u=e.clientWidth||e.width,d=e.clientHeight||e.height,h=Math.max(1,Math.round(u*a)),p=Math.max(1,Math.round(d*a)),_=yield createImageBitmap(e,1>a?{resizeWidth:h,resizeHeight:p,resizeQuality:"medium"}:{resizeWidth:h,resizeHeight:p});o.postMessage({id:i,bitmap:_,width:h,height:p,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions},[_])}catch(e){c.set(i,!1)}}}),function(e){return f.apply(this,arguments)}))),h=requestAnimationFrame(g))};h=requestAnimationFrame(g),this.resetObservers=()=>
1{l(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var s,n,o=th(e,t,r,!1),a=function(e,t,r,i,s){var n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=L(t.CanvasRenderingContext2D.prototype,o,function(n){return function(){for(var a=arguments.length,l=Array(a),u=0;a>u;u++)l[u]=arguments[u];return eA(this.canvas,r,i,!0)||setTimeout(()=>{var r=tl(l,t,this,s);e(this.canvas,{type:w["2D"],property:o,args:r})},0),n.apply(this,l)}});n.push(a)}catch(r){var l=eP(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:w["2D"],property:o,args:[t],setter:!0})}});n.push(l)}};for(var l of o)a(l);return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r,i),l=(s=this.processMutation.bind(this),n=[],void 0!==e.WebGLRenderingContext&&n.push(...tp(e.WebGLRenderingContext.prototype,w.WebGL,s,t,r,e,i)),void 0!==e.WebGL2RenderingContext&&n.push(...tp(e.WebGL2RenderingContext.prototype,w.WebGL2,s,t,r,e,i)),()=>{n.forEach(e=>e())});this.resetObservers=()=>{o(),a(),l()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var i=r.map(e=>d(e,g));this.mutationCb({id:t,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(e)}}}}class tw{constructor(e){f(this,"trackedLinkElements",new WeakSet),f(this,"mutationCb"),f(this,"adoptedStyleSheetCb"),f(this,"styleMirror",new ez),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},s=[],n=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,(t,r)=>({rule:U(t,e.href),index:r}))})),i.styleIds.push(t)};for(var o of e)n(o);s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,ev.forEach(e=>e.abort()),ev.clear()}trackStylesheetInLinkElement(e){}}class tk{constructor(){f(this,"nodeMap",new WeakMap),f(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var tx=!1;try{if(2!==Array.from([1],e=>2*e)[0]){var tC=document.createElement("iframe");document.body.appendChild(tC),Array.from=(null==(_=tC.contentWindow)?void 0:_.Array.from)||Array.from,document.body.removeChild(tC)}}catch(e){console.debug("Unable to override Array.from",e)}var tI=new W,tE=new Set([y.Mutation,y.MediaInteraction,y.StyleSheetRule,y.CanvasMutation,y.Font,y.Log,y.StyleDeclaration,y.AdoptedStyleSheet]);function tT(e){void 0===e&&(e={});var t=e,r=t.emit,i=t.checkoutEveryNms,s=t.checkoutEveryNth,n=t.blockClass,o=void 0===n?"rr-block":n,a=t.blockSelector,l=void 0===a?null:a,u=t.ignoreClass,d=void 0===u?"rr-ignore":u,h=t.ignoreSelector,p=void 0===h?null:h,_=t.maskTextClass,g=void 0===_?"rr-mask":_,v=t.maskTextSelector,f=void 0===v?null:v,b=t.inlineStylesheet,S=void 0===b||b,w=t.maskAllInputs,k=t.maskInputOptions,x=t.slimDOMOptions,C=t.maskInputFn,I=t.maskTextFn,E=t.hooks,T=t.packFn,M=t.sampling,P=void 0===M?{}:M,R=t.dataURLOptions,F=t.canvasResolutionScale,L=t.mousemoveWait,O=t.re
1cordDOM,D=void 0===O||O,A=t.recordCanvas,N=void 0!==A&&A,B=t.recordCrossOriginIframes,H=void 0!==B&&B,$=t.recordAfter,z=void 0===$?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":$,U=t.userTriggeredOnInput,j=void 0!==U&&U,V=t.collectFonts,G=void 0!==V&&V,Q=t.inlineImages,Z=void 0!==Q&&Q,K=t.plugins,Y=t.keepIframeSrcFn,J=void 0===Y?()=>!1:Y,X=t.ignoreCSSAttributes,ee=void 0===X?new Set([]):X,et=t.attributeFilter;t_=t.errorHandler;var er=c({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},void 0===R?{}:R),ei=!H||window.parent===window,es=!1;if(!ei)try{window.parent.document&&(es=!1)}catch(e){es=!0}if(ei&&!r)throw Error("emit function is required");if(!ei&&!es)return()=>{};void 0!==L&&void 0===P.mousemove&&(P.mousemove=L),tI.reset();var en,eo=!0===w?{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!==k?k:{password:!0},ea=ew(void 0!==x&&x);void 0===el&&(el=window),"NodeList"in el&&!el.NodeList.prototype.forEach&&(el.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in el&&!el.DOMTokenList.prototype.forEach&&(el.DOMTokenList.prototype.forEach=[].forEach);var el,eu,ec,ed=0,eh=new Map,ep=e=>{for(var t of K||[])t.eventProcessor&&(e=t.eventProcessor(e));return T&&!es&&(e=T(e)),e};tg=(e,t)=>{var n;if(e.timestamp=eR(),!(null==(n=eY[0])?void 0:n.isFrozen())||e.type===m.FullSnapshot||e.type===m.IncrementalSnapshot&&tE.has(e.data.source)||eY.forEach(e=>e.unfreeze()),ei)null==r||r(ep(e),t);else if(es){var o={type:"rrweb",event:ep(e),origin:window.location.origin,isCheckout:t};window.parent.postMessage(o,"*")}if(e.type===m.FullSnapshot)en=e,ed=0;else if(e.type===m.IncrementalSnapshot){if(e.data.source===y.Mutation&&e.data.isAttachIframe)return;ed++,(s&&ed>=s||i&&e.timestamp-en.timestamp>i)&&tv(!0)}};var e_=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map(e=>e.node.id)):null,r=new Set;if(e.adds.length>0)for(var i of e.adds){var s=tI.getNode(i.node.id);s&&"IFRAME"===s.nodeName&&r.add(s)}e.removes.forEach(e=>{var i=e.id;if(!t||!t.has(i)){var s=em.getIframeElementById(i);s&&r.has(s)?em.forgetIframeId(i):(null==eu||eu(i),em.removeIframeById(i))}}),null==ec||ec(),em.cleanupDetachedIframes()}tg({type:m.IncrementalSnapshot,data:c({source:y.Mutation},e)})},eg=e=>tg({type:m.IncrementalSnapshot,data:c({source:y.Scroll},e)}),ev=e=>tg({type:m.IncrementalSnapshot,data:c({source:y.CanvasMutation},e)}),ef=new tw({mutationCb:e_,adoptedStyleSheetCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.AdoptedStyleSheet},e)})}),em=new tt({mirror:tI,mutationCb:e_,stylesheetManager:ef,recordCrossOriginIframes:H,wrappedEmit:tg});for(var ey of K||[])ey.getMirror&&ey.getMirror({nodeMirror:tI,crossOriginIframeMirror:em.crossOriginIframeMirror,crossOriginIframeStyleMirror:em.crossOriginIframeStyleMirror});var eb=new tk;tf=new tS({recordCanvas:N,mutationCb:ev,win:window,blockClass:o,blockSelector:l,mirror:tI,sampling:P.canvas,dataURLOptions:er,resolutionScale:F});var ek=new tr({mutationCb:e_,scrollCb:eg,bypassOptions:{blockClass:o,blockSelector:l,maskTextClass:g,maskTextSelector:f,inlineStylesheet:S,maskInputOptions:eo,dataURLOptions:er,maskTextFn:I,maskInputFn:C,recordCanvas:N,inlineImages:Z,sampling:P,slimDOMOptions:ea,iframeManager:em,stylesheetManager:ef,canvasManager:tf,keepIframeSrcFn:J,processedNodeManager:eb,attributeFilter:et},mirror:tI});tv=function(e){if(void 0===e&&(e=!1),D){tg({type:m.Meta,data:{href:window.location.href,width:eO(),height:eL()}},e),ef.reset(),ek.init(),eY.forEach(e=>e.lock());var t,r,i,s,n,a,u,c,d,h,p,_,v,y,b,w,k,x,E,T,M,P,R,F,L=(t=document,s=void 0===(i=(r={mirror:tI,blockClass:o,blockSelector:l,maskTextClass:g,maskTextSelector:f,inlineStylesheet:S,maskAllInputs:eo,maskTextFn:I,maskInputFn:C,slimDOM:ea,dataURLOptions:er,recordCanvas:N,inlineImages:Z,onSerialize(e){eB(e,tI)&&em.addIframe(e),eH(e,tI)&&ef.trackLinkElement(e),e$(e)&&ek.addShadowRoot(q(e),document)},onIframeLoad(e,t){em.attachIframe(e,t),ek.observeAttachShadow(e)},onIframeListenerRegistered(e,t){em.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){ef.attachLinkElement(e,t)},keepIframeSrcFn:J}).mirror)?new W:i,n=r.blockClass,a=r.blockSelector,u=r.maskTextClass,c=r.maskTextSelector,d=r.inlineStylesheet,h=r.inlineImages,p=r.recordCanvas,v=void 0!==(_=r.maskAllInputs)&&_,y=r.slimDOM,b=r.dataURLOptions,w=r.preserveWhiteSpace,k=r.onSerialize,x=r.onIframeLoad,E=r.iframeLoadTimeout,T=r.onIframeListenerRegistered,M=r.onStylesheetLoad,P=r.stylesheetLoadTimeout,R=r.keepIframeSrcFn,F=r.maxDepth,eS(t,{doc:t,mirror:s,blockClass:void 0===n?"rr-block":n,blockSelector:void 0===a?null:a,maskTextClass:void 0===u?"rr-mask":u,maskTextSelector:void 0===c?null:c,skipChild:!1,inlineStylesheet:void 0===d||d,maskInputOptions:!0===v?{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===v?{password:!0}:v,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:ew(void 0!==y&&y),dataURLOptions:b,inlineImages:void 0!==h&&h,recordCanvas:void 0!==p&&p,preserveWhiteSpace:w,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:E,onIframeListenerRegistered:T,onStylesheetLoad:M,stylesheetLoadTimeout:P,keepIframeSrcFn:void 0===R?()=>!1:R,newlyAddedElement:!1,maxDepth:F}));if(!L)return console.warn("Failed to snapshot the document");tg({type:m.FullSnapshot,data:{node:L,initialOffset:eF(window)}}
1,e),eY.forEach(e=>e.unlock()),H&&em.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ef.adoptStyleSheets(document.adoptedStyleSheets,tI.getId(document))}};try{var eC=[];eu=e=>{var t=eh.get(e);t&&(t.forEach(e=>{eI(e);var t=eC.indexOf(e);-1!==t&&eC.splice(t,1)}),eh.delete(e))},ec=()=>{for(var e of eh){var t=e[0],r=tI.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==eu||eu(t)}catch(e){null==eu||eu(t)}else null==eu||eu(t)}};var eE=e=>{var t;return eK(e6)({mutationCb:e_,mousemoveCb:(e,t)=>tg({type:m.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.MouseInteraction},e)}),scrollCb:eg,viewportResizeCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.ViewportResize},e)}),inputCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.Input},e)}),mediaInteractionCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.MediaInteraction},e)}),styleSheetRuleCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.StyleSheetRule},e)}),styleDeclarationCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.StyleDeclaration},e)}),canvasMutationCb:ev,fontCb:e=>tg({type:m.IncrementalSnapshot,data:c({source:y.Font},e)}),selectionCb(e){tg({type:m.IncrementalSnapshot,data:c({source:y.Selection},e)})},customElementCb(e){tg({type:m.IncrementalSnapshot,data:c({source:y.CustomElement},e)})},blockClass:o,ignoreClass:d,ignoreSelector:p,maskTextClass:g,maskTextSelector:f,maskInputOptions:eo,inlineStylesheet:S,sampling:P,recordDOM:D,recordCanvas:N,inlineImages:Z,userTriggeredOnInput:j,collectFonts:G,doc:e,maskInputFn:C,maskTextFn:I,keepIframeSrcFn:J,blockSelector:l,slimDOMOptions:ea,dataURLOptions:er,mirror:tI,iframeManager:em,stylesheetManager:ef,shadowDomManager:ek,processedNodeManager:eb,canvasManager:tf,ignoreCSSAttributes:ee,attributeFilter:et,plugins:(null==(t=null==K?void 0:K.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>tg({type:m.Plugin,data:{plugin:e.name,payload:t}})})))||[]},E)};em.addLoadListener(e=>{try{var t=tI.getId(e),r=eE(e.contentDocument);if(eC.push(r),-1!==t){var i=eh.get(t);i||eh.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}}),em.addPageHideListener(e=>{var t=tI.getId(e);null==eu||eu(t),e1(e)});var eT=-1,eM=e=>tg({type:m.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),eP=()=>{var e,t,r,i,s=document,n=null!=(e=null!=(t=null!=(r=null!=(i=s.fullscreenElement)?i:s.webkitFullscreenElement)?r:s.mozFullScreenElement)?t:s.msFullscreenElement)?e:null,o=n?tI.getId(n):-1;o!==eT&&(-1!==eT&&eM({id:eT,enter:!1}),eT=o,-1!==o&&eM({id:o,enter:!0}))},eD=()=>{tv(),eC.push(eE(document)),eC.push(ex("fullscreenchange",eP)),eC.push(ex("webkitfullscreenchange",eP)),eC.push(ex("mozfullscreenchange",eP)),eC.push(ex("MSFullscreenChange",eP)),tx=!0};return["interactive","complete"].includes(document.readyState)?eD():(eC.push(ex("DOMContentLoaded",()=>{tg({type:m.DomContentLoaded,data:{}}),"DOMContentLoaded"===z&&eD()})),eC.push(ex("load",()=>{tg({type:m.Load,data:{}}),"load"===z&&eD()},window))),()=>{eC.forEach(e=>eI(e)),eb.destroy(),em.removeLoadListener(),em.destroy(),eh.clear(),ek.reset(),tI.reset(),tx=!1,t_=void 0}}catch(e){console.warn(e)}}tT.addCustomEvent=(e,t)=>{if(!tx)throw Error("please add custom event after start recording");tg({type:m.Custom,data:{tag:e,payload:t}})},tT.freezePage=()=>{eY.forEach(e=>e.freeze())},tT.takeFullSnapshot=e=>{if(!tx)throw Error("please take full snapshot after start recording");tv(e)},tT.mirror=tI;var tM=Object.defineProperty,tP=(e,t,r)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?tM(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r};class tR{constructor(e){tP(this,"fileName"),tP(this,"functionName"),tP(this,"lineNumber"),tP(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var tF=/(^|@)\S+:\d+/,tL=/^\s*at .*(\S+:\d+|\(native\))/m,tO=/^(eval@)?(\[native code])?$/,tD={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(tL)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter(function(e){return!!e.match(tL)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:i.pop());return new tR({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0],lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari(e){return e.stack.split("\n").filter(function(e){return!e.match(tO)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new tR({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new tR({functionName:i,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})},this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],s=2,n=r.length;n>s;s+=2){var o=t.exec(r[s]);o&&i.push(new tR({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],s=0,n=r.length;n>s;s+=2){var o=t.exec(r[s]);o&&i.push(new tR({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter(function(e){return!!e.match(tF)&&!e.match(/^Error created at/)},this).map(function(e){var t=e.split("@"),r=this.extractLocation(t.pop());return new tR({functionName:(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function tA(e){return Array.isArray(e)}function tN(e){return"object"==typeof e&&null!==e&&!tA(e)}
1function tq(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],s=[];return JSON.stringify(e,function(e,t){if(i.length>0){var n,o,a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?s.splice(a,1/0,e):s.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(tN(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||tN(o)&&function e(t,r){if(0===r)return!0;for(var i of Object.keys(t))if(tN(t[i])&&e(t[i],r-1))return!0;return!1}(o,r.depthOfLimit))return n=t.toString(),r.stringLengthLimit&&n.length>r.stringLengthLimit&&(n=n.slice(0,r.stringLengthLimit)+"..."),n;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var l={};for(var u in t){var c=t[u];l[u]=tA(c)?function(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,s=[];if(i.children&&i.children.length>0)for(var n=0;i.children.length>n;n++){var o=i.children[n];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&s.push(o)}s.length>1&&(r+=":eq("+s.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}(c.length?c[0]:null):c}return l}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var tB={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 tH(e,t,r){var i,s=r?Object.assign({},tB,r):tB,n=s.logger;if(!n)return()=>{};i="string"==typeof n?t[n]:n;var o=0,a=!1,l=[];
1if(s.level.includes("error")){var u=t=>{var r=t.message;e({level:"error",trace:tD.parse(t.error).map(e=>e.toString()),payload:[tq(r,s.stringifyOptions)]})};t.addEventListener("error",u),l.push(()=>{t.removeEventListener("error",u)});var c=t=>{var r,i;t.reason instanceof Error?i=[tq("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,s.stringifyOptions)]:(r=Error(),i=[tq("Uncaught (in promise)",s.stringifyOptions),tq(t.reason,s.stringifyOptions)]),e({level:"error",trace:tD.parse(r).map(e=>e.toString()),payload:i})};t.addEventListener("unhandledrejection",c),l.push(()=>{t.removeEventListener("unhandledrejection",c)})}for(var d of s.level)l.push(function(t,r){var i=this;return t[r]?function(t,n,l){try{let l;if(!(n in t))return()=>{};var u=t[n],c={next:u},d=(l=function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return c.next.apply(this,t)},function(){for(var t=arguments.length,n=Array(t),u=0;t>u;u++)n[u]=arguments[u];if(l.apply(i,n),!("assert"===r&&n[0]||a)){a=!0;try{var c=tD.parse(Error()).map(e=>e.toString()).splice(1),d=("assert"===r?n.slice(1):n).map(e=>tq(e,s.stringifyOptions));o++,s.lengthThreshold>o?e({level:r,trace:c,payload:d}):o===s.lengthThreshold&&e({level:"warn",trace:[],payload:[tq("The number of log records reached the threshold.")]})}catch(e){l("rrweb logger error:",e,...n)}finally{a=!1}
1}});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),t[n]=d,()=>{if(t[n]!==d)for(var e=t[n];"function"==typeof e&&e.__rrweb_layer__;){var r=e.__rrweb_layer__;if(r.next===d)return void(r.next=c.next);e=r.next}else t[n]=c.next}}catch(e){return()=>{}}}(t,r):()=>{}}(i,d));return()=>{l.forEach(e=>e())}}var t$=e=>({name:"rrweb/console@1",observer:tH,options:e}),tz=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function tU(e){return"string"==typeof e||e}function tW(e){return"string"==typeof e?e:void 0}var tj,tV,tG,tQ,tZ=((tj={}).AnonymousId="anonymous_id",tj.DistinctId="distinct_id",tj.Props="props",tj.EnablePersonProcessing="enable_person_processing",tj.PersonMode="person_mode",tj.FeatureFlagDetails="feature_flag_details",tj.FeatureFlags="feature_flags",tj.FeatureFlagPayloads="feature_flag_payloads",tj.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",tj.BootstrapFeatureFlags="bootstrap_feature_flags",tj.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",tj.OverrideFeatureFlags="override_feature_flags",tj.Queue="queue",tj.AiQueue="ai_queue",tj.LogsQueue="logs_queue",tj.OptedOut="opted_out",tj.SessionId="session_id",tj.SessionStartTimestamp="session_start_timestamp",tj.SessionLastTimestamp="session_timestamp",tj.PersonProperties="person_properties",tj.GroupProperties="group_properties",tj.InstalledAppBuild="installed_app_build",tj.InstalledAppVersion="installed_app_version",tj.SessionReplay="session_replay",tj.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",tj.SurveyLastSeenDate="survey_last_seen_date",tj.SurveysSeen="surveys_seen",tj.Surveys="surveys",tj.RemoteConfig="remote_config",tj.FlagsEndpointWasHit="flags_endpoint_was_hit",tj.DeviceId="device_id",tj),tK=((tV={}).GZipJS="gzip-js",tV.Base64="base64",tV),tY="min_length",tJ="max_length",tX=["$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"],t0=["token"],t1="NativeGzipValidationError",t2=e=>e.length>=2&&31===e[0]&&139===e[1],t5=(e,t)=>e===tK.GZipJS||t===tK.GZipJS||"gzip"===t,t3=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t4=e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return t3(e)||t===t1},t8=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=t1,t},t6=(tG=u(function*(e,t){18>e.size&&t8("too-short");var r=new Uint8Array((yield e.slice(0,10).arrayBuffer()));t2(r)&&8===r[2]||t8("invalid-header");var i=new DataView((yield e.slice(e.size-8).arrayBuffer()));i.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(tQ)return tQ;tQ=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?0xedb88320^t>>>1:t>>>1;tQ[e]=t>>>0}return tQ})(),r=0xffffffff,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(0xffffffff^r)>>>0})(t)&&t8("invalid-crc");var s=t.length>>>0;i.getUint32(4,!0)!==s&&t8("invalid-size")}),function(e,t){return tG.apply(this,arguments)});function t7(e,t,r){return t9.apply(this,arguments)}function t9(){return(t9=u(function*(e,t,r){void 0===t&&(t=!0);try{var i,s=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(s).then(()=>o.close()).catch((i=u(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return i.apply(this,arguments)})),l=new Response(n.readable).blob(),c=(yield Promise.all([l,a]))[0];return yield t6(c,s),c}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var re=["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"],rt=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return re.concat(t).some(e=>{var t=e.toLowerCase();return -1!==r.indexOf(t)})};function rr(e,t){return -1!==e.indexOf(t)}var ri=function(e){return e.trim()},rs=function(e){return e.replace(/^\$/,"")};function rn(e){var t,r=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}}))?t:"null"}var ro=Object.prototype,ra=ro.hasOwnProperty,rl=ro.toString,ru=Array.isArray||function(e){return"[object Array]"===rl.call(e)},rc=e=>"function"==typeof e,rd=e=>e===Object(e)&&!ru(e),rh=e=>{if(rd(e)){for(var t in e)if(ra.call(e,t))return!1;return!0}return!1},rp=e=>void 0===e,r_=e=>"[object String]"==rl.call(e),rg=e=>
1r_(e)&&0===e.trim().length,rv=e=>null===e,rf=e=>rp(e)||rv(e),rm=e=>"[object Number]"==rl.call(e)&&e==e,ry=e=>rm(e)&&e>0,rb=e=>"[object Boolean]"===rl.call(e),rS=e=>rr(t0,e);function rw(e){return null===e||"object"!=typeof e}function rk(e,t){return({}).toString.call(e)==="[object "+t+"]"}function rx(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var rC=[!0,"true",1,"1","yes"],rI=[!1,"false",0,"0","no"];function rE(e,t,r,i,s){return t>r&&(i.warn("min cannot be greater than max."),t=r),rm(e)?e>r?(i.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+s),rE(s||r,t,r,i))}class rT{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=rE(e.bucketSize,0,100,e._logger),this._refillRate=rE(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=rE(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=Math.floor((t-e.lastAccess)/this._refillInterval);r>0&&(e.tokens=Math.min(e.tokens+r*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+r*this._refillInterval)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),s=this._buckets[i];return s?this._applyRefill(s,r):this._buckets[i]=s={tokens:this._bucketSize,lastAccess:r},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===s.tokens)}stop(){this._buckets={}}}var rM="Mobile",rP="Android",rR="Tablet",rF=rP+" "+rR,rL="iPad",rO="Apple",rD=rO+" Watch",rA="Safari",rN="BlackBerry",rq="Samsung",rB=rq+"Browser",rH=rq+" Internet",r$="Chrome",rz=r$+" OS",rU=r$+" iOS",rW="Internet Explorer",rj=rW+" "+rM,rV="Opera",rG=rV+" Mini",rQ="Edge",rZ="Microsoft "+rQ,rK="Firefox",rY=rK+" iOS",rJ="Nintendo",rX="PlayStation",r0="Xbox",r1=rP+" "+rM,r2=rM+" "+rA,r5="Windows",r3=r5+" Phone",r4="Nokia",r8="Ouya",r6="Generic",r7=r6+" "+rM.toLowerCase(),r9=r6+" "+rR.toLowerCase(),ie="Konqueror",it="Oculus Browser",ir="Vivaldi",ii="Yandex",is="Whale",io="DuckDuckGo",ia="Pale Moon",il="Waterfox",iu="Brave",ic="Google Search App",id="(\\d+(\\.\\d+)?)",ih=RegExp("Version/"+id),ip=RegExp(r0,"i"),i_=RegExp(rX+" \\w+","i"),ig=RegExp(rJ+" \\w+","i"),iv=RegExp(rN+"|PlayBook|BB10","i"),im={"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"},iy=function(e,t,r,i){var s;return t=t||"",(null!=r&&r.brave?iu:null)||(null!=i&&i.detectGoogleSearchApp&&rr(e,"GSA/")?ic:rr(e," OPR/")&&rr(e,"Mini")?rG:rr(e," OPR/")?rV:iv.test(e)?r
1N:rr(e,"IE"+rM)||rr(e,"WPDesktop")?rj:rr(e,"OculusBrowser")?it:rr(e,rB)?rH:rr(e,rQ)||rr(e,"Edg/")?rZ:rr(e,ir+"/")?ir:rr(e,"YaBrowser/")?ii:rr(e,is+"/")?is:rr(e,io+"/")||rr(e,"Ddg/")?io:rr(e,"FBIOS")?"Facebook "+rM:rr(e,"UCWEB")||rr(e,"UCBrowser")?"UC Browser":rr(e,"CriOS")?rU:rr(e,"CrMo")||rr(e,r$)?r$:rr(e,rP)&&rr(e,rA)?r1:rr(e,"FxiOS")?rY:rr(e.toLowerCase(),ie.toLowerCase())?ie:rr(e,iu+"/")?iu:(s=t)&&rr(s,rO)||rr(e,rA)&&!rr(e,r$)&&!rr(e,rP)?rr(e,rM)?r2:rA:rr(e,"PaleMoon/")?ia:rr(e,il+"/")?il:rr(e,rK)?rK:rr(e,"MSIE")||rr(e,"Trident/")?rW:rr(e,"Gecko")?rK:"")},ib={[rj]:[RegExp("rv:"+id)],[rZ]:[RegExp(rQ+"?\\/"+id)],[r$]:[RegExp("("+r$+"|CrMo)\\/"+id)],[rU]:[RegExp("CriOS\\/"+id)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+id)],[rA]:[ih],[r2]:[ih],[rV]:[RegExp("(Opera|OPR)\\/"+id)],[rK]:[RegExp(rK+"\\/"+id)],[rY]:[RegExp("FxiOS\\/"+id)],[ie]:[RegExp("Konqueror[:/]?"+id,"i")],[rN]:[RegExp(rN+" "+id),ih],[r1]:[RegExp("android\\s"+id,"i")],[rH]:[RegExp(rB+"\\/"+id)],[it]:[RegExp("OculusBrowser\\/"+id)],[ir]:[RegExp(ir+"\\/"+id)],[ii]:[RegExp("YaBrowser\\/"+id)],[is]:[RegExp(is+"\\/"+id)],[iu]:[RegExp(iu+"\\/"+id)],[io]:[RegExp("(DuckDuckGo|Ddg)\\/"+id)],[ia]:[RegExp("PaleMoon\\/"+id)],[il]:[RegExp(il+"\\/"+id)],[ic]:[RegExp("GSA\\/"+id)],[rW]:[RegExp("(rv:|MSIE )"+id)],Mozilla:[RegExp("rv:"+id)]},iS=function(e,t,r,i){var s=ib[iy(e,t,r,i)];if(rp(s))return null;for(var n=0;s.length>n;n++){var o=e.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},iw=[[RegExp(r0+"; "+r0+" (.*?)[);]","i"),e=>[r0,e&&e[1]||""]],[RegExp(rJ,"i"),[rJ,""]],[RegExp(rX,"i"),[rX,""]],[iv,[rN,""]],[RegExp(r5,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[r3,""];if(new RegExp(rM).test(t)&&!/IEMobile\b/.test(t))return[r5+" "+rM,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=im[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[r5,i]}return[r5,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=rp(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+rP+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+rP+")","i"),e=>e&&e[2]?[rP,[e[2],e[3],e[4]||"0"].join(".")]:[rP,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[rz,""]],[/Linux|debian/i,["Linux",""]]],ik=function(e){return ig.test(e)?rJ:i_.test(e)?rX:ip.test(e)?r0:RegExp(r8,"i").test(e)?r8:RegExp("("+r3+"|WPDesktop)","i").test(e)?r3:/iPad/.test(e)?rL:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rD:iv.test(e)?r
1N:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(r4,"i").test(e)?r4:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(rM).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?rP:rF:RegExp("(pda|"+rM+")","i").test(e)?r7:RegExp(rR,"i").test(e)&&!RegExp(rR+" pc","i").test(e)?r9:""},ix=function(e,t){var r,i,s,n,o=ik(e);return o===rL||o===rF||"Kobo"===o||"Kindle Fire"===o||o===r9?rR:o===rJ||o===r0||o===rX||o===r8?"Console":o===rD?"Wearable":o?rM:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!=(r=null==t?void 0:t.maxTouchPoints)?r:0)>0?600>Math.min(null!=(i=null==t?void 0:t.screenWidth)?i:0,null!=(s=null==t?void 0:t.screenHeight)?s:0)/(null!=(n=null==t?void 0:t.devicePixelRatio)?n:1)?rM:rR:"Desktop"},iC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function iI(e,t){return"string"==typeof e&&iC.test(e)?e:t()}function iE(e){return e?e.split("#")[0]:e}function iT(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var iM={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}},iP=iM.info;function iR(e){var t=[];for(var r in e){var i=e[r];rv(i)||rp(i)||t.push({key:r,value:function e(t){if(rb(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(ru(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(i)})}return t}function iF(e,t,r){return c({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}function iL(e,t,r,i){return{resourceLogs:[{resource:{attributes:iR(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}let iO=class{constructor(e,t,r,i,s,n,o){var a;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this._config=t,this._logger=r,this._getContext=i,this._onReady=s,this._waitForStoragePersist=n,this._scopeName=o,this._flushPromise=null,this._evictedSinceAdvance=0,this._consecutiveFlushFailures=0,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!=(a=t.maxQueueSize)?a:t.maxBufferSize,t.maxBufferSize),this._flushIntervalMs=t.flushIntervalMs,this._maxBatchRecordsPerPost=t.maxBatchRecordsPerPost,this._rateCapWindowMs=t.rateCapWindowMs,this._maxLogsPerInterval=t.maxLogsPerInterval}reset(){this._clearFlushTimer(),this._flushPromise=null,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._evictedSinceAdvance=0,this._consecutiveFlushFailures=0,this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost}onReconnect(){this._consecutiveFlushFailures=0,this._flushInBackground()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this._runBeforeSend(e);if(null!==t)if(t.body){if(this._checkRateLimit()){var r,i,s,n,o,a,l,u,d={record:(r=this._getContext(),s=(i=iM[t.level||"info"]||iP).text,n=i.number,o=String(Date.now())+"000000",a={},r.distinctId&&(a.posthogDistinctId=r.distinctId),r.sessionId&&(a.sessionId=r.sessionId),r.windowId&&(a["window.id"]=r.windowId),rf(r.sessionStartTimestamp)||(a.sessionStartTimestamp=String(r.sessionStartTimestamp)),rf(r.lastActivityTimestamp)||(a.lastActivityTimestamp=String(r.lastActivityTimestamp)),r.currentUrl&&(a["url.full"]=r.currentUrl),r.screenName&&(a["screen.name"]=r.screenName),r.appState&&(a["app.state"]=r.appState),r.activeFeatureFlags&&r.activeFeatureFlags.length>0&&(a.feature_flags=r.activeFeatureFlags),l=c({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:n,severityText:s,body:{stringValue:t.body},attributes:iR(l)},t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),rp(t.trace_flags)||(u.flags=t.trace_flags),u)};this._onReady(()=>this._enqueue(d))}}else this._logger.info("Log was rejected in beforeSend function")}}_runBeforeSend(e){var t=this._config.beforeSend;if(!t)return e;var r=ru(t)?t:[t],i=e;for(var s of r)try{var n=s(i);if(!n)return this._logger.info("Log was rejected in beforeSend function"),null;i=n}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}return i}_checkRateLimit(){if(void 0===this._maxLogsPerInterval)return!0;var e=Date.now(),t=e-this._intervalWindowStart;return this._rateCapWindowMs>t&&t>=0||(this._intervalWindowStart=e,this._intervalLogCount=0,this._droppedWarned=!1),this._maxLogsPerInterval>this._intervalLogCount?(this._intervalLogCount++,!0):(this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+this._maxLogsPerInterval+" logs per "+this._rateCapWindowMs+"ms"),this._droppedWarned=!0),!1)}flush(){var e=this;return u(function*(){if(!e._instance.isDisabled)return e._flushPromise||(e._flushPromise=e._flushInner().finally(()=>{e._flushPromise=null})),e._flushPromise})()}_flushInner(){var e=this;return u(function*(){e._clearFlushTimer();var t=null!=(s=e._instance.getPersistedProperty(tZ.LogsQueue))?s:[];if(0!==t.length)for(var r=t.length,i=0;t.length>0&&r>i;){e._evictedSinceAdvance=0;var s,n,o,a=Math.min(t.length,e._maxBatchRecordsPerPost),l=t.slice(0,a),u=iL(l.map(e=>
1e.record),e._buildResourceAttributes(),null!=(n=e._scopeName)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance._sendLogsBatch(u);if("too-large"===c.kind&&l.length>1)e._maxBatchRecordsPerPost=Math.max(1,Math.floor(l.length/2)),e._logger.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e._maxBatchRecordsPerPost);else if("retry-later"===c.kind||("too-large"===c.kind?e._logger.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"===c.kind&&e._config.maxBatchRecordsPerPost>e._maxBatchRecordsPerPost&&(e._maxBatchRecordsPerPost=Math.min(e._config.maxBatchRecordsPerPost,e._maxBatchRecordsPerPost+1)),yield e._persistQueueAdvance(l.length),t=null!=(o=e._instance.getPersistedProperty(tZ.LogsQueue))?o:[],i+=l.length,"fatal"===c.kind))throw c.error}})()}_persistQueueAdvance(e){var t=this;return u(function*(){var r,i=Math.max(0,e-t._evictedSinceAdvance),s=null!=(r=t._instance.getPersistedProperty(tZ.LogsQueue))?r:[];t._instance.setPersistedProperty(tZ.LogsQueue,s.slice(i)),yield t._waitForStoragePersist()})()}_buildResourceAttributes(){return iF(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion())}_enqueue(e){var t;if(!this._instance.optedOut){var r=null!=(t=this._instance.getPersistedProperty(tZ.LogsQueue))?t:[];this._maxQueueSize>r.length||(r.shift(),this._evictedSinceAdvance++,this._logger.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(tZ.LogsQueue,r),this._maxBufferSize>r.length?this._armFlushTimer():this._flushInBackground()}}_armFlushTimer(e){void 0===e&&(e=this._flushIntervalMs),this._flushTimer||(this._flushTimer=iT(()=>{this._flushTimer=void 0,this._flushInBackground()},e))}_nextFlushDelay(){var e=Math.min(Math.max(0,this._consecutiveFlushFailures-1),6);return this._flushIntervalMs*Math.pow(2,e)}_hasQueuedRecords(){var e=this._instance.getPersistedProperty(tZ.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return u(function*(){t._clearFlushTimer();var r=t.flush().catch(()=>{});void 0!==e?yield Promise.race([r,new Promise(t=>iT(t,e))]):yield r})()}flushWithTimeout(e){var t=this;return u(function*(){var r=!1,i=t.flush(),s=new Promise(t=>iT(()=>{r=!0,t()},e));try{yield Promise.race([i,s])}finally{r&&i.catch(()=>{})}})()}_flushInBackground(){this.flush().then(()=>{this._consecutiveFlushFailures=0},e=>{this._consecutiveFlushFailures++,this._logger.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this._hasQueuedRecords()&&this._armFlushTimer(this._nextFlushDelay())})}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}};var iD=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function iA(e){return String(e)+"000000"}function iN(e,t,r,i){var s="";return i&&(s=Object.keys(i).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(i[e])).join(",")),e+"\0"+t+"\0"+(null!=r?r:"")+"\0"+s}let iq=class{constructor(e,t,r){this._instance=e,this._config=t,this._logger=r,this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._generation=0}count(e,t,r){void 0===t&&(t=1),this._capture({name:e,type:"count",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(e,t,r){this._capture({name:e,type:"gauge",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(e,t,r){this._capture({name:e,type:"histogram",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var e,t=this,r=this._flushPromise,i=(e=u(function*(){r&&(yield r.catch(()=>{})),yield t._doFlush()}),function(){return e.apply(this,arguments)})().finally(()=>{this._flushPromise===i&&(this._flushPromise=null)});return this._flushPromise=i,i}drainWindow(){if(0===this._series.size)return null;var e=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(e)}reset(){this._generation++,this._clearFlushTimer(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set}_capture(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._runBeforeSend(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this._logger.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{r=t.attributes?c({},t.attributes):void 0,i=iN(t.type,t.name,t.unit,r)}catch(e){return void this._logger.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var r,i,s=this._series.get(i);if(!s){if(!this._admitNewSeries())return;s={name:t.name,type:t.type,unit:t.unit,attributes:r,windowStartMs:Date.now()},this._series.set(i,s)}var n=this._typeByName.get(t.name);void 0===n?this._typeByName.set(t.name,t.type):n===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(s,t.value),this._armFlushTimer()}else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}}_admitNewSeries(){return this._config.maxSeriesPerFlush>this._series.size||(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn("Metric series cap reached ("+this._config.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}_fold(e,t){var r;switch(e.type){case"count":e.total=(null!=(r=e.total)?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(iD.length+1).fill(0)});var i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(var r=0;t.length>r;r++)if(t[r]>=e)return r;return t.length}(t,iD)]+=1}}_runBeforeSend(e){var t=this._config.beforeSend;if(!t)return e;var r=ru(t)?t:[t],i=e;for(var s of r)try{var n=s(i);if(!n)return this._logger.info("Metric was rejected in beforeSend function"),null;i=n}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}return i}_armFlushTimer(){this._flushTimer||(this._flushTimer=iT(()=>{this._flushTimer=void 0,this.flush().catch(e=>{this._logger.error("Metrics flush failed:",e)})},this._config.flushIntervalMs))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_doFlush(){var e=this;return u(function*(){if(0!==e._series.size){var t=e._series;e._series=new Map,e._seriesCapWarned=!1,e._typeByName=new Map,e._typeCollisionWarned=new Set;var r=e._generation,i=yield e._instance._sendMetricsBatch(e._buildPayload(t));if(r===e._generation)switch(i.kind){case"ok":return;case"retry-later":return e._mergeWindowBack(t),void e._armFlushTimer();case"too-large":return void e._logger.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e._logger.error("Failed to send metrics batch:",i.error)}}})()}_buildPayload(e){var t,r,i,s,n,o,a;return s=this._buildMetrics(e),t=this._config,r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),n=c({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":r,"telemetry.sdk.version":i}),o=this._instance.getLibraryId(),a=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:iR(n)},scopeMetrics:[{scope:{name:o,version:a},metrics:s}]}]}}_buildMetrics(e){var t=iA(Date.now()),r=new Map;for(var i of e.values()){var s,n=iN(i.type,i.name,i.unit,void 0),o=r.get(n);o||(o=c({name:i.name},i.unit&&{unit:i.unit}),"count"===i.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===i.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},r.set(n,o));var a=iR(null!=(s=i.attributes)?s:{}),l=iA(i.windowStartMs);if("count"===i.type){var u,d={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=i.total)?u:0};o.sum.dataPoints.push(d)}else if("gauge"===i.type){var h,p={attributes:a,timeUnixNano:t,asDouble:null!=(h=i.last)?h:0};o.gauge.dataPoints.push(p)}else i.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:i.hist.count,sum:i.hist.sum,min:i.hist.min,max:i.hist.max,bucketCounts:i.hist.bucketCounts,explicitBounds:iD})}return Array.from(r.values())}_mergeWindowBack(e){var t,r;for(var i of e){var s=i[0],n=i[1],o=this._series.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,n.windowStartMs),o.type){case"count":o.total=(null!=(t=o.total)?t:0)+(null!=(r=n.total)?r:0);break;case"gauge":break;case"histogram":if(n.hist)if(o.hist){o.hist.count+=n.hist.count,o.hist.sum+=n.hist.sum,o.hist.min=Math.min(o.hist.min,n.hist.min),o.hist.max=Math.max(o.hist.max,n.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=n.hist.bucketCounts[a]}else o.hist=n.hist}else this._admitNewSeries()&&this._series.set(s,n)}}};function iB(e,t){if(e){var r=e.find(e=>e.type===t);return null==r?void 0:r.value}}class iH{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(n,r),$exception_level:"error"}}modifyFrames(e){var t=this;return u(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&ru(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),c({},e,{cause:r,stack:i})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return u(function*(){var r=e;for(var i of t.modifiers)r=yield i(r);return r})()}convertToExceptionList(e,t){var r,i,s,n={type:e.type,value:e.value,mechanism:{type:null!=(r=t.type)?r:"generic",handled:null==(i=t.handled)||i,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,c({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return ae&&r.length===o9||(o9=r.length,ae=r.reduce((r,i)=>{o7||(o7={});var s=o7[i];if(s)r[s[0]]=s[1];else for(var n=e(i),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,o7[i]=[l,u];break}}return r},{})),ae}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var s=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,s)}};return c({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)})}}function i$(e,t,r,i,s){var n={platform:e,filename:t,function:"<anonymous>"===r?"?":r,in_app:!0};return rp(i)||(n.lineno=i),rp(s)||(n.colno=s),n}var iz=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:"?",r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},iU=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,iW=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ij=/\((\S*)(?::(\d+))(?::(\d+))\)/,iV=(e,t)=>{var r=iU.exec(e);if(r)return i$(t,r[1],"?",+r[2],+r[3]);var i=iW.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var s=ij.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var n=iz(i[1]||"?",i[2]);return i$(t,n[1],n[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},iG=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,iQ=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,iZ=(e,t)=>{var r=iG.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=iQ.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var s=r[3],n=r[1]||"?",o=iz(n,s);return i$(t,s=o[1],n=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},iK=/\(error: (.*)\)/;class iY{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=r_(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return rk(e,"DOMException")}isDOMError(e){return rk(e,"DOMError")}}class iJ{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class iX{match(e){return rk(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var i0=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class i1{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),s=i[0],n=i[1];return{type:null!=s?s:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(i0);return i&&(t=i[1],r=i[2]),[t,r]}}var i2=["fatal","error","warning","log","info","debug"];function i5(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var s=r.slice(0,i).join(", ");
1if(t>=s.length)return i===r.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class i3{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return rx(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+i5(e)}isSeverityLevel(e){return r_(e)&&!rg(e)&&i2.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class i4{match(e){return rx(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+i5(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class i8{match(e){return rw(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class i6{match(e){return rk(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!rx(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return rw(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var i7="$message",i9="$timestamp",se=new Set([i7,i9]),st={enabled:!0,max_bytes:32768};function sr(e){var t;return e?{enabled:null!=(t=e.enabled)?t:st.enabled,max_bytes:function(e,t){if(!rm(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}(e.max_bytes,st.max_bytes)}:c({},st)}class si{constructor(e){this._entries=[],this._totalBytes=0,this._config=sr(e)}setConfig(e){this._config=sr(e),this._trimToMaxBytes()}add(e){var t=function(e){var t;try{t=rn(e)}catch(e){return}try{var r=JSON.parse(t);if(!rd(r))return;var i=r[i7],s=r[i9];if(!r_(i)||0===i.trim().length||!r_(s)&&!rm(s))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this._config.max_bytes||(this._entries.push({step:t.step,bytes:r}),this._totalBytes+=r,this._trimToMaxBytes())}}getAttachable(){return this._entries.map(e=>e.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}}}var ss="u">typeof window?window:void 0,sn="u">typeof globalThis?globalThis:ss;"u"<typeof self&&(sn.self=sn),"u"<typeof File&&(sn.File=function(){});var so=null==sn?void 0:sn.navigator,sa=null==sn?void 0:sn.document,sl=null==sn?void 0:sn.location,su=null==sn?void 0:sn.fetch,sc=null!=sn&&sn.XMLHttpRequest&&"withCredentials"in new sn.XMLHttpRequest?sn.XMLHttpRequest:void 0,sd=null==sn?void 0:sn.AbortController,sh=null==sn?void 0:sn.CompressionStream,sp=null==so?void 0:so.userAgent,s_=null!=ss?ss:{};function sg(){return!(!ss||!1===ss.navigator.onLine)}var sv="1.404.1",sf={DEBUG:!1,LIB_VERSION:sv,LIB_NAME:"web",JS_SDK_VERSION:sv},sm=function(e,t){var r=(void 0===t?{}:t).debugEnabled,i={_log(t){if(ss&&(sf.DEBUG||s_.POSTHOG_DEBUG||r)&&!rp(ss.console)&&ss.console){for(var i=("__rrweb_original__"in ss.console[t])?ss.console[t].__rrweb_original__:ss.console[t],s=arguments.length,n=Array(s>1?s-1:0),o=1;s>o;o++)n[o-1]=arguments[o];i(e,...n)}},debug(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("debug",...t)},info(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("log",...t)},warn(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("warn",...t)},error(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];i._log("error",...t)},critical(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>sm(e+" "+t,r)};return i},sy=sm("[PostHog.js]"),sb=sy.createLogger;function sS(e,t){ru(e)&&e.forEach(t)}function sw(e,t){if(!rf(e))if(ru(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,r)=>t(e,r));else for(var r in e)ra.call(e,r)&&t(e[r],r)}var sk=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var s of r)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function sx(e){for(var t=Object.keys(e),r=t.length,i=Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var sC=function(e){try{return e()}catch(e){return}},sI=function(e){return function(){try{for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){sy.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),sy.critical(e)}}},sE=function(e){var t={};return sw(e,function(e,r){(r_(e)&&e.length>0||rm(e))&&(t[r]=e)}),t},sT=["herokuapp.com","vercel.app","netlify.app"];function sM(e,t,r,i){var s=null!=i?i:{},n=s.capture,o=s.passive;null==e||e.addEventListener(t,r,{capture:void 0!==n&&n,passive:void 0===o||o})}function sP(e){return"ph_toolbar_internal"===e.name}var sR=["localhost","127.0.0.1"],sF=e=>{var t=null==sa?void 0:sa.createElement("a");return rp(t)?null:(t.href=e,t)},sL=function(e,t){void 0===t&&(t="&");var r,i,s=[];return sw(e,function(e,t){rp(e)||rp(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),s[s.length]=i+"="+r)}),s.join(t)},sO=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;i.length>s;s++){var n=i[s].split("=");if(n[0]===t){r=n;break}}if(!ru(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){sy.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},sD=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),s=i[1],n=(i[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");ru(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[c]))}var h=a;return null!=o&&(h+="?"+u.join("&")),null!=s&&(h+="#"+s),h},sA=function(e,t){var r=e.match(RegExp(t+"=([^&]*)"));return r?r[1]:null},sN=(e,t)=>e>=t&&sg(),sq=(e,t,r,i)=>{if(0===e){if(sg()){var s=t+1;return s===r&&i(),s}return t}return 0},sB=()=>{};function sH(e,t,r){try{if(!(t in e))return sB;var i={next:e[t]},s=r(function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)});return rc(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}}
1)),e[t]=s,()=>{if(e[t]!==s)for(var r=e[t];rc(r)&&r.__posthog_layer__;){var n=r.__posthog_layer__;if(n.next===s)return void(n.next=i.next);r=n.next}else e[t]=i.next}}catch(e){return sB}}function s$(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),s={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return s;for(var n of t.payloadHostDenyList)if(i.endsWith(n))return{hostname:i,isHostDenied:!0};return s}function sz(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!rc(i))return t;try{var s=i(t);return r_(s)&&s?s:t}catch(e){return sy.error("Error in get_current_url, falling back to window.location.href",e),t}}function sU(e){var t,r=null==ss||null==(t=ss.location)?void 0:t.href;return rp(r)?void 0:sz(e,r)}var sW="$people_distinct_id",sj="$device_id",sV="$device_model",sG="__alias",sQ="__timers",sZ="$autocapture_disabled_server_side",sK="$heatmaps_enabled_server_side",sY="$exception_capture_enabled_server_side",sJ="$error_tracking_suppression_rules",sX="$error_tracking_capture_extension_exceptions",s0="$web_vitals_enabled_server_side",s1="$dead_clicks_enabled_server_side",s2="$product_tours_enabled_server_side",s5="$web_vitals_allowed_metrics",s3="$session_recording_remote_config",s4="$replay_sample_rate",s8="$replay_override_sampling",s6="$replay_override_linked_flag",s7="$replay_override_url_trigger",s9="$replay_override_event_trigger",ne="$sesid",nt="$session_is_sampled",nr="$session_past_minimum_duration",ni="$session_recording_url_trigger_activated_session",ns="$session_recording_event_trigger_activated_session",nn="$posthog_sr_group_event_trigger_",no="$posthog_sr_group_url_trigger_",na="$posthog_sr_group_sampling_",nl="$debug_first_full_snapshot_timestamp",nu="$sess_rec_flush_size",nc="$enabled_feature_flags",nd="$active_feature_flags",nh="$early_access_features",np="$feature_flag_details",n_="$feature_flag_payloads",ng="$feature_flag_request_id",nv="$override_feature_flags",nf="$override_feature_flag_payloads",nm="$stored_person_properties",ny="$stored_group_properties",nb="$surveys",nS="$surveys_loaded_at",nw="$surveys_activated",nk="ph_product_tours",nx="$flag_call_reported",nC="$flag_call_reported_session_id",nI="$feature_flag_errors",nE="$feature_flag_evaluated_at",nT="$user_state",nM="$client_session_props",nP="$capture_rate_limit",nR="$initial_campaign_params",nF="$initial_referrer_info",nL="$initial_person_info",nO="$epp",nD="__POSTHOG_TOOLBAR__",nA="$posthog_cookieless",nN="$sdk_debug_extensions_init_method",nq="$sdk_debug_extensions_init_time_ms",nB="$sdk_debug_recording_script_not_loaded",nH="$sdk_debug_replay_event_trigger_status",n$="$sdk_debug_replay_linked_flag_trigger_status",nz="$sdk_debug_replay_matched_recording_trigger_groups",nU="$sdk_debug_replay_remote_trigger_matching_config",nW="$sdk_debug_replay_trigger_groups_count",nj="$sdk_debug_replay_url_trigger_status",nV="$session_recording_start_reason",nG="PostHog loadExternalDependency extension not found.",nQ="on_reject",nZ="always",nK="anonymous",nY="identified",nJ="identified_only",nX="visibilitychange",n0="beforeunload",n1="$pageview",n2="$pageleave",n5="$identify",n3="$groupidentify";function n4(e){return e instanceof Element&&(e.id===nD||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function n8(e){return!!e&&1===e.nodeType}function n6(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function n7(e){return!!e&&3===e.nodeType}function n9(e){return!!e&&11===e.nodeType&&n8(e.host)}function oe(e){return e?ri(e).split(/\s+/):[]}function ot(e,t){var r=sU(t);return!!(r&&e&&e.some(e=>r.match(e)))}function or(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return oe(t)}function oi(e){return rf(e)?null:ri(e).split(/(\s+)/).filter(e=>oE(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function os(e){var t="";return oy(e)&&!ob(e)&&e.childNodes&&e.childNodes.length&&sw(e.childNodes,function(e){var r;n7(e)&&e.textContent&&(t+=null!=(r=oi(e.textContent))?r:"")}),ri(t)}function on(e){var t;return rp(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var oo=["a","button","form","input","select","textarea","label"];function oa(e,t){if(rp(t))return!0;var r,i=function(e){if(t.some(t=>(function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var s of e)if(r=i(s))return r.v;return!1}function ol(e){var t=e.parentNode;return!(!t||!n8(t))&&t}var ou=[".ph-no-autocapture","[data-ph-no-autocapture]"],oc=["next","previous","prev",">","<"],od=[...oc,"+","-","−","–"],oh=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,op=[".ph-no-deadclick",".ph-no-capture"],o_=[".ph-no-rageclick",".ph-no-capture"],og=["","text","search","email","password","url","tel","number"];function ov(e,t){if(!ss||of(e)||(rb(t)?(i=!!t&&o_,s=void 0,n=!1):(i=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:o_,s=null==t?void 0:t.content_ignorelist,n=null!=(a=null==t?void 0:t.ignore_text_selection)&&a),!1===i)||n&&!(!(r=e)||!n8(r))&&(n6(r,"textarea")||(n6(r,"input")?rr(og,(r.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(r))))return!1;var r,i,s,n,o,a,l=om(e,!1).targetElementList;return!function(e,t){var r;if(!1===e||rp(e))return!1;if(!0===e)r=oc;else{if(!ru(e))return!1;if(e.length>10)return sy.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,i=e.ariaLabel;return r.some(e=>oh(t,e)||oh(i,e))})}(s,l.map(e=>{var t;return{safeText:os(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!oa(l,i)}var of=e=>!e||n6(e,"html")||!n8(e),om=(e,t)=>{if(!ss||of(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],s=e;s.parentNode&&!n6(s,"body");)if(n9(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=ol(s);if(!n)break;if(t||oo.indexOf(n.tagName.toLowerCase())>-1)r=!0;else try{var o=ss.getComputedStyle(n);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(e){}i.push(n),s=n}return{parentIsUsefulElement:r,targetElementList:i}};function oy(e){for(var t=new Set,r=0,i=e;i.parentNode&&!n6(i,"body");i=i.parentNode){if(r++>=1e3||t.has(i))return!1;t.add(i);var s=or(i);if(rr(s,"ph-sensitive")||rr(s,"ph-no-capture"))return!1}if(rr(or(e),"ph-include"))return!0;var n=e.type||"";if(r_(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var o=e.name||e.id||"";return!r_(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function ob(e){return!!(n6(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||n6(e,"select")||n6(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var oS="(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})",ow=RegExp("^(?:"+oS+")$"),ok=new RegExp(oS),ox="\\d{3}-?\\d{2}-?\\d{4}",oC=RegExp("^("+ox+")$"),oI=RegExp("("+ox+")");function oE(e,t){return void 0===t&&(t=!0),!(rf(e)||r_(e)&&(e=ri(e),(t?ow:ok).test((e||"").replace(/[- ]/g,""))||(t?oC:oI).test(e)))&&!0}function oT(e){var t=os(e);return oE(t=(t+" "+function e(t){var r="";return t&&t.childNodes&&t.childNodes.length&&sw(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var s=os(t);r=(r+" "+s).trim(),t.childNodes&&t.childNodes.length&&(r=(r+" "+e(t)).trim())}catch(e){sy.error("[AutoCapture]",e)}}),r}(e)).trim())?t:""}function oM(e){return e.replace(/"|\\"/g,'\\"')}var oP="[SessionRecording]",oR="redacted";function oF(e){var t;return Math.min(1e6,null!=(t=e.payloadSizeLimitBytes)?t:1e6)}var oL={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","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},oO=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],oD=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],oA=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],oN=e=>{rf(e)||sw(Object.keys(e),t=>{var r;r=t.toLowerCase(),(oO.includes(r)||oA.some(e=>r.includes(e)))&&(e[t]=oR)})},oq=["/s/","/e/","/i/"];function oB(e,t,r,i){if(rf(e))return e;var s=(null==t?void 0:t["content-length"])||new Blob([e]).size;return r_(s)&&(s=parseInt(s)),s>r?oP+" "+i+" body too large to record ("+s+" bytes)":e}function oH(e,t){if(rf(e))return e;var r=e;return oE(r,!1)||(r=oP+" "+t+" body "+oR),sw(oD,e=>{var i,s;null!=(i=r)&&i.length&&-1!==(null==(s=r)?void 0:s.indexOf(e))&&(r=oP+" "+t+" body "+oR+" as might contain: "+e)}),r}var o$=sb("[Recorder]"),oz=e=>"resource"===e.entryType;function oU(e,t){return!!t&&(rb(t)||t[e])}function oW(e){if("u"<typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"===({}).toString.call(e)}catch(e){return!1}}var oj=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function oV(e){var t=e.type,r=e.recordBody,i=e.headers;function s(e){var t=Object.keys(i).find(e=>"content-type"===e.toLowerCase()),r=t&&i[t];return e.some(e=>null==r?void 0:r.toLowerCase().includes(e))}if(!r||function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!oW(t)&&e(t.url)}catch(e){return!1}}(e.url)||s(oj))return!1;if(rb(r))return!0;if(ru(r))return s(r);var n=r[t];return rb(n)?n:s(n)}function oG(e,t,r,i,s,n){return oQ.apply(this,arguments)}function oQ(){return(oQ=u(function*(e,t,r,i,s,n){return(void 0===n&&(n=0),n>10)?(o$.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null):function(e){for(var r,n=e.length-1;n>=0;n-=1)if(oz(r=e[n])&&r.initiatorType===t&&(rp(i)||r.startTime>=i)&&(rp(s)||s>=r.startTime))return e[n]}(e.performance.getEntriesByName(r))||(yield new Promise(e=>setTimeout(e,50*n)),oG(e,t,r,i,s,n+1))})).apply(this,arguments)}function oZ(e){var t=e.body,r=e.options,i=e.url;if(rf(t))return null;var s=s$(i,r);if(s.isHostDenied)return s.hostname+" is in deny list";if(r_(t))return t;if(t instanceof Document)return t.textContent;if(t instanceof FormData)return sL(t);
1if(rd(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}function oK(e){var t=e.entry,r=e.method,i=e.status,s=e.networkRequest,n=e.isInitial,o=e.start,a=e.end,l=e.url,u=e.initiatorType;o=t?t.startTime:o,a=t?t.responseEnd:a;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(o||0)),p=[c({},t?t.toJSON():{name:l},{startTime:rp(o)?void 0:Math.round(o),endTime:rp(a)?void 0:Math.round(a),timeOrigin:d,timestamp:h,method:r,initiatorType:u||(t?t.initiatorType:void 0),status:i,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:n})];if(!rv(t)&&("navigation"===t.entryType||"resource"===t.entryType))for(var _ of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:_.name,duration:_.duration,entryType:"serverTiming"});return p}var oY=["video/","audio/"];function oJ(e){return rd(e)&&rc(e.getReader)&&rc(e.tee)}var oX="[SessionReplay] Timeout while trying to read body",o0="[SessionReplay] Failed to read body";function o1(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function o2(e,t){if(!t.streamNetworkBody)return new Promise(t=>{var r=setTimeout(()=>t(oX),500);try{e.clone().text().then(e=>t(e),e=>t(o0+": "+e)).finally(()=>clearTimeout(r))}catch(e){clearTimeout(r),t(o0)}});var r=oF(t);return!function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var s=parseInt(i,10);return Number.isFinite(s)&&s>t}catch(e){return!1}}(e,r)?new Promise(t=>{var i,s=!1;function n(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){s||(s=!0,clearTimeout(l),n(),t(e))}var a,l=setTimeout(()=>o(oX),500);try{a=e.clone()}catch(e){return void o(o0)}var u=a.body;if(oJ(u)&&"u">typeof TextDecoder){try{i=u.getReader()}catch(e){return void o(o0)}var c=[],d=0;!function e(){i.read().then(t=>{var i=t.done,a=t.value;if(s)n();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var s of e)r.set(s,i),i+=s.byteLength;return r}(c,d)));else{if(a){if(d+a.byteLength>r)return void o(o1(r));d+=a.byteLength,c.push(a)}e()}},e=>o(o0+": "+e))}()}else try{a.text().then(e=>o(e),e=>o(o0+": "+e))}catch(e){o(o0)}}):Promise.resolve(o1(r))}function o5(){return(o5=u(function*(e){var t=e.r,r=e.options,i=s$(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):o2(t,r)})).apply(this,arguments)}function o3(){return(o3=u(function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,s=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=oY.some(e=>null==n?void 0:n.startsWith(e));if(n&&o)return"Content-Type "+n+" is not supported";var a=s$(s,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return rv(i)?o2(t,r):Promise.resolve(i)})).apply(this,arguments)}var o4=null;function o8(e,t,r){if(!("performance"in t))return()=>{};if(o4)return o$.warn("Network observer already initialised, doing nothing"),()=>{};var i,s,n=r?Object.assign({},oL,r):oL,o=t=>{var r=[];t.requests.forEach(e=>{var t=n.maskRequestFn(e);t&&r.push(t)}),r.length>0&&e(c({},t,{requests:r}))},a=(n.recordInitialRequests&&o({requests:t.performance.getEntries().filter(e=>"navigation"===e.entryType||oz(e)&&n.initiatorTypes.includes(e.initiatorType)).flatMap(e=>oK({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0}),i=new t.PerformanceObserver(e=>{o({requests:e.getEntries().filter(e=>"navigation"===e.entryType||oz(e)&&n.initiatorTypes.includes(e.initiatorType)&&(!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)).flatMap(e=>oK({entry:e,method:void 0,status:void 0,networkRequest:{}}))})}),s=PerformanceObserver.supportedEntryTypes.filter(e=>n.performanceEntryTypeToObserve.includes(e)),i.observe({entryTypes:s}),()=>{i.disconnect()}),l=()=>{},d=()=>{};return(n.recordHeaders||n.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=oU("request",r.recordHeaders),s=oU("response",r.recordHeaders),n=sH(t.XMLHttpRequest.prototype,"open",n=>function(o,a,l,u,c){void 0===l&&(l=!0);var d=this;
1try{var h,p,_=new Request(a),g={},v={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(v[e]=t,f(e,t)),i&&(g.requestHeaders=v);var m=d.send.bind(d);d.send=e=>(oV({type:"request",headers:v,url:a,recordBody:r.recordBody})&&(g.requestBody=oZ({body:e,options:r,url:a})),h=t.performance.now(),m(e));var y=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",y),d.removeEventListener("abort",y),d.removeEventListener("timeout",y)},b=()=>{if(d.readyState===d.DONE){y(),p=t.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{var t=e.split(": "),r=t.shift(),s=t.join(": ");r&&(i[r]=s)}),s&&(g.responseHeaders=i),oV({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=oZ({body:d.response,options:r,url:a})),oG(t,"xmlhttprequest",_.url,h,p).then(t=>{var r=oK({entry:t,method:o,status:null==d?void 0:d.status,networkRequest:g,start:h,end:p,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})}).catch(()=>{})}};d.addEventListener("readystatechange",b),d.addEventListener("error",y),d.addEventListener("abort",y),d.addEventListener("timeout",y)}catch(e){o$.error("Failed to instrument XHR for network capture",e)}n.call(d,o,a.toString(),l,u,c)});return()=>{n()}}(o,t,n),d=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=oU("request",r.recordHeaders),s=oU("response",r.recordHeaders),n=sH(t,"fetch",n=>{var o;return o=u(function*(o,a){try{l=new Request(o,a)}catch(e){return o$.error("Failed to instrument fetch for network capture",e),n(o,a)}var l,u,c,d,h={};try{try{var p={};l.headers.forEach((e,t)=>{p[t]=e}),i&&(h.requestHeaders=p),!oJ(null==a?void 0:a.body)&&oV({type:"request",headers:p,url:o,recordBody:r.recordBody})&&(h.requestBody=yield function(e){return o5.apply(this,arguments)}({r:l,options:r,url:o}))}catch(e){o$.error("Failed to record fetch request for network capture",e)}c=t.performance.now(),u=oW(o)?yield n(l):yield n(o,a),d=t.performance.now();var _={};return u.headers.forEach((e,t)=>{_[t]=e}),s&&(h.responseHeaders=_),oV({type:"response",headers:_,url:o,recordBody:r.recordBody})&&(h.responseBody=yield function(e){return o3.apply(this,arguments)}({r:u,options:r,url:o})),u}finally{oG(t,"fetch",l.url,c,d).then(t=>{var r;e({requests:oK({entry:t,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:c,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}}),function(e,t){return o.apply(this,arguments)}});return()=>{n()}}(o,t,n)),o4=()=>{a(),l(),d(),o4=null}}var o6=e=>({name:"rrweb/network@1",observer:o8,options:e});s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t$,getRecordNetworkPlugin:o6},s_.__PosthogExtensions__.rrweb={record:tT,version:"v2",wasMaxDepthReached:()=>eb,resetMaxDepthState(){eb=!1,ey=!1}},s_.rrweb={record:tT,version:"v2"},s_.rrwebConsoleRecord={getRecordConsolePlugin:t$},s_.getRecordNetworkPlugin=o6;var o7,o9,ae,at,ar,ai,as,an,ao,aa,al,au,ac,ad,ah,ap,a_,ag,av={},af=[],am=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ay=Array.isArray;function ab(e,t){for(var r in t)e[r]=t[r];return e}function aS(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function aw(e,t,r){var i,s,n,o={};for(n in t)"key"==n?i=t[n]:"ref"==n?s=t[n]:o[n]=t[n];if(arguments.length>2&&(o.children=arguments.length>3?at.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(n in e.defaultProps)void 0===o[n]&&(o[n]=e.defaultProps[n]);return ak(e,o,i,s,null)}function ak(e,t,r,i,s){var n={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++ai:s,__i:-1,__u:0};return null==s&&null!=ar.vnode&&ar.vnode(n),n}function ax(e){return e.children}function aC(e,t){this.props=e,this.context=t}function aI(e,t){if(null==t)return e.__?aI(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?aI(e):null}function aE(e){(!e.__d&&(e.__d=!0)&&as.push(e)&&!aT.__r++||an!=ar.debounceRendering)&&((an=ar.debounceRendering)||ao)(aT)}function aT(){try{for(var e,t=1;as.length;)as.length>t&&as.sort(aa),e=as.shift(),t=as.length,function(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],s=[],n=ab({},t);n.__v=t.__v+1,ar.vnode&&ar.vnode(n),aL(e.__P,n,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?aI(t):r,!!(32&t.__u),s),n.__v=t.__v,n.__.__k[n.__i]=n,aD(i,n,s),t.__e=t.__=null,n.__e!=r&&function e(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}),e(t)}(n)}}(e)}finally{as.length=aT.__r=0}}function aM(e,t,r,i,s,n,o,a,l,u,c){var d,h,p,_,g,v,f,m=i&&i.__k||af,y=t.length;for(l=function(e,t,r,i,s){var n,o,a,l,u,c=r.length,d=c,h=0;for(e.__k=Array(s),n=0;s>n;n++)null!=(o=t[n])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[n]=ak(null,o,null,null,null):ay(o)?o=e.__k[n]=ak(ax,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[n]=ak(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[n]=o,l=n+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=function(e,t,r,i){var s,n,o,a=e.key,l=e.type,u=t[r],c=null!=u&&0==(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return r;if(i>+!!c){for(s=r-1,n=r+1;s>=0||t.length>n;)if(null!=(u=t[o=0>s?n++:s--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o}return -1}(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(s>c?h--:c>s&&h++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,o.__u|=4))):e.__k[n]=null;if(d)for(n=0;c>n;n++)null!=(a=r[n])&&0==(2&a.__u)&&(a.__e==i&&(i=aI(a)),function e(t,r,i){var s,n;if(ar.unmount&&ar.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||aA(s,null,r)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){ar.__e(e,r)}s.base=s.__P=s.__n=null}if(s=t.__k)for(n=0;s.length>n;n++)s[n]&&e(s[n],r,i||"function"!=typeof t.type);i||aS(t.__e),t.__c=t.__=t.__e=void 0}(a,a));return i}(r,t,m,l,y),d=0;y>d;d++)null!=(p=r.__k[d])&&(h=-1!=p.__i&&m[p.__i]||av,p.__i=d,v=aL(e,p,h,s,n,o,a,l,u,c),_=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&aA(h.ref,null,p),c.push(p.ref,p.__c||_,p)),null==g&&null!=_&&(g=_),(f=!!(4&p.__u))||h.__k===p.__k?(l=function e(t,r,i,s){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&n.length>o;o++)n[o]&&(n[o].__=t,r=e(n[o],r,i,s));return r}t.__e!=r&&(s&&(r&&t.type&&!r.parentNode&&(r=aI(t)),i.insertBefore(t.__e,r||null)),r=t.__e);do r=r&&r.nextSibling;while(null!=r&&8==r.nodeType)return r}
vendor: 5,918 bytes, line 1
1(p,l,e,f),f&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==v?l=v:_&&(l=_.nextSibling),p.__u&=-7);return r.__e=g,l}function aP(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||am.test(t)?r:r+"px"}function aR(e,t,r,i,s){var n,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||aP(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||aP(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])n=t!=(t=t.replace(ad,"$1")),t=(o=t.toLowerCase())in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=r,r?i?r[ac]=i[ac]:(r[ac]=ah,e.addEventListener(t,n?a_:ap,n)):e.removeEventListener(t,n?a_:ap,n);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function aF(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[au])t[au]=ah++;else if(r[ac]>t[au])return;return r(ar.event?ar.event(t):t)}}}function aL(e,t,r,i,s,n,o,a,l,u){var c,d,h,p,_,g,v,f,m,y,b,S,w,k,x,C,I=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),n=[a=t.__e=r.__e]),(c=ar.__b)&&c(t);e:if("function"==typeof I){d=o.length;try{if(m=t.props,y=I.prototype&&I.prototype.render,b=(c=I.contextType)&&i[c.__c],S=c?b?b.props.value:c.__:i,r.__c?f=(h=t.__c=r.__c).__=h.__E:(y?t.__c=h=new I(m,S):(t.__c=h=new aC(m,S),h.constructor=I,h.render=aN),b&&b.sub(h),h.state||(h.state={}),h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),y&&null==h.__s&&(h.__s=h.state),y&&null!=I.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=ab({},h.__s)),ab(h.__s,I.getDerivedStateFromProps(m,h.__s))),_=h.props,g=h.state,h.__v=t,p)y&&null==I.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),y&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(y&&null==I.getDerivedStateFromProps&&m!==_&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,S),t.__v==r.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,S)){t.__v!=r.__v&&(h.props=m,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),af.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&o.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,S),y&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(_,g,v)})}if(h.context=S,h.props=m,h.__P=e,h.__e=!1,w=ar.__r,k=0,y)h.state=h.__s,h.__d=!1,w&&w(t),c=h.render(h.props,h.state,h.context),af.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,w&&w(t),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&25>++k)h.state=h.__s,null!=h.getChildContext&&(i=ab(ab({},i),h.getChildContext())),y&&!p&&null!=h.getSnapshotBeforeUpdate&&(v=h.getSnapshotBeforeUpdate(_,g)),x=null!=c&&c.type===ax&&null==c.key?function e(t){return"object"!=typeof t||null==t||t.__b>0?t:ay(t)?t.map(e):void 0!==t.constructor?null:ab({},t)}(c.props.children):c,a=aM(e,ay(x)?x:[x],t,r,i,s,n,o,a,l,u),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),f&&(h.__E=h.__=null)}catch(e){if(o.length=d,t.__v=null,l||null!=n)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=n&&(n[n.indexOf(a)]=null),t.__e=a}else{if(null!=n)for(C=n.length;C--;)aS(n[C]);aO(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||aO(t);ar.__e(e,t,r)}}else null==n&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,s,n,o,a,l){var u,c,d,h,p,_,g,v=r.props||av,f=t.props,m=t.type;if("svg"==m?s="http://www.w3.org/2000/svg":"math"==m?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=n){for(u=0;n.length>u;u++)if((p=n[u])&&"setAttribute"in p==!!m&&(m?p.localName==m:3==p.nodeType)){e=p,n[u]=null;break}}if(null==e){if(null==m)return document.createTextNode(f);e=document.createElementNS(s,m,f.is&&f),a&&(ar.__m&&ar.__m(t,n),a=!1),n=null}if(null==m)v===f||a&&e.data==f||(e.data=f);else{if(n="textarea"==m&&null!=f.defaultValue?null:n&&at.call(e.childNodes),!a&&null!=n)for(v={},u=0;e.attributes.length>u;u++)v[(p=e.attributes[u]).name]=p.value;for(u in v)p=v[u],"dangerouslySetInnerHTML"==u?d=p:"children"==u||u in f||"value"==u&&"defaultValue"in f||"checked"==u&&"defaultChecked"in f||aR(e,u,null,p,s);for(u in f)p=f[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?_=p:"checked"==u?g=p:a&&"function"!=typeof p||v[u]===p||aR(e,u,p,v[u],s);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),aM("template"==t.type?e.content:e,ay(h)?h:[h],t,r,i,"foreignObject"==m?"http://www.w3.org/1999/xhtml":s,n,o,n?n[0]:r.__k&&aI(r,0),a,l),null!=n)for(u=n.length;u--;)aS(n[u]);a&&"textarea"!=m||(u="value","progress"==m&&null==_?e.removeAttribute("value"):null==_||_===e[u]&&("progress"!=m||_)&&("option"!=m||_==v[u])||aR(e,u,_,v[u],s),u="checked",null!=g&&g!=e[u]&&aR(e,u,g,v[u],s))}return e}(r.__e,t,r,i,s,n,o,l,u);return(c=ar.diffed)&&c(t),128&t.__u?void 0:a}function aO(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(aO))}function aD(e,t,r){for(var i=0;r.length>i;i++)aA(r[i],r[++i],r[++i]);ar.__c&&ar.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){ar.__e(e,t.__v)}})}function aA(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ar.__e(e,r)}}function aN(e,t,r){return this.constructor(e,r)}function aq(e,t,r){var i,s,n;t==document&&(t=document.documentElement),ar.__&&ar.__(e,t),i=t.__k,s=[],n=[],aL(t,e=t.__k=aw(ax,null,[e]),i||av,av,t.namespaceURI,i?null:t.firstChild?at.call(t.childNodes):null,
1s,i?i.__e:t.firstChild,!1,n),aD(s,e,n),e.props.children=null}at=af.slice,ar={__e(e,t,r,i){for(var s,n,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&null!=n.getDerivedStateFromError&&(s.setState(n.getDerivedStateFromError(e)),o=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,i||{}),o=s.__d),o)return s.__E=s}catch(t){e=t}throw e}},ai=0,aC.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ab({},this.state),"function"==typeof e&&(e=e(ab({},r),this.props)),e&&ab(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),aE(this))},aC.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),aE(this))},aC.prototype.render=ax,as=[],ao="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,aa=function(e,t){return e.__v.__b-t.__v.__b},aT.__r=0,au="__d"+(al=Math.random().toString(8)),ac="__a"+al,ad=/(PointerCapture)$|Capture$/i,ah=0,ap=aF(!1),a_=aF(!0),ag=0;var aB,aH,a$,az,aU=0,aW=[],aj=ar,aV=aj.__b,aG=aj.__r,aQ=aj.diffed,aZ=aj.__c,aK=aj.unmount,aY=aj.__;function aJ(e,t){aj.__h&&aj.__h(aH,e,aU||t),aU=0;var r=aH.__H||(aH.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function aX(e){return aU=1,function(e,t){var r=aJ(aB++,2);if(r.t=e,!r.__c&&(r.__=[a9(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=aH,!aH.__f)){var i=function(e,t,i){if(!r.__c.__H)return!0;var n=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s){var a=s.call(this,e,t,i);return n?a||o:a}return!n||o};aH.__f=!0;var s=aH.shouldComponentUpdate,n=aH.componentWillUpdate;aH.componentWillUpdate=function(e,t,r){if(this.__e){var o=s;s=void 0,i(e,t,r),s=o}n&&n.call(this,e,t,r)},aH.shouldComponentUpdate=i}return r.__N||r.__}(a9,e)}function a0(e,t){var r=aJ(aB++,3);!aj.__s&&a7(r.__H,t)&&(r.__=e,r.u=t,aH.__H.__h.push(r))}function a1(e){return aU=5,a2(function(){return{current:e}},[])}function a2(e,t){var r=aJ(aB++,7);return a7(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function a5(e){var t=aH.context[e.__c],r=aJ(aB++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(aH)),t.props.value):e.__}function a3(){for(var e;e=aW.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(a8),t.__h.some(a6),t.__h=[]}catch(r){t.__h=[],aj.__e(r,e.__v)}}}aj.__b=function(e){aH=null,aV&&aV(e)},aj.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),aY&&aY(e,t)},aj.__r=function(e){aG&&aG(e),aB=0;var t=(aH=e.__c).__H;t&&(a$===aH?(t.__h=[],aH.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&a3(),aB=0)),a$=aH},aj.diffed=function(e){aQ&&aQ(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==aW.push(t)&&az===aj.requestAnimationFrame||((az=aj.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(i),a4&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);a4&&(t=requestAnimationFrame(r))})(a3)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),a$=aH=null},aj.__c=function(e,t){t.some(function(e){try{e.__h.some(a8),e.__h=e.__h.filter(function(e){return!e.__||a6(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],aj.__e(r,e.__v)}}),aZ&&aZ(e,t)},aj.unmount=function(e){aK&&aK(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{a8(e)}catch(e){t=e}}),r.__H=void 0,t&&aj.__e(t,r.__v))};var a4="function"==typeof requestAnimationFrame;function a8(e){var t=aH,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),aH=t}function a6(e){var t=aH;e.__c=e.__(),aH=t}function a7(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function a9(e,t){return"function"==typeof t?t(e):t}var le="events",lt="cancelEvents",lr="left",li="center",ls="right",ln="next_to_trigger",lo="popover",la="widget",ll="external_survey",lu="open",lc="multiple_choice",ld="single_choice",lh="rating",lp="always",l_="survey shown",lg="survey dismissed",lv="survey sent",lf="$survey_id",lm="$survey_name",ly="$survey_iteration",lb="$survey_iteration_start_date",lS="$survey_submission_id",lw="$survey_language",lk="popover";function lx(e){return"$survey_response_"+e}function lC(e,t){if(!t)return null;var r=e[lx(t)];return ru(r)?[...r]:r}function lI(e,t){void 0===e&&(e={});var r={};return t.questions.forEach(t=>{if(!rp(t.originalQuestionIndex)){var i,s=0===(i=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,n=lC(e,t.id);rp(n)||(r[s]=n)}}),c({$survey_questions:t.questions.map(t=>({id:t.id,question:t.question,response:lC(e,t.id)}
1))},e,r)}function lE(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function lT(e){return"string"==typeof e&&e.trim()?e.trim():null}function lM(e){return e.toLowerCase()}function lP(e,t,r){if(!e||!t)return null;var i=lM(t),s=Object.keys(e).find(e=>lM(e)===i);if(s)return null==r||r.debug("Found exact translation match: "+s),s;if(i.includes("-")){var n=i.split("-")[0],o=Object.keys(e).find(e=>lM(e)===n);if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function lR(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function lF(e){var t;return lR(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var lL=sb("[Surveys]");function lO(e){return!(!e.start_date||e.end_date)}function lD(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var lA="seenSurvey_",lN="inProgressSurvey_",lq=(e,t)=>""+e+(t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id),lB=e=>{try{var t=lq(lA,e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){lL.error("Failed to persist survey seen state",e)}},lH=[lo,la,"api"],l$={ignoreConditions:!1,ignoreDelay:!1,displayType:lk};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return rm(e)&&isFinite(e)&&Math.floor(e)===e});class lz{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>0x3fffffff||i>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new lz(s)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new lz(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class lU{constructor(){this._timestamp=0,this._counter=0,this._random=new lV}generate(){var e=this.generateOrAbort();if(rp(e)){this._timestamp=0;var t=this.generateOrAbort();if(rp(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>0x3ffffffffff&&(this._timestamp++,this._resetCounter())}return lz.fromFieldsV7(this._timestamp,Math.trunc(this._counter/0x40000000),0x3fffffff&this._counter,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var lW,lj=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ss&&!rp(ss.crypto)&&crypto.getRandomValues&&(lj=e=>crypto.getRandomValues(e));class lV{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._buffer.length>this._cursor||(lj(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var lG=()=>lQ().toString(),lQ=()=>(lW||(lW=new lU)).generate(),lZ="gzip-js",lK="base64",lY=Uint8Array,lJ=Uint16Array,lX=Uint32Array,l0=new lY([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]),l1=new lY([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]),l2=new lY([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l5=function(e,t){for(var r=new lJ(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var s=new lX(r[30]);for(i=1;30>i;++i)for(var n=r[i];r[i+1]>n;++n)s[n]=n-r[i]<<5|i;return[r,s]},l3=l5(l0,2),l4=l3[1];l3[0][28]=258,l4[258]=28;for(var l8=l5(l1,0)[1],l6=new lJ(32768),l7=0;32768>l7;++l7){var l9=(43690&l7)>>>1|(21845&l7)<<1;l6[l7]=((65280&(l9=(61680&(l9=(52428&l9)>>>2|(13107&l9)<<2))>>>4|(3855&l9)<<4))>>>8|(255&l9)<<8)>>>1}var ue=function(e,t,r){for(var i=e.length,s=0,n=new lJ(t);i>s;++s)++n[e[s]-1];var o,a=new lJ(t);for(s=0;t>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(r){o=new lJ(1<<t);var l=15-t;for(s=0;i>s;++s)if(e[s])for(var u=s<<4|e[s],c=t-e[s],d=a[e[s]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[l6[d]>>>l]=u}else for(o=new lJ(i),s=0;i>s;++s)o[s]=l6[a[e[s]-1]++]>>>15-e[s];return o},ut=new lY(288);for(l7=0;144>l7;++l7)ut[l7]=8;for(l7=144;256>l7;++l7)ut[l7]=9;for(l7=256;280>l7;++l7)ut[l7]=7;for(l7=280;288>l7;++l7)ut[l7]=8;var ur=new lY(32);for(l7=0;32>l7;++l7)ur[l7]=5;var ui=ue(ut,9,0),us=ue(ur,5,0),un=function(e){return(e/8|0)+(7&e&&1)},uo=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof lJ?lJ:e instanceof lX?lX:lY)(r-t);return i.set(e.subarray(t,r)),i},ua=function(e,t,r){var i=t/8|0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},ul=function(e,t,r){var i=t/8|0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},uu=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var s=r.length,n=r.slice();if(!s)return[new lY(0),0];if(1==s){var o=new lY(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=c&&r[d].f>r[u].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=n[0].s;for(i=1;s>i;++i)n[i].s>h&&(h=n[i].s);var p=new lJ(h+1),_=uc(r[c-1],p,0);if(_>t){i=0;var g=0,v=_-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>i;++i){var m=n[i].s;if(t>=p[m])break;g+=f-(1<<_-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[i].s;t>p[y]?g-=1<<t-p[y]++-1:++i}for(;i>=0&&g;--i){var b=n[i].s;p[b]==t&&(--p[b],++g)}_=t}return[new lY(p),_]},uc=function(e,t,r){return -1==e.s?Math.max(uc(e.l,t,r+1),uc(e.r,t,r+1)):t[e.s]=r},ud=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new lJ(++t),i=0,s=e[0],n=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[r.subarray(0,i),t]},uh=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},up=function(e,t,r){var i=r.length,s=un(t+2);e[s]=255&i,e[s+1]=i>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;i>n;++n)e[s+n+4]=r[n];return 8*(s+4+i)},u_=function(e,t,r,i,s,n,o,a,l,u,c){ua(t,c++,r),++s[256];for(var d=uu(s,15),h=d[0],p=d[1],_=uu(n,15),g=_[0],v=_[1],f=ud(h),m=f[0],y=f[1],b=ud(g),S=b[0],w=b[1],k=new lJ(19),x=0;m.length>x;++x)k[31&m[x]]++;for(x=0;S.length>x;++x)k[31&S[x]]++;for(var C=uu(k,7),I=C[0],E=C[1],T=19;T>4&&!I[l2[T-1]];--T);var M,P,R,F,L=u+5<<3,O=uh(s,ut)+uh(n,ur)+o,D=uh(s,h)+uh(n,g)+o+14+3*T+uh(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(O>=L&&D>=L)return up(t,c,e.subarray(l,l+u));if(ua(t,c,1+(O>D)),c+=2,O>D){M=ue(h,p,0),P=h,R=ue(g,v,0),F=g;var A=ue(I,E,0);for(ua(t,c,y-257),ua(t,c+5,w-1),ua(t,c+10,T-4),c+=14,x=0;T>x;++x)ua(t,c+3*x,I[l2[x]]);c+=3*T;for(var N=[m,S],q=0;2>q;++q){var B=N[q];for(x=0;B.length>x;++x)ua(t,c,A[H=31&B[x]]),c+=I[H],H>15&&(ua(t,c,B[x]>>>5&127),c+=B[x]>>>12)}}else M=ui,P=ut,R=us,F=ur;for(x=0;a>x;++x)if(i[x]>255){ul(t,c,M[257+(H=i[x]>>>18&31)]),c+=P[H+257],H>7&&(ua(t,c,i[x]>>>23&31),c+=l0[H]);var H,$=31&i[x];ul(t,c,R[$]),c+=F[$],$>3&&(ul(t,c,i[x]>>>5&8191),c+=l1[$])}else ul(t,c,M[i[x]]),c+=P[i[x]];return ul(t,c,M[256]),c+P[256]},ug=new lX([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),uv=function(){for(var e=new lX(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&0xedb88320)^r>>>1;e[t]=r}return e}(),uf=function(){var e=0xffffffff;return{p(t){for(var r=e,i=0;t.length>i;++i)r=uv[255&r^t[i]]^r>>>8;e=r},d:()=>0xffffffff^e}},um=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},uy=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&um(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}};function ub(e,t){void 0===t&&(t={});var r,i,s,n=uf(),o=e.length;n.p(e);var a=(i=t,s=10+((r=t).filename&&r.filename.length+1||0),function(e,t,r,i){var s=e.length,n=new lY(i+s+5*(1+Math.floor(s/7e3))+8),o=n.subarray(i,n.length-8),a=0;if(!t||8>s)for(var l=0;s>=l;l+=65535){var u=l+65535;s>u?a=up(o,a,e.subarray(l,u)):(o[l]=!0,a=up(o,a,e.subarray(l,s)))}else{for(var c=ug[t-1],d=c>>>13,h=8191&c,p=(1<<r)-1,_=new lJ(32768),g=new lJ(p+1),v=Math.ceil(r/3),f=2*v,m=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<f)&p}
1,y=new lX(25e3),b=new lJ(288),S=new lJ(32),w=0,k=0,x=(l=0,0),C=0,I=0;s>l;++l){var E=m(l),T=32767&l,M=g[E];if(_[T]=M,g[E]=T,l>=C){var P=s-l;if((w>7e3||x>24576)&&P>423){a=u_(e,o,0,y,b,S,k,x,I,l-I,a),x=w=k=0,I=l;for(var R=0;286>R;++R)b[R]=0;for(R=0;30>R;++R)S[R]=0}var F=2,L=0,O=h,D=T-M&32767;if(P>2&&E==m(l-D))for(var A=Math.min(d,P)-1,N=Math.min(32767,l),q=Math.min(258,P);N>=D&&--O&&T!=M;){if(e[l+F]==e[l+F-D]){for(var B=0;q>B&&e[l+B]==e[l+B-D];++B);if(B>F){if(F=B,L=D,B>A)break;var H=Math.min(D,B-2),$=0;for(R=0;H>R;++R){var z=l-D+R+32768&32767,U=z-_[z]+32768&32767;U>$&&($=U,M=z)}}}D+=(T=M)-(M=_[T])+32768&32767}if(L){y[x++]=0x10000000|l4[F]<<18|l8[L];var W=31&l4[F],j=31&l8[L];k+=l0[W]+l1[j],++b[257+W],++S[j],C=l+F,++w}else y[x++]=e[l],++b[e[l]]}}a=u_(e,o,!0,y,b,S,k,x,I,l-I,a)}return uo(n,0,i+un(a)+8)}(e,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+i.mem,s)),l=a.length;return uy(a,t),um(a,l-8,n.d()),um(a,l-4,o),a}function uS(e,t){var r=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new lY(e.length+(e.length>>>1)),s=0,n=function(e){i[s++]=e},o=0;r>o;++o){if(s+5>i.length){var a=new lY(s+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l||t?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return uo(i,0,s)}function uw(e,t){for(var r="",i=0;e.length>i;)r+=String.fromCharCode(e[i++]);return r}var uk=!!sc||!!su,ux="text/plain",uC=!1,uI=(e,t)=>{var r=e.split("#"),i=r[1],s=r[0].split("?"),n=s[0],o=s[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(i?"#"+i:"")},uE=function(e,t,r){void 0===r&&(r=!0);var i,s=e.split("?"),n=s[0],o=s[1],a=c({},t),l=null!=(i=null==o?void 0:o.split("&").map(e=>{var t,i=e.split("="),s=i[0],n=r&&null!=(t=a[s])?t:i[1];return delete a[s],s+"="+n}))?i:[],u=sL(a);return u&&l.push(u),n+"?"+l.join("&")},uT=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return rn(e)}},uM=e=>{if(e._encodedBody)return e._encodedBody;var t=e.data,r=e.compression;if(t){if(r===lZ){var i=ub(uS(uT(t)),{mtime:0});return{contentType:ux,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===lK){let e;var s,n="data="+encodeURIComponent("string"==typeof(e=(s=uT(t))?btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):s)?e:uT(e));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=uT(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},uP=e=>{var t,r,i=()=>"sendBeacon"===e.transport?{url:uE(e.url,{compression:lK}),encodedBody:uM(c({},e,{compression:lK,_encodedBody:void 0}))}:{url:uI(e.url,"compression"),encodedBody:uM(c({},e,{compression:void 0,_encodedBody:void 0}))};try{t=uM(e)}catch(t){if(t5(e.compression,sO(e.url,"compression")))return sy.error("Failed to gzip request body, sending uncompressed payload",t),i();throw t}return!(t&&t5(e.compression,sO(e.url,"compression")))||((r=t.body)instanceof ArrayBuffer?t2(new Uint8Array(r)):ArrayBuffer.isView(r)&&t2(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?{url:e.url,encodedBody:t}:(uC=!0,i())},uR=e=>{try{return uP(e)}catch(t){return sy.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},uF=(dN=u(function*(e){var t=uT(e.data),r=yield t7(t,sf.DEBUG,{rethrow:!0});if(!r)return e;var i=yield r.arrayBuffer();return c({},e,{_encodedBody:{contentType:ux,body:i,estimatedSize:i.byteLength}})}),function(e){return dN.apply(this,arguments)}),uL=/Failed to fetch|NetworkError|Load failed/i,uO=e=>{var t=uR(e);if(t){var r,i=t.url,s=t.encodedBody,n=null!=s?s:{},o=n.contentType,a=n.body,l=n.estimatedSize,u=new Headers;sw(e.headers,function(e,t){u.append(t,e)}),o&&u.append("Content-Type",o);var d=null,h=!1;if(sd){var p=new sd;d={signal:p.signal,timeout:setTimeout(()=>{var t,r;h=!0,p.abort(((r=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",r))},e.timeout)}}var _=t=>{h&&"AbortError"===(null==t?void 0:t.name)||"TypeError"===(null==t?void 0:t.name)&&uL.test((null==t?void 0:t.message)||"")?sy.warn(t):sy.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{su(i,c({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(l||0),body:a,signal:null==(r=d)?void 0:r.signal},e.fetchOptions)).then(t=>t.text().then(r=>{var i={statusCode:t.status,text:r};
1if(200===t.status)try{i.json=JSON.parse(r)}catch(e){sy.error(e)}null==e.callback||e.callback(i)})).catch(_).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),_(e)}}},uD=e=>{try{var t=uP(e),r=t.url,i=t.encodedBody,s=null!=i?i:{},n=s.body,o=s.estimatedSize;if(!n)return;var a=n instanceof Blob?n:new Blob([n],{type:s.contentType});if(so.sendBeacon(r,a))return;if(ru(e.data)&&e.data.length>1&&(null!=o?o:0)>16384){var l=Math.ceil(e.data.length/2);return uD(c({},e,{data:e.data.slice(0,l)})),void uD(c({},e,{data:e.data.slice(l)}))}sy.warn("Beacon of ~"+(null!=o?o:0)+" bytes was rejected by the browser, falling back to fetch"),uO(c({},e,{_keepaliveDisabled:!0}))}catch(e){sy.warn("Beacon send failed",e)}},uA=["/e/","/s/"],uN=(e,t)=>{var r,i,s,n=(s=(i=(null==(r=sF(e))?void 0:r.pathname)||e.split(/[?#]/)[0])?"/"===i[0]?i:"/"+i:"/",uA.some(e=>s.slice(s.length-e.length)===e)),o=n?uI(e,"ver"):e;return uE(t===lZ?uI(o,"compression"):o,c({_:(new Date).getTime().toString()},n?{}:{ver:sf.JS_SDK_VERSION},t===lZ?{}:{compression:t}))},uq=[];su&&uq.push({transport:"fetch",method:uO}),sc&&uq.push({transport:"XHR",method(e){var t=uR(e);if(t){var r=new sc,i=t.encodedBody;r.open(e.method||"GET",t.url,!0);var s=null!=i?i:{},n=s.contentType,o=s.body;sw(e.headers,function(e,t){r.setRequestHeader(t,e)}),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(o)}}}),null!=so&&so.sendBeacon&&uq.push({transport:"sendBeacon",method:uD});var uB=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function uH(e,t,r){return uT({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var u$={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>uB(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!uB(t,e))),icontains:(e,t)=>t.map(uz).some(t=>e.map(uz).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(uz).every(t=>e.map(uz).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>r<parseFloat(e))})},uz=e=>e.toLowerCase(),uU=new Set(["is_not","not_icontains","not_regex"]);function uW(e,t,r){return!e||0===e.length||e.every(e=>{var i="person"===e.type?r:t,s=null==i?void 0:i[e.key],n=e.operator||"exact";if(rp(s)||rv(s))return uU.has(n);var o=u$[n];return!!o&&!rp(e.value)&&!rv(e.value)&&o(ru(e.value)?e.value.map(String):[String(e.value)],ru(s)?s.map(String):[String(s)])})}function uj(e,t){return!e||Object.entries(e).every(e=>{var r=e[1],i=null==t?void 0:t[e[0]];if(rp(i)||rv(i))return!1;var s=[String(i)],n=u$[r.operator];return!!n&&n(r.values,s)})}var uV="",uG=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,uQ={_is_supported:()=>!!sa,_error(e){sy.error("cookieStore error: "+e)},_get(e){if(sa){try{for(var t=e+"=",r=sa.cookie.split(";").filter(e=>e.length),i=0;r.length>i;i++){for(var s=r[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},_parse(e){var t;try{t=JSON.parse(uQ._get(e))||{}}catch(e){}return t},_set(e,t,r,i,s){if(!sa)return!1;try{var n="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=sa),uV)return uV;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),s="dmn_chk_"+lG();!uV&&i--;){var n=r.slice(i).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",uV=n)}return uV}(e);if(!r){var i,s=(i=e.match(uG))?i[0]:"";s!==r&&sy.info("Warning: cookie subdomain discovery mismatch",s,r),r=s}return r?"; domain=."+r:""}return""}(sa.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&sy.warn("cookieStore warning: large cookie, len="+u.length),sa.cookie=u,!0}catch(e){return!1}},_remove(e,t){if(null!=sa&&sa.cookie)try{uQ._set(e,"",-1,t)}catch(e){return}}},uZ=null,uK={_is_supported(){if(!rv(uZ))return uZ;var e=!0;if(rp(ss))e=!1;
1else try{var t="__mplssupport__";uK._set(t,"xyz"),'"xyz"'!==uK._get(t)&&(e=!1),uK._remove(t)}catch(t){e=!1}return e||sy.error("localStorage unsupported; falling back to cookie store"),uZ=e,e},_error(e){sy.error("localStorage error: "+e)},_get(e){try{return null==ss?void 0:ss.localStorage.getItem(e)}catch(e){uK._error(e)}return null},_parse(e){try{return JSON.parse(uK._get(e))||{}}catch(e){}return null},_set(e,t){try{return null==ss||ss.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){uK._error(e)}return!1},_remove(e){try{null==ss||ss.localStorage.removeItem(e)}catch(e){uK._error(e)}}},uY=[sj,"distinct_id",ne,nt,nO,nL,nT],uJ={},uX={_is_supported:()=>!0,_error(e){sy.error("memoryStorage error: "+e)},_get:e=>uJ[e]||null,_parse:e=>uJ[e]||null,_set:(e,t)=>(uJ[e]=t,!0),_remove(e){delete uJ[e]}},u0=null,u1={_is_supported(){if(!rv(u0))return u0;if(u0=!0,rp(ss))u0=!1;else try{var e="__support__";u1._set(e,"xyz"),'"xyz"'!==u1._get(e)&&(u0=!1),u1._remove(e)}catch(e){u0=!1}return u0},_error(e){sy.error("sessionStorage error: ",e)},_get(e){try{return null==ss?void 0:ss.sessionStorage.getItem(e)}catch(e){u1._error(e)}return null},_parse(e){try{return JSON.parse(u1._get(e))||null}catch(e){}return null},_set(e,t){try{return null==ss||ss.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){u1._error(e)}return!1},_remove(e){try{null==ss||ss.sessionStorage.removeItem(e)}catch(e){u1._error(e)}}},u2=sb("[Stylesheet Loader]"),u5="#020617",u3={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:ls,widgetType:"tab",widgetLabel:"Feedback",widgetColor:"black",zIndex:String(0x7ffffffd),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:u5,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},u4=[li,lr,ls];function u8(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function u6(e){void 0===e&&(e=u3.backgroundColor),"#"===e[0]&&(t=u8(e)),e.startsWith("rgb")&&(t=e);var t,r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",s
1almon:"#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"}[e.toLowerCase()];if(r&&(t=u8(r)),!t)return u5;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var s=parseInt(i[1]),n=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(s*s*.299+n*n*.587+o*o*.114)>127.5?u5:"white"}return u5}var u7=(e,t,r)=>{var i,s,n,o,a,l,u,d,h,p,_,g=cp(e),v=sa.querySelector("."+g);if(v&&v.shadowRoot)return{shadow:v.shadowRoot,isNewlyCreated:!1};var f=sa.createElement("div");i=e.type,s=e.appearance,n=c({},u3,s),o=f.style,a=!u4.includes(n.position)||i===la&&(null==s?void 0:s.widgetType)==="tab",o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),a?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==s?void 0:s.submitButtonTextColor)||u6(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",u6(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==s?void 0:s.textColor)||u6(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",u6(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex),u=(l=(null==s?void 0:s.inputBackground)||(null==s?void 0:s.inputBackgroundColor))||n.inputBackground,l||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u),d=(null==s?void 0:s.inputTextColor)||u6(u),o.setProperty("--ph-survey-input-text-color",d),o.setProperty("--ph-survey-rating-text-color",d),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor),f.className=g;var m=f.attachShadow({mode:"open"}),y=(null==((p=sa.createElement("style")).innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}
1to{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}
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)}}',null!=t&&null!=(h=t.config)&&h.prepare_external_dependency_stylesheet&&(p=t.config.prepare_external_dependency_stylesheet(p)),_=p||(u2.error("prepare_external_dependency_stylesheet returned null"),null))||_.setAttribute("data-ph-survey-style","true"),_);if(y){var b=m.querySelector("style");b&&m.removeChild(b),m.appendChild(y)}return sa.body.appendChild(f),{shadow:m,isNewlyCreated:!0}},u9=e=>{var t=e.responses,r=e.survey,i=e.surveySubmissionId,s=e.posthog,n=e.isSurveyCompleted,o=e.properties,a=e.surveyLanguage;s?(lB(r),s.capture(lv,c({[lm]:r.name,[lf]:r.id,[ly]:r.current_iteration,[lb]:r.current_iteration_start_date,[lS]:i,$survey_completed:n},a&&{[lw]:a},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},lI(t,r),o,{$set:{[lE(r,"responded")]:!0}})),n&&(ss.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),ch(r))):lL.error("[survey sent] event not captured, PostHog instance not found.")},ce=(e,t,r)=>{var i;return c({[lm]:e.name,[lf]:e.id,[ly]:e.current_iteration,[lb]:e.current_iteration_start_date,$survey_partially_completed:(void 0===(i=null==t?void 0:t.responses)&&(i={}),Object.values(i).some(e=>!rf(e)))},(null==t?void 0:t.surveyLanguage)&&{[lw]:t.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[lS]:null==t?void 0:t.surveySubmissionId},lI(null==t?void 0:t.responses,e))},ct=(e,t,r,i)=>{if(t){if(!r){var s=cc(e);t.capture(lg,c({},ce(e,s,t),i&&{[lw]:i},{$set:{[lE(e,"dismissed")]:!0}})),ch(e),lB(e),ss.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else lL.error("[survey dismissed] event not captured, PostHog instance not found.")},cr=(e,t)=>
1{if(t){var r=lq("abandonedSurvey_",e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=cc(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture("survey abandoned",ce(e,i,t),{transport:"sendBeacon"})}}else lL.error("[survey abandoned] event not captured, PostHog instance not found.")},ci=e=>e.map(e=>({sort:Math.floor(10*Math.random()),value:e})).sort((e,t)=>e.sort-t.sort).map(e=>e.value),cs=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r])?t.reverse():t,cn=e=>lF(e)||cd(e),co=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,aE(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+ag++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),ca=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,s,n,o,a=ab({},e.props);for(n in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==n?i=t[n]:"ref"==n?s=t[n]:a[n]=void 0===t[n]&&null!=o?o[n]:t[n];return arguments.length>2&&(a.children=arguments.length>3?at.call(arguments,2):r),ak(e.type,a,i||e.key,s||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function cl(e,t){if(null==(i=e.conditions)||!i.url)return!0;var r,i,s,n=sU(t);if(!n)return!1;var o=[e.conditions.url];return u$[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](o,[n])}var cu=(e,t)=>{try{localStorage.setItem(lq(lN,e),JSON.stringify(t))}catch(e){lL.error("Error setting in-progress survey state in localStorage",e)}},cc=e=>{try{var t=localStorage.getItem(lq(lN,e));if(t)return JSON.parse(t)}catch(e){lL.error("Error getting in-progress survey state from localStorage",e)}return null},cd=e=>{var t=cc(e);return!rf(null==t?void 0:t.surveySubmissionId)},ch=e=>{try{localStorage.removeItem(lq(lN,e))}catch(e){lL.error("Error clearing in-progress survey state from localStorage",e)}};function cp(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var c_=0;function cg(e,t,r,i,s,n){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={}
vendor: 4,197 bytes, line 1
1,t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--c_,__i:-1,__u:0,__source:s,__self:n};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ar.vnode&&ar.vnode(u),u}var cv=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:cg("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"})}),cf=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:cg("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"})}),cm=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:cg("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"})}),cy=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:cg("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"})}),cb=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:cg("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
1-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"})}),cS=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:cg("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"})}),cw=cg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:cg("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"})}),ck=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return cg("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[cg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),cg("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:r})]})},cx=cg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[cg("g",{"clip-path":"url(#clip0_2415_6911)",children:[cg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:cg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),cg("g",{mask:"url(#mask0_2415_6911)",children:[cg("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"}),cg("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"}),cg("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"}),cg("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"}),cg("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.04214
1C8.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"}),cg("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"})]})]}),cg("defs",{children:cg("clipPath",{id:"clip0_2415_6911",children:cg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function cC(e){var t=e.urlParams,r=t?Object.entries(t).map(e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)}).join("&"):"";return cg("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",cx]})}function cI(e){var t=e.text,r=e.submitDisabled,i=e.appearance,s=e.onSubmit,n=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,l=e.canGoBack,u=e.onBack,c=a5(co).isPreviewMode,d=!!l&&!!u,h=!a&&cg("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){n&&(null==ss||ss.open(n)),c?null==o||o():s()},children:t});return cg("div",{className:"bottom-section",children:[d?cg("div",{className:"form-buttons form-buttons-with-back",children:[cg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&cg(cC,{urlParams:{utm_source:"survey-footer"}})]})}function cE(e){var t=e.question,r=e.forceDisableHtml;return cg("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[cg(t.type===lu?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&ca({component:aw("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function cT(e){return cg("button",{className:"form-cancel",onClick:e.onClick,disabled:a5(co).isPreviewMode,"aria-label":"Close survey",type:"button",children:ck({fill:"black"})})}function cM(e){var t=e.header,r=e.description,i=e.contentType,s=e.forceDisableHtml,n=e.appearance,o=e.onClose,a=a5(co).isPopup;return a0(()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return sM(ss,"keydown",e),()=>{ss.removeEventListener("keydown",e)}},[o]),cg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==n.hideCancelButton&&cg(cT,{onClick:()=>o()}),cg("h3",{className:"thank-you-message-header",children:t}
1),r&&ca({component:aw("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!s&&"text"!==i}),a&&cg(cI,{text:n.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:n,onSubmit:()=>o()})]})}cg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:cg("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 cP=e=>ru(e)&&e.every(e=>r_(e));function cR(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,s=e.onSubmit,n=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,l=e.canGoBack,u=e.onBack,c=a5(co).isPreviewMode,d=a1(null),h=aX(()=>r_(a)?a:""),p=h[0],_=h[1],g=null==i?void 0:i.disableAutofocus;a0(()=>{g||setTimeout(()=>{var e;c||null==(e=d.current)||e.focus()},100)},[c,g]);var v="surveyQuestion"+o,f=a2(()=>(function(e,t,r){var i,s,n=e.trim();if(!r&&""===n)return"This field is required";if(""===n)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case tY:if(void 0!==o.value&&o.value>n.length)return null!=(i=o.errorMessage)?i:"Please enter at least "+o.value+" characters";break;case tJ:if(void 0!==o.value&&n.length>o.value)return null!=(s=o.errorMessage)?s:"Please enter no more than "+o.value+" characters"}return!1})(p,t.validation,t.optional),[p,t.validation,t.optional]),m=iB(t.validation,tY),y=iB(t.validation,tJ),b=a2(()=>{var e;return(e=1===m?void 0:m)&&y?"Enter "+e+"-"+y+" characters":e?"Enter at least "+e+" "+(1===e?"character":"characters"):y?"Maximum "+y+" "+(1===y?"character":"characters"):void 0},[m,y]),S=()=>{f||s(p.trim())},w=()=>{f||n(p.trim())};return cg(ax,{children:[cg("div",{className:"question-container",children:[cg(cE,{question:t,forceDisableHtml:r,htmlFor:v}),cg("textarea",{ref:d,id:v,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:m,maxLength:y,onInput(e){_(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&!f&&(e.preventDefault(),c?w():S())},value:p}),b&&cg("div",{className:"validation-hint",children:b})]}),cg(cI,{text:t.buttonText||"Submit",submitDisabled:!!f,appearance:i,onSubmit:S,onPreviewSubmit:w,canGoBack:l,onBack:u})]})}function cF(e){var t=e.question,r=e.appearance,i=e.onSubmit,s=e.onPreviewSubmit,n=e.canGoBack,o=e.onBack;return cg(ax,{children:[cg("div",{className:"question-container",children:cg(cE,{question:t,forceDisableHtml:e.forceDisableHtml})}),cg(cI,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>s("link clicked"),canGoBack:n,onBack:o})]})}function cL(e){var t,r=e.question,i=e.forceDisableHtml,s=e.displayQuestionIndex,n=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,l=e.initialValue,u=e.canGoBack,c=e.onBack,d=r.scale,h=+(10!==r.scale),p=aX(()=>rm(l)?l:ru(l)&&l.length>0&&rm(parseInt(l[0]))?parseInt(l[0]):r_(l)&&rm(parseInt(l))?parseInt(l):null),_=p[0],g=p[1],v="emoji"===r.display&&2===r.scale,f=a5(co).isPreviewMode,m=e=>f?a(e):o(e);return cg(ax,{children:[cg("div",{className:"question-container",children:[cg(cE,{question:r,forceDisableHtml:i}),cg("div",{className:"rating-section",children:[cg("div",{className:"rating-options",children:["emoji"===r.display&&cg("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=cB[r.scale])?void 0:t.map((e,t)=>cg("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+s+"-rating-"+t+" "+(t+1===_?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;g(e),r.skipSubmitButton&&m(e)},children:e},t))}),"number"===r.display&&cg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:(function(e){switch(e){case 5:default:return cA;case 7:return cN;case 10:return cq}})(r.scale).map((e,t)=>cg(cO,{displayQuestionIndex:s,active:_===e,appearance:n,num:e,setActiveNumber(e){g(e),r.skipSubmitButton&&m(e)}},t))})]}),!v&&cg("div",{className:"rating-text",children:[cg("div",{children:r.lowerBoundLabel}),cg("div",{children:r.upperBoundLabel})]})]})]}),cg(cI,{text:r.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:rv(_)&&!r.optional,appearance:n,onSubmit:()=>o(_),onPreviewSubmit:()=>
1a(_),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:c})]})}function cO(e){var t=e.num,r=e.setActiveNumber;return cg("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function cD(e){var t=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,s=e.appearance,n=e.onSubmit,o=e.onPreviewSubmit,a=e.initialValue,l=e.canGoBack,u=e.onBack,d=a1(null),h=a2(()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=cs(t,ci(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t),[t]),p=aX(()=>{let e;return e=t.type,r_(a)||cP(a)?a:e===ld?null:[]}),_=p[0],g=p[1],v=aX(()=>((e,t)=>{if(r_(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(cP(e)){var r=e.find(e=>!t.includes(e));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(a,h)),f=v[0],m=v[1],y=a5(co).isPreviewMode,b=t.type===ld,S=t.type===lc,w=t.skipSubmitButton&&b&&!t.hasOpenChoice,k=(e,t)=>{if(t){var r=!f.isSelected;return m(e=>c({},e,{isSelected:r,inputValue:r?e.inputValue:""})),b&&g(""),void(r&&setTimeout(()=>{var e;return null==(e=d.current)?void 0:e.focus()},75))}b?(g(e),m(e=>c({},e,{isSelected:!1,inputValue:""})),w&&(n(e),y&&o(e))):S&&ru(_)&&(_.includes(e)?g(_.filter(t=>t!==e)):g([..._,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;m(e=>c({},e,{inputValue:t})),b&&g(t)},C=e=>{e.stopPropagation(),"Enter"!==e.key||I()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),m(e=>c({},e,{isSelected:!1,inputValue:""})),b&&g(null))},I=()=>!(t.optional||!rv(_)&&(!ru(_)||f.isSelected||0!==_.length)&&(!f.isSelected||""!==f.inputValue.trim())),E=()=>{f.isSelected&&S?ru(_)&&(y?o([..._,f.inputValue]):n([..._,f.inputValue])):y?o(_):n(_)};return cg(ax,{children:[cg("div",{className:"question-container",children:[cg(cE,{question:t,forceDisableHtml:r}),cg("fieldset",{className:"multiple-choice-options limit-height",children:[cg("legend",{className:"sr-only",children:S?" Select all that apply":" Select one"}),h.map((e,r)=>{var s=!!t.hasOpenChoice&&r===t.choices.length-1,n="surveyQuestion"+i+"Choice"+r,o=n+"Open",a=s?f.isSelected:b?_===e:ru(_)&&_.includes(e);return cg("label",{className:s?"choice-option-open":"",children:[cg("div",{className:"response-choice",children:[cg("input",{type:b?"radio":"checkbox",name:n,checked:a,onChange:()=>k(e,s),id:n,"aria-controls":o}),cg("span",{children:s?e+":":e})]}),s&&cg("input",{type:"text",ref:d,id:o,name:"question"+i+"Open",value:f.inputValue,onKeyDown:C,onInput:x,onClick(t){f.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)})]})]}),cg(cI,{text:t.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:w,canGoBack:l,onBack:u})]})}var cA=[1,2,3,4,5],cN=[1,2,3,4,5,6,7],cq=[0,1,2,3,4,5,6,7,8,9,10],cB={2:[cS,cw],3:[cm,cf,cv],5:[cy,cm,cf,cv,cb]},cH=sb("[Surveys]");function c$(e,t,r){var i,s=e.questions[t],n=t+1;if(null==(i=s.branching)||!i.type)return t===e.questions.length-1?"end":n;if("end"===s.branching.type)return"end";if("specific_question"===s.branching.type){if(Number.isInteger(s.branching.index))return s.branching.index}else if("response_based"===s.branching.type){if(s.type===ld){var o,a=s.choices.indexOf(""+r);if(-1===a&&s.hasOpenChoice&&(a=s.choices.length-1),null!=(o=s.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=s.branching.responseValues[a];return Number.isInteger(l)?l:"end"===l?"end":n}}else if(s.type===lh){if("number"!=typeof r||!Number.isInteger(r))throw Error("The response type must be an integer");var u,c=function(e,t){if(2===t){if(1>e||e>2)throw Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,s.scale);if(null!=(u=s.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(c)){var d=s.branching.responseValues[c];return Number.isInteger(d)?d:"end"===d?"end":n}}return n}return cH.warn("Falling back to next question index due to unexpected branching type"),n}var cz="https?://(.*)",cU=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cW=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...cU],cj="<masked>",cV=["li_fat_id"];function cG(e,t,r){if(!sa)return{};var i,s=t?[...cU,...r||[]]:[],n=cQ(sD(sa.URL,s,cj),e);return sk((i={},sw(cV,function(e){var t=uQ._get(e);i[e]=t||null}),i),n)}function cQ(e,t){var r=cW.concat(t||[]),i={};return sw(r,function(t){var r=sO(e,t);i[t]=r||null}),i}function cZ(e){var t=e?0===e.search(cz+"google.([^/?]*)")?"google":0===e.search(cz+"bing.com")?"bing":0===e.search(cz+"yaho
1o.com")?"yahoo":0===e.search(cz+"duckduckgo.com")?"duckduckgo":null:null,r={};if(!rv(t)){r.$search_engine=t;var i=sa?sO(sa.referrer,"yahoo"!=t?"q":"p"):"";i.length&&(r.ph_keyword=i)}return r}function cK(){return navigator.language||navigator.userLanguage}var cY="$direct";function cJ(){return(null==sa?void 0:sa.referrer)||cY}function cX(e,t,r){void 0===r&&(r=!1);var i=e?[...cU,...t||[]]:[],s=r?iE(null==sl?void 0:sl.href):null==sl?void 0:sl.href,n=null==s?void 0:s.substring(0,1e3);return{r:cJ().substring(0,1e3),u:n?sD(n,i,cj):void 0}}function c0(e,t){void 0===t&&(t=!1);var r,i=e.r,s=e.u,n=t?iE(s):s,o={$referrer:i,$referring_domain:null==i?void 0:i==cY?cY:null==(r=sF(i))?void 0:r.host};if(n){o.$current_url=n;var a=sF(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,sk(o,cQ(n))}return i&&sk(o,cZ(i)),o}function c1(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var c2=sb("[SurveyTranslations]"),c5="ph:show_survey_widget",c3="PHWidgetSurveyClickListener";function c4(e,t){try{var r=e.getBoundingClientRect(),i=ss.innerHeight,s=ss.innerWidth,n=r.left+r.
1width/2-t/2;n+t>s-20&&(n=s-t-20),20>n&&(n=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:n+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:u3.zIndex}}catch(e){return lL.warn("Failed to calculate trigger position:",e),null}}class c8{constructor(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._prefillHandledSurveys=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(nb);if(e)for(var t of e)cd(t)&&cr(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var r,i,s,n,o=this._translateSurveyForRendering(e),a=o.survey,l=o.language,u=null!=t&&t.position||null!=t&&t.selector?c({},a,{appearance:c({},a.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):a;this._clearSurveyTimeout(u.id);var d=null!=t?t:{},h=d.properties,p=d.initialResponses,_=!(!p||0>=Object.keys(p).length)&&this._handleInitialResponses(u,p,h,l);if(!_||null!=(r=u.appearance)&&r.displayThankYouMessage){this._addSurveyToFocus(u);var g={};if((null==(i=u.appearance)?void 0:i.position)===ln&&null!=(s=u.appearance)&&s.widgetSelector){var v,f=sa.querySelector(u.appearance.widgetSelector);f&&(g=c4(f,parseInt((null==(v=u.appearance)?void 0:v.maxWidth)||u3.maxWidth))||{})}var m=(null==(n=u.appearance)?void 0:n.surveyPopupDelaySeconds)||0,y=u7(u,this._posthog).shadow,b={posthog:this._posthog,survey:u,removeSurveyFromFocus:this._removeSurveyFromFocus,properties:h,style:g,isSurveyCompleted:_,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:l};if(0>=m)return aq(cg(c9,c({},b)),y);var S=setTimeout(()=>{if(this._surveyTimeouts.delete(u.id),!this._shouldDisplaySurvey(u))return lL.info("Survey "+u.id+" no longer eligible when its display delay elapsed; not displaying"),this._removeSurveyFromFocus(u);aq(cg(c9,c({},b,{survey:c({},u,{appearance:c({},u.appearance,{surveyPopupDelaySeconds:0})})})),y)},1e3*m);this._surveyTimeouts.set(u.id,S)}},this._handleWidget=e=>{var t=this._translateSurveyForRendering(e),r=t.survey,i=t.language,s=u7(r,this._posthog),n=s.shadow;s.isNewlyCreated&&aq(cg(dt,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),n)},this._removeWidgetSelectorListener=e=>{this._removeSurveyFromDom(e);var t=this._widgetSelectorListeners.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(c3),this._widgetSelectorListeners.delete(e.id),lL.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=sa.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;lL.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(c3)){var s=t=>{t.stopPropagation();var r,i,s=(null==(r=e.appearance)?void 0:r.position)===ln?c4(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||u3.maxWidth)):{};ss.dispatchEvent(new CustomEvent(c5,{detail:{surveyId:e.id,position:s}}))};sM(r,"click",s),r.setAttribute(c3,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:s,survey:e}),lL.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var t=this._translateSurveyForRendering(e),r=t.survey,i=t.language,s=u7(r,this._posthog).shadow;aq(cg(c9,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:i}),s)},this.renderSurvey=(e,t,r)=>{var i,s=this._translateSurveyForRendering(e),n=s.survey,o=s.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this._handleUrlPrefill(n,o)),aq(cg(c9,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys(r=>{e(r.filter(e=>t._shouldDisplaySurvey(e)))},r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys(e=>{var r=e.filter(e=>e.type===lo||e.type===la),i=new Set(r.map(e=>e.id));for(var s of Array.from(t._surveyTimeouts.keys()))i.has(s)||t.cancelSurvey(s);var n=t._sortSurveysByAppearanceDelay(r),o=new Set;
1n.forEach(e=>{if(e.type===la){var r,i,s,n;if((null==(r=e.appearance)?void 0:r.widgetType)==="tab")return void t._handleWidget(e);(null==(i=e.appearance)?void 0:i.widgetType)==="selector"&&null!=(s=e.appearance)&&s.widgetSelector&&(o.add(e.id),t._manageWidgetSelectorListener(e,null==(n=e.appearance)?void 0:n.widgetSelector))}rv(t._surveyInFocus)&&e.type===lo&&t.handlePopoverSurvey(e)}),t._widgetSelectorListeners.forEach(e=>{var r=e.survey;o.has(r.id)||t._removeWidgetSelectorListener(r)})},e)},this._addSurveyToFocus=e=>{rv(this._surveyInFocus)||lL.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&lL.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this._clearSurveyTimeout(e.id),this._surveyInFocus=null,this._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null}_clearSurveyTimeout(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))}cancelSurvey(e){this._surveyTimeouts.has(e)&&(lL.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null))}_sortSurveysByAppearanceDelay(e){return e.sort((e,t)=>{var r,i,s=cd(e),n=cd(t);if(s&&!n)return -1;if(!s&&n)return 1;var o=e.schedule===lp,a=t.schedule===lp;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)})}_translateSurveyForRendering(e){return function(e,t){var r=function(e,t){var r=e.storedPersonProperties,i=e.locale,s=lT(e.overrideLanguage);if(s)return null==t||t.info("Using override display language: "+s),s;var n=r&&"object"==typeof r&&"language"in r?lT(r.language):null;if(n)return null==t||t.info("Using person property language: "+n),n;var o=lT(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:rc(t.get_property)?t.get_property(nm):void 0,locale:cK()},c2);if(!r)return c2.info("No user language detected"),{survey:e,language:null};var i=function(e,t,r){var i,s=lP(e.translations,t,r),n=c({},e),o=!1;if(s){var a,l=null==(a=e.translations)?void 0:a[s];l&&(null==r||r.info("Applying survey-level translation for language: "+s),rp(l.name)||(n.name=l.name,o=!0),n.appearance?(n.appearance=c({},n.appearance),rp(l.thankYouMessageHeader)||(n.appearance.thankYouMessageHeader=l.thankYouMessageHeader,o=!0),rp(l.thankYouMessageDescription)||(n.appearance.thankYouMessageDescription=l.thankYouMessageDescription,o=!0),rp(l.thankYouMessageCloseButtonText)||(n.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,o=!0),rp(l.submitButtonText)||(n.appearance.submitButtonText=l.submitButtonText,o=!0),rp(l.backButtonText)||(n.appearance.backButtonText=l.backButtonText,o=!0)):rp(l.thankYouMessageHeader)&&rp(l.thankYouMessageDescription)&&rp(l.thankYouMessageCloseButtonText)&&rp(l.submitButtonText)&&rp(l.backButtonText)||(o=!0))}var u=e.questions.map(e=>(function(e,t,r){var i,s=lP(e.translations,t,r);if(!s)return{question:e,matchedKey:null,hasChanges:!1};var n=null==(i=e.translations)?void 0:i[s];if(!n)return{question:e,matchedKey:null,hasChanges:!1};var o=c({},e),a=!1;return rp(n.question)||(o.question=n.question,a=!0),rp(n.description)||(o.description=n.description,a=!0),rp(n.buttonText)||(o.buttonText=n.buttonText,a=!0),"link"in o&&!rp(n.link)&&(o.link=n.link,a=!0),"lowerBoundLabel"in o&&!rp(n.lowerBoundLabel)&&(o.lowerBoundLabel=n.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!rp(n.upperBoundLabel)&&(o.upperBoundLabel=n.upperBoundLabel,a=!0),"choices"in o&&ru(n.choices)&&(o.choices=n.choices,a=!0),{question:a?o:e,matchedKey:a?s:null,hasChanges:a}})(e,t,r)),d=u.map(e=>e.question),h=u.some(e=>e.hasChanges),p=null;return s||(p=(null==(i=u.find(e=>e.matchedKey))?void 0:i.matchedKey)||null),h&&(n.questions=d,o=!0,null==r||r.info("Applied question-level translations for language: "+t)),{survey:n,matchedKey:o?s||p:null}}(e,r,c2);return{survey:i.survey,language:i.matchedKey}}(e,this._posthog)}_handleUrlPrefill(e,t){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(){var e={},t=!1,r=ss.location.search.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:t};for(var i of r.split("&")){var s=i.split("="),n=s[0],o=s[1];if(n&&!rp(o)){var a=decodeURIComponent(n),l=decodeURIComponent(o);if("auto_submit"!==a||"true"!==l){var u=a.match(/^q(\d+)$/);if(u){var c=parseInt(u[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else t=!0}}return{params:e,autoSubmit:t}}().params;if(0===Object.keys(r).length)return!1;lL.info("[Survey Prefill] Detected URL prefill parameters");var i=this._processPrefillData(e,r,t);if(!i)return!1;var s=i.responses,n=i.submissionId,o=i.isSurveyCompleted,a=i.skippedResponses;return(Object.keys(a).length>0&&e.enable_partial_responses||o)&&u9({responses:o?s:a,survey:e,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this._prefillHandledSurveys.add(e.id),o}_handleInitialResponses(e,t,r,i){var s={};for(var n of Object.entries(t)){var o=n[1];s[parseInt(n[0])]=ru(o)?o.map(String):[String(o)]}lL.info("[Survey] Processing initial responses");var a=this._processPrefillData(e,s,i);if(!a)return!1;var l=a.isSurveyCompleted;return u9({responses:a.responses,survey:e,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}_processPrefillData(e,t,r){try{var i,s=(i={},e.questions.forEach((e,r)=>{if(t[r]&&e.id){var s=t[r],n=lx(e.id);try{switch(e.type){case ld:if(!e.choices||0===e.choices.length)return void sy.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(s[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void sy.warn("[Survey Prefill] Invalid choice index for q"+r+": "+s[0]);i[n]=e.choices[o];break;case lc:if(!e.choices||0===e.choices.length)return void sy.warn("[Survey Prefill] Question "+r+" has no choices");var a=s.map(e=>parseInt(e,10)).filter(t=>!isNaN(t)&&t>=0&&e.choices.length>t);if(0===a.length)return void sy.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(t=>e.choices[t]))];a.length>l.length&&sy.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[n]=l;break;case lh:var u=parseInt(s[0],10),c=e.scale||10;if(isNaN(u)||0>u||u>c)return void sy.warn("[Survey Prefill] Invalid rating for q"+r+": "+s[0]+" (scale: 0-"+c+")");i[n]=u;break;default:sy.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}
1catch(e){sy.error("[Survey Prefill] Error converting q"+r+":",e)}}}),i);if(0===Object.keys(s).length)return lL.warn("[Survey Prefill] No valid responses after conversion"),null;var n=lG(),o=Object.keys(t).map(e=>parseInt(e,10)),a=function(e,t,r){for(var i=0,s={},n=e.questions.length+1;e.questions.length>i&&n>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=lx(o.id);rp(r[a])||(s[a]=r[a])}var l=c$(e,i,o.id?r[lx(o.id)]:null);if("end"===l)return{startQuestionIndex:e.questions.length,skippedResponses:s};i=l}return{startQuestionIndex:i,skippedResponses:s}}(e,o,s),l=a.startQuestionIndex,u=a.skippedResponses,c=l>=e.questions.length;return cu(e,{surveySubmissionId:n,responses:s,lastQuestionIndex:l,surveyLanguage:r}),lL.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:s,submissionId:n,startQuestionIndex:l,isSurveyCompleted:c,skippedResponses:u}}catch(e){return lL.error("[Survey Prefill] Error handling prefill:",e),null}}_isSurveyFeatureFlagEnabled(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r,i,s=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),n=!0;return t&&(n=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),s&&n}_isSurveyConditionMatched(e){var t,r,i;return!e.conditions||cl(e,this._posthog)&&function(e,t){if(!e||0===e.length)return!0;if(!sp)return!1;var r,i,s,n=ix(sp,{userAgentDataPlatform:null==so||null==(r=so.userAgentData)?void 0:r.platform,maxTouchPoints:null==so?void 0:so.maxTouchPoints,screenWidth:null==ss||null==(i=ss.screen)?void 0:i.width,screenHeight:null==ss||null==(s=ss.screen)?void 0:s.height,devicePixelRatio:null==ss?void 0:ss.devicePixelRatio});return u$[null!=t?t:"icontains"](e,[n])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)&&(null==(i=e.conditions)||!i.selector||!(null==sa||!sa.querySelector(e.conditions.selector)))}_internalFlagCheckSatisfied(e){return cn(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||cd(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!lO(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!lH.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var s=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this._isSurveyFeatureFlagEnabled(e.linked_flag_key,s)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?this._internalFlagCheckSatisfied(e)?!function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t;return Math.ceil(Math.abs((new Date).getTime()-r.getTime())/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,uK._get("lastSeenSurveyDate"))?(i.eligible=!1,i.reason="Survey wait period has not passed"):uK._get(lq(lA,e))&&!cn(e)&&(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again"):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress"):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled"):(i.eligible=!1,i.reason=s?"Survey linked feature flag is not enabled for variant "+s:"Survey linked feature flag is not enabled"),i}_hasActionOrEventTriggeredSurvey(e){if(!lR(e)&&!lD(e))return!0;var t,r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_checkFlags(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(e=>{var t=e.value;return!e.key||!t||this._isSurveyFeatureFlagEnabled(t)})}_shouldDisplaySurvey(e){return this.checkSurveyEligibility(e).eligible&&this._isSurveyConditionMatched(e)&&this._hasActionOrEventTriggeredSurvey(e)&&this._checkFlags(e)}_removeSurveyFromDom(e){try{var t=sa.querySelector(cp(e,!0));null!=t&&t.shadowRoot&&aq(null,t.shadowRoot),null==t||t.remove()}catch(t){lL.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this)}}}function c6(e,t){if(sa&&ss){var r,i=new c8(e);if(e.config.disable_surveys_automatic_display)return lL.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return lL.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var s=()=>{rp(r)&&(r=setInterval(()=>{i.callSurveysAndEvaluateDisplayLogic(!1)},1e3))};return s(),sM(sa,"visibilitychange",()=>{sa.hidden?rp(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),s())}),i}}function c7(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,s=e.setSurveyVisible,n=e.isPreviewMode,o=void 0!==n&&n,a=e.posthog;a0(()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===la,n=cl(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)==="tab"&&r;if(!n)return lL.info("Hiding survey "+t.id+" because URL does not match"),s(!1),i(t);o&&(lL.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),s(!0))};sM(ss,"popstate",r),sM(ss,"hashchange",r);var n=ss.history.pushState,l=ss.history.replaceState;return ss.history.pushState=function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];n.apply(this,t),r()},ss.history.replaceState=function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];l.apply(this,t),r()},()=>{ss.removeEventListener("popstate",r),ss.removeEventListener("hashchange",r),ss.history.pushState=n,ss.history.replaceState=l}}},[o,t,i,s,a])}function c9(e){var t,r,i,s,n,o,a,l,u,d,h,p,_,g,v,f=e.survey,m=e.forceDisableHtml,y=e.posthog,b=e.style,S=e.previewPageIndex,w=e.removeSurveyFromFocus,k=e.isPopup,x=void 0===k||k,C=e.onPreviewSubmit,I=void 0===C?()=>{}:C,E=e.onPreviewBack,T=void 0===E?()=>{}:E,M=e.onPopupSurveyDismissed,P=void 0===M?()=>{}:M,R=e.onCloseConfirmationMessage,F=void 0===R?()=>{}:R,L=e.properties,O=e.isSurveyCompleted,D=e.skipShownEvent,A=e.surveyLanguage,N=a1(null),q=Number.isInteger(S),B=null!=(d=f.a
1ppearance)&&d.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,H=(t=void 0===w?()=>{}:w,i=(r=aX(q||0===B||f.type===ll))[0],s=r[1],o=(n=aX(!1))[0],a=n[1],l=()=>{var e=()=>{x&&t(f),s(!1)};sa.startViewTransition?sa.startViewTransition(()=>{var e;null==N||null==(e=N.current)||e.remove()}).finished.then(()=>{setTimeout(()=>{e()},100)}):e()},u=e=>{e.detail.surveyId===f.id&&l()},a0(()=>{if(y){if(!q){var e=e=>{var t,r;if(e.detail.surveyId===f.id){if(null==(t=f.appearance)||!t.displayThankYouMessage)return l();a(!0),null!=(r=f.appearance)&&r.autoDisappear&&setTimeout(()=>{l()},5e3)}},t=()=>{if(cl(f,y)){s(!0),ss.dispatchEvent(new Event("PHSurveyShown")),D||y.capture(l_,c({[lm]:f.name,[lf]:f.id,[ly]:f.current_iteration,[lb]:f.current_iteration_start_date},A&&{[lw]:A},{sessionRecordingUrl:null==y.get_session_replay_url?void 0:y.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(sM(ss,"PHSurveyClosed",u),sM(ss,"PHSurveySent",e),B>0){var r=setTimeout(t,B);return()=>{clearTimeout(r),ss.removeEventListener("PHSurveyClosed",u),ss.removeEventListener("PHSurveySent",e)}}return t(),()=>{ss.removeEventListener("PHSurveyClosed",u),ss.removeEventListener("PHSurveySent",e)}}}else lL.error("usePopupVisibility hook called without a PostHog instance.")},[]),c7({survey:f,removeSurveyFromFocus:t,setSurveyVisible:s,isPreviewMode:q,posthog:y}),{isPopupVisible:i,isSurveySent:o,setIsPopupVisible:s,hidePopupWithViewTransition:l}),$=H.isPopupVisible,z=H.hidePopupWithViewTransition,U=H.isSurveySent||S===f.questions.length||!0===O,W=a2(()=>{var e=cc(f);return{isPreviewMode:q,previewPageIndex:S,onPopupSurveyDismissed(){A?ct(f,y,q,A):ct(f,y,q),P()},isPopup:x||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||lG(),onPreviewSubmit:I,onPreviewBack:T,posthog:y,properties:L,surveyLanguage:A}},[q,S,x,y,f,P,I,T,L,A]);return $?cg(co.Provider,{value:W,children:cg("div",{className:"ph-survey",style:c({},function(e,t,r){if(void 0===t&&(t=ls),e===ll)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case lr:return{left:"30px"};case li:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===la&&"tab"===r?"60px":"30px"}}}(f.type,null==(h=f.appearance)?void 0:h.position,null==(p=f.appearance)?void 0:p.widgetType),void 0===b?{}:b),ref:N,children:U?cg(cM,{header:(null==(_=f.appearance)?void 0:_.thankYouMessageHeader)||"Thank you!",description:(null==(g=f.appearance)?void 0:g.thankYouMessageDescription)||"",forceDisableHtml:!!m,contentType:null==(v=f.appearance)?void 0:v.thankYouMessageDescriptionContentType,appearance:f.appearance||u3,onClose(){z(),F()}}):cg(de,{survey:f,forceDisableHtml:!!m,posthog:y})})}):null}function de(e){var t,r,i=e.survey,s=e.forceDisableHtml,n=e.posthog,o=aX(()=>{var e=cc(i);return null!=e&&e.responses&&lL.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}}),a=o[0],l=o[1],u=a5(co),d=u.previewPageIndex,h=u.onPopupSurveyDismissed,p=u.isPopup,_=u.onPreviewSubmit,g=u.onPreviewBack,v=u.surveySubmissionId,f=u.isPreviewMode,m=u.properties,y=u.surveyLanguage,b=aX(()=>{var e=cc(i);return d||(null==e?void 0:e.lastQuestionIndex)||0}),S=b[0],w=b[1],k=aX(()=>{var e,t=cc(i);return null!=(e=null==t?void 0:t.visitedIndices)?e:[]}),x=k[0],C=k[1],I=a2(()=>i.appearance&&i.appearance.shuffleQuestions&&!i.enable_partial_responses?cs(i.questions,ci(i.questions)):i.questions,[i]);a0(()=>{f&&!rp(d)&&w(d)},[d,f]);var E=!(null==(t=i.appearance)||!t.allowGoBack)&&(f?(null!=d?d:0)>0:x.length>0),T=I.at(S);return T?cg("form",{className:"survey-form",name:"surveyForm",children:[p&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&cg(cT,{onClick(){h()}}),cg("div",{className:"survey-box","data-question-index":S,children:dr({question:T,forceDisableHtml:s,displayQuestionIndex:S,appearance:i.appearance||u3,onSubmit:e=>(e=>{var t=e.res,r=e.displayQuestionIndex,s=e.questionId;if(n)if(s){var o=lx(s),u=c({},a,{[o]:t});l(u);var d=c$(i,r,t),h="end"===d,p=[...x,r];if(h||(C(p),w(d),cu(i,{surveySubmissionId:v,responses:u,lastQuestionIndex:d,visitedIndices:p,surveyLanguage:y})),i.enable_partial_responses||h){var _=new Set(p.map(e=>{var t;return null==(t=I[e])?void 0:t.id}).filter(e=>!!e).map(e=>lx(e)));u9({responses:Object.fromEntries(Object.entries(u).filter(e=>_.has(e[0]))),survey:i,surveySubmissionId:v,isSurveyCompleted:h,posthog:n,properties:m,surveyLanguage:y})}}else lL.error("onNextButtonClick called without a questionId.");else lL.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:S,questionId:T.id}),onPreviewSubmit:_,initialValue:T.id?a[lx(T.id)]:void 0,canGoBack:E,onBack(){if(f)g();else if(0!==x.length){var e=x[x.length-1],t=x.slice(0,-1);C(t),w(e),cu(i,{surveySubmissionId:v,responses:a,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:y})}}})})]}):null}function dt(e){var t,r,i,s,n,o,a,l=e.survey,u=e.forceDisableHtml,c=e.posthog,d=e.readOnly,h=e.surveyLanguage,p=aX(!0),_=p[0],g=p[1],v=aX(!1),f=v[0],m=v[1],y=aX({}),b=y[0],S=y[1],w=()=>{m(!f)};if(a0(()=>{var e;if(c){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&S({top:"50%",bottom:"auto"});var t=e=>{var t;(null==(t=e.detail)?void 0:t.surveyId)===l.id&&(lL.info("Received show event for feedback button survey "+l.id),S(e.detail.position||{}),w())};return sM(ss,c5,t),()=>{ss.removeEventListener(c5,t)}}}else lL.error("FeedbackWidget called without a PostHog instance.")},[c,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),c7({survey:l,setSurveyVisible:g,posthog:c}),!_)return null;var k=()=>{l.schedule!==lp&&g(!1),setTimeout(()=>{m(!1)},200)};return cg(ax,{children:["tab"===(null==(s=l.appearance)?void 0:s.widgetType)&&cg("button",{className:"ph-survey-widget-tab "+((null==(n=l.appearance)?void 0:n.tabPosition)==="top"?"widget-tab-top":""),onClick:w,disabled:d,style:function(e){switch(void 0===e&&(e="right"),e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&cg(c9,{posthog:c,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:h})]})}var dr=e=>{var t=e.question,r=e.onSubmit,i=e.onPreviewSubmit,s={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){i(e)},onSubmit(e){r(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack}
1;switch(t.type){case lu:return aw(cR,c({},s,{question:t,key:t.id}));case"link":return aw(cF,c({},s,{question:t,key:t.id}));case lh:return aw(cL,c({},s,{question:t,key:t.id}));case ld:case lc:return aw(cD,c({},s,{question:t,key:t.id}));default:return lL.error("Unsupported question type: "+t.type),null}};s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.generateSurveys=c6,s_.extendPostHogWithSurveys=c6;var di=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),ds=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return di(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var s=0,n=Math.min(e.length,r.remaining-2);n>s;){var o=Math.ceil((s+n)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?n=o-1:s=o}return di(t,JSON.stringify(e.slice(0,s)),r)},dn=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,da=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},dl=(e,t,r)=>{if(!r.truncated)if(rd(e)){if(r.seen.has(e))return void da(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!({}).hasOwnProperty.call(e,i))continue;if(dl(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else da(t,e,r)},du=function(e,t,r,i,s,n){if(void 0===s&&(s=!1),!dn(e))return!s||di(t,"null",r);if(rv(e)||(e=>{try{return rm(e)||rb(e)}catch(e){return!1}})(e))return di(t,JSON.stringify(e),r);if("string"==typeof e)return ds(e,t,r);if(!rd(e)&&!ru(e))return di(t,JSON.stringify(e),r);if(i.has(e))return ds("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(rc(o))return du(o.call(e),t,r,i,s)}catch(e){}try{var a=({}).toString.call(e);if("[object String]"===a)return ds(String(e.valueOf()),t,r);if("[object Number]"===a||"[object Boolean]"===a)return di(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var l={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(l[u]=e[u])}catch(e){}try{l.name=e.name}catch(e){}try{l.message=e.message}catch(e){}try{l.stack=e.stack}catch(e){}return du(l,t,r,i,s,n)}if(ru(e)){if(!di(t,"[",r))return!1;for(var c=0;e.length>c;c++){if(c>0&&!di(t,",",r))return!1;var d=void 0;try{d=e[c]}catch(e){d=void 0}if(!du(d,t,r,i,!0))return!1}return di(t,"]",r)}if(!di(t,"{",r))return!1;var h=!0;try{for(var p in e)if(({}).hasOwnProperty.call(e,p)){if(0>=r.remaining)return r.truncated=!0,!1;var _=void 0;try{_=e[p]}catch(e){continue}if(n)try{dl(_,p,n)}catch(e){}if(dn(_)){var g=(h?"":",")+JSON.stringify(p)+":";if(g.length>=r.remaining)return r.truncated=!0,!1;var v=t.length,f=r.remaining,m=r.truncated;if(!di(t,g,r))return!1;var y=t.length,b=du(_,t,r,i,!1),S=r.truncated;if(t.length!==y){if(h=!1,!b)return!1}else if(t.length=v,r.remaining=f,r.truncated=b?m:S,!b)return!1}}}catch(e){}return di(t,"}",r)},dc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.logs={initializeLogs(e){var t={host:s_.location.host},r=!1,i=function(i){var s=s_.console[i],n=function(){for(var n=!1,o=arguments.length,a=Array(o),l=0;o>l;l++)a[l]=arguments[l];try{if(a.length>0&&!r&&e.is_capturing()){r=!0,n=!0;var u,d=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},s=rd(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,n=0;e.length>n&&(0>=n||di(r," ",i))&&du(e[n],r,i,new WeakSet,!1,0===n?s:void 0);n++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==s?void 0:s.result)||{}}})(a),h=d.body,p=d.attributes,_=c({},t,d.truncated?{body_truncated:"true"}:{});null==(u=e.logs)||u._captureConsoleLog({level:dc[i],body:h,attributes:c({"log.source":"console."+i},_,p)})}}catch(e){}finally{n&&(r=!1),s.apply(s_.console,a)}};n.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(s),s_.console[i]=n};for(var s of Object.keys(dc))i(s)}};var dd=sb("[Error tracking]");function dh(){return new iH([new iY,new i6,new iX,new iJ,new i4,new i3,new i1,new i8],function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var s=[],n=t.split("\n"),o=i;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=iK.test(a)?a.replace(iK,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of r){var d=u(l,e);if(d){s.push(d);break}}if(s.length>=50)break}}}if(!s.length)return[];var h=Array.from(s);return h.reverse(),h.slice(0,50).map(e=>c({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",iV,iZ))}var dp=sb("[ExceptionAutocapture]"),d_=dh(),dg={wrapOnError(e){ss||dp.info("window not available, cannot wrap onerror");var t=ss.onerror;return ss.onerror=function(){for(var r,i=arguments.length,s=Array(i),n=0;i>n;n++)s[n]=arguments[n];return e(d_.buildFromUnknown(s[4]||s[0],{mechanism:{handled:!1}})),null!=(r=null==t?void 0:t(...s))&&r},ss.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=ss.onerror)||delete e.__POSTHOG_INSTRUMENTED__,ss.onerror=t}},wrapUnhandledRejection(e){ss||dp.info("window not available, cannot wrap onUnhandledRejection");var t=ss.onunhandledrejection;return ss.onunhandledrejection=function(r){var i;return e(d_.buildFromUnknown(r,{mechanism:{handled:!1}})),null!=(i=null==t?void 0:t(r))&&i},ss.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=ss.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,ss.onunhandledrejection=t}},wrapConsoleError(e){var t=console;t||dp.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,s=Array(i),n=0;i>n;n++)s[n]=arguments[n];t=1==s.length?s[0]:s.join(" ");var o=s.find(e=>e instanceof Error);return e(d_.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:Error("PostHog syntheticException"),skipFirstLines:2})),null==r?void 0:r(...s)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.errorWrappingFunctions=dg,s_.posthogErrorWrappingFunctions=dg;var dv="X-POSTHOG-SESSION-ID",df="X-POSTHOG-WINDOW-ID",dm="X-POSTHOG-DISTINCT-ID",dy=[dv,df,dm],db=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],dS=(e,t)=>({}).hasOwnProperty.call(e,t),dw=e=>"object"==typeof e&&!rv(e)||rc(e),dk=e=>"u">typeof Request&&(e instanceof Request||"[object Request]"===({}).toString.call(e)),dx=e=>{try{var t;
1return dk(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==ss||null==(t=ss.location)?void 0:t.href).toString()}catch(e){return}},dC=(e,t,r,i,s)=>{try{n=new URL(i).hostname}catch(e){return!1}if(!e||ru(e)&&!e.includes(n))return!1;var n,o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;s.set(dv,a.sessionId),s.set(df,l),o=!0}var u=rc(t)?t():t;return u&&u!==nA&&(s.set(dm,u),o=!0),o};s_.__PosthogExtensions__=s_.__PosthogExtensions__||{};var dI={_patchFetch:(e,t,r)=>sH(ss,"fetch",i=>function(s,n){var o=arguments.length>1?[s,n]:[s],a=o;try{var l=dx(s);if(l)if(dk(s)){var u=new Request(s,n);dC(e,t,r,u.url,u.headers),a=[u]}else{var d=new Headers(dw(n)?n.headers:void 0);if(dC(e,t,r,l,d)){var h=((e,t)=>{if(rp(e)||rv(e))return{headers:t};if(dw(e)){if("u"<typeof Proxy||"u"<typeof Reflect){var r=Object.create(e);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),r}return new Proxy({headers:t},{get:(t,r)=>dS(t,r)?Reflect.get(t,r):Reflect.get(e,r,e),has:(t,r)=>dS(t,r)||r in e,ownKeys(t){var r=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(e).forEach(e=>r.add(e)),db.forEach(t=>{t in e&&r.add(t)}),Array.from(r)},getOwnPropertyDescriptor(t,r){var i=Reflect.getOwnPropertyDescriptor(t,r);if(i)return i;if("string"==typeof r&&db.includes(r)&&r in e)return{configurable:!0,enumerable:!0,get:()=>Reflect.get(e,r,e)};var s=Reflect.getOwnPropertyDescriptor(e,r);return s?c({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(e)})}})(n,d);h&&(a=[s,h])}}}catch(e){a=o}return i.apply(this,a)}),_patchXHR:(e,t,r)=>
1sH(ss.XMLHttpRequest.prototype,"open",i=>function(s,n,o,a,l){void 0===o&&(o=!0);var u=this,c=new Headers,d=dx(n);d&&dC(e,t,r,d,c);var h=i.call(u,s,n,o,a,l);return dy.forEach(e=>{var t=c.get(e);if(t)try{u.setRequestHeader(e,t)}catch(e){}}),h})};s_.__PosthogExtensions__.tracingHeadersPatchFns=dI,s_.postHogTracingHeadersPatchFns=dI,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var dE=-1,dT=e=>{addEventListener("pageshow",t=>{t.persisted&&(dE=t.timeStamp,e(t))},!0)},dM=(e,t,r,i)=>{var s,n;return o=>{let a;t.value>=0&&(o||i)&&((n=t.value-(null!=s?s:0))||void 0===s)&&(s=t.value,t.delta=n,a=t.value,t.rating=a>r[1]?"poor":a>r[0]?"needs-improvement":"good",e(t))}},dP=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},dR=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},dF=()=>{var e,t;return null!=(e=null==(t=dR())?void 0:t.activationStart)?e:0},dL=function(e,t){void 0===t&&(t=-1);var r=dR(),i="navigate";return 0>dE?r&&(document.prerendering||dF()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(0x82f79cd8fff*Math.random())+1e12),navigationType:i}},dO=new WeakMap;function dD(e,t){var r=dO.get(t);return r||(r=new WeakMap,dO.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class dA{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var dN,dq,dB=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return i.observe(c({type:e,buffered:!0},r)),i}}catch(e){}},dH=e=>{var t=!1;return()=>{t||(e(),t=!0)}},d$=-1,dz=new Set,dU=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,dW=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of dz)t();isFinite(d$)||(d$="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",dW,!0))}},dj=()=>{if(0>d$){var e,t=dF(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))?void 0:e.startTime;d$=null!=r?r:dU(),addEventListener("visibilitychange",dW,!0),addEventListener("prerenderingchange",dW,!0),dT(()=>{setTimeout(()=>{d$=dU()})})}return{get firstHiddenTime(){return d$},onHidden(e){dz.add(e)}}},dV=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},dG=[1800,3e3],dQ=function(e,t){void 0===t&&(t={}),dV(()=>{var r,i=dj(),s=dL("FCP"),n=dB("paint",e=>{for(var t of e)"first-contentful-paint"===t.name&&(n.disconnect(),i.firstHiddenTime>t.startTime&&(s.value=Math.max(t.startTime-dF(),0),s.entries.push(t),r(!0)))});n&&(r=dM(e,s,dG,t.reportAllChanges),dT(i=>{r=dM(e,s=dL("FCP"),dG,t.reportAllChanges),dP(()=>{s.value=performance.now()-i.timeStamp,r(!0)})}))})},dZ=[.1,.25],dK=0,dY=1/0,dJ=0,dX=e=>{for(var t of e)t.interactionId&&(dY=Math.min(dY,t.interactionId),dK=(dJ=Math.max(dJ,t.interactionId))?(dJ-dY)/7+1:0)},d0=()=>{var e;return dq?dK:null!=(e=performance.interactionCount)?e:0},d1=0;class d2{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){d1=d0(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((d0()-d1)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r,i=this.l.at(-1),s=this.u.get(e.interactionId);if(s||10>this.l.length||e.duration>i.L){if(s?e.duration>s.L?(s.entries=[e],s.L=e.duration):e.duration===s.L&&e.startTime===s.entries[0].startTime&&s.entries.push(e):(this.u.set((s={id:e.interactionId,entries:[e],L:e.duration}).id,s),this.l.push(s)),this.l.sort((e,t)=>
1t.L-e.L),this.l.length>10)for(var n of this.l.splice(10))this.u.delete(n.id);null==(r=this.p)||r.call(this,s)}}}}var d5=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=dH(e),s=-1,n=()=>{r(s),i()};addEventListener("visibilitychange",n,{once:!0,capture:!0}),s=t(()=>{removeEventListener("visibilitychange",n,{capture:!0}),i()})}},d3=[200,500];class d4{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var d8=[2500,4e3],d6={onLCP(e,t){void 0===t&&(t={}),dV(()=>{var r,i=dj(),s=dL("LCP"),n=dD(t,d4),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))n.h(o),i.firstHiddenTime>o.startTime&&(s.value=Math.max(o.startTime-dF(),0),s.entries=[o],r())},a=dB("largest-contentful-paint",o);if(a){r=dM(e,s,d8,t.reportAllChanges);var l=dH(()=>{o(a.takeRecords()),a.disconnect(),r(!0)}),u=e=>{e.isTrusted&&(d5(l),removeEventListener(e.type,u,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});dT(i=>{r=dM(e,s=dL("LCP"),d8,t.reportAllChanges),dP(()=>{s.value=performance.now()-i.timeStamp,r(!0)})})}})},onCLS(e,t){void 0===t&&(t={});var r=dj();dQ(dH(()=>{var i,s=dL("CLS",0),n=dD(t,dA),o=e=>{for(var t of e)n.h(t);n.i>s.value&&(s.value=n.i,s.entries=n.o,i())},a=dB("layout-shift",o);a&&(i=dM(e,s,dZ,t.reportAllChanges),r.onHidden(()=>{o(a.takeRecords()),i(!0)}),dT(()=>{n.i=0,dP(i=dM(e,s=dL("CLS",0),dZ,t.reportAllChanges))}),setTimeout(i))}))},onFCP:dQ,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=dj();dV(()=>{"interactionCount"in performance||dq||(dq=dB("event",dX,{durationThreshold:0}));var i,s,n=dL("INP"),o=dD(t,d2),a=e=>{d5(()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==n.value&&(n.value=r.L,n.entries=r.entries,s())})},l=dB("event",a,{durationThreshold:null!=(i=t.durationThreshold)?i:40});s=dM(e,n,d3,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(l.takeRecords()),s(!0)}),dT(()=>{o.v(),s=dM(e,n=dL("INP"),d3,t.reportAllChanges)}))})}}};s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.postHogWebVitalsCallbacks=d6,s_.postHogWebVitalsCallbacks=d6,s_.__PosthogExtensions__.loadWebVitalsCallbacks=()=>d6;class d7{constructor(e){this.disabled=!1===e;var t=rd(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var d9="$copy_autocapture",he=sb("[AutoCapture]");function ht(e,t){return t.length>e?t.slice(0,e)+"...":t}function hr(e,t){var r,i,s=t.e,n=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,u=t.disableCaptureUrlHashes;if(!n8(e))return{props:{}};for(var d=[e],h=new Set([e]),p=e;p.parentNode&&!n6(p,"body")&&1e3>d.length;)if(n9(p.parentNode)){var _=p.parentNode.host;if(h.has(_))break;h.add(_),d.push(_),p=_}else{if(!n8(p.parentNode)||h.has(p.parentNode))break;h.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}var g,v=[],f={},m=!1,y=!1;if(sw(d,e=>{var t=oy(e);if(n6(e,"a")){var r=e.getAttribute("href");m=!!(t&&r&&oE(r))&&(u?iE(r):r)}rr(or(e),"ph-no-capture")&&(y=!0),v.push(function(e,t,r,i,s){void 0===s&&(s=!1);var n=e.tagName.toLowerCase(),o={tag_name:n};oo.indexOf(n)>-1&&!r&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?ht(1024,oT(e)):ht(1024,os(e)));var a=or(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),sw(e.attributes,function(r){var n;if((!ob(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&oE(r.value)&&(!r_(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var a=r.value;"class"===r.name&&(a=oe(a).join(" ")),o["attr__"+r.name]=ht(1024,"href"===r.name&&s?iE(a):a)}});for(var l=1,u=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!n8(t))return t}(c);)l++,c.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,n,o,a,u)),sk(f,function(e){if(!oy(e))return{};var t={};return sw(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&oE(i)&&(t[r]=i)}}),t}(e))}),y)return{props:{},explicitNoCapture:y};if(o||(v[0].$el_text=n6(e,"a")||n6(e,"button")?oT(e):os(e)),m){v[0].attr__href=m;var b,S,w=null==(b=sF(m))?void 0:b.host,k=null==ss||null==(S=ss.location)?void 0:S.host;w&&k&&w!==k&&(g=m)}return{props:sk({$event_type:s.type,$ce_version:1},l?{}:{$elements:v},{$elements_chain:v.map(e=>{var t,r,i,s={text:null==(r=e.$el_text)?void 0:r.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:(t=e.attr__class)?ru(t)?t:oe(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sx(e).filter(e=>
10===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).map(e=>{var t,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))i+="."+s.replace(/"/g,"");var n=c({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(r=e.nth_of_type)?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return sx(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return o[oM(e[0].toString())]=oM(t.toString())}),(i+=":")+sx(o).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(r=v[0])&&r.$el_text?{$el_text:null==(i=v[0])?void 0:i.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},f)}}var hi={};function hs(e,t){var r=on(e);return r?c({node:r,originalEvent:e,timestamp:Date.now()},t):null}function hn(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var ho="canvas,video,audio,embed,object";function ha(e,t){return rm(e)&&e>=t}class hl{_asRequiredConfig(e){var t,r,i,s,n,o,a,l,u=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!=(t=null==e?void 0:e.element_attribute_ignorelist)?t:u.element_attribute_ignorelist,scroll_threshold_ms:null!=(r=null==e?void 0:e.scroll_threshold_ms)?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!=(i=null==e?void 0:e.selection_change_threshold_ms)?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!=(s=null==e?void 0:e.mutation_threshold_ms)?s:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!=(n=null==e?void 0:e.capture_clicks_with_modifier_keys)?n:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!=(o=null==e?void 0:e.capture_dead_swipes)?o:u.capture_dead_swipes,swipe_threshold_px:null!=(a=null==e?void 0:e.swipe_threshold_px)?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!=(l=null==e?void 0:e.max_dead_swipes_per_page_load)?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(e,t){this._clicks=[],this._deadSwipesCaptured=0,this._defaultConfig=e=>({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:e}),this._onClick=e=>{var t=hs(e,{type:"click"});rv(t)||this._ignore(t)||this._clicks.push(t),this._scheduleCheck()},this._onScroll=()=>{var e=Date.now();this._lastScroll=e,e%50==0&&this._clicks.forEach(t=>{rp(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)})},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this._onVisibilityChange=()=>{"visible"===(null==sa?void 0:sa.visibilityState)&&(this._lastVisibilityChange=Date.now())},this._onTouchStart=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this._touchStart=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this._onTouchCancel=()=>{this._touchStart=void 0},this._onTouchEnd=e=>{var t,r=this._touchStart;if(this._touchStart=void 0,!rp(r)&&this._config.max_dead_swipes_per_page_load>this._deadSwipesCaptured){var i=null==(t=e.changedTouches)?void 0:t[0];if(i){var s=i.clientX-r.x,n=i.clientY-r.y,o=s*s+n*n,a=this._config.swipe_threshold_px;if(o>=a*a&&![this._lastScroll,this._lastMutation,this._lastSelectionChanged].some(e=>rm(e)&&e>=r.timestamp)){if(this._pageHasUnobservableSurfaces()&&(null!=(l=null==sa||null==sa.elementsFromPoint?void 0:sa.elementsFromPoint(r.x,r.y))?l:[]).some(e=>null==e.matches?void 0:e.matches(ho)))return;var l,u=hs(e,{type:"swipe",swipeDirection:Math.abs(s)<Math.abs(n)?0>n?"up":"down":0>s?"left":"right",swipeDistancePx:Math.round(Math.sqrt(o))});rv(u)||this._ignore(u)||this._clicks.push(u),this._scheduleCheck()}}}},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startVisibilityChangeObserver(),this._startMutationObserver(e),this._config.capture_dead_swipes&&this._startSwipeObserver()}_startMutationObserver(e){if(!this._mutationObserver){var t=function(e,t){var r=hi[e];if(r)return r;var i,s=t[e];if(rc(i=s)&&-1!==i.toString().indexOf("[native code]")&&!ss.Zone)return hi[e]=s.bind(t);var n=t.document;if(n&&rc(n.createElement))try{var o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(s=a[e]),n.head.removeChild(o)}catch(t){sy.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return s&&rc(s)?hi[e]=s.bind(t):s}("MutationObserver",s_);this._mutationObserver=new t(e=>{this._onMutation(e)}),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this._mutationObserver)||e.disconnect(),this._mutationObserver=void 0,s_.removeEventListener("click",this._onClick),s_.removeEventListener("scroll",this._onScroll,{capture:!0}),s_.removeEventListener("selectionchange",this._onSelectionChange),s_.removeEventListener("touchstart",this._onTouchStart,{capture:!0}),s_.removeEventListener("touchend",this._onTouchEnd,{capture:!0}),s_.removeEventListener("touchcancel",this._onTouchCancel,{capture:!0}),null==sa||sa.removeEventListener("visibilitychange",this._onVisibilityChange),this._touchStart=void 0}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){sM(s_,"click",this._onClick)}_scheduleCheck(){this._clicks.length&&rp(this._checkClickTimer)&&(this._checkClickTimer=s_.setTimeout(()=>{this._checkClicks()},1e3))}_startScrollObserver(){sM(s_,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){sM(s_,"selectionchange",this._onSelectionChange)}_startVisibilityChangeObserver(){sM(sa,"visibilitychange",this._onVisibilityChange)}_startSwipeObserver(){sM(s_,"touchstart",this._onTouchStart,{capture:!0,passive:!0}),sM(s_,"touchend",this._onTouchEnd,{capture:!0,passive:!0}),sM(s_,"touchcancel",this._onTouchCancel,{capture:!0,passive:!0})}_pageHasUnobservableSurfaces(){var e=rp(this._surfacesCheckedAt)||rm(this._lastMutation)&&this._lastMutation>this._surfacesCheckedAt;return(rp(this._hasUnobservableSurfaces)||e)&&(this._surfacesCheckedAt=Date.now(),this._hasUnobservableSurfaces=!(null==sa||!sa.querySelector(ho))),!!this._hasUnobservableSurfaces}_ignore(e){return!e||("swipe"===e.type?this._ignoreCommon(e):this._ignoreClick(e))}_ignoreCommon(e){return!!n4(e.node)||!(!this._clicks.some(t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp))&&!n6(e.node,"html")&&n8(e.node)&&function(e,t){if(!ss||of(e))return!1;var r,i=rb(t)?op:null!=(r=null==t?void 0:t.css_selector_ignorelist)?r:op;return!oa(om(e,!1).targetElementList,i)}
1(e.node,{css_selector_ignorelist:this._config.css_selector_ignorelist}))}_ignoreClick(e){var t,r;return!(this._config.capture_clicks_with_modifier_keys||!((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))||!!this._ignoreCommon(e)||(r=e.node,!(!ss||of(r))&&om(r,!1).targetElementList.some(e=>n6(e,"a")))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){t.mutationDelayMs=null!=(r=t.mutationDelayMs)?r:this._lastMutation&&this._lastMutation>=t.timestamp?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&this._lastSelectionChanged>=t.timestamp?this._lastSelectionChanged-t.timestamp:void 0,t.visibilityChangedDelayMs=this._lastVisibilityChange?Math.abs(t.timestamp-this._lastVisibilityChange):void 0;var r,i=ha(t.scrollDelayMs,this._config.scroll_threshold_ms),s=ha(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),n=ha(t.mutationDelayMs,this._config.mutation_threshold_ms),o=ha(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=rm(t.scrollDelayMs)&&this._config.scroll_threshold_ms>t.scrollDelayMs,l=rm(t.mutationDelayMs)&&this._config.mutation_threshold_ms>t.mutationDelayMs,u=rm(t.selectionChangedDelayMs)&&this._config.selection_change_threshold_ms>t.selectionChangedDelayMs,c=rm(t.visibilityChangedDelayMs)&&this._config.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||c)){var d=ha(t.visibilityChangedDelayMs,this._config.selection_change_threshold_ms);if(i||n||o||s||d){var h=hn(t);if("$dead_swipe"===h){if(this._deadSwipesCaptured>=this._config.max_dead_swipes_per_page_load)continue;this._deadSwipesCaptured++}this._onCapture(t,{[h+"_last_mutation_timestamp"]:this._lastMutation,[h+"_event_timestamp"]:t.timestamp,[h+"_scroll_timeout"]:i,[h+"_mutation_timeout"]:n,[h+"_absolute_timeout"]:o,[h+"_selection_changed_timeout"]:s,[h+"_visibility_changed_timeout"]:d})}else this._config.mutation_threshold_ms>t.absoluteDelayMs&&this._clicks.push(t)}}this._scheduleCheck()}}_captureDeadClick(e,t){var r=hn(e);this.instance.capture(r,c({},t,hr(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:e.scrollDelayMs,[r+"_mutation_delay_ms"]:e.mutationDelayMs,[r+"_absolute_delay_ms"]:e.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new hl(e,t);var hu="disabled",hc="sampled",hd="active",hh="buffering",hp="paused",h_="lazy_loading",hg="awaiting_config",hv="missing_config",hf="rrweb_error",hm="trigger",hy=hm+"_activated",hb=hm+"_pending",hS=hm+"_"+hu;function hw(e,t,r,i,s,n){return 0===t?hS:(null==e?void 0:e.get_property(r?i+r:s))===n?hy:hb}function hk(e,t,r){return t.some(t=>{var i;return"regex"===t.matching&&(null!=(i=null==r?void 0:r.get(t.url))?i:new RegExp(t.url)).test(e)})}class hx{constructor(e){this._matchers=e}triggerStatus(e){var t=this._matchers.map(t=>t.triggerStatus(e));return t.includes(hy)?hy:t.includes(hb)?hb:hS}stop(){this._matchers.forEach(e=>e.stop())}}class hC{constructor(e){this._matchers=e}triggerStatus(e){var t=new Set;for(var r of this._matchers)t.add(r.triggerStatus(e));switch(t.delete(hS),t.size){case 0:return hS;case 1:return Array.from(t)[0];default:return hb}}stop(){this._matchers.forEach(e=>e.stop())}}class hI{triggerStatus(){return hy}stop(){}}class hE{constructor(e,t){this._urlTriggers=[],this._urlBlocklist=[],this._compiledTriggerRegexes=new Map,this._compiledBlocklistRegexes=new Map,this._lastCheckedUrl="",this.urlBlocked=!1,this._instance=e,this._groupId=t}onConfig(e){var t,r;this._urlTriggers=("sessionRecording"in e?rd(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this._urlBlocklist=("sessionRecording"in e?rd(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this._compileRegexCache()}_compileRegexCache(){for(var e of(this._compiledTriggerRegexes.clear(),this._compiledBlocklistRegexes.clear(),this._urlTriggers))if("regex"===e.matching&&!this._compiledTriggerRegexes.has(e.url))try{this._compiledTriggerRegexes.set(e.url,new RegExp(e.url))}catch(t){sy.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this._urlBlocklist)if("regex"===t.matching&&!this._compiledBlocklistRegexes.has(t.url))try{this._compiledBlocklistRegexes.set(t.url,new RegExp(t.url))}catch(e){sy.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}_urlTriggerStatus(e){return hw(this._instance,this._urlTriggers.length,this._groupId,no,ni,e)}triggerStatus(e){var t=this._urlTriggerStatus(e),r=t===hy?hy:t===hb?hb:hS;return this._instance.register_for_session({[nj]:r}),r}checkUrlBlocklist(e,t){var r=sU(this._instance);if(r&&r!==this._lastCheckedUrl){this._lastCheckedUrl=r;var i=this.urlBlocked,s=hk(r,this._urlBlocklist,this._compiledBlocklistRegexes);i&&s||(s&&!i?e():!s&&i&&t())}}checkUrlTriggerConditions(e,t,r,i){var s=sU(this._instance);if(s&&s!==this._lastCheckedUrl){this._lastCheckedUrl=s;var n=this.urlBlocked,o=hk(s,this._urlBlocklist,this._compiledBlocklistRegexes);o&&!n?e():!o&&n&&t();var a=this._urlTriggerStatus(i)===hy,l=hk(s,this._urlTriggers,this._compiledTriggerRegexes);!a&&l&&r("url",s)}}stop(){this._lastCheckedUrl=""}}class hT{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this._flagListenerCleanup=()=>{},this._instance=e}triggerStatus(){var e=hb;return rf(this.linkedFlag)&&(e=hS),this.linkedFlagSeen&&(e=hy),this._instance.register_for_session({[n$]:e}),e}onConfig(e,t){var r;if(this.linkedFlag=("sessionRecording"in e?rd(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!rf(this.linkedFlag)&&!this.linkedFlagSeen){var i=r_(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,s=r_(this.linkedFlag)?null:this.linkedFlag.variant;this._flagListenerCleanup=this._instance.onFeatureFlags((e,r)=>{var n=!1;if(rd(r)&&i in r){var o=r[i];n=rb(o)?!0===o:s?o===s:!!o}this.linkedFlagSeen=n,n&&t(i,s)})}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this._flagListenerCleanup()}}class hM{constructor(e,t){this._eventTriggers=[],this._instance=e,this._groupId=t}onConfig(e){var t;this._eventTriggers=("sessionRecording"in e?rd(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}_eventTriggerStatus(e){return hw(this._instance,this._eventTriggers.length,this._groupId,nn,ns,e)}triggerStatus(e){var t=this._eventTriggerStatus(e),r=t===hy?hy:t===hb?hb:hS;return this._instance.register_for_session({[nH]:r}),r}checkEventTriggerConditions(e,t,r){if(0!==this._eventTriggers.length){var i=this._eventTriggerStatus(r)===hy,s=this._eventTriggers.includes(e);!i&&s&&t("event",e)}}stop(){}}class hP{constructor(e,t,r){if(this._instance=e,this.group=t,this._urlTriggerMatching=new hE(e,t.id),this._eventTriggerMatching=new hM(e,t.id),this._linkedFlagMatching=new hT(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map(e=>e.name),s={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this._urlTriggerMatching.onConfig(s),this._eventTriggerMatching.onConfig(s),this._linkedFlagMatching.onConfig(s,r);var n=[this._eventTriggerMatching,this._urlTriggerMatching,this._linkedFlagMatching];this._combinedMatching="any"===t.conditions.matchType?new hx(n):new hC(n)}else this._combinedMatching=new hI}triggerStatus(e){return this._combinedMatching.triggerStatus(e)}checkEventTriggerConditions(e,t,r){this._eventTriggerMatching.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this._urlTriggerMatching.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?no+this.group.id:nn+this.group.id]:t})}stop(){this._urlTriggerMatching.stop(),this._eventTriggerMatching.stop(),this._linkedFlagMatching.stop()}}function hR(e){if(e.rrwebError)return hf;if(!e.receivedFlags)return hh;if(!e.isRecordingEnabled)return hu;if(e.urlTriggerMatching.urlBlocked)return hp;var t=!0===e.isSampled,r=new hx([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?hc:r===hy?hd:r===hb?hh:!1===e.isSampled?hu:hd}function hF(e){if(e.rrwebError)return hf;if(!e.receivedFlags)return hh;if(!e.isRecordingEnabled)return hu;if(e.urlTriggerMatching.urlBlocked)return hp;var t=new hC([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==hS,i=rb(e.isSampled);return r&&t===hb?hh:r&&t===hS||i&&!e.isSampled?hu:!0===e.isSampled?hc:hd}function hL(){var e=[];return function(t,r){if(rd(r)||ru(r)){for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?"[Circular]":(e.push(r),r)}return r}}function hO(e){var t=JSON.stringify(e,hL());return t?new Blob([t]).size:0}class hD{constructor(e,t){var r,i;void 0===t&&(t={}),this._loggedTracker={},this._onNodeRateLimited=e=>{if(!this._loggedTracker[e]){this._loggedTracker[e]=!0;var t,r,i=this._getNode(e);null==(t=(r=this._options).onBlockedNode)||t.call(r,e,i)}},this._getNodeOrRelevantParent=e=>{var t=this._getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this._getNode=e=>this._rrweb.mirror.getNode(e),this._numberOfChanges=e=>{var t,r,i,s,n,o,a,l;return(null!=(t=null==(r=e.removes)?void 0:r.length)?t:0)+(null!=(i=null==(s=e.attributes)?void 0:s.length)?i:0)+(null!=(n=null==(o=e.texts)?void 0:o.length)?n:0)+(null!=(a=null==(l=e.adds)?void 0:l.length)?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this._numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t=this._getNodeOrRelevantParent(e.id);return!this._rateLimiter.consumeRateLimit(t[0])&&e}));var i=this._numberOfChanges(t);return 0!==i||r===i?e:void 0},this._rrweb=e,this._options=t,this._rateLimiter=new rT({bucketSize:null!=(r=this._options.bucketSize)?r:100,refillRate:null!=(i=this._options.refillRate)?i:10,refillInterval:1e3,_onBucketRateLimited:this._onNodeRateLimited,_logger:sy})}reset(){this._loggedTracker={}}stop(){this._rateLimiter.stop(),this.reset()}}class hA{constructor(e){if(!e.persistence)throw Error("it is not val
1id to not have persistence and be this far into setting up the application");this._getProperty=e.get_property.bind(e),this._setProperty=e.persistence.set_property.bind(e.persistence)}trackSize(e,t){this._setProperty(nu,{sessionId:e,size:this.currentTrackedSize(e)+t})}currentTrackedSize(e){var t=this._getProperty(nu);return rd(t)&&r_(t.sessionId)&&rm(t.size)&&t.sessionId===e?t.size:0}}function hN(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%100<rE(100*t,0,100,sy)}var hq=sb("[SessionRecording]");function hB(e,t){return e===t||e!=="!"+t&&null}class hH{constructor(e,t,r,i,s,n){this._sampleRate=null,this._recordingStatusFunction=hF,this._instance=e,this._urlTriggerMatching=t,this._eventTriggerMatching=r,this._linkedFlagMatching=i,this._reportStarted=s,this._tryTakeFullSnapshot=n}onRemoteConfig(e){this._sampleRate=rm(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this._triggerStatusMatcher=new hx([this._eventTriggerMatching,this._urlTriggerMatching]),this._recordingStatusFunction=hR):(this._triggerStatusMatcher=new hC([this._eventTriggerMatching,this._urlTriggerMatching]),this._recordingStatusFunction=hF),this._instance.register_for_session({[nU]:e.triggerMatchType}),this._urlTriggerMatching.onConfig(e),this._eventTriggerMatching.onConfig(e),this._linkedFlagMatching.onConfig(e,(e,t)=>{this._reportStarted("linked_flag_matched",{flag:e,variant:t})})}getStatus(e){return this._recordingStatusFunction({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return rm(r)?r:null}checkUrlTriggers(e,t,r,i){this._urlTriggerMatching.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this._eventTriggerMatching._eventTriggers.length&&rf(this._removeEventTriggerCaptureHook))return this._removeEventTriggerCaptureHook=e(e=>{try{this._eventTriggerMatching.checkEventTriggerConditions(e.event,r,t)}catch(e){hq.error("Could not activate event trigger",e)}}),this._removeEventTriggerCaptureHook}makeSamplingDecisions(e){var t,r,i,s=this._sampleRate;if(!rm(s))return null==(r=this._instance.persistence)||r.unregister(nt),void(null==(i=this._instance.persistence)||i.unregister(s4));var n=this._instance.get_property(nt),o=this._instance.get_property(s4),a=hB(n,e),l=rm(o)&&o!==s,u=rp(o)&&n===e,c=l||u||!rb(a),d=c?hN(e,s):a;c&&(d?this._reportStarted("sampled"):hq.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[nt]:d?e:"!"+e,[s4]:rv(o)&&n===e?null:s})}ensureSamplingDecision(e){rm(this._sampleRate)&&(rb(hB(this._instance.get_property(nt),e))||this.makeSamplingDecisions(e))}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i,s;null==(e=this._instance.persistence)||e.unregister(ns),null==(t=this._instance.persistence)||t.unregister(ni),null==(r=this._instance.persistence)||r.unregister(nt),null==(i=this._instance.persistence)||i.unregister(s4),null==(s=this._instance.persistence)||s.unregister(nr)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this._triggerStatusMatcher)?void 0:t.triggerStatus(e))===hb}stop(){var e;null==(e=this._removeEventTriggerCaptureHook)||e.call(this),this._removeEventTriggerCaptureHook=void 0,this._eventTriggerMatching.stop(),this._urlTriggerMatching.stop(),this._linkedFlagMatching.stop()}}
1class h${constructor(e,t,r,i){this._triggerGroupMatchers=[],this._triggerGroupSamplingResults=new Map,this._hasCompletedInitialFlush=!1,this._instance=e,this._urlTriggerMatching=t,this._reportStarted=r,this._tryAddCustomEvent=i}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this._setupTriggerGroups(e.triggerGroups),this._instance.register_for_session({[nU]:"v2_trigger_groups",[nW]:e.triggerGroups.length}),this._urlTriggerMatching.onConfig(e)):hq.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return hf;if(e.urlTriggerMatching.urlBlocked)return hp;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return hu;var i=!1,s=!1;for(var n of t){var o=n.triggerStatus(e.sessionId);if(o===hy){var a=n.group.id,l=r.get(a);rp(l)?sy.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(s=!0)}else o===hb&&(i=!0)}return s?hc:i?hh:hu}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this._triggerGroupMatchers,triggerGroupSamplingResults:this._triggerGroupSamplingResults,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this._triggerGroupMatchers)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;rm(i)&&(rv(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var s=this;this._urlTriggerMatching.checkUrlBlocklist(t,r);var n=function(i){i.checkUrlTriggerConditions(t,r,t=>{s._checkGroupLevelProperties(i,void 0)&&(i.activateTrigger(t,e),s.updateActiveTriggers(e))},e)};for(var o of this._triggerGroupMatchers)n(o)}setupEventTriggerListeners(e,t,r){var i=this;return this._removeEventTriggerCaptureHook=e(e=>{var r;if(this._hasCompletedInitialFlush)return hq.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this._removeEventTriggerCaptureHook)||r.call(this),void(this._removeEventTriggerCaptureHook=void 0);try{var s=function(r){r.checkEventTriggerConditions(e.event,s=>{if(i._checkGroupLevelProperties(r,e.properties)){var n=(r.group.conditions.events||[]).filter(t=>t.name===e.event),o=i._instance.get_property(nm);n.some(t=>!t.properties||0===t.properties.length||uW(t.properties,e.properties,o))&&(r.activateTrigger(s,t),i.updateActiveTriggers(t))}},t)};for(var n of this._triggerGroupMatchers)s(n)}catch(e){hq.error("Could not activate event trigger for trigger groups",e)}}),this._removeEventTriggerCaptureHook}makeSamplingDecisions(e){for(var t of this._triggerGroupMatchers){var r,i=t.group,s=i.id,n=i.sampleRate,o=na+s,a=this._instance.get_property(o),l=null,u=!1,c=!1,d=!1;if(rd(a)){var h=a.sessionId,p=a.sampleRate,_=a.sampled;u="string"==typeof h&&h!==e,c=rm(p)&&p!==n,l=h===e&&rm(p)&&p===n&&rb(_)?_:null}else l=a===e||null,u="string"==typeof a&&a!==e,d=a===e;var g=u||c||d||!rb(l),v=g?hN(e+s,n):l;g&&this._tryAddCustomEvent("triggerGroupSamplingDecisionMade",{group_id:s,group_name:i.name,sampleRate:n,isSampled:v}),this._triggerGroupSamplingResults.set(s,v),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:e,sampleRate:n,sampled:v}})}this.updateActiveTriggers(e)}ensureSamplingDecision(e){}onFlushComplete(){this._hasCompletedInitialFlush=!0}clearConditionalRecordingPersistence(){var e,t,r;for(var i of(null==(e=this._instance.persistence)||e.unregister(nt),null==(t=this._instance.persistence)||t.unregister(s4),null==(r=this._instance.persistence)||r.unregister(nr),this._triggerGroupMatchers)){var s,n,o,a=i.group.id;null==(s=this._instance.persistence)||s.unregister(nn+a),null==(n=this._instance.persistence)||n.unregister(no+a),null==(o=this._instance.persistence)||o.unregister(na+a)}}updateActiveTriggers(e){var t=[];for(var r of this._triggerGroupMatchers){var i=r.group,s=i.id,n="trigger_activated"===r.triggerStatus(e),o=!0===this._triggerGroupSamplingResults.get(s);n&&t.push({id:s,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[nz]:t})}hasPendingTriggers(e){for(var t of this._triggerGroupMatchers)if(t.triggerStatus(e)===hb)return!0;return!1}stop(){var e;null==(e=this._removeEventTriggerCaptureHook)||e.call(this),this._removeEventTriggerCaptureHook=void 0,this._triggerGroupMatchers.forEac
1h(e=>e.stop()),this._triggerGroupMatchers=[],this._triggerGroupSamplingResults.clear(),this._urlTriggerMatching.stop()}_checkGroupLevelProperties(e,t){var r=e.group.conditions.properties;return!r||0===r.length||uW(r,t,this._instance.get_property(nm))}_setupTriggerGroups(e){var t=this;this._triggerGroupMatchers.forEach(e=>e.stop()),this._triggerGroupMatchers=[],this._triggerGroupSamplingResults.clear();var r=function(e){var r=new hP(t._instance,e,(r,i)=>{t._reportStarted("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name})});t._triggerGroupMatchers.push(r)};for(var i of e)r(i)}}function hz(e){return rd(e)?e.network_timing:e}var hU,hW,hj="[SessionRecording]",hV=sb(hj),hG=[1,2,3,4,5,6,7,12],hQ=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function hZ(){var e;return null==s_||null==(e=s_.__PosthogExtensions__)?void 0:e.rrweb}function hK(){var e;return null==(e=hZ())?void 0:e.record}function hY(e){try{return JSON.stringify(e)}catch(t){return JSON.stringify(e,hL())}}function hJ(e){return uw(ub(uS(hY(e))))}function hX(e){return h0.apply(this,arguments)}function h0(){return(h0=u(function*(e){var t=hY(e),r=yield t7(t,sf.DEBUG,{rethrow:!0});return uw(new Uint8Array((yield r.arrayBuffer())))})).apply(this,arguments)}var h1="u">typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,h2=!1;function h5(e){return ru(e)&&0===e.length?hU=null!=hU?hU:hJ([]):hJ(e)}function h3(e){return h4.apply(this,arguments)}function h4(){return(h4=u(function*(e){return ru(e)&&0===e.length?hU||(hW=null!=hW?hW:hX([]).then(e=>(hU=e,e)).catch(e=>{throw hU=void 0,hW=void 0,e})):hX(e)})).apply(this,arguments)}function h8(e){return h1&&!h2&&(2===e.type||3===e.type&&(0===e.data.source||8===e.data.source))}function h6(e){return{event:e,size:function e(t){if(rv(t))return 4;if(rp(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(ru(t)){for(var r=2,i=0;t.length>i;i++){i>0&&(r+=1);var s=t[i];r+=rp(s)||rv(s)?4:e(s)}return r}var n=2,o=!0;for(var a in t)if(({}).hasOwnProperty.call(t,a)){var l=t[a];rp(l)||(o||(n+=1),o=!1,n+=a.length+3+e(l))}return n;default:return 0}}(e)}}function h7(e,t){return c({},e,{data:t,cv:"2024-10"})}function h9(e,t){return c({},e,{cv:"2024-10",data:c({},e.data,t)})}function pe(e){try{if(2===e.type)return h6(h7(e,hJ(e.data)));if(3===e.type&&0===e.data.source)return h6(h9(e,{texts:h5(e.data.texts),attributes:h5(e.data.attributes),removes:h5(e.data.removes),adds:h5(e.data.adds)}));if(3===e.type&&8===e.data.source)return h6(h9(e,{adds:e.data.adds?hJ(e.data.adds):void 0,removes:e.data.removes?hJ(e.data.removes):void 0}))}catch(e){hV.error("could not compress event - will use uncompressed event",e)}return{event:e,size:hO(e)}}function pt(){return(pt=u(function*(e){try{if(2===e.type)return h6(h7(e,(yield hX(e.data))));if(3===e.type&&0===e.data.source){var t=yield Promise.all([h3(e.data.texts),h3(e.data.attributes),h3(e.data.removes),h3(e.data.adds)]);return h6(h9(e,{texts:t[0],attributes:t[1],removes:t[2],adds:t[3]}))}if(3===e.type&&8===e.data.source){var r=yield Promise.all([e.data.adds?hX(e.data.adds):void 0,e.data.removes?hX(e.data.removes):void 0]);return h6(h9(e,{adds:r[0],removes:r[1]}))}}catch(t){return t4(t)&&(h2=!0),hV.error("could not compress event asynchronously - trying synchronous compression",t),pe(e)}return{event:e,size:hO(e)}})).apply(this,arguments)}function pr(e,t){return 5===e.type&&e.data.tag===t}function pi(e){return pr(e,"sessionIdle")}function ps(e){return pr(e,"$session_ending")}function pn(e){return pr(e,"$session_starting")}class po{get sessionId(){return this._sessionId}get _sessionManager(){if(!this._instance.sessionManager)throw Error(hj+" must be started with a valid sessionManager.");return this._instance.sessionManager}get _sessionIdleThresholdMilliseconds(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get _isSampled(){return hB(this._instance.get_property(nt),this.sessionId)}get _sampleRate(){var e,t=null==(e=this._remoteConfig)?void 0:e.sampleRate;return rm(t)?t:null}get _minimumDuration(){var e,t;return null!=(e=null==(t=this._strategy)?void 0:t.getMinimumDuration(this.sessionId))?e:null}constructor(e){this._endpoint="/s/",this._forceAllowLocalhostNetworkCapture=!1,this._stopRrweb=void 0,this._lastActivityTimestamp=Date.now(),this._isActivatingTrigger=!1,this._queuedRRWebEvents=[],this._isIdle="unknown",this._rrwebError=!1,this._rrwebStartAttempted=!1,this._maxDepthExceeded=!1,this._fullSnapshotTimestamps=[],this._lastFullSnapshotSessionId=void 0,this._fullSnapshotHealAttemptedFor=void 0,this._pendingCompressionEvents=[],this._queuedCompressionEvents=0,this._compressionQueueGeneration=0,this._isStoppingAfterCompression=!1,this._removePageViewCaptureHook=void 0,this._removeEventTriggerCaptureHook=void 0,this._onSessionIdListener=void 0,this._onSessionIdleResetForcedListener=void 0,this._forceIdleSessionIdListener=void 0,this._onSessionIdCallback=(e,t,r)=>{var i,s,n;if(r&&(e!==this._sessionId||t!==this._windowId)){var o,a=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this._sessionId,u=this._windowId;a&&this._tryAddCustomEvent("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this._lastActivityTimestamp,flushed_size:null==(o=this._flushedSizeTracker)?void 0:o.currentTrackedSize(l)}),null==(i=this._instance.persistence)||i.unregister(nl),this._maxDepthExceeded=!1,null==(s=hZ())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this._clearConditionalRecordingPersistence(),!0!==this._isIdle&&this.isStarted||(this._isIdle="unknown",this.stop(),this.start("session_id_changed")),a&&this._tryAddCustomEvent("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this._lastActivityTimestamp}),null==(n=this._strategy)||n.makeSamplingDecisions(e)}},this._hasPassedMinimumDuration=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[nr])===this._sessionId},this._getBufferDuration=()=>
1{if(0===this._buffer.data.length)return null;var e,t,r=null==(e=this._buffer.data[0])?void 0:e.timestamp,i=null==(t=this._buffer.data[this._buffer.data.length-1])?void 0:t.timestamp;return rm(r)&&rm(i)?i-r:null},this._isBelowMinimumDuration=()=>{var e,t,r=this._minimumDuration;if(!rm(r))return!1;if(null==(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||!e){var i=this._sessionDuration;return rm(i)&&i>=0&&r>i}if(this._hasPassedMinimumDuration())return!1;var s,n=this._getBufferDuration();return!!rv(n)||r>n||(null==(s=this._instance.persistence)||s.register({[nr]:this._sessionId}),!1)},this._onBeforeUnload=()=>{this.status!==hh?(this._drainCompressionQueueSync(),this._flushBuffer()):this._clearBuffer()},this._onOffline=()=>{this._tryAddCustomEvent("browser offline",{})},this._onOnline=()=>{this._tryAddCustomEvent("browser online",{})},this._onVisibilityChange=()=>{null!=sa&&sa.visibilityState&&this._tryAddCustomEvent("window "+sa.visibilityState,{})},this._instance=e;var t=this._sessionManager.checkAndGetSessionAndWindowId(),r=t.windowId;this._sessionId=t.sessionId,this._windowId=r,this._linkedFlagMatching=new hT(this._instance),this._urlTriggerMatching=new hE(this._instance),this._eventTriggerMatching=new hM(this._instance),this._buffer=this._clearBuffer(),this._sessionManager.sessionTimeoutMs>this._sessionIdleThresholdMilliseconds||hV.warn("session_idle_threshold_ms ("+this._sessionIdleThresholdMilliseconds+") is greater than the session timeout ("+this._sessionManager.sessionTimeoutMs+"). Session will never be detected as idle"),this._flushedSizeTracker=new hA(this._instance)}get _masking(){var e,t,r,i,s,n,o,a=null==(e=this._remoteConfig)?void 0:e.masking,l={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},u=null!=(s=null==l?void 0:l.maskAllInputs)?s:null==a?void 0:a.maskAllInputs,c=null!=(n=null==l?void 0:l.maskTextSelector)?n:null==a?void 0:a.maskTextSelector,d=null!=(o=null==l?void 0:l.blockSelector)?o:null==a?void 0:a.blockSelector;return rp(u)&&rp(c)&&rp(d)?void 0:{maskAllInputs:null==u||u,maskTextSelector:c,blockSelector:d}}get _canvasResolutionScale(){var e;return rE(null==(e=this._instance.config.session_recording.canvasCapture)?void 0:e.resolutionScale,.1,1,sb("canvas recording resolution scale"),1)}get _canvasRecording(){var e,t,r,i,s,n,o,a=this._instance.config.session_recording.captureCanvas,l=null==(e=this._remoteConfig)?void 0:e.canvasRecording,u=null!=(t=null!=(r=null==a?void 0:a.recordCanvas)?r:null==l?void 0:l.enabled)&&t,c=null!=(i=null!=(s=null==a?void 0:a.canvasFps)?s:null==l?void 0:l.fps)?i:4,d=null!=(n=null!=(o=null==a?void 0:a.canvasQuality)?o:null==l?void 0:l.quality)?n:.4;if("string"==typeof d){var h=parseFloat(d);d=isNaN(h)?.4:h}return{enabled:u,fps:rE(c,0,12,sb("canvas recording fps"),4),quality:rE(d,0,1,sb("canvas recording quality"),.4)}}get _isConsoleLogCaptureEnabled(){var e,t=!(null==(e=this._remoteConfig)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get _networkPayloadCapture(){var e,t,r,i=null==(e=this._remoteConfig)?void 0:e.networkPayloadCapture,s={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},n=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),a=hz(this._instance.config.capture_performance),l=hz(null==i?void 0:i.capturePerformance),u=!!(rb(a)?a:l);return n||o||u?{recordHeaders:n,recordBody:o,recordPerformance:u}:void 0}_gatherRRWebPlugins(){var e,t,r=[],i=null==(e=s_.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;i&&this._isConsoleLogCaptureEnabled&&r.push(i());var s,n,o,a,l,u,d,h,p,_,g=null==(t=s_.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this._networkPayloadCapture&&rc(g)&&(!sR.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(g((a={payloadSizeLimitBytes:oL.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...oL.performanceEntryTypeToObserve],payloadHostDenyList:[...(n=this._networkPayloadCapture).payloadHostDenyList||[],...oL.payloadHostDenyList]},l=!1!==(s=this._instance.config).session_recording.recordHeaders&&n.recordHeaders,u=!1!==s.session_recording.recordBody&&n.recordBody,d=!1!==s.capture_performance&&n.recordPerformance,o=oF(a),h=e=>(null!=e&&e.requestBody&&(e.requestBody=oB(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=oB(e.responseBody,e.responseHeaders,o,"Response")),e),p=e=>h(((e,t)=>{var r,i=sF(e.name),s=0===t.indexOf("http")?null==(r=sF(t))?void 0:r.pathname:t;"/"===s&&(s="");var n=null==i?void 0:i.pathname.replace(s||"","");if(!(i&&n&&oq.some(e=>0===n.indexOf(e))))return e})((oN(e.requestHeaders),oN(e.responseHeaders),e),s.api_host)),(_=rc(s.session_recording.maskNetwork
1RequestFn))&&rc(s.session_recording.maskCapturedNetworkRequestFn)&&sy.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),_&&(s.session_recording.maskCapturedNetworkRequestFn=e=>{var t=s.session_recording.maskNetworkRequestFn({url:e.name});return c({},e,{name:null==t?void 0:t.url})}),a.maskRequestFn=rc(s.session_recording.maskCapturedNetworkRequestFn)?e=>{var t,r=p(e);return r&&null!=(t=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))?t:void 0}:e=>(function(e){if(!rp(e))return e.requestBody=oH(e.requestBody,"Request"),e.responseBody=oH(e.responseBody,"Response"),e})(p(e)),c({},oL,a,{recordHeaders:l,recordBody:u,recordPerformance:d,recordInitialRequests:d,streamNetworkBody:!0===s.session_recording.streamNetworkBody})))):hV.info("NetworkCapture not started because we are on localhost.")),r}_stripUrlHash(e){return this._instance.config.disable_capture_url_hashes?iE(e):e}_maskReplayUrl(e,t){void 0===t&&(t=!1);var r=t?iE(e):this._stripUrlHash(e),i=this._instance.config.mask_personal_data_properties?[...cU,...this._instance.config.custom_personal_data_properties||[]]:[];return this._maskUrl(sD(r,i,cj))}_maskUrl(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!=(r=null==i?void 0:i.name)?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var s=t.maskNetworkRequestFn({url:e});return null==s?void 0:s.url}return e}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this._queuedRRWebEvents.length?this._queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):hV.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(hQ(()=>hK().addCustomEvent(e,t)))}_pageViewFallBack(){try{if(this._instance.config.capture_pageview||!ss)return;var e=new URL(ss.location.href),t=this._maskReplayUrl(e.origin+e.pathname+e.search);this._lastHref!==t&&(this._lastHref=t,this._tryAddCustomEvent("$url_changed",{href:t}))}catch(e){}}_processQueuedEvents(){if(this._queuedRRWebEvents.length){var e=[...this._queuedRRWebEvents];this._queuedRRWebEvents=[],e.forEach(e=>{Date.now()-e.enqueuedAt>2e3||this._tryRRWebMethod(e)})}}_tryTakeFullSnapshot(){return this._tryRRWebMethod(hQ(()=>hK().takeFullSnapshot()))}get _fullSnapshotIntervalMillis(){var e,t,r;return null!=(e=this._strategy)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!=(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)?t:3e5}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this._isIdle){var e=this._fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_pauseRecording(){this._urlTriggerMatching.urlBlocked||(this._urlTriggerMatching.urlBlocked=!0,clearInterval(this._fullSnapshotTimer),hV.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlTriggerMatching.urlBlocked&&(this._urlTriggerMatching.urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),hV.info("recording resumed"))}_activateTrigger(e,t){var r,i,s;if(!this._isActivatingTrigger&&null!=(r=this._strategy)&&r.hasPendingTriggers(this.sessionId)){this._isActivatingTrigger=!0;try{null==(i=this._instance.persistence)||i.register({["url"===e?ni:ns]:this.sessionId}),null==(s=this._strategy)||s.updateActiveTriggers(this.sessionId),this._flushBuffer(),this._reportStarted(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this._isActivatingTrigger=!1}}}get isStarted(){return!!this._stopRrweb}get _remoteConfig(){var e=this._instance.get_property(s3);if(e){try{t=rd(e)?e:JSON.parse(e)}catch(e){return void hV.warn("persisted remote config for session recording is invali
1d and will be ignored",e)}if(!this.isStarted){var t,r,i,s=null!=(r=t.cache_timestamp)?r:Date.now();if(Date.now()-s>36e5)return hV.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:s,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister(s3))}return t}}_checkOverride(e,t,r){this._instance.get_property(e)&&(t(),r())}start(e){var t,r,i=this._remoteConfig;if(i){this._isStoppingAfterCompression&&(this._invalidateCompressionQueue(),this._clearBuffer());var s=this._sessionManager.checkAndGetSessionAndWindowId(),n=s.windowId;this._sessionId=s.sessionId,this._windowId=n,null==(t=this._instance.persistence)||t.unregister(nl),null!=i&&i.endpoint&&(this._endpoint=null==i?void 0:i.endpoint),this._strategy=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new h$(this._instance,this._urlTriggerMatching,this._reportStarted.bind(this),this._tryAddCustomEvent.bind(this)):new hH(this._instance,this._urlTriggerMatching,this._eventTriggerMatching,this._linkedFlagMatching,this._reportStarted.bind(this),this._tryTakeFullSnapshot.bind(this)),this._strategy.onRemoteConfig(i),null==(r=this._removeEventTriggerCaptureHook)||r.call(this),this._removeEventTriggerCaptureHook=this._strategy.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(e,t)=>this._activateTrigger(e,t)),this._checkOverride(s8,()=>{this.overrideSampling()},()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(s8)}),this._checkOverride(s6,()=>{this.overrideLinkedFlag()},()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(s6)}),this._checkOverride(s9,()=>{this.overrideTrigger("event")},()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(s9)}),this._checkOverride(s7,()=>{this.overrideTrigger("url")},()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(s7)}),this._strategy.makeSamplingDecisions(this.sessionId),this._startRecorder(),this._rrwebError||(sM(ss,"beforeunload",this._onBeforeUnload),sM(ss,"offline",this._onOffline),sM(ss,"online",this._onOnline),sM(ss,"visibilitychange",this._onVisibilityChange),!this._onSessionIdListener&&rc(this._sessionManager.onSessionId)&&(this._onSessionIdListener=this._sessionManager.onSessionId(this._onSessionIdCallback)),!this._onSessionIdleResetForcedListener&&rc(this._sessionManager.on)?this._onSessionIdleResetForcedListener=this._sessionManager.on("forcedIdleReset",()=>{this._clearConditionalRecordingPersistence(),this._isIdle="unknown",this.stop(),this._forceIdleSessionIdListener=this._sessionManager.onSessionId((e,t,r)=>{var i;null==(i=this._forceIdleSessionIdListener)||i.call(this),this._forceIdleSessionIdListener=void 0,this._onSessionIdCallback(e,t,r)})}):rc(this._sessionManager.on)||hV.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),rf(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskReplayUrl(e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){hV.error("Could not add $pageview to rrweb session",e)}})),this.status===hd&&this._reportStarted(e||"recording_initialized"))}else hV.info("remote config must be stored in persistence before recording can start")}_teardown(){var e,t,r,i,s,n;null==ss||ss.removeEventListener("beforeunload",this._onBeforeUnload),null==ss||ss.removeEventListener("offline",this._onOffline),null==ss||ss.removeEventListener("online",this._onOnline),null==ss||ss.removeEventListener("visibilitychange",this._onVisibilityChange),clearInterval(this._fullSnapshotTimer),this._clearFlushBufferTimer(),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._removeEventTriggerCaptureHook)||t.call(this),this._removeEventTriggerCaptureHook=void 0,null==(r=this._onSessionIdListener)||r.call(this),this._onSessionIdListener=void 0,null==(i=this._onSessionIdleResetForcedListener)||i.call(this),this._onSessionIdleResetForcedListener=void 0,null==(s=this._forceIdleSessionIdListener)||s.call(this),this._forceIdleSessionIdListener=void 0,null==(n=this._strategy)||n.stop(),this._stopRecordingProducers(),this._invalidateCompressionQueue()}_invalidateCompressionQueue(){this._compressionQueueGeneration+=1,this._pendingCompressionEvents=[],this._queuedCompressionEvents=0,this._compressionQueue=void 0,this._isStoppingAfterCompression=!1}_stopRecordingProducers(){var e,t;null==(e=this._mutationThrottler)||e.stop(),this._queuedRRWebEvents=[],null==(t=this._stopRrweb)||t.call(this),this._stopRrweb=void 0}_stopAfterCompressionQueueDrains(){if(!this._compressionQueue||0===this._queuedCompressionEvents)return!1;if(this._isStoppingAfterCompression)return!0;this._isStoppingAfterCompression=!0;var e=this._compressionQueueGeneration;return this._clearFlushBufferTimer(),this._stopRecordingProducers(),this._compressionQueue.catch(()=>{}).then(()=>{e===this._compressionQueueGeneration&&(this._isStoppingAfterCompression=!1,this._flushBuffer(),this._clearBuffer(),this._teardown(),hV.info("stopped"))}).catch(()=>{this._isStoppingAfterCompression=!1,this._teardown(),hV.info("stopped")}),!0}stop(){this._stopAfterCompressionQueueDrains()||(this._flushBuffer(),this._clearBuffer(),this._teardown(),hV.info("stopped"))}discard(){this._clearBuffer(),this._teardown(),hV.info("discarded")}_captureProcessedEvent(e,t,r,i,s){var n;2===e.type&&null!=(n=hZ())&&null!=n.wasMaxDepthReached&&n.wasMaxDepthReached()&&(this._maxDepthExceeded=!0),this.status!==
1hu?(this._ensureFullSnapshotForSession(e,i),this._captureSnapshotBuffered({$snapshot_bytes:r,$snapshot_data:t,$session_id:i,$window_id:s})):this._clearBuffer()}_ensureFullSnapshotForSession(e,t){2!==e.type?3===e.type&&(rp(this._lastFullSnapshotSessionId)||this._lastFullSnapshotSessionId===t||this._fullSnapshotHealAttemptedFor===t||(this._fullSnapshotHealAttemptedFor=t,hV.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:t}),this._tryTakeFullSnapshot())):this._lastFullSnapshotSessionId=t}_finishQueuedCompressionEvent(e){e.counted&&e.generation===this._compressionQueueGeneration&&(this._queuedCompressionEvents=Math.max(0,this._queuedCompressionEvents-1)),e.counted=!1,this._pendingCompressionEvents=this._pendingCompressionEvents.filter(t=>t!==e)}_captureQueuedCompressionEvent(e,t,r){e.processed||e.generation!==this._compressionQueueGeneration||(e.processed=!0,this._captureProcessedEvent(e.event,t,r,e.targetSessionId,e.targetWindowId))}_processQueuedCompressionEventSync(e){try{var t=e.compressionEnabled?pe(e.event):{event:e.event,size:hO(e.event)};this._captureQueuedCompressionEvent(e,t.event,t.size)}finally{this._finishQueuedCompressionEvent(e)}}_drainCompressionQueueSync(){[...this._pendingCompressionEvents].forEac
1h(e=>{this._processQueuedCompressionEventSync(e)})}_enqueueCompression(e,t,r,i){var s,n=this,o={event:e,compressionEnabled:t,targetSessionId:r,targetWindowId:i,generation:this._compressionQueueGeneration,processed:!1,counted:!0};this._pendingCompressionEvents.push(o),this._queuedCompressionEvents+=1;var a=(s=u(function*(){try{if(o.processed)return;try{var r,i,s=t?h8(e)?yield function(e){return pt.apply(this,arguments)}(e):pe(e):{event:e,size:hO(e)};r=s.event,i=s.size}catch(t){hV.error("could not process queued compression event - will use uncompressed event",t),r=e,i=hO(e)}n._captureQueuedCompressionEvent(o,r,i)}finally{n._finishQueuedCompressionEvent(o)}}),function(){return s.apply(this,arguments)});this._compressionQueue=this._compressionQueue?this._compressionQueue.catch(()=>{}).then(a):a()}onRRwebEmit(e){var t,r,i,s,n,o,a;if(this._instance.sessionManager&&(this._processQueuedEvents(),e&&rd(e))){if(4===e.type){var l=this._maskReplayUrl(e.data.href);if(this._lastHref=l,!l)return;e.data.href=l}else this._pageViewFallBack();if(null==(t=this._strategy)||t.checkUrlTriggers(this.sessionId,()=>this._pauseRecording(),()=>this._resumeRecording(),(e,t)=>this._activateTrigger(e,t)),!this._urlTriggerMatching.urlBlocked||5===e.type&&"recording paused"===e.data.tag){2===e.type&&(this._scheduleFullSnapshot(),null==(u=this._mutationThrottler)||u.reset(),null==(c=this._instance.persistence)||c.register_once({[nl]:e.timestamp},void 0)),2===e.type&&null!=(r=this._strategy)&&r.hasPendingTriggers(this.sessionId)&&this._clearBufferBeforeMostRecentMeta();var u,c,d=this._mutationThrottler?this._mutationThrottler.throttleMutations(e):e;if(d){var h,p=function(e){if(e&&rd(e)&&6===e.type&&rd(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],r=0;e.data.payload.payload.length>r;r++)t.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=t,e}return e}(d),_=ps(p)?p.data.payload:null,g=pn(p)?p.data.payload:null;if(_||g){var v=null!=_?_:g;null!=v&&v.lastActivityTimestamp&&(p.timestamp=v.lastActivityTimestamp)}else this._updateWindowAndSessionIds(p);2===e.type&&(this._fullSnapshotTimestamps.push([this._sessionId,e.timestamp]),this._fullSnapshotTimestamps.length>6&&(this._fullSnapshotTimestamps=this._fullSnapshotTimestamps.slice(-6)));var f=null!=(i=null!=(s=null==_?void 0:_.currentSessionId)?s:null==g?void 0:g.nextSessionId)?i:this._sessionId,m=null!=(n=null!=(o=null==_?void 0:_.currentWindowId)?o:null==g?void 0:g.nextWindowId)?n:this._windowId;if(!0!==this._isIdle||pi(h=p)||ps(h)||pn(h)){if(pi(p)){var y=p.data.payload;y&&(p.timestamp=y.lastActivityTimestamp+y.threshold)}var b=null==(a=this._instance.config.session_recording.compress_events)||a;if(this._queuedCompressionEvents>0||b&&h8(p))this._enqueueCompression(p,b,f,m);else{var S=b?pe(p):{event:p,size:hO(p)};this._captureProcessedEvent(p,S.event,S.size,f,m)}}}}}}get status(){return this._strategy?this._strategy.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this._isSampled,rrwebError:this._rrwebError,urlTriggerMatching:this._urlTriggerMatching,eventTriggerMatching:this._eventTriggerMatching,linkedFlagMatching:this._linkedFlagMatching,remoteConfig:this._remoteConfig}):hu}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this._linkedFlagMatching.linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[nt]:this.sessionId,[s4]:null}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_currentMaskedHostname(){try{var e,t=null==ss||null==(e=ss.location)?void 0:e.href;if(!t)return;var r=this._maskReplayUrl(t);if(!r)return;return new URL(r).hostname||void 0}catch(e){return}}_clearFlushBufferTimer(){this._flushBufferTimer&&(clearTimeout(this._flushBufferTimer),this._flushBufferTimer=void 0)}_flushBuffer(){this._clearFlushBufferTimer(),null==(t=this._strategy)||t.ensureSamplingDecision(this.sessionId);var e=this._isBelowMinimumDuration();if(this.status===hh||this.status===hp||this.status===hu||e)return this._flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this._buffer;if(this._buffer.data.length>0){var t,r,i=this._currentMaskedHostname();(function e(t,r){if(void 0===r&&(r=6606028.8),t.size>=r&&t.data.length>1){var i=Math.floor(t.data.length/2),s=t.sizes.slice(0,i),n=t.sizes.slice(i);return[e({size:s.reduce((e,t)=>
1e+t,0),data:t.data.slice(0,i),sizes:s,sessionId:t.sessionId,windowId:t.windowId}),e({size:n.reduce((e,t)=>e+t,0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this._buffer).forEach(e=>{var t;null==(t=this._flushedSizeTracker)||t.trackSize(e.sessionId,e.size),this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:sf.LIB_NAME,$lib_version:sf.LIB_VERSION,$snapshot_host:i})}),null==(r=this._strategy)||r.onFlushComplete()}return this._clearBuffer()}_captureSnapshotBuffered(e){var t,r=2+((null==(t=this._buffer)?void 0:t.data.length)||0),i=e.$session_id,s=this._buffer.sessionId!==i;(s||!this._isIdle&&this._buffer.size+e.$snapshot_bytes+r>943718.4)&&(this._buffer=this._flushBuffer(),s&&this._buffer.data.length>0&&(this._buffer=this._clearBuffer()),this._buffer.sessionId=i,this._buffer.windowId=e.$window_id),this._buffer.size+=e.$snapshot_bytes,this._buffer.data.push(e.$snapshot_data),this._buffer.sizes.push(e.$snapshot_bytes),this._flushBufferTimer||this._isIdle||(this._flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get _sessionDuration(){var e,t,r=null==(e=this._buffer)?void 0:e.data[(null==(t=this._buffer)?void 0:t.data.length)-1],i=this._sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}_clearBufferBeforeMostRecentMeta(){if(!this._buffer||0===this._buffer.data.length)return this._clearBuffer();for(var e=-1,t=this._buffer.data.length-1;t>=0;t--)if(4===this._buffer.data[t].type){e=t;break}return 0>e?this._clearBuffer():(this._buffer.data=this._buffer.data.slice(e),this._buffer.sizes=this._buffer.sizes.slice(e),this._buffer.size=this._buffer.sizes.reduce((e,t)=>e+t,0),this._buffer)}_clearBuffer(){return this._buffer={size:0,data:[],sizes:[],sessionId:this._sessionId,windowId:this._windowId},this._buffer}_reportStarted(e,t){this._instance.register_for_session({[nV]:e}),hV.info(e.replace("_"," "),t),"session_id_changed"!==e&&this._tryAddCustomEvent("$recording_started",c({reason:e},t))}_isInteractiveEvent(e){var t;return 3===e.type&&-1!==hG.indexOf(null==(t=e.data)?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this._isInteractiveEvent(e);t||this._isIdle||e.timestamp-this._lastActivityTimestamp>this._sessionIdleThresholdMilliseconds&&(this._isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this._sessionIdleThresholdMilliseconds,bufferLength:this._buffer.data.length,bufferSize:this._buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this._isIdle)){var i="unknown"===this._isIdle;this._isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}if(!this._isIdle){var s=this._sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),n=s.windowId,o=s.sessionId,a=this._sessionId!==o,l=this._windowId!==n;this._windowId=n,this._sessionId=o,a||l?(this.stop(),this.start("session_id_changed")):r&&this._scheduleFullSnapshot()}}_clearConditionalRecordingPersistence(){var e;null==(e=this._strategy)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,t=this._sessionManager.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this._buffer.data.length,$sdk_debug_replay_internal_buffer_size:this._buffer.size,$sdk_debug_current_session_duration:this._sessionDuration,$sdk_debug_session_start:t.sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this._flushedSizeTracker)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this._fullSnapshotTimestamps,$snapshot_max_depth_exceeded:this._maxDepthExceeded,$sdk_debug_replay_rrweb_error:this._rrwebError,$sdk_debug_rrweb_attached:!!this._stopRrweb,$sdk_debug_rrweb_start_attempted:this._rrwebStartAttempted}}_startRecorder(){var e;if(!this._stopRrweb){this._rrwebStartAttempted=!0;var t,r,i,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
1,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1,attributeFilter:void 0};for(var n of Object.entries(this._instance.config.session_recording||{})){var o=n[0],a=n[1];o in s&&("maskInputOptions"===o?s.maskInputOptions=c({password:!0},a):s[o]=a)}this._canvasRecording&&this._canvasRecording.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this._canvasRecording.fps},s.dataURLOptions={type:"image/webp",quality:this._canvasRecording.quality},s.canvasResolutionScale=this._canvasResolutionScale),this._masking&&(s.maskAllInputs=null==(t=this._masking.maskAllInputs)||t,s.maskTextSelector=null!=(r=this._masking.maskTextSelector)?r:void 0,s.blockSelector=null!=(i=this._masking.blockSelector)?i:void 0);var l=hK();if(l){this._mutationThrottler=null!=(e=this._mutationThrottler)?e:new hD(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";hV.info(r,{node:t}),this.log(hj+" "+r,"warn")}});var u=this._gatherRRWebPlugins();if(this._stopRrweb=l(c({emit:e=>{this.onRRwebEmit(e)},plugins:u},s)),!this._stopRrweb)return this._rrwebError=!0,void hV.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._rrwebError=!1,this._lastActivityTimestamp=Date.now(),this._isIdle=rb(this._isIdle)?this._isIdle:"unknown",this.tryAddCustomEvent("$remote_config_received",this._remoteConfig),this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:s,activePlugins:u.map(e=>null==e?void 0:e.name)}),this._tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else hV.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this._tryAddCustomEvent(e,t)}}s_.__PosthogExtensions__=s_.__PosthogExtensions__||{},s_.__PosthogExtensions__.initSessionRecording=e=>new po(e);class pa{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?0:this._storedConsent}isOptedOut(){return this._config.cookieless_mode===nZ||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===nQ}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default}optInOut(e){this._storage._set(this._storageKey,+!!e,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var e=this._instance.config,t=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+t:"__ph_opt_in_out_"+t)}get _storedConsent(){var e=this._storage._get(this._storageKey);return rr(rC,e)?1:rr(rI,e)?0:-1}get _storage(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?uK:uQ;if(!this._persistentStore||this._persistentStore!==t){this._persistentStore=t;var r="localStorage"===e?uQ:uK;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(rr(rC,r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&[null==so?void 0:so.doNotTrack,null==so?void 0:so.msDoNotTrack,s_.doNotTrack].some(e=>rr(rC,e))}}var pl=sb("[Dead Clicks]"),pu=()=>!0,pc=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(s1)),i=e.instance.config.capture_dead_clicks;return rb(i)?i:!!rd(i)||r};class pd{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[s1]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this._loadScript(()=>{this._start()}):this.stop()}_loadScript(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?pl.error("failed to load script",t):e()})}_start(){var e;
1if(sa){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=s_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=rd(this.instance.config.capture_dead_clicks)?c({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=s_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(sa),pl.info("starting...")}}else pl.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,pl.info("stopping..."))}}var ph=sb("[SegmentIntegration]"),pp="posthog-js";function p_(e,t){var r=void 0===t?{}:t,i=r.organization,s=r.projectId,n=r.prefix,o=r.severityAllowList,a=void 0===o?["error"]:o,l=r.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var r=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=r,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var o,l,d,h,p,_,g=(null==(o=t.exception)?void 0:o.values)||[],v=g.map(e=>c({},e,{stacktrace:e.stacktrace?c({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>c({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=g[0])?void 0:l.value)||t.message,$exception_type:null==(d=g[0])?void 0:d.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=g[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(p=g[0])?void 0:p.type,$sentry_tags:t.tags};return i&&s&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),u&&(null==(_=e.exceptions)||_.sendExceptionEvent(f)),t}}class pg{constructor(e,t,r,i,s,n){this.name=pp,this.setupOnce=function(o){o(p_(e,{organization:t,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class pv{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(sy.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!=(r=null==ss?void 0:ss.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,l=s.maxContentHeight,u=s.lastContentY,c=s.maxContentY;if(!(rp(n)||rp(o)||rp(a)||rp(l)||rp(u)||rp(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=n>1?rE(o/n,0,1,sy):1,h=n>1?rE(a/n,0,1,sy):1,p=l>1?rE(u/l,0,1,sy):1,_=l>1?rE(c/l,0,1,sy):1;i=sk(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var pf=["flags","surveys"],pm={[sW]:{exposure:"hidden"},[sG]:{exposure:"hidden"},__cmpns:{exposure:"hidden"}
1,[sQ]:{exposure:"hidden"},[sZ]:{exposure:"event"},[sK]:{exposure:"hidden"},[sY]:{exposure:"event"},[sJ]:{exposure:"hidden"},[sX]:{exposure:"event"},[s0]:{exposure:"event"},[s1]:{exposure:"event"},[s2]:{exposure:"hidden"},[s5]:{exposure:"event"},[s3]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ne]:{exposure:"hidden"},[nt]:{exposure:"event"},[s4]:{exposure:"event",shouldSkipFromEventProperties:e=>rv(e)},[nr]:{exposure:"event"},[ni]:{exposure:"event"},[ns]:{exposure:"event"},[nl]:{exposure:"event"},[nu]:{exposure:"hidden"},[nc]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!rd(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[nd]:{exposure:"event",storageGroup:"flags"},[nh]:{exposure:"hidden"},[np]:{exposure:"hidden",storageGroup:"flags"},[n_]:{exposure:"event",storageGroup:"flags"},[ng]:{exposure:"event",storageGroup:"flags",volatile:!0},[nv]:{exposure:"event"},[nf]:{exposure:"hidden"},[nm]:{exposure:"hidden"},[ny]:{exposure:"hidden"},[nb]:{exposure:"hidden",storageGroup:"surveys"},[nS]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[nw]:{exposure:"event"},[nk]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[nx]:{exposure:"hidden"},[nC]:{exposure:"hidden"},[nI]:{exposure:"hidden"},[nE]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[nT]:{exposure:"hidden"},[nM]:{exposure:"hidden"},[nP]:{exposure:"hidden"},[nR]:{exposure:"hidden"},[nF]:{exposure:"hidden"},[nL]:{exposure:"hidden"},[nO]:{exposure:"hidden"},[s8]:{exposure:"event"},[s6]:{exposure:"event"},[s7]:{exposure:"event"},[s9]:{exposure:"event"},[nN]:{exposure:"event"},[nq]:{exposure:"event"},[nB]:{exposure:"event"},[nH]:{exposure:"event"},[n$]:{exposure:"event"},[nz]:{exposure:"event"},[nU]:{exposure:"event"},[nW]:{exposure:"event"},[nj]:{exposure:"event"},[nV]:{exposure:"event"}},py=[[nn,{exposure:"hidden"}],[no,{exposure:"hidden"}],[na,{exposure:"hidden"}]],pb=e=>{var t=pm[e];if(t)return t;for(var r of py){var i=r[1];if(0===e.indexOf(r[0]))return i}},pS={flags:nE,surveys:nS},pw=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],pk="main";class px{constructor(e,t,r){if(void 0===r&&(r=!0),this._slotState={},this._splitStorageEligible=!1,this._splitStorage=!1,this._config=e,this._ownsSplitStorage=r,this.props={},this._campaign_params_saved=!1,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),e.debug&&sy.info("Persistence loaded",e.persistence,c({},this.props)),this.update_config(e,e,t),this.save(),ss){var i=()=>this.flush();sM(ss,"beforeunload",i,{capture:!1}),sM(ss,"pagehide",i,{capture:!1})}}_saveDebounceMs(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return rm(t)&&t>0?t:0}isDisabled(){return!!this._disabled}_buildStorage(e){-1===pw.indexOf(e.persistence.toLowerCase())&&(sy.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,r,i,s,n=(t=e.cookie_persisted_properties||[],r=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===r&&(r=!1),i=[...uY,...t],c({},uK,{_parse(e){try{var t={};try{t=uQ._parse(e)||{}}catch(e){}var i,s=JSON.parse(uK._get(e)||"{}");if(r){var n={};for(var o in t){var a=t[o];rv(a)||""===a||(n[o]=a)}i=sk(s,n)}else i=sk(t,s);return uK._set(e,i),i}catch(e){}return null},_set(e,t,r,s,n,o){var a=uK._set(e,t,void 0,void 0,o);try{var l={};i.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&uQ._set(e,l,r,s,n,o)}catch(e){uK._error(e)}return a},_remove(e,t){try{null==ss||ss.localStorage.removeItem(e),uQ._remove(e,t)}catch(e){uK._error(e)}}})),o=!1,a=e.persistence.toLowerCase();return"localstorage"===a&&uK._is_supported()?(s=uK,o=!0):"localstorage+cookie"===a&&n._is_supported()?(s=n,o=!0):"sessionstorage"===a&&u1._is_supported()?s=u1:"memory"===a?s=uX:"cookie"===a?s=uQ:n._is_supported()?(s=n,o=!0):s=uQ,this._splitStorageEligible=o,s}_groupEntryName(e){return this._name+"__"+e}_resolveSplitStorage(e){return this._splitStorageEligible&&!!e.split_storage}_isFeatureFlagCacheStale(e){var t=null!=e?e:this._config.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[nE];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return sw(this.props,(t,r)=>{var i=pb(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===nc?()=>this._isFeatureFlagCacheStale():()=>!1))return;i.transformToEventProperties&&sk(e,i.transformToEventProperties(t))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,()=>!1))return;e[r]=t}}),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=sk({},e)),this._splitStorage&&this._loadGroupEntries()}}_loadGroupEntries(){for(var e of pf){var t=uK._parse(this._groupEntryName(e));if(t&&!rh(t)){var r=this._slotWriteState(e);r.persisted=!0,this._mainCarriesGroupKey(e)||(r.fingerprint=this._entryFingerprint(t,e)),this._groupEntryIsStale(e,t)||sk(this.props,t)}}}_mainCarriesGroupKey(e){return Object.keys(this.props).some(t=>{var r;return(null==(r=pb(t))?void 0:r.storageGroup)===e})}_groupEntryIsStale(e,t){var r=pS[e];if(!r)return!1;var i=t[r],s=this.props[r];return rm(i)&&rm(s)&&s>i}refreshKey(e){var t;if(!this._disabled){var r=this._splitStorage?null==(t=pb(e))?void 0:t.storageGroup:void 0,i=r?uK._parse(this._groupEntryName(r)):this._storage._parse(this._name);if(i&&e in i)this._setProp(e,i[e]);else{if(r){var s=this._storage._parse(this._name);if(s&&e in s)return void this._setProp(e,s[e])}this._deleteProp(e)}}}save(){if(!this._disabled){var e=this._saveDebounceMs();e>
10?rp(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(()=>{this._pendingSaveTimer=void 0,this._writeNow()},e)):this._writeNow()}}flush(){rp(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())}_writeNow(){this._disabled||(this._splitStorage?this._writeNowSplit():this._writeEntry(this._storage,this._name,this.props,pk))}_writeNowSplit(){var e=this._partitionProps(),t=e.main,r=e.groups;for(var i of(this._writeEntry(this._storage,this._name,t,pk),pf)){var s,n=r[i];(!rh(n)||null!=(s=this._slotState[i])&&s.persisted)&&this._writeEntry(uK,this._groupEntryName(i),n,i)}}_partitionProps(){var e={},t={flags:{},surveys:{}};return sw(this.props,(r,i)=>{var s,n=null==(s=pb(i))?void 0:s.storageGroup;n?t[n][i]=r:e[i]=r}),{main:e,groups:t}}_entryFingerprint(e,t){if(t===pk)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var r={};return sw(e,(e,t)=>{var i;r[t]=null!=(i=pb(t))&&i.volatile?"__volatile__":e}),JSON.stringify(r)}_writeEntry(e,t,r,i){var s,n=this._slotWriteState(i);if(i===pk||n.dirty||rp(n.fingerprint)){try{if((s=this._entryFingerprint(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e._set(t,r,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(n.dirty=!1,i!==pk&&(n.persisted=!0),rp(s)||(n.fingerprint=s)):this._config.debug&&sy.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,r=void 0!==t&&t;if(rp(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!r&&this._ownsSplitStorage)for(var i of pf)uK._remove(this._groupEntryName(i));r?delete this._slotState[pk]:this._slotState={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(rd(e)){rp(t)&&(t="None"),this._expire_days=rp(r)?this._default_expiry:r;var i=!1;if(sw(e,(e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this._setProp(r,e),i=!0)}),i)return this.save(),!0}return!1}register(e,t){if(rd(e)){this._expire_days=rp(t)?this._default_expiry:t;var r=!1;if(sw(e,(t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this._setProp(i,t),r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this._deleteProp(e),this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=cG(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);rh(sE(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==sa?void 0:sa.referrer)?cZ(e):{})}update_referrer_info(){var e;this.register_once({$referrer:cJ(),$referring_domain:null!=sa&&sa.referrer&&(null==(e=sF(sa.referrer))?void 0:e.host)||cY},void 0)}set_initial_person_info(){this.props[nR]||this.props[nF]||this.register_once({[nL]:cX(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes)},void 0)}get_initial_props(){var e,t,r,i={};sw([nF,nR],e=>{var t=this.props[e];t&&sw(t,function(e,t){i["$initial_"+rs(t)]=e})});var s=this.props[nL];return s&&sk(i,(void 0===(e=this._config.disable_capture_url_hashes)&&(e=!1),t=c0(s,e),r={},sw(t,function(e,t){r["$initial_"+rs(t)]=e}),r)),i}safe_merge(e){return sw(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t,r){this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every((e,t)=>e===i[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=i?this._buildStorage(e):this._storage,n=this._resolveSplitStorage(e);if(i||n!==this._splitStorage){var o=this.props;this.clear(),this._storage=s,this._splitStorage=n,this.props=o,this.save()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[sQ]||{};r[e]=t,this._setProp(sQ,r),this.save()}remove_event_timer(e){var t=this.props[sQ]||{},r=t[e];return rp(r)||(delete t[e],this._setProp(sQ,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this._setProp(e,t),this.save()}_setProp(e,t){var r;this.props[e]=t,null!=(r=pb(e))&&r.volatile||this._markGroupDirty(e)}_deleteProp(e){delete this.props[e],this._markGroupDirty(e)}_markGroupDirty(e){var t,r=null==(t=pb(e))?void 0:t.storageGroup;r&&(this._slotWriteState(r).dirty=!0)}_slotWriteState(e){return this._slotState[e]||(this._slotState[e]={})}}var pC=sb("[RateLimiter]");class pI{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{pC.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void pC.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,r,i,s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!=(t=null==(r=this.instance.persistence)?void 0:r.get_property(nP))?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(nP,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var pE=sb("[RemoteConfig]");class pT{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=s_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}_loadRemoteConfigJSON(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return pE.info("Using preloaded remote config",this.remoteConfig),this._onRemoteConfig(this.remoteConfig),void this._startRefreshInterval();if(this._instance._shouldDisableFlags())return void pE.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(e=>{e?(this._onRemoteConfig(e),this._startRefreshInterval()):(pE.info("No config found after loading remote JS config. Falling back to JSON."),this._loadRemoteConfigJSON(e=>{this._onRemoteConfig(e),this._startRefreshInterval()}))})}catch(e){pE.error("Error loading remote config",e)}}stop(){this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=void 0)}refresh(){!this._instance._shouldDisableFlags()&&sa&&"hidden"!==sa.visibilityState&&this._instance.reloadFeatureFlags()}_startRefreshInterval(){var e;if(!this._refreshInterval){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this._refreshInterval=setInterval(()=>{this.refresh()},t))}}_onRemoteConfig(e){var t;e||pE.error("Failed to fetch remote config from PostHog."),this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}class pM{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=rE((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,sy.createLogger("flush interval"),3e3),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=Object.values(this._queue.length>0?this._formatQueue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this._sendRequestSafely(c({},e,{transport:"sendBeacon"}))})}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout(()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue();for(var r in t)!function(){var i=t[r],s=(new Date).getTime();i.data&&ru(i.data)&&sw(i.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e._sendRequestSafely(i)}()}},this._flushTimeoutMs))}_sendRequestSafely(e){try{this._sendRequest(e)}catch(e){sy.error(e)}}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return sw(this._queue,t=>{var r,i=(t?t.batchKey:null)||t.url;rp(e[i])&&(e[i]=c({},t,{data:[]})),null==(r=e[i].data)||r.push(t.data)}),this._queue=[],e}}var pP=["retriesPerformedSoFar"];class pR{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!rp(ss)&&"onLine"in ss.navigator&&(this._areWeOnline=ss.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},sM(ss,"online",this._onlineListener),sM(ss,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var t=e.retriesPerformedSoFar,r=d(e,pP);ry(t)&&(r.url=uE(r.url,{retry_count:t})),this._instance._send_request(c({},r,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this._enqueue(c({retriesPerformedSoFar:t},r));0===e.statusCode&&sy.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!=t?t:0)+" retries.")}null==r.callback||r.callback(e)}}))}_enqueue(e){var t,r,i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;var s=Math.ceil((r=Math.min(18e5,t=3e3*Math.pow(2,i)))+(Math.random()-.5)*(r-t/2)),n=Date.now()+s;this._queue.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+s;
1navigator.onLine||(o+=" (Browser is offline)"),sy.warn(o),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){(this._poller&&clearTimeout(this._poller),0===this._queue.length)?(this._isPolling=!1,this._poller=void 0):this._poller=setTimeout(()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()},this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],r=this._queue.filter(r=>e>r.retryAt||(t.push(r),!1));if(this._queue=t,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var e of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,rp(ss)||(this._onlineListener&&(ss.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(ss.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue)){var t=e.requestOptions;try{this._instance._send_request(c({},t,{transport:"sendBeacon"}))}catch(e){sy.error(e)}}this._queue=[]}}class pF{constructor(e){this._updateScrollData=()=>{this._context||(this._context={});var e,t,r,i,s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this._context.lastScrollY=Math.ceil(n),this._context.maxScrollY=Math.max(n,null!=(e=this._context.maxScrollY)?e:0),this._context.maxScrollHeight=Math.max(o,null!=(t=this._context.maxScrollHeight)?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!=(r=this._context.maxContentY)?r:0),this._context.maxContentHeight=Math.max(l,null!=(i=this._context.maxContentHeight)?i:0)},this._instance=e}get _scrollRoot(){return this._instance.config.scroll_root_selector}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){sM(ss,"scroll",this._updateScrollData,{capture:!0}),sM(ss,"scrollend",this._updateScrollData,{capture:!0}),sM(ss,"resize",this._updateScrollData)}scrollElement(){if(!this._scrollRoot)return null==ss?void 0:ss.document.documentElement;for(var e of ru(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]){var t=null==ss?void 0:ss.document.querySelector(e);if(t)return t}}_scrollPosition(e){if(this._scrollRoot){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return ss?"y"===e?ss.scrollY||ss.pageYOffset||ss.document.documentElement.scrollTop||0:ss.scrollX||ss.pageXOffset||ss.document.documentElement.scrollLeft||0:0}scrollY(){return this._scrollPosition("y")}scrollX(){return this._scrollPosition("x")}}var pL=e=>cX(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);
1class pO{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[nM]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||pL,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[nM]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?c0(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return sw(sE(this.getSetOnceProps()),(t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+rs(r)]=t}),e}}class pD{constructor(){this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter(e=>e!==t)}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}var pA=sb("[SessionId]");class pN{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){if(this._lastPersistedActivityTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new pD,this._sessionHasBeenIdleTooLong=(e,t)=>!(!ry(e)||!ry(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===nZ)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||lG,this._windowIdGenerator=r||lG;var i,s=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*rE(this._config.session_idle_timeout_seconds||1800,60,36e3,pA.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var n=u1._parse(this._window_id_storage_key),o=u1._parse(this._primary_window_exists_storage_key);n&&!o?this._windowId=n:u1._remove(this._window_id_storage_key),u1._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this._config.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){pA.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return rp(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&u1._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&u1._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?u1._parse(this._window_id_storage_key):null}_isActivityChangeBelowGranularity(e){var t=this._lastPersistedActivityTimestamp;return!rv(t)&&!rv(e)&&5e3>Math.abs(e-t)}_setSessionId(e,t,r){var i=t!==this._sessionActivityTimestamp,s=e===this._sessionId&&r===this._sessionStartTimestamp;this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,s&&!i||s&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register({[ne]:[t,e,r]}))}_useCrossTabRefreshHardening(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return ry(t)&&t>0}_refreshSessionIdFromStorage(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(ne):(this._persistence.flush(),this._persistence.load())}_flushPendingActivityTimestamp(){var e;if(!rv(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var t=this._getSessionId();t[1]===this._sessionId&&t[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register({[ne]:[this._sessionActivityTimestamp,null!=(e=this._sessionId)?e:null,this._sessionStartTimestamp]}),this._persistence.flush())}}_freshestActivityTimestamp(){var e=this._getSessionId()[0];return Math.max(ry(e)?e:0,ry(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}_isSessionIdleAfterCrossTabRefresh(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())}_getSessionId(){var e=this._persistence.props[ne];return ru(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._lastPersistedActivityTimestamp=null,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)}destroy(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&ss&&(ss.removeEventListener(n0,this._beforeUnloadListener,{capture:!1}
1),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._flushPendingActivityTimestamp(),this._canUseSessionStorage()&&u1._remove(this._primary_window_exists_storage_key)},sM(ss,n0,this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this._config.cookieless_mode===nZ)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),i=this._getSessionId(),s=i[1],n=i[2],o=this._freshestActivityTimestamp(),a=this._getWindowId(),l=ry(n)&&Math.abs(r-n)>864e5,u=!1,c=!1,d=!s,h=s,p=!d&&!e&&this._sessionHasBeenIdleTooLong(r,o);if(p){(p=this._isSessionIdleAfterCrossTabRefresh(r))||pA.info("cross-tab refresh kept the session alive",{sessionId:s});var _=this._getSessionId();s=_[1],n=_[2]}d||p||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),pA.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}}),n=r,u=!0):(a||(a=this._windowIdGenerator(),u=!0),(c=s!==h)&&(pA.info("adopted cross-tab session id",{sessionId:s,windowId:a}),u=!0));var g=ry(o)&&e&&!l?o:r,v=ry(n)?n:(new Date).getTime();this._setWindowId(a),this._setSessionId(s,g,v),e||this._resetIdleTimer();var f={noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:c};return u&&this._sessionIdChangedHandlers.forEach(e=>e(s,a,f)),{sessionId:s,windowId:a,sessionStartTimestamp:v,changeReason:u?f:void 0,lastActivityTimestamp:o}}_resetIdleTimer(){this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{if(!this._destroyed)if(this._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var e=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:e})}else this._resetIdleTimer()},1.1*this.sessionTimeoutMs))}}var pq=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&rt(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some(e=>rt(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function pB(){return(pB=u(function*(){var e=null==so?void 0:so.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return r_(r)&&r.length>0?r:void 0}catch(e){return void sy.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var pH="custom",p$="i.posthog.com",pz=/^\/static\//;class pU{constructor(e){this._regionCache={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+p$,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(this._regionCache[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":pH),this._regionCache[this.apiHost]}_staticAssetHostOverride(e){if(pz.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this._staticAssetHostOverride(t);if(r)return""+r+t}if(this.region===pH)return this.apiHost+t;var i=p$+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var pW=sb("[PostHog ExternalIntegrations]"),pj={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class pV{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,e=>{if(e)return pW.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var r of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,i,s,n=r[0],o=r[1];!o||null!=(e=s_.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t._loadScript(pj[n],()=>{var e;null==(e=s_.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(i=s_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[n]&&(null==(s=s_.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())}()}}var pG={},pQ=0,pZ=()=>{}
1,pK='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',pY="Surveys module not available",pJ="sanitize_properties is deprecated. Use before_send instead",pX="Invalid value for property_denylist config: ",p0="posthog",p1=!uk&&-1===(null==sp?void 0:sp.indexOf("MSIE"))&&-1===(null==sp?void 0:sp.indexOf("Mozilla")),p2=e=>{var t;return c({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!r_(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of sT)if(r===i)return!1;return!0}(null==sa?void 0:sa.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:pZ,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:sl&&r_(null==sl?void 0:sl.search)&&-1!==sl.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==ss||null==(t=ss.location)?void 0:t.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(e){sy.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:nJ,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:pZ},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:od,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)})},p5=[["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"]],p3=e=>{var t={};for(var r of p5){var i=r[0],s=r[1];rp(e[i])||(t[s]=e[i])}var n=sk({},t,e),o=e.__preview_external_dependency_versioned_paths;return rp(o)||(rp(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),r_(o)&&rp(e.asset_host)&&(n.asset_host=o)),ru(e.property_blacklist)&&(rp(e.property_denylist)?n.property_denylist=e.property_blacklist:ru(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:sy.error(pX+e.property_denylist)),n};class p4{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){sy.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class p8{_replaceExtension(e,t){if(e){var r=this._extensions.indexOf(e);-1!==r&&this._extensions.splice(r,1)}return this._extensions.push(t),null==t.initialize||t.initialize(),t}_inCookielessMode(){return this.config.cookieless_mode===nZ||this.config.cookieless_mode===nQ&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new p4,this._personProcessingSetOncePropertiesSent=!1,this.version=sf.LIB_VERSION,this._internalEventEmitter=new pD,this._extensions=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=p2(),this.SentryIntegration=pg,this.sentryIntegration=e=>{var t;return t=p_(this,e),{name:pp,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new pF(this),this.pageViewManager=new pv(this),this.rateLimiter=new pI(this),this.requestRouter=new pU(this),this.consent=new pa(this),this.externalIntegrations=new pV(this);var e,t=null!=(e=p8.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=r_(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=r_(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",e=>sy.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,r){if(r&&r!==p0){var i,s=null!=(i=pG[r])?i:new p8;return s._init(e,t,r),pG[r]=s,pG[p0][r]=s,s}return this._init(e,t,r)}_init(e,t,r){void 0===t&&(t={});var i,s,n=r_(e)?e.trim():"";if(!n)return sy.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=p2(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var o=p2(t.defaults),a=p3(t),l=sk({},o,a,{name:r,token:n});rd(o.rageclick)&&rd(a.rageclick)&&(l.rageclick=sk({},o.rageclick,a.rageclick)),rd(o.session_recording)&&rd(a.session_recording)&&(l.session_recording=sk({},o.session_recording,a.session_recording)),this.set_config(l),this.config.on_xhr_error&&sy.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:lZ;var u=this._is_persistence_disabled();this.persistence=new px(this.config,u),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new px(c({},this.config,{persistence:"sessionStorage"}),u,!1);var d=c({},this.persistence.props),h=c({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new pM(e=>this._send_retriable_request(e),this.config.request_queue_config),this._retryQueue=new pR(this),this.__request_queue=[];var p=this._inCookielessMode();if(p||(this.sessionManager=new pN(this),this.sessionPropsManager=new pO(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(sy.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this._initExtensions(p)},0)):(sy.info("Initializing extensions synchronously"),this._initExtensions(p)),sf.DEBUG=sf.DEBUG||this.config.debug,sf.DEBUG&&sy.info("Starting in debug mode",{this:this,config:t,thisC:c({},this.config),p:d,s:h}),!this.config.identity_distinct_id||null!=(i=t.bootstrap)&&i.distinctID||(t.bootstrap=c({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var _=t.bootstrap.distinctID,g=this.get_distinct_id(),v=this.persistence.get_property(nT);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==_&&v===nK)this.identify(_);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==_&&v===nY)sy.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 f=this.config.get_device_id(lG()),m=t.bootstrap.isIdentifiedID?f:_;this.persistence.set_property(nT,t.bootstrap.isIdentifiedID?nY:nK),this.register({distinct_id:_,$device_id:m})}}if(p)this.register_once({distinct_id:nA,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(lG());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(nT,nK)}return sM(ss,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||lG();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(nT,nY)),t()},s=r.user();"then"in s&&rc(s.then)?s.then(i):i(s)}(e,()=>{var i;r.register(("u">typeof Promise&&Promise.resolve||ph.warn("This browser does not have Promise support, and can not use the segment integration"),i=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ph.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ph.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>i(e,e.event.event),page:e=>i(e,n1),identify:e=>i(e,n5),screen:e=>i(e,"$screen")})).then(()=>{t()})})}(this,()=>this._loaded()):this._loaded(),rc(this.config._onCapture)&&this.config._onCapture!==pZ&&(sy.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&sy.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 pB.apply(this,arguments)})().then(e=>{e&&this.register({[sV]:e})}).catch(pZ),this}_initExtensions(e){var t,r,i,s,n,o,a,l,u=performance.now(),d=c({},p8.__defaultExtensionClasses,this.config.__extensionClasses),h=[];d.featureFlags&&this._extensions.push(this.featureFlags=null!=(t=this.featureFlags)?t:new d.featureFlags(this)),d.exceptions&&this._extensions.push(this.exceptions=null!=(r=this.exceptions)?r:new d.exceptions(this)),d.historyAutocapture&&this._extensions.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this._extensions.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this._extensions.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this._extensions.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this._extensions.push(this.autocapture=new d.autocapture(this)),d.surveys&&this._extensions.push(this.surveys=null!=(i=this.surveys)?i:new d.surveys(this)),d.logs&&this._extensions.push(this.logs=null!=(s=this.logs)?s:new d.logs(this)),d.metrics&&this._extensions.push(this.metrics=null!=(n=this.metrics)?n:new d.metrics(this)),d.conversations&&this._extensions.push(this.conversations=null!=(o=this.conversations)?o:new d.conversations(this)),d.productTours&&this._extensions.push(this.productTours=new d.productTours(this)),d.heatmaps&&this._extensions.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this._extensions.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,pc)),d.toolbar&&this._extensions.push(this.toolbar=null!=(a=this.toolbar)?a:new d.toolbar(this)),d.experiments&&this._extensions.push(this.experiments=null!=(l=this.experiments)?l:new d.experiments(this)),this._extensions.forEach(e
1=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}}),this._processInitTaskQueue(h,u)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this._processInitTaskQueue(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){sy.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[nN]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[nq]:i}),this.config.__preview_deferred_init_extensions&&sy.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){if(!sa||!sa.body)return sy.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(e)},500);this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e);var t,r=e.ok?e.config:{supportedCompression:[],toolbarParams:{},toolbarVersion:"toolbar",isAuthenticated:!1,siteApps:[]};this._lastRemoteConfig=r,this.compression=void 0,r.supportedCompression&&!this.config.disable_compression&&(this.compression=rr(r.supportedCompression,lZ)?lZ:rr(r.supportedCompression,lK)?lK:void 0),null!=(t=r.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:nJ}),this._extensions.forEach(t=>{!e.ok&&t.onRemoteConfigFailed?t.onRemoteConfigFailed():null==t.onRemoteConfig||t.onRemoteConfig(r)})}_loaded(){try{this.config.loaded(this)}catch(e){sy.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=sl&&sl.hostname){var e=sl.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._inCookielessMode())&&this._captureInitialPageview()},1),this._remoteConfigLoader=new pT(this),this._remoteConfigLoader.load()}_start_queue_if_opted_in(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())}_dom_loaded(){this.is_capturing()&&sS(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t,r,i,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(n2),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this._requestQueue)||i.unload(),null==(s=this._retryQueue)||s.unload()):this._shouldCapturePageleave()&&this.capture(n2,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?p1?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=c({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(rp(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,r,i,s=c({},e);s.timeout=s.timeout||6e4;var n=null!=(t=s.transport)?t:"fetch";"sendBeacon"===n&&rp(s.compression)&&s.data&&(s.compression=lK),s.url=uN(s.url,s.compression);var o=uq.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!=(r=null==(i=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(o,e=>e.transport===n))?void 0:i.method)?r:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===lZ&&sh&&"u">typeof Promise&&!uC?uF(s).then(e=>{a(e)}).catch(t=>{t3(t)?(uC=!0,a(c({},s,{compression:void 0,url:uN(e.url,void 0)}))):(t4(t)&&(uC=!0),a(s))}):a(s)})(c({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){pQ++;try{var t,r=[],i=[],s=[];sS(e,e=>{if(e)if(ru(t=e[0]))s.push(e);else if(rc(e))try{e.call(this)}catch(t){sy.error("Error executing queued PostHog call",e,t)}else ru(e)&&"alias"===t?r.push(e):ru(e)&&-1!==t.indexOf("capture")&&rc(this[t])?s.push(e):i.push(e)});var n=function(e,t){sS(e,function(e){try{if(ru(e[0])){var r=t;
1sw(e,function(e){r=r[e[0]].apply(r,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){sy.error("Error executing queued PostHog call",e,t)}})};n(r,this),n(i,this),n(s,this)}finally{pQ--}}push(e){if(pQ>0&&ru(e)&&r_(e[0])){var t=p8.prototype[e[0]];rc(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,r){var i,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!rp(e)&&r_(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!r_(null==t?void 0:t.$current_url)&&(sy.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=r&&r._originatedFromCaptureException||sy.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 d=new Date,h=(null==r?void 0:r.timestamp)||d,p=iI(null==r?void 0:r.uuid,lG),_={uuid:p,event:e,properties:this.calculateEventProperties(e,t||{},h,p)};e===n1&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==r?void 0:r.$set)&&(_.$set=null==r?void 0:r.$set);var g=null==r?void 0:r.$unset;g&&(_.$unset=g);var v=this._calculate_set_once_properties(null==r?void 0:r.$set_once,e!==n3,e===n5
1);if(v&&(_.$set_once=v),null!=r&&r._noTruncate||(s=this.config.properties_string_max_length,n=_,o=e=>r_(e)?e.slice(0,s):e,a=new Set,_=function e(t,r){if(t!==Object(t))return o?o(t):t;if(!a.has(t)){var i;if(a.add(t),ru(t))i=[],sS(t,t=>{i.push(e(t))});else{var s={};sw(t,(t,r)=>{a.has(t)||(s[r]=e(t,r))}),i=s}return i}}(n)),_.timestamp=h,rp(null==r?void 0:r.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=d),e===lg||e===lv){var f=null==t?void 0:t[lf],m=null==t?void 0:t[ly];lB({id:f,current_iteration:m}),_.$set=c({},_.$set,{[lE({id:f,current_iteration:m},e===lv?"responded":"dismissed")]:!0})}else e===l_&&(_.$set=c({},_.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var y=null==t?void 0:t.$product_tour_type;y&&(_.$set=c({},_.$set,{["$product_tour_last_seen_date/"+y]:(new Date).toISOString()}))}var b=c({},_.properties.$set,_.$set);if(rh(b)||this.setPersonPropertiesForFlags(b),!rf(this.config.before_send)){var S=this._runBeforeSend(_);if(!S)return;(_=S).uuid=iI(_.uuid,lG)}this._internalEventEmitter.emit("eventCaptured",_);var w={method:"POST",url:null!=(i=null==r?void 0:r._url)?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",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._send_retriable_request(w):this._requestQueue.enqueue(w),_}sy.critical("This capture call is ignored due to client rate limiting.")}}else sy.error("No event name provided to posthog.capture")}else sy.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var n,o=s?void 0:this.persistence.remove_event_timer(e),a=c({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this._inCookielessMode()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=c({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!r_(a.distinct_id)&&!rm(a.distinct_id)||rg(a.distinct_id))&&sy.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,d=function(e,t,r,i){if(void 0===i&&(i=!1),!sp)return{};var s,n,o,a,l,u,c=e?[...cU,...t||[]]:[],d=function(e){for(var t=0;iw.length>t;t++){var r=iw[t],i=r[1],s=r[0].exec(e),n=s&&(rc(i)?i(s,e):i);if(n)return n}return["",""]}(sp),h=null!=(l="u">typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},p={detectGoogleSearchApp:r},_=sk(sE({$os:d[0],$os_version:d[1],$browser:iy(sp,navigator.vendor,h,p),$device:ik(sp),$device_type:ix(sp,{userAgentDataPlatform:null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==ss||null==(o=ss.screen)?void 0:o.width,screenHeight:null==ss||null==(a=ss.screen)?void 0:a.height,devicePixelRatio:null==ss?void 0:ss.devicePixelRatio}),$timezone:c1(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:sD(i?iE(null==sl?void 0:sl.href):null==sl?void 0:sl.href,c,cj),$host:null==sl?void 0:sl.host,$pathname:null==sl?void 0:sl.pathname,$raw_user_agent:sp.length>1e3?sp.substring(0,997)+"...":sp,$browser_version:iS(sp,navigator.vendor,h,p),$browser_language:cK(),$browser_language_prefix:"string"==typeof(u=cK())?u.split("-")[0]:void 0,$screen_height:null==ss?void 0:ss.screen.height,$screen_width:null==ss?void 0:ss.screen.width,$viewport_height:null==ss?void 0:ss.innerHeight,$viewport_width:null==ss?void 0:ss.innerWidth,$lib:sf.LIB_NAME,$lib_version:sf.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return sf.SDK_DIST_CHANNEL&&(_.$sdk_dist_channel=sf.SDK_DIST_CHANNEL),_}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime()),p=h.windowId;a.$session_id=h.sessionId,a.$window_id=p}this.sessionPropsManager&&sk(a,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sk(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(n=this._retryQueue)?void 0:n.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===pH&&(a.$lib_custom_api_host=this.config.api_host),u=e!==n1||s?e!==n2||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=sk(a,u),e===n1&&sa&&(a.title=sa.title),!rp(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}sp&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=sk({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ru(this.config.property_denylist)?sw(this.config.property_denylist,function(e){delete a[e]}):sy.error(pX+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(sy.error(pJ),a=g(a,e));var v=this._hasPersonProcessing();return a.$process_person_profile=v,v&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t,r){if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this._hasPersonProcessing()||this._personProcessingSetOncePropertiesSent&&!r)return e;var i,s=sk({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(sy.error(pJ),s=n(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),rh(s)?void 0:s}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:pY}),()=>{})}onSessionId(e){var t,r;return null!=(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:pY})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:pY})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=l$),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!=(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))?t:{visible:!1,disabledReason:pY}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!=(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))?r:Promise.resolve({visible:!1,disabledReason:pY})}_validateIdentifyId(e){return!e||rg(e)?(sy.critical("Unique user id has not been set in posthog.identify"),!1):e===nA?(sy.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(sy.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return sy.uninitializedWarning("posthog.identify");if(rm(e)&&(e=e.toString(),sy.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(sj)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(sG)&&(this.unregister(sG),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(nT)||nK)===nK;e!==i&&n?(this.persistence.set_property(nT,nY),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(n5,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this._cachedPersonProperties=uH(e,t,r),null==(s=this.featureFlags)||s.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(nx))}}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var r=uH(this.get_distinct_id(),e,t);this._cachedPersonProperties!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=r):sy.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(ru(e)?e:[e]).filter(e=>r_(e)&&e.length>0);0!==r.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this._cachedPersonProperties=null)}group(e,t,r){if(e&&t){var i=this.getGroups(),s=i[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:c({},i,{[e]:t})}),s||r){var n={$group_type:e,$group_key:t};r&&(n.$group_set=r),this.capture(n3,n)}r&&this.setGroupPropertiesForFlags({[e]:r}),s&&!r&&this.reloadFeatureFlags()}else sy.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(sy.info("reset"),!this.__loaded)return sy.uninitializedWarning("posthog.reset");var t,r,i,s,n,o,a,l,u,c,d,h=this.get_property(sj),p=this.get_property(sV),_=this.get_property(s3);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),rp(_)||null==(d=this.persistence)||d.register({[s3]:_}),null==(i=this.surveys)||i.reset(),null==(s=this._remoteConfigLoader)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(nT,nK),null==(c=this.sessionManager)||c.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===nZ)this.register_once({distinct_id:nA,$device_id:null},"");else{var g=this.config.get_device_id(lG());this.register_once({distinct_id:g,$device_id:e?g:h},""),e||rp(p)||this.register({[sV]:p})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return u(function*(){var e,r,i,s,n;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(r=t.metrics)||r.flush("sendBeacon"),null==(i=t._requestQueue)||i.unload(),null==(s=t._retryQueue)||s.unload(),null==(n=t.featureFlags)||n.destroy()):sy.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&r){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-n,0)}return i}alias(e,t){return e===this.get_property(sW)?(sy.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(rp(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(sG,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(sy.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=c({},this.config);if(rd(e)){sk(this.config,p3(e));var r,i,s,n,o,a,l,u,d,h,p,_=this._is_persistence_disabled();null==(r=this.persistence)||r.update_config(this.config,t,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new px(c({},this.config,{persistence:"sessionStorage"}),_,!1);var g=this._checkLocalStorageForDebug(this.config.debug);rb(g)&&(this.config.debug=g),rb(this.config.debug)&&(this.config.debug?(sf.DEBUG=!0,uK._is_supported()&&uK._set("ph_debug",!0),sy.info("set_config",{config:e,oldConfig:t,newConfig:c({},this.config)})):(sf.DEBUG=!1,uK._is_supported()&&uK._remove("ph_debug"))),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){sf.LIB_NAME=e,sf.LIB_VERSION=t}startSessionRecording(e){var t,r,i,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var r=Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(c({},i,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;
1return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:p8._noopLogger}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!=(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:p0;return t!==p0&&(t=p0+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(nT))===nY||(null==(t=this.sessionPersistence)?void 0:t.get_property(nT))===nY}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===nJ&&!this._isIdentified()&&rh(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[sG])&&(null==(t=this.persistence)||null==(t=t.props)||!t[nO]))}_shouldCapturePageleave(){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._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(sy.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(nO,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==nQ)}_sync_opt_out_with_persistence(){var e,t,r,i,s=this._is_persistence_disabled();return(null==(e=this.persistence)?void 0:e._disabled)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t._disabled)!==s&&(null==(i=this.sessionPersistence)||i.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==nZ){if(this._inCookielessMode()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new pN(this),this.pageViewManager=new pv(this),this.persistence&&(this.sessionPropsManager=new pO(this,this.sessionManager,this.persistence));var r,i,s,n,o,a,l,u,c=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=p8.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new c(this)),this._lastRemoteConfig&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this._lastRemoteConfig)))}this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==nQ&&(null==(r=this.surveys)||r.loadIfEnabled()),(rp(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(i=null==e?void 0:e.captureEventName)?i:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else sy.warn(pK)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==nZ?(this.config.cookieless_mode===nQ&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===nQ&&(this.register({distinct_id:nA,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())):sy.warn(pK)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===nZ||(this.config.cookieless_mode===nQ?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return so?pq(so,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){sa&&("visible"===sa.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(n1,{title:sa.title},{send_instantly:!0}),this._visibilityStateListener&&(sa.removeEventListener(nX,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),sM(sa,nX,this._visibilityStateListener)))}
1debug(e){!1===e?(null==ss||ss.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==ss||ss.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}))}_shouldDisableFlags(){var e,t,r,i,s=this._originalUserConfig||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(sy.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):(t="advanced_disable_decide",r=(e="advanced_disable_flags")in s&&!rf(s[e]),i=t in s&&!rf(s[t]),r?s[e]:!!i&&(sy&&sy.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}_runBeforeSend(e){if(rf(this.config.before_send))return e;var t,r=Object.keys(null!=(t=e.properties)?t:{}).filter(rS),i=ru(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of i){if(rf(s=n(s))){var o="Event '"+e.event+"' was rejected in beforeSend function";return rr(tX,e.event)?sy.warn(o+". This can cause unexpected behavior."):sy.info(o),null}s.properties&&!rh(s.properties)||sy.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(s.properties&&rf(s.properties[a]))return sy.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}_checkLocalStorageForDebug(e){var t=rb(e)&&!e,r=uK._is_supported()&&"true"===uK._get("ph_debug");return!t&&(!!r||e)}}p8.__defaultExtensionClasses={},p8._noopLogger={trace:h=()=>{},debug:h,info:h,warn:h,error:h,fatal:h},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=sI(e.prototype[t[r]])}(p8,["identify"]);var p6=sb("[ExceptionAutocapture]"),p7=sb("[TracingHeaders]"),p9=sb("[Web Vitals]"),_e="[SessionRecording]",_t=sb(_e),_r=sb("[Heatmaps]");function _i(e){return rd(e)&&"clientX"in e&&"clientY"in e&&rm(e.clientX)&&rm(e.clientY)}var _s=sb("[Product Tours]"),_n=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(s2))},_o=["$set_once","$set"],_a=sb("[SiteApps]"),_l="Error while initializing PostHog app with config id ";function _u(e,t,r){if(rf(e))return!1;switch(r){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class _c{constructor(e){this._debugEventEmitter=new pD,this._checkStep=(e,t)=>this._checkStepEvent(e,t)&&this._checkStepUrl(e,t)&&this._checkStepElement(e,t)&&this._checkStepProperties(e,t),this._checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._actionEvents=new Set,this._actionRegistry=new Set}init(){var e,t;rp(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,r;if(!rp(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,r;null==(t=this._actionRegistry)||t.add(e),null==(r=e.steps)||r.forEach(e=>{var t;null==(t=this._actionEvents)||t.add((null==e?void 0:e.event)||"")})}),null!=(r=this._instance)&&r.autocapture)){var i,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(i=this._instance)||i.autocapture.setElementSelectors(s)}}on(e,t){var r;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(t.event))&&this._actionRegistry&&(null==(r=this._actionRegistry)?void 0:r.size)>
10&&this._actionRegistry.forEach(e=>{this._checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}_checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this._checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}_checkStepUrl(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i||!_u(i,t.url,t.url_matching||"contains"))return!1}return!0}_checkStepElement(e,t){return!!this._checkStepHref(e,t)&&!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t)}_checkStepHref(e,t){if(null==t||!t.href)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(e=>_u(e.href,t.href,t.href_matching||"exact"));var i,s,n=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!n&&_u((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}_checkStepText(e,t){if(null==t||!t.text)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(e=>_u(e.text,t.text,t.text_matching||"exact")||_u(e.$el_text,t.text,t.text_matching||"exact"));var i,s,n,o,a=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!a&&(s=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!rf(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),n=t.text,o=t.text_matching||"exact",s.some(e=>_u(e,n,o)))}_checkStepSelector(e,t){if(null==t||!t.selector)return!0;var r,i,s=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}_getElementsList(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_checkStepProperties(e,t){return null==t||!t.properties||0===t.properties.length||uj(t.properties.reduce((e,t)=>{var r=ru(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class _d{constructor(e){this._pendingActivatedItems=[],this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&uj(e.propertyFilters,null==t?void 0:t.properties)}_buildEventToItemMap(e,t){var r=new Map;return e.forEach(e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach(t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}})}),r}_getMatchingItems(e,t,r){var i=(r===le?this._eventToItems:this._cancelEventToItems).get(e),s=[];return this._getItems(e=>{s=e.filter(e=>null==i?void 0:i.includes(e.id))}),s.filter(i=>{var s,n=null==(s=i.conditions)||null==(s=s[r])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this._doesEventMatchFilter(n,t)})}register(e){var t;rp(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedItems(e),this._setupActionBasedItems(e))}_setupActionBasedItems(e){var t=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0});0!==t.length&&(null==this._actionMatcher&&(this._actionMatcher=new _c(this._instance),this._actionMatcher.init(),this._actionMatcher._addActionHook(e=>{this.onAction(e)})),t.forEach(e=>{var t,r,i,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(s=this._actionMatcher)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var r=this._actionToItems.get(t.name);r&&r.push(e.id),this._actionToItems.set(t.name,r||[e.id])}}))}))}_setupEventBasedItems(e){var t,r=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0}),i=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0});0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this._eventToItems=this._buildEventToItemMap(e,le),this._cancelEventToItems=this._buildEventToItemMap(e,lt))}onEvent(e,t){var r,i,s=this._getLogger(),n=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var o=this._activationOutcome(e,n);if("consume"===o)return s.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this._deactivateItems([n]);if("persist"===o)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this._persistActivation(n)}if(this._cancelEventToItems.has(e)){var a=this._getMatchingItems(e,t,lt);a.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this._deactivateItems(a.map(e=>e.id)),a.forEach(e=>this._cancelPendingItem(e.id)))}if(this._eventToItems.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var l=this._getMatchingItems(e,t,le);this._activateItems(l.map(e=>e.id))}}onAction(e){this._actionToItems.has(e)&&this._activateItems(this._actionToItems.get(e)||[])}_activateItems(e){0!==e.length&&(this._pendingActivatedItems=[...new Set([...this._pendingActivatedItems,...e])],this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()}))}_persistActivation(e){this._pendingActivatedItems=this._pendingActivatedItems.filter(t=>t!==e);var t=this._getPersistedActivatedIds();t.includes(e)||this._setActivatedItems([...t,e])}_deactivateItems(e){var t=new Set(e);this._pendingActivatedItems=this._pendingActivatedItems.filter(e=>!t.has(e));var r=this._getPersistedActivatedIds(),i=r.filter(e=>!t.has(e));i.length!==r.length&&this._setActivatedItems(i)}_getPersistedActivatedIds(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this._getPersistedActivatedIds(),...this._pendingActivatedItems])].filter(e=>!this._isItemPermanentlyIneligible(e))}reset(){this._pendingActivatedItems=[],this._getPersistedActivatedIds().length>0&&this._setActivatedItems([])}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class _h extends _d{constructor(e){super(e)}_getActivatedKey(){return nw}_getShownEventName(){return l_}_getItems(e){var t;null==(t=this._instance)||t.getSurveys(e)}_cancelPendingItem(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}_getLogger(){return lL}_setActivatedItems(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[nw]:e})}_isItemPermanentlyIneligible(){return!1}_activationOutcome(e,t){var r;return this._getItems(e=>{r=e.find(e=>e.id===t)}),!r||lF(r)?e===l_?"consume":"ignore":e===l_?"persist":e===lg||e===lv?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var _p="SDK is not enabled or survey functionality is not yet loaded",__="Disabled. Not loading surveys.",_g=null!=ss&&ss.location?sA(ss.location.hash,"__posthog")||sA(location.hash,"state"):null,_v="_postHogToolbarParams",_f=sb("[Toolbar]"),_m=sb("[FeatureFlags]"),_y=sb("[FeatureFlags]",{debugEnabled:!0}),_b="\" failed. Feature flags didn't load in time.",_S=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},_w=e=>{var t={};for(var r of sx(e||{})){var i=r[1];i&&(t[r[0]]=i)}return t},_k="Refusing to render web experiment since the viewer is a likely bot",_x={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>uB(t,e),not_regex:(e,t)=>!uB(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class _C{get _config(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{_C._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach(e=>{if(e.feature_flag_key){t._flagToExperiments&&(_C._logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t._flagToExperiments)||r.set(e.feature_flag_key,e));var r,i=t._instance.getFeatureFlag(e.feature_flag_key);r_(i)&&e.variants[i]&&t._applyTransforms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];_C._matchesTestVariant(n,t._instance)&&t._applyTransforms(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())_C._logInfo(_k);else if(!this._config.disable_web_experiments){if(rf(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();
vendor: 1,747 bytes, line 1
1_C._logInfo("applying feature flags",e),e.forEach(e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),s=null==(r=this._flagToExperiments)?void 0:r.get(e);i&&null!=s&&s.variants[i]&&this._applyTransforms(s.name,i,s.variants[i].transforms)}})}}previewWebExperiment(){var e=_C.getWindowLocation();if(null!=e&&e.search){var t=sO(null==e?void 0:e.search,"__experiment_id"),r=sO(null==e?void 0:e.search,"__experiment_variant");t&&r&&(_C._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments(e=>{this._showPreviewWebExperiment(parseInt(t),r,e)},!1,!0))}}loadIfEnabled(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._config.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}_showPreviewWebExperiment(e,t,r){var i=r.filter(t=>t.id===e);i&&i.length>0&&(_C._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this._applyTransforms(i[0].name,t,i[0].variants[t].transforms))}static _matchesTestVariant(e,t){return!rf(e.conditions)&&_C._matchUrlConditions(e,t)&&_C._matchUTMConditions(e)}static _matchUrlConditions(e,t){if(rf(e.conditions)||rf(null==(i=e.conditions)?void 0:i.url))return!0;var r=_C.getWindowLocation();if(r){var i,s,n,o,a=sz(t,r.href);return null==(s=e.conditions)||!s.url||_x[null!=(n=null==(o=e.conditions)?void 0:o.urlMatchType)?n:"icontains"](e.conditions.url,a)}return!1}
1static getWindowLocation(){return null==ss?void 0:ss.location}static _matchUTMConditions(e){if(rf(e.conditions)||rf(null==(r=e.conditions)?void 0:r.utm))return!0;var t=cG();if(t.utm_source){var r,i,s,n,o,a,l,u,c,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,h=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,_=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return d&&p&&_&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];sy.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?_C._logInfo(_k):"control"!==t?r.forEach(r=>{if(r.selector){_C._logInfo("applying transform of variant "+t+" for experiment "+e+" ",r);var i,s=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==s||s.forEach(e=>{r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)})}}):_C._logInfo("Control variants leave the page unmodified.")}_is_bot(){return so&&this._instance?pq(so,this._config.custom_blocked_useragents):void 0}}var _I=sb("[Conversations]"),_E="Conversations not available yet.",_T="console",_M={featureFlags:class{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._hasLoggedDeprecationWarning=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._onOnline=()=>{var e=this._hasStatusZeroCircuitBreakerTripped();this._consecutiveStatusZeroFailures=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],ss&&sM(ss,"online",this._onOnline)}destroy(){null==ss||ss.removeEventListener("online",this._onOnline)}get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}_prop(e){return this._instance.get_property(e)}_isCacheStale(){var e,t;return null!=(e=null==(t=this._persistence)?void 0:t._isFeatureFlagCacheStale(this._config.feature_flag_cache_ttl_ms))&&e}_checkAndTriggerStaleRefresh(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,_m.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_getValidEvaluationEnvironments(){var e,t=null!=(e=this._config.evaluation_contexts)?e:this._config.evaluation_environments;return!this._config.evaluation_environments||this._config.evaluation_contexts||this._hasLoggedDeprecationWarning||(_m.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._hasLoggedDeprecationWarning=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||_m.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}_getValidFlagKeys(){var e=this._config.flag_keys;if(!rp(e)){if(ru(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||_m.error("Invalid flag key found:",e,"Expected non-empty string"),t});_m.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,r=this._instance.config,i=null!=(e=null==(t=r.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(i).length){var s,n,o=null!=(s=null==(n=r.bootstrap)?void 0:n.featureFlagPayloads)?s:{},a=Object.keys(i).filter(e=>!!i[e]).reduce((e,t)=>(e[t]=i[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,r){var i,s,n=null!=r&&r.merge&&null!=(i=this._prop(nc))?i:{},o=null!=r&&r.merge&&null!=(s=this._prop(n_))?s:{},a=c({},n,e),l=c({},o,t),u={};for(var d of Object.entries(a)){var h=d[0],p=d[1];u[h]={key:h,enabled:tU(p),variant:tW(p),reason:void 0,metadata:rp(null==l?void 0:l[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._prop(np),t=this._prop(nv),r=this._prop(nf);if(!r&&!t)return e||{};var i=sk({},e||{});for(var s of[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])]){var n,o,a=i[s],l=null==t?void 0:t[s],u=rp(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,d=rp(l)?a.variant:"string"==typeof l?l:void 0,h=null==r?void 0:r[s],p=c({},a,{enabled:u,variant:u?null!=d?d:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(p.original_enabled=null==a?void 0:a.enabled),d!==(null==a?void 0:a.variant)&&(p.original_variant=null==a?void 0:a.variant),h&&(p.metadata=c({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),i[s]=p}return this._override_warning||(_m.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}
1),this._override_warning=!0),i}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(r=>{var i=e[r];return{key:r,enabled:tU(i),variant:tW(i),payload:tz(t[r])}})}getFlagVariants(){var e=this._prop(nc),t=this._prop(nv);if(!t)return e||{};for(var r=sk({},e),i=Object.keys(t),s=0;i.length>s;s++)r[i[s]]=t[i[s]];return this._override_warning||(_m.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._prop(n_),t=this._prop(nf);if(!t)return e||{};for(var r=sk({},e||{}),i=Object.keys(t),s=0;i.length>s;s++)r[i[s]]=t[i[s]];return this._override_warning||(_m.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._config.advanced_disable_feature_flags||this._hasStatusZeroCircuitBreakerTripped()||this._reloadDebouncer||(this._instance._internalEventEmitter.emit("featureFlagsReloading",!0),this._reloadDebouncer=setTimeout(()=>{this._callFlagsEndpoint()},5))}_clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callFlagsEndpoint(e){var t;if(this._clearDebouncer(),!this._instance._shouldDisableFlags()&&!this._hasStatusZeroCircuitBreakerTripped())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r=this._config.token,i=this._prop(sj),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:c({},(null==(t=this._persistence)?void 0:t.get_initial_props())||{},this._prop(nm)||{}),group_properties:this._prop(ny),timezone:c1()};rv(i)||rp(i)||(s.$device_id=i),(null!=e&&e.disableFlags||this._config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_contexts=this._getValidEvaluationEnvironments());var n=this._getValidFlagKeys();rp(n)||(s.flag_keys=n);var o=!!this._config.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this._config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this._requestInFlight=!0,this._instance._send_request({method:"POST",url:a,data:s,compression:this._config.disable_compression?void 0:lK,timeout:this._config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(this._trackStatusZeroReachability(e.statusCode),200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),n=!1),this._requestInFlight=!1,!s.disable_flags||this._additionalReloadRequested){this._flagsLoadedFromRemote=!n;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));(u&&a.push("quota_limited"),null==(i=this._persistence)||i.register({[nI]:a}),u)?_m.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:o}),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint()))}}})}}_hasStatusZeroCircuitBreakerTripped(){return sN(this._consecutiveStatusZeroFailures,3)}_trackStatusZeroReachability(e){this._consecutiveStatusZeroFailures=sq(e,this._consecutiveStatusZeroFailures,3,()=>_m.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(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i=this.getFeatureFlagResult(e,t);return null!=(r=null==i?void 0:i.variant)?r:null==i?void 0:i.enabled}}else _m.warn('getFeatureFlag for key "'+e+_b)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var r=this.getFlagVariants(),i=e in r,s=r[e],n=this.getFlagPayloads()[e],o=String(s),a=this._prop(ng)||void 0,l=this._prop(nE)||void 0,u=this._prop(nx)||{};if(this._config.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this._prop(nC);d&&d!==h&&(u={},null==(c=this._persistence)||c.register({[nx]:u,[nC]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){ru(u[e])?u[e].push(o):u[e]=[o],null==(v=this._persistence)||v.register({[nx]:u});var p=this.getFeatureFlagDetails(e),_=[...null!=(f=this._prop(nI))?f:[]];rp(s)&&_.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this._config.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this._config.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};rp(null==p||null==(b=p.metadata)?void 0:b.has_experiment)||(g.$feature_flag_has_experiment=p.metadata.has_experiment),rp(null==p||null==(S=p.metadata)?void 0:S.version)||(g.$feature_flag_version=p.metadata.version);var v,f,m,y,b,S,w,k,x,C,I,E,T=null!=(w=null==p||null==(k=p.reason)?void 0:k.description)?w:null==p||null==(x=p.reason)?void 0:x.code;T&&(g.$feature_flag_reason=T),null!=p&&null!=(C=p.metadata)&&C.id&&(g.$feature_flag_id=p.metadata.id),rp(null==p?void 0:p.original_variant)&&rp(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=rp(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(I=p.metadata)&&I.original_payload&&(g.$feature_flag_original_payload=null==p||null==(E=p.metadata)?void 0:E.original_payload),_.length&&(g.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",g)}if(i)return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:tz(n)}}}else _m.warn('getFeatureFlagResult for key "'+e+_b)}getRemoteConfigPayload(e,t){var r=this._config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_contexts=this._getValidEvaluationEnvironments());var s=this._getValidFlagKeys();rp(s)||(i.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this._config.disable_compression?void 0:lK,timeout:this._config.feature_flag_request_timeout_ms,callback(r){var i,s=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote){if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return rp(r)?void 0:!!r}_m.warn('isFeatureEnabled for key "'+e+_b)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,r){if(this._persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,r,i,s,n){void 0===r&&(r={}),void 0===i&&(i={}),void 0===s&&(s={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))):e.featureFlags&&_m.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,d=a.featureFlagPayloads;if(u){var h=e.requestId,p=e.evaluatedAt;if(ru(u)){_m.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(u)for(var g=0;u.length>g;g++)_[u[g]]=!0;t&&t.register({[nd]:u,[nc]:_})}else{var v=u,f=d,m=l;if(null!=n&&n.partialResponse)v=c({},r,v),f=c({},i,f),m=c({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));v=c({},r,Object.fromEntries(Object.entries(v).filter(e=>y.has(e[0])))),f=c({},i,Object.fromEntries(Object.entries(f||{}).filter(e=>y.has(e[0])))),m=c({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>y.has(e[0]))))}else v=c({},r,v),f=c({},i,f),m=c({},s,m);t&&t.register(c({[nd]:Object.keys(_w(v)),[nc]:v||{},[n_]:f||{},[np]:m||{}},h?{[ng]:h}:{},p?{[nE]:p}:{}))}}}(e,this._persistence,i,s,n,r),t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),_m.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._persistence)return _m.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._persistence.unregister(nv),this._persistence.unregister(nf),this._fireFeatureFlagsCallbacks(),_y.info("All overrides cleared");if(ru(e)){var t,r=_S(e);return this._persistence.register({[nv]:r}),this._fireFeatureFlagsCallbacks(),_y.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this._override_warning=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._persistence.unregister(nv),_y.info("Flag overrides cleared");else if(e.flags){if(ru(e.flags)){var i=_S(e.flags);this._persistence.register({[nv]:i})}else this._persistence.register({[nv]:e.flags});_y.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this._persistence.unregister(nf),_y.info("Payload overrides cleared")):e.payloads&&(this._persistence.register({[nf]:e.payloads}),_y.info("Payload overrides set",{payloads:e.payloads}))),void this._fireFeatureFlagsCallbacks()}if(e&&"object"==typeof e)return this._persistence.register({[nv]:e}),this._fireFeatureFlagsCallbacks(),_y.info("Flag overrides set",{flags:e});_m.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var t=this._prepareFeatureFlagsForCallbacks(),r=t.flags,i=t.flagVariants;try{e(r,i)}catch(e){_m.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var i,s=(this._prop(nh)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),r&&(o.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=c({},this.getFlagVariants(),{[e]:t});null==(i=this._persistence)||i.register({[nd]:Object.keys(_w(a)),[nc]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._prop(nh),s=r?"&"+r.map(e=>"stage="+e).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._config.token+s),method:"GET",callback:t=>{var r,i;if(t.json){var s=t.json.earlyAccessFeatures;return null==(r=this._persistence)||r.unregister(nh),null==(i=this._persistence)||i.register({[nh]:s}),e(s)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,r)=>(e[r]=t[r],e),{})}}_fireFeatureFlagsCallbacks(e){var t=this._prepareFeatureFlagsForCallbacks(),r=t.flags,i=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(r,i,{errorsLoading:e})}catch(e){_m.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this._prop(nm)||{},i=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in r||(n[o]=s[o]));this._instance.register({[nm]:c({},r,n,i)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=c({},this._prop(nm)||{});e.forEach(e=>{delete r[e]}),this._instance.register({[nm]:r}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(nm),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this._prop(ny)||{};0!==Object.keys(r).length&&Object.keys(r).forEach(t=>{r[t]=c({},r[t],e[t]),delete e[t]}),this._instance.register({[ny]:c({},r,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._prop(ny)||{};this._instance.register({[ny]:c({},t,{[e]:{}})})}else this._instance.unregister(ny)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0}}},_P=c({productTours:class{get _persistence(){return this._instance.persistence}constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,r;if(this._persistence&&this._persistence.register({[s2]:!!e.productTours}),!_n(this._instance))return!this._productTourManager&&rf(null==(t=this._persistence)?void 0:t.props[nk])||_s.info("product tours disabled; stopping and clearing cached tours"),null==(r=this._productTourManager)||r.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this._productTourManager&&_n(this._instance)&&this._loadScript(()=>this._startProductTours())}_loadScript(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",t=>{t?_s.error("Could not load product tours script",t):e()})}_startProductTours(){var e;!this._productTourManager&&null!=(e=s_.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=s_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!ru(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[nk];if(ru(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(_n(this._instance)){var i=t.statusCode;if(200!==i||!t.json){var s="Product Tours API could not be loaded, status: "+i;return _s.error(s),void e([],{isLoaded:!1,error:s})}var n=ru(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=n,r&&r.register({[nk]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){rf(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this._productTourManager)||t.showTourById(e)}previewTour(e){this._productTourManager?this._productTourManager.previewTour(e):this._loadScript(()=>{var t;this._startProductTours(),null==(t=this._productTourManager)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this._productTourManager)||e.nextStep()}previousStep(){var e;null==(e=this._productTourManager)||e.previousStep()}clearCache(){var e;this._cachedTours=null,null==(e=this._persistence)||e.unregister(nk)}resetTour(e){var t;null==(t=this._productTourManager)||t.resetTour(e)}resetAllTours(){var e;null==(e=this._productTourManager)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)}}},_M),_R=c({surveys:class{get _config(){return this._instance.config}constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._config.disable_surveys){var t=e.surveys;if(rf(t))return lL.warn("Flags not loaded yet. Not loading surveys.");var r=ru(t);this._isSurveysEnabled=r?t.length>0:t,lL.info("flags response received, isSurveysEnabled: "+this._isSurveysEnabled),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);
1(null!=i&&i.startsWith(lA)||null!=i&&i.startsWith(lN))&&t.push(i)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)lL.info("Already initializing surveys, skipping...");else if(this._config.disable_surveys)lL.info(__);else if(this._config.cookieless_mode&&this._instance.consent.isOptedOut())lL.info("Not loading surveys in cookieless mode without consent.");else{var e=null==s_?void 0:s_.__PosthogExtensions__;if(e){if(!rp(this._isSurveysEnabled)||this._config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._config.advanced_enable_surveys;this._isInitializingSurveys=!0;try{var r=e.generateSurveys;if(r)return void this._completeSurveyInitialization(r,t);var i=e.loadExternalDependency;if(!i)return void this._handleSurveyLoadError(nG);i(this._instance,"surveys",r=>{r||!e.generateSurveys?this._handleSurveyLoadError("Could not load surveys script",r):this._completeSurveyInitialization(e.generateSurveys,t)})}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}}else lL.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new _h(this._instance),lL.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){lL.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})}onSurveysLoaded(e){return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._config.disable_surveys)return lL.info(__),e([]);var r,i=this._instance.get_property(nb);i&&!t?(e(i,{isLoaded:!0}),this._shouldBackgroundRefreshSurveys()&&this.getSurveys(()=>{},!0)):"u">typeof Promise&&this._getSurveysInFlightPromise?this._getSurveysInFlightPromise.then(t=>e(t.surveys,t.context)):("u">typeof Promise&&(this._getSurveysInFlightPromise=new Promise(e=>{r=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._config.token),method:"GET",timeout:this._config.surveys_request_timeout_ms,callback:t=>{this._getSurveysInFlightPromise=null;var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;lL.error(s),this._lastSurveyRefreshFailedAt=Date.now();var n={isLoaded:!1,error:s};return e([],n),void(null==r||r({surveys:[],context:n}))}this._lastSurveyRefreshFailedAt=null;var o,a,l=t.json.surveys||[],u=l.filter(e=>lO(e)&&(lR(e)||lD(e)));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[nb]:l,[nS]:Date.now()});var c={isLoaded:!0};e(l,c),null==r||r({surveys:l,context:c})}}))}_shouldBackgroundRefreshSurveys(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()}_isSurveyCacheStale(){var e=this._instance.get_property(nS);return rm(e)&&Date.now()-e>3e5}_isSurveyRefreshBackingOff(){return rm(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt}markSurveyAsSeen(e,t){var r;lB({id:e,current_iteration:null!=(r=null==t?void 0:t.iteration)?r:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}_notifySurveyCallbacks(e){for(var t of this._surveyCallbacks)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){lL.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!rf(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);lL.warn("init was not called")}_getSurveyById(e){var t=null;return this.getSurveys(r=>{var i;t=null!=(i=r.find(t=>t.id===e))?i:null}),t}_checkSurveyEligibility(e){if(rf(this._surveyManager))return{eligible:!1,reason:_p};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(rf(this._surveyManager))return lL.warn("init was not called"),{visible:!1,disabledReason:_p};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return rf(this._surveyManager)?(lL.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:_p})):new Promise(r=>
1{this.getSurveys(t=>{var i,s=null!=(i=t.find(t=>t.id===e))?i:null;if(s){var n=this._checkSurveyEligibility(s);r({visible:n.eligible,disabledReason:n.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,r){var i;if(rf(this._surveyManager))lL.warn("init was not called");else{var s="string"==typeof e?this._getSurveyById(e):e;if(null!=s&&s.id)if(lH.includes(s.type)){var n=null==sa?void 0:sa.querySelector(t);if(n)return null!=(i=s.appearance)&&i.surveyPopupDelaySeconds?(lL.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;lL.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,r),lL.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,r);lL.warn("Survey element not found")}else lL.warn("Surveys of type "+s.type+" cannot be rendered in the app");else lL.warn("Survey not found")}}displaySurvey(e,t){var r;if(rf(this._surveyManager))lL.warn("init was not called");else{var i=this._getSurveyById(e);if(i){var s=i;if(null!=(r=i.appearance)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=c({},i,{appearance:c({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==lk&&t.initialResponses&&lL.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(i);if(!n.visible)return void lL.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else lL.warn("Survey not found")}}cancelPendingSurvey(e){rf(this._surveyManager)?lL.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},_M),_F=c({experiments:_C},_M),_L=c({},_M,{sessionRecording:class{get _config(){return this._instance.config}get _persistence(){return this._instance.persistence}get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){var e,t;return this._recordingStatus===hg||this._recordingStatus===hv?this._recordingStatus:null!=(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)?e:this._recordingStatus}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=hu,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw _t.error("started without valid sessionManager"),Error(_e+" started without valid sessionManager. This is a bug.");if(this._config.cookieless_mode===nZ)throw Error(_e+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(s3))||!e.enabled),r=!this._config.disable_session_recording,i=this._config.disable_session_recording||this._instance.consent.isOptedOut();return ss&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!rp(Object.assign)&&!rp(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),_t.info("starting")):(this._recordingStatus=hu,this.stopRecording())}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(this._recordingStatus!==hg&&this._recordingStatus!==hv&&(this._recordingStatus=h_),null!=s_&&null!=(t=s_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=s_.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=s_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,t=>{if(t)return _t.error("could not load recorder",t);this._onScriptLoaded(e)}))}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_discardRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.discard()}_resetSampling(){var e,t;null==(e=this._persistence)||e.unregister(nt),null==(t=this._persistence)||t.unregister(s4)}_validateSampleRate(e,t){if(rf(e))return null;var r=rm(e)?e:parseFloat(e);return"number"!=typeof r||!Number.isFinite(r)||0>r||r>1?(_t.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}_persistRemoteConfig(e){if(this._persistence){var t,r,i=this._persistence,s=()=>{var t,r=!1===e.sessionRecording?void 0:e.sessionRecording,s=this._val
1idateSampleRate(null==(t=this._config.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this._validateSampleRate(null==r?void 0:r.sampleRate,"remote config sampleRate"),o=null!=s?s:n;rf(o)&&this._resetSampling();var a=null==r?void 0:r.minimumDurationMilliseconds;i.register({[s3]:c({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:c({capturePerformance:e.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:rp(a)?null:a,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==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this._persistRemoteConfig(e),void this._discardRecording()):(this._persistRemoteConfig(e),void this.startIfEnabledOrStop()):(this._recordingStatus===hg&&(this._recordingStatus=hv,_t.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):_t.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(s3);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_isRemoteConfigFresh(){var e,t,r=this._instance.get_property(s3);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return _t.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!=(e=t.cache_timestamp)?e:Date.now();return Date.now()-i<=36e5}_onScriptLoaded(e){var t,r;if(null==(t=s_.__PosthogExtensions__)||!t.initSessionRecording)return _t.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[nB]:!0});if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=s_.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if(this._recordingStatus===hv||this._recordingStatus===hg)return;return this._recordingStatus=hg,_t.info("persisted remote config is stale, requesting fresh config before starting"),void new pT(this._instance).load()}this._recordingStatus=h_,this._lazyLoadedSessionRecording.start(e)}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register({[s6]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register({[s8]:!0}),null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||null==(r=this._persistence)||r.register({["url"===e?s7:s9]:!0}),null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsC
vendor: 1,130 bytes, line 1
1hainAsString=!1,this.instance=e,this.rageclicks=new d7(e.config.rageclick),this._elementSelectors=null}initialize(){this.startIfEnabled()}get _config(){var e,t,r=rd(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map(e=>new RegExp(e)),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(ss&&sa){var e=e=>{e=e||(null==ss?void 0:ss.event);try{this._captureEvent(e)}catch(e){he.error("Failed to capture event",e)}};if(sM(sa,"submit",e,{capture:!0}),sM(sa,"change",e,{capture:!0}),sM(sa,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==ss?void 0:ss.event);try{this._captureEvent(e,d9)}catch(e){he.error("Failed to capture copy/cut event",e)}};sM(sa,"copy",t,{capture:!0}),sM(sa,"cut",t,{capture:!0})}}}else he.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfigFailed(){this.startIfEnabled()}
1onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[sZ]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach(t=>{var i=null==sa?void 0:sa.querySelectorAll(t);null==i||i.forEach(i=>{e===i&&r.push(t)})}),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[sZ];if(rv(this._isDisabledServerSide)&&!rb(r)&&!this.instance._shouldDisableFlags())return!1;var i=null!=(t=this._isDisabledServerSide)?t:!!r;return!!this.instance.config.autocapture&&!i}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=on(e);n7(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&ov(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var s=t===d9;if(i&&function(e,t,r,i,s,n){if(void 0===r&&(r=void 0),!ss||of(e)||null!=(o=r)&&o.url_allowlist&&!ot(r.url_allowlist,n)||null!=(a=r)&&a.url_ignorelist&&ot(r.url_ignorelist,n))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var o,a,l,u,c,d,h=r.dom_event_allowlist;if(h&&!h.some(e=>t.type===e))return!1}var p=om(e,i),_=p.parentIsUsefulElement,g=p.targetElementList;if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(rp(r))return!0;var i,s=function(e){if(r.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(i=s(n))return i.v;return!1}(g,r)||!oa(g,null==(u=r)?void 0:u.css_selector_allowlist)||oa(g,null!=(c=null==(d=r)?void 0:d.css_selector_ignorelist)?c:ou))return!1;try{var v=ss.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return _?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(oo.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this._config,s,s?["copy","cut"]:void 0,this.instance)){var n=hr(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsC
1hainAsString,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=n.props;if(n.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),t===d9){var l,u=oi(null==ss||null==(l=ss.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return rc(null==sa?void 0:sa.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this._lastPathname=(null==ss||null==(t=ss.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(sy.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,sy.info("History API monitoring stopped")}monitorHistoryChanges(){ss&&ss.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener())}_patchHistoryMethod(e){var t;if(ss&&(null==(t=ss.history[e])||!t.__posthog_wrapped__)){var r=this;sH(ss.history,e,t=>function(i,s,n){t.call(this,i,s,n),r._capturePageview(e)})}}_capturePageview(e){try{var t,r=null==ss||null==(t=ss.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture(n1,{navigation_type:e}),this._lastPathname=r}catch(t){sy.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};sM(ss,"popstate",e),this._popstateListener=()=>{ss&&ss.removeEventListener("popstate",e)}}}},heatmaps:class{get _config(){return this.instance.config}constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[sK]),this.rageclicks=new d7(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return rd(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return rf(this._config.capture_heatmaps)?rf(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this._initialized||(_r.info("starting..."),this._setupListeners(),this._onVisibilityChange());else{var e;clearInterval(null!=(e=this._flushInterval)?e:void 0),this._removeListeners(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[sK]:t}),this._enabledServerSide=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this._buffer;return this._buffer=void 0,e}_onDeadClick(e){_i(e.originalEvent)&&this._onClick(e.originalEvent,"deadclick")}_onVisibilityChange(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval="visible"===(null==sa?void 0:sa.visibilityState)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null}_setupListeners(){ss&&sa&&(this._flushHandler=this._flush.bind(this),sM(ss,n0,this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==ss?void 0:ss.event)),sM(sa,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==ss?void 0:ss.event)),sM(sa,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new pd(this.instance,pu,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),sM(sa,nX,this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;ss&&sa&&(this._flushHandler&&ss.removeEventListener(n0,this._flushHandler),this._onClickHandler&&sa.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&sa.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&sa.removeEventListener(nX,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),n=function(e,t,r){for(var i=e;i&&n8(i)&&!n6(i,"body")&&i!==r;){var s,n,o,a=void 0;try{a=null==(s=null!=(n=null==(o=i.ownerDocument)?void 0:o.defaultView)?n:ss)?void 0:s.getComputedStyle(i).position}catch(e){break}if(rr(t,a))return!0;
1i=ol(i)}return!1}(on(e),["fixed","sticky"],s);return{x:e.clientX+(n?0:i),y:e.clientY+(n?0:r),target_fixed:n,type:t}}_onClick(e,t){var r;if(void 0===t&&(t="click"),!n4(e.target)&&_i(e)){var i=this._getProperties(e,t);null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&ov(on(e),this.instance.config.rageclick)&&this._capture(c({},i,{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){!n4(e.target)&&_i(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(ss){var t=this._config.disable_capture_url_hashes?iE(ss.location.href):ss.location.href,r=this._config.custom_personal_data_properties,i=sD(t,this._config.mask_personal_data_properties?[...cU,...r||[]]:[],cj);this._buffer=this._buffer||{},this._buffer[i]||(this._buffer[i]=[]),this._buffer[i].push(e)}}_flush(){this._buffer&&!rh(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:pd,webVitalsAutocapture:class{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this._buffer.metrics.length&&(this._instance.capture("$web_vitals",this._buffer.metrics.reduce((e,t)=>c({},e,{["$web_vitals_"+t.name+"_event"]:c({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=e=>{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,r=this._currentURL();if(!rp(r))if(rf(null==e?void 0:e.name)||rf(null==e?void 0:e.value))p9.error("Invalid metric received",e);else if(!this._maxAllowedValue||this._maxAllowedValue>e.value){this._buffer.url!==r&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),rp(this._buffer.url)&&(this._buffer.url=r),this._buffer.firstMetricTimestamp=rp(this._buffer.firstMetricTimestamp)?Date.now():this._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=c({},e,{$current_url:r,timestamp:Date.now()});rp(i)||(s.$session_id=i.sessionId,s.$window_id=i.windowId),this._buffer.metrics.push(s),this._buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}else p9.error("Ignoring metric with value >= "+this._maxAllowedValue,e)},this._startCapturing=()=>{if(!this._initialized){var e,t,r,i,s=s_.__PosthogExtensions__;if(!rp(s)&&!rp(s.postHogWebVitalsCallbacks)){var n=s.postHogWebVitalsCallbacks;e=n.onLCP,t=n.onCLS,r=n.onFCP,i=n.onINP}e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):p9.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[s0]),this.startIfEnabled()}get _perfConfig(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=rd(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return rf(r)?(null==(t=this._instance.persistence)?void 0:t.props[s5])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(rd(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=rd(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return null!=e&&e}get _maxAllowedValue(){var e=rd(this._perfConfig)&&rm(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==sl?void 0:sl.protocol;if("http:"!==e&&"https:"!==e)return p9.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=rd(this._perfConfig)?this._perfConfig.web_vitals:rb(this._perfConfig)?this._perfConfig:void 0;return rb(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(p9.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){if("capturePerformance"in e){var t=rd(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=rd(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[s0]:t}),this._instance.persistence.register({[s5]:r})),this._enabledServerSide=t,this.startIfEnabled()}}_loadScript(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?p9.error("failed to load script",t):e()})}_currentURL(){var e=ss?this._instance.config.disable_capture_url_hashes?iE(ss.location.href):ss.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return sD(e,this._instance.config.mask_personal_data_properties?[...cU,...t||[]]:[],cj)}p9.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,r,i,s,n,o;this._startCapturing=()=>{var e;if(ss&&this.isEnabled&&null!=(e=s_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=s_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=s_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=s_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this._unwrapOnError&&this._config.capture_unhandled_errors&&(this._unwrapOnError=t(this.captureException.bind(this))),!this._unwrapUnhandledRejection&&this._config.capture_unhandled_rejections&&(this._unwrapUnhandledRejection=r(this.captureException.bind(this))),!this._unwrapConsoleError&&this._config.capture_console_errors&&(this._unwrapConsoleError=i(this.captureException.bind(this)))}catch(e){p6.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[sY]),this._rateLimiter=new rT(c({},(void 0===(r=this._instance.config.error_tracking)&&(r={}),{refillRate:null!=(i=null!=(s=r.exceptionRateLimiterRefillRate)?s:r.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(n=null!=(o=r.exceptionRateLimiterBucketSize)?o:r.__exceptionRateLimiterBucketSize)?n:10}),{refillInterval:1e4,_logger:p6})),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}_requiredConfig(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return rd(e)?t=c({},t,e):(rp(e)?this._remoteEnabled:e)&&(t=c({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(p6.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return p6.error("failed to load script",t);e()})}_stopCapturing(){var e,t,r;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(r=this._unwrapConsoleError)||r.call(this),this._unwrapConsoleError=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this._remoteEnabled=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[sY]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i,s=null!=(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)?t:"Exception";this._rateLimiter.consumeRateLimit(s)?p6.info("Skipping exception capture because of client rate limiting.",{exception:s}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=dh(),this._instance=e,this._suppressionRules=null!=(t=null==(r=this._instance.persistence)?void 0:r.get_property(sJ))?t
1:[],this._exceptionStepsConfig=sr(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new si(this._exceptionStepsConfig)}onConfigChange(){this._exceptionStepsConfig=sr(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var s=null!=(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)?t:[],n=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=s,this._instance.persistence&&this._instance.persistence.register({[sJ]:this._suppressionRules,[sX]:n})}}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(sX),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=r?r:t)&&e}buildProperties(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this._exceptionStepsConfig.enabled)try{if(!r_(e)||0===e.trim().length)return void dd.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((r,i)=>(se.has(i)?t.push(i):r[i]=e[i],r),{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),i=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&dd.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(c({[i7]:e,[i9]:(new Date).toISOString()},i))}catch(e){dd.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void dd.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void dd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void dd.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this._exceptionStepsConfig.enabled&&rf(e.$exception_steps)?this._addBufferedExceptionSteps(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return dd.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void dd.error("Failed to process exception event. Ignoring this exception.",e)}}_addBufferedExceptionSteps(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:c({},e,{$exception_steps:t})}catch(t){return dd.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}_addDroppedExceptionStep(e){this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add({[i7]:e,[i9]:(new Date).toISOString()})}_coerceExceptionStepProperties(e){return rd(e)?c({},e):{}}_getExceptionStepsConfig(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var r=t.type,i=t.value;return r_(r)&&r.length>0&&e.$exception_types.push(r),r_(i)&&i.length>0&&e.$exception_values.push(i),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(e=>{var r=e.values.map(e=>{var r,i=u$[e.operator],s=ru(e.value)?e.value:[e.value],n=null!=(r=t[e.key])?r:[];return s.length>0&&i(s,n)});return"OR"===e.type?r.some(Boolean):r.every(Boolean)})}_isExtensionException(e){return e.flatMap(e=>{var t,r;return null!=(t=null==(r=e.stacktrace)?void 0:r.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}_isPostHogException(e){if(e.length>0){var t,r,i,s,n=null!=(t=null==(r=e[0].stacktrace)?void 0:r.frames)?t:[],o=n[n.length-1];return null!=(i=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&i}return!1}_isExceptionList(e){return!rf(e)&&ru(e)}}},_P,{siteApps:class{constructor(e){this._siteAppElementPatchCount=0,this._instance=e,this._bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}_eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this._bufferedInvocations.push(r),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}}get siteAppLoaders(){var e;return null==(e=s_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=()=>{e(),this._bufferedInvocations=[],this._stopBuffering=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,r,i,s,n,o,a,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var p=h[0];l[p]={id:u[p],type:p,properties:h[1]}}var _=e.$set_once,g=e.$set;return{event:c({},d(e,_o),{properties:c({},e.properties,g?{$set:c({},null!=(t=null==(r=e.properties)?void 0:r.$set)?t:{},g)}:{},_?{$set_once:c({},null!=(i=null==(s=e.properties)?void 0:s.$set_once)?i:{},_)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}_prepareElementForSiteApp(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(_a.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(_a.error("prepare_external_dependency_script returned null"),null):e}_patchSiteAppElementInsertionMethods(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,r,i,s,n,o,a,l=null==sa?void 0:sa.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this._siteAppElementPatchCount++,this._restoreSiteAppElementPatches)return this._releaseSiteAppElementPatches();var c=[],d=this,h=new WeakSet,p=(e,t,r)=>{if(null!=e&&e[t]){var i=e[t];e[t]=r(i),c.push(()=>{e[t]=i})}},_=e=>{if(h.has(e))return e;var t=d._prepareElementForSiteApp(e);return t&&h.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:_(e)).filter(e=>!rv(e));return p(u,"appendChild",e=>function(t){var r=_(t);return r?e.call(this,r):t}),p(u,"insertBefore",e=>function(t,r){var i=_(t);return i?e.call(this,i,r):t}),p(u,"replaceChild",e=>function(t,r){var i=_(t);return i?e.call(this,i,r):r}),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach(e
vendor: 11,716 bytes, line 1
1=>{p(e,"append",e=>function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,g(r))}),p(e,"prepend",e=>function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,g(r))})}),[null==(s=l.Element)?void 0:s.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,g(r))}),p(e,"after",e=>function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,g(r))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var s=g(r);return r.length&&!s.length?void 0:e.apply(this,s)})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",e=>function(t,r){var i=_(r);return i?e.call(this,t,i):null}),this._restoreSiteAppElementPatches=()=>{c.forEach(e=>e()),this._restoreSiteAppElementPatches=void 0},this._releaseSiteAppElementPatches()}_releaseSiteAppElementPatches(){var e=!1;return()=>{var t;e||(e=!0,this._siteAppElementPatchCount--,0===this._siteAppElementPatchCount&&(null==(t=this._restoreSiteAppElementPatches)||t.call(this)))}}_runWithPreparedSiteAppElements(e,t){void 0===t&&(t=!0);var r=this._patchSiteAppElementInsertionMethods();try{var i=e(r);return t&&r(),i}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this._bufferedInvocations.length&&(_a.info("Processing "+this._bufferedInvocations.length+" events for site app with id "+e.id),this._bufferedInvocations.forEach(e=>this._runWithPreparedSiteAppElements(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(r=this._stopBuffering)||r.call(this))},i=!1,s=s=>{t.errored=!s,t.loaded=!0,_a.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),i&&r()};try{var n=this._runWithPreparedSiteAppElements(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1).processEvent;n&&(t.processEvent=n),i=!0}catch(t){_a.error(_l+e.id,t),s(!1)}if(i&&t.loaded)try{r()}catch(r){_a.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}_setupSiteApps(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}_onCapturedEvent(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),i=function(i){try{t._runWithPreparedSiteAppElements(()=>null==i.processEvent?void 0:i.processEvent(r))}catch(t){_a.error("Error while processing event "+e.event+" for site app "+i.id,t)}};for(var s of Object.values(this.apps))i(s)}}onRemoteConfig(e){var t,r,i,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",e=>this._onCapturedEvent(e))):void _a.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._stopBuffering)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled)for(var n of e.siteApps)!function(){var e,t=n.id,r=n.url;s_["__$$ph_site_app_"+t]=s._instance,null==(e=s_.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(s._instance,r,e=>{if(e)return _a.error(_l+t,e)})}();else _a.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},_R,{tracingHeaders:class{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._startCapturing=()=>{var e,t,r=this._syncHostnamesForPatch();r?(rp(this._restoreXHRPatch)&&(this._restoreXHRPatch=null==(e=s_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),rp(this._restoreFetchPatch)&&(this._restoreFetchPatch=null==(t=s_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this._stopCapturing()},this._instance=e}initialize(){this.startIfEnabledOrStop()}_loadScript(e){var t,r;null!=(t=s_.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=s_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return p7.error("failed to load script",t);e()})}_getConfiguredHostnames(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}_syncHostnamesForPatch(){var e=this._getConfiguredHostnames();return ru(e)?(ru(this._hostnamesForPatch)?this._hostnamesForPatch.splice(0,this._hostnamesForPatch.length,...e):this._hostnamesForPatch=[...e],e.length>0?this._hostnamesForPatch:void 0):(ru(this._hostnamesForPatch)&&this._hostnamesForPatch.splice(0),this._hostnamesForPatch=e||void 0,this._hostnamesForPatch)}_stopCapturing(){var e,t;null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0}startIfEnabledOrStop(){this._syncHostnamesForPatch()?this._loadScript(this._startCapturing):this._stopCapturing()}}},{toolbar:class{constructor(e){this.instance=e}_setToolbarState(e){s_.ph_toolbar_state=e}_getToolbarState(){var e;return null!=(e=s_.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),sP(this.instance.config)||!ss||!sa)return!1;e=null!=e?e:ss.location,r=null!=r?r:ss.history;try{if(!t){try{ss.localStorage.setItem("test","test"),ss.localStorage.removeItem("test")}catch(e){return!1}t=null==ss?void 0:ss.localStorage}var i,s=_g||sA(e.hash,"__posthog")||sA(e.hash,"state"),n=s?sC(()=>JSON.parse(atob(decodeURIComponent(s))))||sC(()=>JSON.parse(decodeURIComponent(s))):null;return n&&"ph_authorize"===n.action?((i=n).source="url",i&&Object.keys(i).length>0&&(n.desiredHash?e.hash=n.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(_v)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}_callLoadToolbar(e){var t=s_.ph_load_toolbar||s_.ph_load_editor;!rf(t)&&rc(t)?t(e,this.instance):_f.warn("No toolbar load function found")}loadToolbar(e){var t,r=!(null==sa||!sa.getElementById(nD));if(!ss||r)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=c({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});return(ss.localStorage.setItem(_v,JSON.stringify(c({},s,{source:void 0}))),2===this._getToolbarState())?this._callLoadToolbar(s):0===this._getToolbarState()&&(this._setToolbarState(1),null==(t=s_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(_f.error("[Toolbar] Failed to load",e),this._setToolbarState(0)):(this._setToolbarState(2),this._callLoadToolbar(s))}),sM(ss,"turbolinks:load",()=>{this._setToolbarState(0),this.loadToolbar(s)})),!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},_F,{conversations:class{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;rf(t)||(rb(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null}loadIfEnabled(){if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||sP(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==s_?void 0:s_.__PosthogExtensions__;if(e&&!rp(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var t=e.initConversations;if(t)return this._completeInitialization(t),void(this._isInitializing=!1);var r=e.loadExternalDependency;if(!r)return void this._handleLoadError(nG);r(this._instance,"conversations",t=>{t||!e.initConversations?this._handleLoadError("Could not load conversations script",t):this._completeInitialization(e.initConversations),this._isInitializing=!1})}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else _I.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),_I.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else _I.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){_I.error(e,t),this._conversationsManager=null,this._isInitializing=!1}show(){this._conversationsManager?this._conversationsManager.show():_I.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._isConversationsEnabled&&!rv(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,r){var i=this;return u(function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,t,r):(_I.warn(_E),null)})()}getMessages(e,t){var r=this;return u(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(_I.warn(_E),null)})()}markAsRead(e){var t=this;return u(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(_I.warn(_E),null)})()}getTickets(e){var t=this;return u(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(_I.warn(_E),null)})()}requestRestoreLink(e){var t=this;return u(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(_I.warn(_E),null)})()}restoreFromToken(e){var t=this;return u(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(_I.warn(_E),null)})()}restoreFromUrlToken(){var e=this;return u(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(_I.warn(_E),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}_onIdentityChanged(){var e;null==(e=this._conversationsManager)||e.setIdentity()}_onIdentityCleared(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this._isLogsEnabled=!1,this._isLoaded=!1,this._logger=sb("[logs]"),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._onReconnect=()=>{var e,t;this._consecutiveStatusZeroFailures=0,null==(e=this._core)||e.onReconnect(),null==(t=this._consoleCore)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),ss&&sM(ss,"online",this._onReconnect)}
1_buildCore(e,t,r,i){var s,n,o,a,l,u,c,d,h,p,_,g,v,f,m=(s=null==(f=this._instance)||null==(f=f.config)?void 0:f.logs,h=null!=(n=null==s?void 0:s.flushIntervalMs)?n:3e3,p=null!=(o=null==s?void 0:s.maxBufferSize)?o:100,g=rp(_=null!=r&&r.consoleCapture?void 0:null!=(a=null==s?void 0:s.maxLogsPerInterval)?a:1e3)?Math.max(p,2048):Math.max(p,_),{serviceName:null!=(l=null!=(u=null==(v=null==s?void 0:s.resourceAttributes)?void 0:v["service.name"])?u:null==s?void 0:s.serviceName)?l:null==r?void 0:r.serviceNameDefault,serviceVersion:null!=(c=null==v?void 0:v["service.version"])?c:null==s?void 0:s.serviceVersion,environment:null!=(d=null==v?void 0:v["deployment.environment"])?d:null==s?void 0:s.environment,resourceAttributes:v,beforeSend:null==s?void 0:s.beforeSend,flushIntervalMs:h,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:_,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new iO(this._createHost(e,t),m,this._logger,()=>this._getSdkContext(),e=>e(),void 0,i),m]}_getCore(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._core||this._resolvedFrom!==t){null==(r=this._core)||r.reset(),this._resolvedFrom=t;var r,i=this._buildCore(()=>this._queue,e=>{this._queue=e});this._core=i[0],this._resolvedConfig=i[1]}return this._core}_getConsoleCore(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._consoleCore||this._consoleResolvedFrom!==t){null==(r=this._consoleCore)||r.reset(),this._consoleResolvedFrom=t;var r,i=this._buildCore(()=>this._consoleQueue,e=>{this._consoleQueue=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},_T);this._consoleCore=i[0],this._consoleResolvedConfig=i[1]}return this._consoleCore}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!rf(r)&&r&&(this._isLogsEnabled=!0,this.loadIfEnabled())}reset(){var e,t;this._queue=[],null==(e=this._core)||e.reset(),this._consoleQueue=[],null==(t=this._consoleCore)||t.reset(),this._consecutiveStatusZeroFailures=0}captureLog(e){this._getCore().captureLog(e)}_captureConsoleLog(e){this._getConsoleCore().captureLog(e)}get logger(){return this._capture_logger||(this._capture_logger={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this._capture_logger}flushLogs(e){e?this._flushViaTransport(e):(this._core&&this._core.flush().catch(e=>this._logger.error("PostHog logs flush failed:",e)),this._consoleCore&&this._consoleCore.flush().catch(e=>this._logger.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this._isLogsEnabled&&!this._isLoaded){var e=null==s_?void 0:s_.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this._logger.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this._isLoaded=!0)}):this._logger.error(nG)}else this._logger.error("PostHog Extensions not found.")}}_createHost(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===tZ.LogsQueue?e():void 0,setPersistedProperty(e,r){e===tZ.LogsQueue&&t(null!=r?r:[])},_sendLogsBatch:e=>this._sendLogsBatch(e),getLibraryId:()=>sf.LIB_NAME,getLibraryVersion:()=>sf.LIB_VERSION}}_sendLogsBatch(e){return new Promise(t=>{if(sN(this._consecutiveStatusZeroFailures,3))t({kind:"fatal",error:Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=e=>{r||(r=!0,clearTimeout(s),t(e))},s=setTimeout(()=>i({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this._logsUrl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,r=e.statusCode;(this._trackEndpointReachability(r),r>=200&&300>r)?i({kind:"ok"}):413===r?i({kind:"too-large"}):0!==r&&429!==r&&500>r?i({kind:"fatal",error:Error("logs request failed with status "+r)}):i({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+r)})}})}})}_trackEndpointReachability(e){(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=sq(e,this._consecutiveStatusZeroFailures,3,()=>this._logger.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.")))}_flushViaTransport(e){this._queue.length>0&&this._drainQueueViaTransport(e,this._queue,this._resolvedConfig,sf.LIB_NAME,e=>{this._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,_T,e=>{this._consoleQueue=e})}_drainQueueViaTransport(e,t,r,i,s){if(0!==t.length){var n=t.map(e=>e.record);s([]);var o=iL(n,iF(r,sf.LIB_NAME,sf.LIB_VERSION),i,sf.LIB_VERSION);this._instance._send_request({method:"POST",url:this._logsUrl(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}_logsUrl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}_getSdkContext(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,s=r.sessionStartTimestamp,n=r.lastActivityTimestamp;t.sessionId=r.sessionId,t.windowId=i,rf(s)||(t.sessionStartTimestamp=s),rf(n)||(t.lastActivityTimestamp=n)}if(null!=s_&&null!=(e=s_.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?iE(s_.location.href):s_.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},{metrics:class{constructor(e){this._logger=sb("[metrics]"),this._instance=e}initialize(){}_getCore(){var e,t,r,i,s,n,o,a,l=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this._core&&this._resolvedFrom===l||(null==(t=this._core)||t.reset(),this._resolvedFrom=l,this._core=new iq(this._createHost(),{serviceName:null!=(r=null==(a=null==l?void 0:l.resourceAttributes)?void 0:a["service.name"])?r:null==l?void 0:l.serviceName,serviceVersion:null!=(i=null==a?void 0:a["service.version"])?i:null==l?void 0:l.serviceVersion,environment:null!=(s=null==a?void 0:a["deployment.environment"])?s:null==l?void 0:l.environment,resourceAttributes:a,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(n=null==l?void 0:l.flushIntervalMs)?n:1e4,maxSeriesPerFlush:null!=(o=null==l?void 0:l.maxSeriesPerFlush)?o:1e3},this._logger)),this._core}count(e,t,r){void 0===t&&(t=1),this._getCore().count(e,t,r)}gauge(e,t,r){this._getCore().gauge(e,t,r)}histogram(e,t,r){this._getCore().histogram(e,t,r)}flush(e){if(!this._core)return Promise.resolve();if(e){var t=this._core.drainWindow();return t&&this._sendMetricsBatch(t,e),Promise.resolve()}return this._core.flush().catch(e=>this._logger.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this._core)||e.reset()}_createHost(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_sendMetricsBatch:e=>t._sendMetricsBatch(e),getLibraryId:()=>sf.LIB_NAME,getLibraryVersion:()=>sf.LIB_VERSION}}_sendMetricsBatch(e,t){return new Promise(r=>{var i=!1,s=e=>{i||(i=!0,clearTimeout(n),r(e))},n=setTimeout(()=>s({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(c({method:"POST",url:this._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,r=e.statusCode;r>=200&&300>r?s({kind:"ok"}):413===r?s({kind:"too-large"}):0!==r&&429!==r&&500>r?s({kind:"fatal",error:Error("metrics request failed with status "+r)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+r)})}}))})}_metricsUrl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});p8.__defaultExtensionClasses=c({},_L);var _O=(sf.SDK_DIST_CHANNEL="npm",p=pG[p0]=new p8,function(){function e(){e.done||(e.done=!0,p1=!1,sw(pG,function(e){e._dom_loaded()}))}null!=sa&&sa.addEventListener?"complete"===sa.readyState?e():sM(sa,"DOMContentLoaded",e,{capture:!1}):ss&&sy.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),p);e.s(["default",0,_O],446254)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.