posthog-js 1.347.2 → 1.349.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.js +1 -1
  3. package/dist/array.full.no-external.js +1 -1
  4. package/dist/array.js +1 -1
  5. package/dist/array.no-external.js +1 -1
  6. package/dist/conversations.js +1 -1
  7. package/dist/conversations.js.map +1 -1
  8. package/dist/customizations.full.js +1 -1
  9. package/dist/lazy-recorder.js +1 -1
  10. package/dist/main.js +1 -1
  11. package/dist/main.js.map +1 -1
  12. package/dist/module.d.ts +56 -2
  13. package/dist/module.full.d.ts +56 -2
  14. package/dist/module.full.js +1 -1
  15. package/dist/module.full.js.map +1 -1
  16. package/dist/module.full.no-external.d.ts +56 -2
  17. package/dist/module.full.no-external.js +1 -1
  18. package/dist/module.full.no-external.js.map +1 -1
  19. package/dist/module.js +1 -1
  20. package/dist/module.js.map +1 -1
  21. package/dist/module.no-external.d.ts +56 -2
  22. package/dist/module.no-external.js +1 -1
  23. package/dist/module.no-external.js.map +1 -1
  24. package/dist/posthog-recorder.js +1 -1
  25. package/dist/product-tours-preview.d.ts +14 -0
  26. package/dist/product-tours-preview.js +1 -1
  27. package/dist/product-tours-preview.js.map +1 -1
  28. package/dist/product-tours.js +1 -1
  29. package/dist/product-tours.js.map +1 -1
  30. package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  31. package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  32. package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  33. package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
  34. package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
  35. package/dist/src/extensions/conversations/external/index.d.ts +39 -1
  36. package/dist/src/extensions/product-tours/product-tours-utils.d.ts +1 -0
  37. package/dist/src/extensions/product-tours/product-tours.d.ts +3 -0
  38. package/dist/src/posthog-product-tours-types.d.ts +54 -0
  39. package/dist/surveys-preview.d.ts +14 -0
  40. package/lib/package.json +1 -1
  41. package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  42. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
  43. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
  44. package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  45. package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
  46. package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
  47. package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  48. package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
  49. package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
  50. package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
  51. package/lib/src/extensions/conversations/external/components/styles.js +189 -0
  52. package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
  53. package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
  54. package/lib/src/extensions/conversations/external/components/utils.js +49 -0
  55. package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
  56. package/lib/src/extensions/conversations/external/index.d.ts +39 -1
  57. package/lib/src/extensions/conversations/external/index.js +253 -31
  58. package/lib/src/extensions/conversations/external/index.js.map +1 -1
  59. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
  60. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
  61. package/lib/src/extensions/product-tours/product-tours-utils.d.ts +1 -0
  62. package/lib/src/extensions/product-tours/product-tours-utils.js +34 -0
  63. package/lib/src/extensions/product-tours/product-tours-utils.js.map +1 -1
  64. package/lib/src/extensions/product-tours/product-tours.d.ts +3 -0
  65. package/lib/src/extensions/product-tours/product-tours.js +104 -75
  66. package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
  67. package/lib/src/posthog-product-tours-types.d.ts +54 -0
  68. package/lib/src/posthog-product-tours-types.js +43 -1
  69. package/lib/src/posthog-product-tours-types.js.map +1 -1
  70. package/lib/src/utils/product-tour-event-receiver.js +2 -1
  71. package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
  72. package/lib/tsconfig.tsbuildinfo +1 -1
  73. package/package.json +3 -3
  74. package/react/dist/esm/index.js +25 -1
  75. package/react/dist/esm/index.js.map +1 -1
  76. package/react/dist/types/index.d.ts +4 -2
  77. package/react/dist/umd/index.js +25 -0
  78. package/react/dist/umd/index.js.map +1 -1
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var s=f(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=C(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var s=i(V);if(","===s.slice(-1))s=Y(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Y(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var I=t.attributes[_];J(m,I.name,I.value)||(y[I.name]=X(i,m,T(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=C(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var M=C(t.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,s=E in n?n[E]:n;if(new Uint32Array(s.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(u=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:R=!0}=e;E||(E=Q(t,o,a,void 0===E));var M,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;M=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:M});if(i.add(t,O),M===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(I(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&C){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&C(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},st={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ot={};function at(t){if(ot[t])return ot[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in st?st[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ot[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ot[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var s=at(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ut[n]=o,o.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vt.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=vt.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Mt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),jt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),Zt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Zt||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&qt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=vt.parentNode(n);if(s&&Pt(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removes,s,this.mirror)&&!this.movedSet.has(vt.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||Ut(this.removes,o,this.mirror)?Wt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.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.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=R(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!I(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,s,o,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=jt.Mouse;break;case"touch":u=jt.Touch;break;case"pen":u=jt.Pen}u===jt.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):jt.Pen}else Tt(i)&&(u=jt.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===jt.Touch||l.startsWith("Mouse")&&u===jt.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",Jt(mt(Jt((t=>{var o=Qt(t);if(o&&!kt(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function se(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function oe(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:s,stylesheetManager:o}=t,a=null;a="#document"===e.nodeName?s.getId(e):s.getId(vt.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{o.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;s||(s=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),o,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),o=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",Jt(mt(Jt((()=>{var t=It(),e=Ct();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=ne.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ne.set(t,i);var o=n.getId(t);Jt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Jt((t=>mt(Jt((s=>{var o=Qt(s);if(o&&!kt(o,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),s.media||500))),u=[ft("play",a(Zt.Play),o),ft("pause",a(Zt.Pause),o),ft("seeked",a(Zt.Seeked),o),ft("volumechange",a(Zt.VolumeChange),o),ft("ratechange",a(Zt.RateChange),o)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...se(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...se(e),o]}]}),t.apply(e,s)}))})})),Jt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=l,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,o)=>{var u,[l,h,c]=o;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=oe(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:se(e.parentRule)}),t.apply(e,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,o)=>{var a,[l]=o;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=oe(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:se(e.parentRule)}),t.apply(e,o)}))}),Jt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),s(),o(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=vt.shadowRoot(this);return s&&Pt(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ie(t,e,r,i){var n=[];try{var s=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ce(t,e,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,s,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,s,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));o.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(l)}};for(var l of a)u(l);return o}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this,a=Ie(r,i,n,!0),u=new Map,l=new Re;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ie(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=bt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:$t["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:$t["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...Ce(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ce(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Mt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function je(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Vt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var s,o=t;if(o.timestamp=wt(),!(null==(s=Kt[0])?void 0:s.isFrozen())||o.type===Lt.FullSnapshot||o.type===Lt.IncrementalSnapshot&&o.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(o),r);else if(P){var a={type:"rrweb",event:Z(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Lt.FullSnapshot)L=o,j=0;else if(o.type===Lt.IncrementalSnapshot){if(o.data.source===Dt.Mutation&&o.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&o.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Me({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Ne({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),I){ke({type:Lt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Rt(t,Be)&&z.trackLinkElement(t),Nt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}je.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},je.freezePage=()=>{Kt.forEach((t=>t.freeze()))},je.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},je.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,Ze=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Ue?Ue[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var s=Xe(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Je[n]=o,o.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in sr?sr[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in or?or[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var s=ur(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(lr[n]=o,o.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),u=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vr.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=vr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=vr.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Cr[Ir.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Rr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Mr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;s<i.children.length;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var a in e){var u=e[a];Array.isArray(u)?o[a]=Mr(u.length?u[0]:null):o[a]=u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={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 Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,s=Nr.parse(i).map((t=>t.toString())),o=[Pr(r,n.stringifyOptions)];t({level:"error",trace:s,payload:o})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var s=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++o<n.lengthThreshold?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),jr=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),$r=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Zr(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var qr=["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"],Hr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return qr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Vr(t,e){return-1!==t.indexOf(e)}var zr=function(t){return t.trim()},Gr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Ur=Object.prototype,Wr=Ur.hasOwnProperty,Xr=Ur.toString,Jr=Yr||function(t){return"[object Array]"===Xr.call(t)},Kr=t=>"function"==typeof t,Qr=t=>Kr(t)&&-1!==t.toString().indexOf("[native code]"),ti=t=>t===Object(t)&&!Jr(t),ei=t=>{if(ti(t)){for(var e in t)if(Wr.call(t,e))return!1;return!0}return!1},ri=t=>void 0===t,ii=t=>"[object String]"==Xr.call(t),ni=t=>ii(t)&&0===t.trim().length,si=t=>null===t,oi=t=>ri(t)||si(t),ai=t=>"[object Number]"==Xr.call(t)&&t==t,ui=t=>ai(t)&&t>0,li=t=>"[object Boolean]"===Xr.call(t),hi=t=>t instanceof FormData,ci=t=>Vr($r,t);function di(t){return null===t||"object"!=typeof t}function vi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fi(t){return!ri(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var pi=[!0,"true",1,"1","yes"],gi=t=>Vr(pi,t),mi=[!1,"false",0,"0","no"];function yi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ai(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),yi(n||r,e,r,i))}class bi{constructor(t){this.I={},this.C=t.C,this.S=yi(t.bucketSize,0,100,t.k),this.A=yi(t.refillRate,0,this.S,t.k),this.T=yi(t.refillInterval,0,864e5,t.k)}R(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.T);if(i>0){var n=i*this.A;t.tokens=Math.min(t.tokens+n,this.S),t.lastAccess=t.lastAccess+i*this.T}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.I[i];return n?this.R(n,r):(n={tokens:this.S,lastAccess:r},this.I[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.C)||e.call(this,t)),0===n.tokens)}stop(){this.I={}}}var wi="Mobile",_i="iOS",Ii="Android",Ci="Tablet",Si=Ii+" "+Ci,ki="iPad",xi="Apple",Ai=xi+" Watch",Ti="Safari",Ei="BlackBerry",Ri="Samsung",Ni=Ri+"Browser",Mi=Ri+" Internet",Fi="Chrome",Oi=Fi+" OS",Pi=Fi+" "+_i,Li="Internet Explorer",Di=Li+" "+wi,Bi="Opera",ji=Bi+" Mini",$i="Edge",Zi="Microsoft "+$i,qi="Firefox",Hi=qi+" "+_i,Vi="Nintendo",zi="PlayStation",Gi="Xbox",Yi=Ii+" "+wi,Ui=wi+" "+Ti,Wi="Windows",Xi=Wi+" Phone",Ji="Nokia",Ki="Ouya",Qi="Generic",tn=Qi+" "+wi.toLowerCase(),en=Qi+" "+Ci.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+nn),on=new RegExp(Gi,"i"),an=new RegExp(zi+" \\w+","i"),un=new RegExp(Vi+" \\w+","i"),ln=new RegExp(Ei+"|PlayBook|BB10","i"),hn={"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"};var cn,dn,vn,fn=(t,e)=>e&&Vr(e,xi)||function(t){return Vr(t,Ti)&&!Vr(t,Fi)&&!Vr(t,Ii)}(t),pn=function(t,e){return e=e||"",Vr(t," OPR/")&&Vr(t,"Mini")?ji:Vr(t," OPR/")?Bi:ln.test(t)?Ei:Vr(t,"IE"+wi)||Vr(t,"WPDesktop")?Di:Vr(t,Ni)?Mi:Vr(t,$i)||Vr(t,"Edg/")?Zi:Vr(t,"FBIOS")?"Facebook "+wi:Vr(t,"UCWEB")||Vr(t,"UCBrowser")?"UC Browser":Vr(t,"CriOS")?Pi:Vr(t,"CrMo")||Vr(t,Fi)?Fi:Vr(t,Ii)&&Vr(t,Ti)?Yi:Vr(t,"FxiOS")?Hi:Vr(t.toLowerCase(),rn.toLowerCase())?rn:fn(t,e)?Vr(t,wi)?Ui:Ti:Vr(t,qi)?qi:Vr(t,"MSIE")||Vr(t,"Trident/")?Li:Vr(t,"Gecko")?qi:""},gn={[Di]:[new RegExp("rv:"+nn)],[Zi]:[new RegExp($i+"?\\/"+nn)],[Fi]:[new RegExp("("+Fi+"|CrMo)\\/"+nn)],[Pi]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[sn],[Ui]:[sn],[Bi]:[new RegExp("(Opera|OPR)\\/"+nn)],[qi]:[new RegExp(qi+"\\/"+nn)],[Hi]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Ei]:[new RegExp(Ei+" "+nn),sn],[Yi]:[new RegExp("android\\s"+nn,"i")],[Mi]:[new RegExp(Ni+"\\/"+nn)],[Li]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},mn=function(t,e){var r=pn(t,e),i=gn[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},yn=[[new RegExp(Gi+"; "+Gi+" (.*?)[);]","i"),t=>[Gi,t&&t[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp(zi,"i"),[zi,""]],[ln,[Ei,""]],[new RegExp(Wi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Xi,""];if(new RegExp(wi).test(e)&&!/IEMobile\b/.test(e))return[Wi+" "+wi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=hn[i]||"";return/arm/i.test(e)&&(n="RT"),[Wi,n]}return[Wi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[_i,e.join(".")]}return[_i,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ri(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ii+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ii+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ii,e.join(".")]}return[Ii,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Oi,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return un.test(t)?Vi:an.test(t)?zi:on.test(t)?Gi:new RegExp(Ki,"i").test(t)?Ki:new RegExp("("+Xi+"|WPDesktop)","i").test(t)?Xi:/iPad/.test(t)?ki:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ai:ln.test(t)?Ei:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ji,"i").test(t)?Ji:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(wi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Ii:Si:new RegExp("(pda|"+wi+")","i").test(t)?tn:new RegExp(Ci,"i").test(t)&&!new RegExp(Ci+" pc","i").test(t)?en:""},wn=function(t){var e=bn(t);return e===ki||e===Si||"Kobo"===e||"Kindle Fire"===e||e===en?Ci:e===Vi||e===Gi||e===zi||e===Ki?"Console":e===Ai?"Wearable":e?wi:"Desktop"},_n=t=>t instanceof Error;function In(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return vn&&r.length===dn||(dn=r.length,vn=r.reduce(((r,i)=>{cn||(cn={});var n=cn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,cn[i]=[u,l];break}}return r}),{})),vn}}class Cn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Jr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:In(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Sn="?";function kn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Sn:r,in_app:!0};return ri(i)||(s.lineno=i),ri(n)||(s.colno=n),s}var xn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Sn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},An=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=(t,e)=>{var r=An.exec(t);if(r){var[,i,n,s]=r;return kn(e,i,Sn,+n,+s)}var o=Tn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=En.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=xn(o[1]||Sn,o[2]);return kn(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fn=(t,e)=>{var r=Nn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Sn;return[s,n]=xn(s,n),kn(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Pn=50;function Ln(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;a<o.length;a++){var u=o[a];if(!(u.length>1024)){var l=On.test(u)?u.replace(On,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){s.push(c);break}}if(s.length>=Pn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Pn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Sn});var i}))}(s)}}("web:javascript",Rn,Fn)}class Dn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ii(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return vi(t,"DOMException")}isDOMError(t){return vi(t,"DOMError")}}class Bn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class jn{constructor(){}match(t){return vi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var $n=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Zn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match($n);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Hn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class Vn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return fi(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Hn(t)}isSeverityLevel(t){return ii(t)&&!ni(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(_n(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class zn{match(t){return fi(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return di(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Yn{match(t){return vi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return di(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(di(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Un="undefined"!=typeof window?window:void 0,Wn="undefined"!=typeof globalThis?globalThis:Un;"undefined"==typeof self&&(Wn.self=Wn),"undefined"==typeof File&&(Wn.File=function(){});var Xn=Array.prototype,Jn=Xn.forEach,Kn=Xn.indexOf,Qn=null==Wn?void 0:Wn.navigator,ts=null==Wn?void 0:Wn.document,es=null==Wn?void 0:Wn.location,rs=null==Wn?void 0:Wn.fetch,is=null!=Wn&&Wn.XMLHttpRequest&&"withCredentials"in new Wn.XMLHttpRequest?Wn.XMLHttpRequest:void 0,ns=null==Wn?void 0:Wn.AbortController,ss=null==Qn?void 0:Qn.userAgent,os=null!=Un?Un:{},as=()=>!!Un.Zone,us=t=>t instanceof Document,ls={DEBUG:!1,LIB_VERSION:"1.347.2"},hs=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={N:function(e){if(Un&&(ls.DEBUG||os.POSTHOG_DEBUG||r)&&!ri(Un.console)&&Un.console){for(var i=("__rrweb_original__"in Un.console[e]?Un.console[e].__rrweb_original__:Un.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(t,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>hs(t+" "+e,r)};return i},cs=hs("[PostHog.js]"),ds=cs.createLogger,vs={};function fs(t,e,r){if(Jr(t))if(Jn&&t.forEach===Jn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===vs)return}function ps(t,e,r){if(!oi(t)){if(Jr(t))return fs(t,e,r);if(hi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===vs)return}else for(var n in t)if(Wr.call(t,n)&&e.call(r,t[n],n)===vs)return}}var gs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},ms=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){fs(e,(function(e){t.push(e)}))})),t};function ys(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var bs=function(t){try{return t()}catch(t){return}},ws=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){cs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cs.critical(t)}}},_s=function(t){var e={};return ps(t,(function(t,r){(ii(t)&&t.length>0||ai(t))&&(e[r]=t)})),e};function Is(t,e){return r=t,i=t=>ii(t)&&!si(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Jr(e)?(s=[],fs(e,(e=>{s.push(t(e))}))):(s={},ps(e,((e,r)=>{n.has(e)||(s[r]=t(e,r))}))),s);var s}(r);var r,i,n}var Cs=["herokuapp.com","vercel.app","netlify.app"];function Ss(t){var e=null==t?void 0:t.hostname;if(!ii(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Cs)if(r===i)return!1;return!0}function ks(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function xs(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var As=t=>{var e=null==ts?void 0:ts.createElement("a");return ri(e)?null:(e.href=t,e)},Ts=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ps(t,(function(t,e){ri(t)||ri(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Es=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Jr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Rs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],u=o[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Jr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=s&&(v+="#"+s),v},Ns=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Ms(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Fs(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Os="$people_distinct_id",Ps="__alias",Ls="__timers",Ds="$autocapture_disabled_server_side",Bs="$heatmaps_enabled_server_side",js="$exception_capture_enabled_server_side",$s="$error_tracking_suppression_rules",Zs="$error_tracking_capture_extension_exceptions",qs="$web_vitals_enabled_server_side",Hs="$dead_clicks_enabled_server_side",Vs="$product_tours_enabled_server_side",zs="$web_vitals_allowed_metrics",Gs="$session_recording_remote_config",Ys="$sesid",Us="$session_is_sampled",Ws="$enabled_feature_flags",Xs="$early_access_features",Js="$feature_flag_details",Ks="$stored_person_properties",Qs="$stored_group_properties",to="$surveys",eo="$flag_call_reported",ro="$feature_flag_errors",io="$user_state",no="$client_session_props",so="$capture_rate_limit",oo="$initial_campaign_params",ao="$initial_referrer_info",uo="$initial_person_info",lo="$epp",ho="__POSTHOG_TOOLBAR__",co="$posthog_cookieless",vo=[Os,Ps,"__cmpns",Ls,"$session_recording_enabled_server_side",Bs,Ys,Ws,$s,io,Xs,Js,Qs,Ks,to,eo,ro,no,so,oo,ao,lo,uo,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function fo(t){return t instanceof Element&&(t.id===ho||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function po(t){return!!t&&1===t.nodeType}function go(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mo(t){return!!t&&3===t.nodeType}function yo(t){return!!t&&11===t.nodeType}function bo(t){return t?zr(t).split(/\s+/):[]}function wo(t){var e=null==Un?void 0:Un.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function _o(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return bo(e)}function Io(t){return oi(t)?null:zr(t).split(/(\s+)/).filter((t=>Ho(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(t){var e="";return Po(t)&&!Lo(t)&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;mo(t)&&t.textContent&&(e+=null!==(r=Io(t.textContent))&&void 0!==r?r:"")})),zr(e)}function So(t){return ri(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ko=["a","button","form","input","select","textarea","label"];function xo(t,e){if(ri(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Ao(t){var e=t.parentNode;return!(!e||!po(e))&&e}var To=["next","previous","prev",">","<"],Eo=10;var Ro=[".ph-no-rageclick",".ph-no-capture"];function No(t,e){if(!Un||Mo(t))return!1;var r,i,n;li(e)?(r=!!e&&Ro,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ro,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Fo(t,!1);return!function(t,e){if(!1===t||ri(t))return!1;var r;if(!0===t)r=To;else{if(!Jr(t))return!1;if(t.length>Eo)return cs.error("[PostHog] content_ignorelist array cannot exceed "+Eo+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,s.map((t=>{var e;return{safeText:Co(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!xo(s,r)}var Mo=t=>!t||go(t,"html")||!po(t),Fo=(t,e)=>{if(!Un||Mo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!go(n,"body");)if(yo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Ao(n);if(!s)break;if(e||ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Un.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Oo(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!Un||Mo(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!wo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&wo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Fo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ri(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!xo(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Un.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ko.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Po(t){for(var e=t;e.parentNode&&!go(e,"body");e=e.parentNode){var r=_o(e);if(Vr(r,"ph-sensitive")||Vr(r,"ph-no-capture"))return!1}if(Vr(_o(t),"ph-include"))return!0;var i=t.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Lo(t){return!!(go(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||go(t,"select")||go(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Do="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Bo=new RegExp("^(?:"+Do+")$"),jo=new RegExp(Do),$o="\\d{3}-?\\d{2}-?\\d{4}",Zo=new RegExp("^("+$o+")$"),qo=new RegExp("("+$o+")");function Ho(t,e){if(void 0===e&&(e=!0),oi(t))return!1;if(ii(t)){if(t=zr(t),(e?Bo:jo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Zo:qo).test(t))return!1}return!0}function Vo(t){var e=Co(t);return Ho(e=(e+" "+zo(t)).trim())?e:""}function zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Co(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+zo(t)).trim())}catch(t){cs.error("[AutoCapture]",t)}})),e}function Go(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ys(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Yo(e.toString())]=Yo(r.toString())})),n+=":",n+=ys(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Uo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ys(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Yo(t){return t.replace(/"|\\"/g,'\\"')}function Uo(t){var e=t.attr__class;return e?Jr(e)?e:bo(e):void 0}var Wo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xo=ds("[Recorder]"),Jo=t=>"navigation"===t.entryType,Ko=t=>"resource"===t.entryType;function Qo(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>oa({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>oa({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function ta(t,e){return!!e&&(li(e)||e[t])}function ea(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(li(r))return!0;if(Jr(r))return s(r);var o=r[e];return li(o)?o:s(o)}function ra(t,e,r,i,n,s){return ia.apply(this,arguments)}function ia(){return ia=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Xo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ko(t)&&t.initiatorType===e&&(ri(i)||t.startTime>=i)&&(ri(n)||t.startTime<=n)));return o||(yield new Promise((t=>setTimeout(t,50*s))),ra(t,e,r,i,n,s+1))})),ia.apply(this,arguments)}function na(t){var{body:e,options:r,url:i}=t;if(oi(e))return null;var{hostname:n,isHostDenied:s}=Fs(i,r);if(s)return n+" is in deny list";if(ii(e))return e;if(us(e))return e.textContent;if(hi(e))return Ts(e);if(ti(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var sa=t=>!si(t)&&("navigation"===t.entryType||"resource"===t.entryType);function oa(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(sa(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var aa=["video/","audio/"];function ua(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function la(){return la=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Fs(i,r);return s?Promise.resolve(n+" is in deny list"):ua(e)})),la.apply(this,arguments)}function ha(){return ha=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=aa.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Fs(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return si(n)?ua(e):Promise.resolve(n)})),ha.apply(this,arguments)}function ca(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ta("request",i.recordHeaders),s=ta("response",i.recordHeaders),o=Ms(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),ea({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return la.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield o(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),ea({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ha.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{ra(r,"fetch",c.url,l,h).then((e=>{var r,i=oa({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}var da=null;function va(t,e,i){if(!("performance"in e))return()=>{};if(da)return Xo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Wo,i):Wo,s=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},o=Qo(s,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ta("request",r.recordHeaders),n=ta("response",r.recordHeaders),s=Ms(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,u,l,h){void 0===u&&(u=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=na({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=na({body:v.response,options:r,url:a})),ra(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=oa({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),u,l,h)}));return()=>{s()}}(s,e,n),u=ca(s,e,n)),da=()=>{o(),a(),u(),da=null}}var fa=t=>({name:"rrweb/network@1",observer:va,options:t});os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:fa},os.__PosthogExtensions__.rrweb={record:je,version:"v2"},os.rrweb={record:je,version:"v2"},os.rrwebConsoleRecord={getRecordConsolePlugin:Br},os.getRecordNetworkPlugin=fa;var pa,ga,ma,ya,ba,wa,_a,Ia,Ca,Sa,ka,xa,Aa={},Ta=[],Ea=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ra=Array.isArray;function Na(t,e){for(var r in e)t[r]=e[r];return t}function Ma(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?pa.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Oa(t,o,i,n,null)}function Oa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ma:n,__i:-1,__u:0};return null==n&&null!=ga.vnode&&ga.vnode(s),s}function Pa(t){return t.children}function La(t,e){this.props=t,this.context=e}function Da(t,e){if(null==e)return t.__?Da(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Da(t):null}function Ba(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ba(t)}}function ja(t){(!t.__d&&(t.__d=!0)&&ya.push(t)&&!$.__r++||ba!=ga.debounceRendering)&&((ba=ga.debounceRendering)||wa)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ya.length;)ya.length>a&&ya.sort(_a),t=ya.shift(),a=ya.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Na({},i)).__v=i.__v+1,ga.vnode&&ga.vnode(r),Ga(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Da(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ua(s,r,o),i.__e=i.__=null,r.__e!=n&&Ba(r)));$.__r=0}function $a(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Ta,b=e.length;for(u=function(t,e,r,i,n){var s,o,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;s<n;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Oa(null,o,null,null,null):Ra(o)?o=t.__k[s]=Oa(Pa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Oa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(l=o.__i=qa(o,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<h;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ja(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Aa:y[v.__i]||Aa,v.__i=c,g=Ga(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Za(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Za(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=t,e=Za(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Da(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function qa(t,e,r,i){var n,s,o,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||s<e.length;)if(null!=(l=e[o=n>=0?n--:s++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function Ha(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ea.test(e)?r:r+"px"}function Va(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Ha(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ha(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ia,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=Ca,t.addEventListener(e,s?ka:Sa,s)):t.removeEventListener(e,s?ka:Sa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function za(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ca++;else if(e.t<r.u)return;return r(ga.event?ga.event(e):e)}}}function Ga(t,e,r,i,n,s,o,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ga.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new La(m,w),c.constructor=x,c.render=Ka),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Na({},c.__s)),Na(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),$=0;$<c._sb.length;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ga.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),C=0;C<c._sb.length;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++I<25);c.state=c.__s,null!=c.getChildContext&&(i=Na(Na({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Pa&&null==h.key&&(S=Wa(h.props.children)),a=$a(t,Ra(S)?S:[S],e,r,i,n,s,o,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=s)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(k=s.length;k--;)Ma(s[k]);Ya(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ya(e);ga.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,u){var l,h,c,d,v,f,p,g=r.props||Aa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;l<s.length;l++)if((v=s[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ga.__m&&ga.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&pa.call(t.childNodes),!a&&null!=s)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Va(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Va(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),$a("template"==e.type?t.content:t,Ra(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Da(r,0),a,u),null!=s)for(l=s.length;l--;)Ma(s[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Va(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Va(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ga.diffed)&&h(e),128&e.__u?void 0:a}function Ya(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ya)}function Ua(t,e,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);ga.__c&&ga.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ga.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ra(t)?t.map(Wa):Na({},t)}function Xa(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ga.__e(t,r)}}function Ja(t,e,r){var i,n;if(ga.unmount&&ga.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ga.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ja(i[n],e,r||"function"!=typeof t.type);r||Ma(t.__e),t.__c=t.__=t.__e=void 0}function Ka(t,e,r){return this.constructor(t,r)}function Qa(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ga.__&&ga.__(t,e),i=!1?null:e.__k,n=[],s=[],Ga(e,t=e.__k=Fa(Pa,null,[t]),i||Aa,Aa,e.namespaceURI,i?null:e.firstChild?pa.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,s),Ua(n,t,s)}function tu(t,e,r){var i,n,s,o,a=Na({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?pa.call(arguments,2):r),Oa(t.type,a,i||t.key,n||t.ref,null)}pa=Ta.slice,ga={__e:function(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ma=0,La.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Na({},this.state),"function"==typeof t&&(t=t(Na({},r),this.props)),t&&Na(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),ja(this))},La.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ja(this))},La.prototype.render=Pa,ya=[],wa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_a=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ia=/(PointerCapture)$|Capture$/i,Ca=0,Sa=za(!1),ka=za(!0),xa=0;var eu,ru,iu,nu,su=0,ou=[],au=ga,uu=au.__b,lu=au.__r,hu=au.diffed,cu=au.__c,du=au.unmount,vu=au.__;function fu(t,e){au.__h&&au.__h(ru,t,su||e),su=0;var r=ru.__H||(ru.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function pu(t){return su=1,function(t,e,r){var i=fu(eu++,2);if(i.t=t,!i.__c&&(i.__=[xu(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=ru,!ru.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};ru.__f=!0;var s=ru.shouldComponentUpdate,o=ru.componentWillUpdate;ru.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},ru.shouldComponentUpdate=n}return i.__N||i.__}(xu,t)}function gu(t,e){var r=fu(eu++,3);!au.__s&&ku(r.__H,e)&&(r.__=t,r.u=e,ru.__H.__h.push(r))}function mu(t){return su=5,yu((function(){return{current:t}}),[])}function yu(t,e){var r=fu(eu++,7);return ku(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function bu(t){var e=ru.context[t.__c],r=fu(eu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(ru)),e.props.value):t.__}function wu(){for(var t;t=ou.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Cu),t.__H.__h.forEach(Su),t.__H.__h=[]}catch(e){t.__H.__h=[],au.__e(e,t.__v)}}au.__b=function(t){ru=null,uu&&uu(t)},au.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vu&&vu(t,e)},au.__r=function(t){lu&&lu(t),eu=0;var e=(ru=t.__c).__H;e&&(iu===ru?(e.__h=[],ru.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Cu),e.__h.forEach(Su),e.__h=[],eu=0)),iu=ru},au.diffed=function(t){hu&&hu(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==ou.push(e)&&nu===au.requestAnimationFrame||((nu=au.requestAnimationFrame)||Iu)(wu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),iu=ru=null},au.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Cu),t.__h=t.__h.filter((function(t){return!t.__||Su(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],au.__e(r,t.__v)}})),cu&&cu(t,e)},au.unmount=function(t){du&&du(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Cu(t)}catch(t){e=t}})),r.__H=void 0,e&&au.__e(e,r.__v))};var _u="function"==typeof requestAnimationFrame;function Iu(t){var e,r=function(){clearTimeout(i),_u&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);_u&&(e=requestAnimationFrame(r))}function Cu(t){var e=ru,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),ru=e}function Su(t){var e=ru;t.__c=t.__(),ru=e}function ku(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function xu(t,e){return"function"==typeof e?e(t):e}var Au=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Tu=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Eu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Ru=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Nu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Mu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Fu=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Ou=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Pu=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Lu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Du=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Bu=ds("[Surveys]");function ju(t){return!(!t.start_date||t.end_date)}function $u(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Zu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var qu="seenSurvey_",Hu="inProgressSurvey_",Vu=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},zu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Gu=t=>zu(qu,t),Yu=t=>{localStorage.getItem(Gu(t))||localStorage.setItem(Gu(t),"true")},Uu=[Nu.Popover,Nu.Widget,Nu.API],Wu={ignoreConditions:!1,ignoreDelay:!1,displayType:Du.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ai(t)&&isFinite(t)&&Math.floor(t)===t});var Xu="0123456789abcdef";class Ju{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Ju(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Xu.charAt(this.bytes[e]>>>4)+Xu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Ju(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ku{constructor(){this.M=0,this.F=0,this.O=new el}generate(){var t=this.generateOrAbort();if(ri(t)){this.M=0;var e=this.generateOrAbort();if(ri(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.M)this.M=t,this.D();else{if(!(t+1e4>this.M))return;this.F++,this.F>4398046511103&&(this.M++,this.D())}return Ju.fromFieldsV7(this.M,Math.trunc(this.F/Math.pow(2,30)),this.F&Math.pow(2,30)-1,this.O.nextUint32())}D(){this.F=1024*this.O.nextUint32()+(1023&this.O.nextUint32())}}var Qu,tl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Un&&!ri(Un.crypto)&&crypto.getRandomValues&&(tl=t=>crypto.getRandomValues(t));class el{constructor(){this.B=new Uint32Array(8),this.j=1/0}nextUint32(){return this.j>=this.B.length&&(tl(this.B),this.j=0),this.B[this.j++]}}var rl=()=>il().toString(),il=()=>(Qu||(Qu=new Ku)).generate(),nl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),sl=Uint8Array,ol=Uint16Array,al=Uint32Array,ul=new sl([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]),ll=new sl([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]),hl=new sl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cl=function(t,e){for(var r=new ol(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new al(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},dl=cl(ul,2),vl=dl[0],fl=dl[1];vl[28]=258,fl[258]=28;for(var pl=cl(ll,0)[1],gl=new ol(32768),ml=0;ml<32768;++ml){var yl=(43690&ml)>>>1|(21845&ml)<<1;yl=(61680&(yl=(52428&yl)>>>2|(13107&yl)<<2))>>>4|(3855&yl)<<4,gl[ml]=((65280&yl)>>>8|(255&yl)<<8)>>>1}var bl=function(t,e,r){for(var i=t.length,n=0,s=new ol(e);n<i;++n)++s[t[n]-1];var o,a=new ol(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new ol(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[gl[c]>>>u]=l}else for(o=new ol(i),n=0;n<i;++n)o[n]=gl[a[t[n]-1]++]>>>15-t[n];return o},wl=new sl(288);for(ml=0;ml<144;++ml)wl[ml]=8;for(ml=144;ml<256;++ml)wl[ml]=9;for(ml=256;ml<280;++ml)wl[ml]=7;for(ml=280;ml<288;++ml)wl[ml]=8;var _l=new sl(32);for(ml=0;ml<32;++ml)_l[ml]=5;var Il=bl(wl,9,0),Cl=bl(_l,5,0),Sl=function(t){return(t/8>>0)+(7&t&&1)},kl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof ol?ol:t instanceof al?al:sl)(r-e);return i.set(t.subarray(e,r)),i},xl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Al=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Tl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new sl(0),0];if(1==n){var o=new sl(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;i<n;++i)s[i].s>d&&(d=s[i].s);var v=new ol(d+1),f=El(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=s[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new sl(v),f]},El=function(t,e,r){return-1==t.s?Math.max(El(t.l,e,r+1),El(t.r,e,r+1)):e[t.s]=r},Rl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ol(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},Nl=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Ml=function(t,e,r){var i=r.length,n=Sl(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Fl=function(t,e,r,i,n,s,o,a,u,l,h){xl(e,h++,r),++n[256];for(var c=Tl(n,15),d=c[0],v=c[1],f=Tl(s,15),p=f[0],g=f[1],m=Rl(d),y=m[0],b=m[1],w=Rl(p),_=w[0],I=w[1],C=new ol(19),S=0;S<y.length;++S)C[31&y[S]]++;for(S=0;S<_.length;++S)C[31&_[S]]++;for(var k=Tl(C,7),x=k[0],A=k[1],T=19;T>4&&!x[hl[T-1]];--T);var E,R,N,M,F=l+5<<3,O=Nl(n,wl)+Nl(s,_l)+o,P=Nl(n,d)+Nl(s,p)+o+14+3*T+Nl(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Ml(e,h,t.subarray(u,u+l));if(xl(e,h,1+(P<O)),h+=2,P<O){E=bl(d,v,0),R=d,N=bl(p,g,0),M=p;var L=bl(x,A,0);xl(e,h,b-257),xl(e,h+5,I-1),xl(e,h+10,T-4),h+=14;for(S=0;S<T;++S)xl(e,h+3*S,x[hl[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];xl(e,h,L[Z]),h+=x[Z],Z>15&&(xl(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=Il,R=wl,N=Cl,M=_l;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;Al(e,h,E[Z+257]),h+=R[Z+257],Z>7&&(xl(e,h,i[S]>>>23&31),h+=ul[Z]);var q=31&i[S];Al(e,h,N[q]),h+=M[q],q>3&&(Al(e,h,i[S]>>>5&8191),h+=ll[q])}else Al(e,h,E[i[S]]),h+=R[i[S]];return Al(e,h,E[256]),h+R[256]},Ol=new al([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pl=function(){for(var t=new al(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ll=function(t,e,r,i,n){return function(t,e,r,i,n,s){var o=t.length,a=new sl(i+o+5*(1+Math.floor(o/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c<o?l=Ml(u,l,t.subarray(h,c)):(u[h]=s,l=Ml(u,l,t.subarray(h,o)))}else{for(var d=Ol[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new ol(32768),m=new ol(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new al(25e3),I=new ol(288),C=new ol(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<o;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,A<=h){var M=o-h;if((S>7e3||x>24576)&&M>423){l=Fl(t,u,0,_,I,C,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)I[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),Z=Math.min(258,M);D<=j&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|fl[O]<<18|pl[P];var Y=31&fl[O],U=31&pl[P];k+=ul[Y]+ll[U],++I[257+Y],++C[U],A=h+O,++S}else _[x++]=t[h],++I[t[h]]}}l=Fl(t,u,s,_,I,C,k,x,T,h-T,l)}return kl(a,0,i+Sl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Dl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Bl(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Pl[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Ll(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),s=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Dl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Dl(n,s-8,r.d()),Dl(n,s-4,i),n}var jl=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=t.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),si(a)||(r>e&&(s+=t.substring(e,r)),s+=a,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},$l=!!is||!!rs,Zl="text/plain",ql=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],l=Ts(a);return l&&u.push(l),s+"?"+u.join("&")},Hl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Vl=t=>{var{data:e,compression:r}=t;if(e){if(r===nl.GZipJS){var i=Bl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new sl(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;o<r;++o){if(n+5>i.length){var a=new sl(n+8+(r-o<<1));a.set(i),i=a}var u=t.charCodeAt(o);u<128||e?s(u):u<2048?(s(192|u>>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return kl(i,0,n)}(Hl(e)),{mtime:0}),n=new Blob([i],{type:Zl});return{contentType:Zl,body:n,estimatedSize:n.size}}if(r===nl.Base64){var s=function(t){var e,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=jl(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,h[u++]=o.charAt(e)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Hl(e)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:Hl(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Hl(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},zl=[];rs&&zl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=Vl(t))&&void 0!==e?e:{},a=new Headers;ps(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(ns){var h=new ns;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}rs(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(o||0)<52428.8,body:s,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){cs.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{cs.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),is&&zl.push({transport:"XHR",method:t=>{var e,r=new is;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Vl(t))&&void 0!==e?e:{};ps(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&zl.push({transport:"sendBeacon",method:t=>{var e=ql(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Vl(t))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(e,s)}catch(t){}}});var Gl=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Yl(t,e,r){return Hl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Ul={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Gl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Gl(e,t))))),icontains:(t,e)=>e.map(Wl).some((e=>t.map(Wl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Wl).every((e=>t.map(Wl).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Wl=t=>t.toLowerCase();function Xl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ri(n)||si(n))return!1;var s=[String(n)],o=Ul[i.operator];return!!o&&o(i.values,s)}))}var Jl=ds("[Stylesheet Loader]"),Kl=Un,Ql=ts;function th(t){return"$survey_response_"+t}var eh="#020617",rh={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:Eu.Right,widgetType:Tu.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:eh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function ih(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function nh(t){var e;void 0===t&&(t=rh.backgroundColor),"#"===t[0]&&(e=ih(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=ih(r)),!e)return eh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?eh:"white"}return eh}function sh(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Jl.error("prepare_external_dependency_stylesheet returned null"),null)})(Ql,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var oh=(t,e,i)=>{var n=Ah(t),s=Ql.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Ql.createElement("div");((t,e,i)=>{var n=r({},rh,i),s=t.style,o=![Eu.Center,Eu.Left,Eu.Right].includes(n.position)||e===Nu.Widget&&(null==i?void 0:i.widgetType)===Tu.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||nh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",nh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||nh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",nh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),s.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||nh(u);s.setProperty("--ph-survey-input-text-color",l),s.setProperty("--ph-survey-rating-text-color",l),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),u=sh(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return Ql.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ah=(t,e)=>{if(!e)return null;var r=t[th(e)];return Jr(r)?[...r]:r},uh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=t;s?(Yu(i),s.capture(Pu.SENT,r({[Lu.SURVEY_NAME]:i.name,[Lu.SURVEY_ID]:i.id,[Lu.SURVEY_ITERATION]:i.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Lu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:ah(e,t.id)}))),[Lu.SURVEY_SUBMISSION_ID]:n,[Lu.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,a,{$set:{[Vu(i,"responded")]:!0}})),o&&(Kl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xh(i))):Bu.error("[survey sent] event not captured, PostHog instance not found.")},lh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!oi(t))).length>0,hh=(t,e,i)=>r({[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Lu.SURVEY_PARTIALLY_COMPLETED]:lh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Lu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Lu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:ah((null==e?void 0:e.responses)||{},t.id)})))}),ch=(t,e,i)=>{if(e){if(!i){var n=Sh(t);e.capture(Pu.DISMISSED,r({},hh(t,n,e),{$set:{[Vu(t,"dismissed")]:!0}})),xh(t),Yu(t),Kl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bu.error("[survey dismissed] event not captured, PostHog instance not found.")},dh=(t,e)=>{if(e){var r=(t=>zu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Sh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Pu.ABANDONED,hh(t,i,e),{transport:"sendBeacon"})}}else Bu.error("[survey abandoned] event not captured, PostHog instance not found.")},vh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),fh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ph=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?fh(t.questions,vh(t.questions)):t.questions,gh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===Ou.Always||kh(t)},mh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,ja(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+xa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),yh=()=>bu(mh),bh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return tu(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function wh(t){return null!=t?t:"icontains"}function _h(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Kl||null==(r=Kl.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=wh(null==(i=t.conditions)?void 0:i.urlMatchType);return Ul[o](s,[n])}var Ih=t=>{var e=""+Hu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Hu+t.id+"_"+t.current_iteration),e},Ch=(t,e)=>{try{localStorage.setItem(Ih(t),JSON.stringify(e))}catch(t){Bu.error("Error setting in-progress survey state in localStorage",t)}},Sh=t=>{try{var e=localStorage.getItem(Ih(t));if(e)return JSON.parse(e)}catch(t){Bu.error("Error getting in-progress survey state from localStorage",t)}return null},kh=t=>{var e=Sh(t);return!oi(null==e?void 0:e.surveySubmissionId)},xh=t=>{try{localStorage.removeItem(Ih(t))}catch(t){Bu.error("Error clearing in-progress survey state from localStorage",t)}};function Ah(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Th(t,e,r){if(void 0===e&&(e=Eu.Right),t===Nu.ExternalSurvey)return{};switch(e){case Eu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Eu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Eu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Eu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Eu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Eu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Eu.Left:return{left:"30px"};case Eu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Eu.Right:return{right:t===Nu.Widget&&r===Tu.Tab?"60px":"30px"}}}var Eh=0;function Rh(t,e,r,i,n,s){e||(e={});var o,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?o=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Eh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return ga.vnode&&ga.vnode(l),l}var Nh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Mh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Oh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Ph=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Lh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rh("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"})}),Dh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rh("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"})}),Bh=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Rh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Rh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Rh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]})},jh=Rh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Rh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Rh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Rh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Rh("g",{mask:"url(#mask0_2415_6911)",children:[Rh("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"}),Rh("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"}),Rh("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"}),Rh("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"}),Rh("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Rh("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"})]})]}),Rh("defs",{children:Rh("clipPath",{id:"clip0_2415_6911",children:Rh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function $h(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Rh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",jh]})}function Zh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=bu(mh);return Rh("div",{className:"bottom-section",children:[!a&&Rh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Un||Un.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Rh($h,{urlParams:{utm_source:"survey-footer"}})]})}function qh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Rh("div",{class:"question-header",children:[Rh(e.type===Mu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&bh({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Hh(t){var{onClick:e}=t,{isPreviewMode:r}=bu(mh);return Rh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Bh({fill:"black"})})}Rh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Rh("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 Vh=Un;function zh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=bu(mh);return gu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return xs(Vh,"keydown",t),()=>{Vh.removeEventListener("keydown",t)}}),[o]),Rh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Rh(Hh,{onClick:()=>o()}),Rh("h3",{className:"thank-you-message-header",children:e}),r&&bh({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Rh(Zh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Gh=t=>Jr(t)&&t.every((t=>ii(t)));function Yh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=yh(),l=mu(null),[h,c]=pu((()=>ii(a)?a:""));gu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+o,v=yu((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case jr.MinLength:if(void 0!==o.value&&s.length<o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case jr.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Zr(e.validation,jr.MinLength),p=Zr(e.validation,jr.MaxLength),g=yu((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:e,forceDisableHtml:r,htmlFor:d}),Rh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h}),g&&Rh("div",{className:"validation-hint",children:g})]}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:()=>{v||n(h.trim())},onPreviewSubmit:()=>{v||s(h.trim())}})]})}function Uh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Rh(Pa,{children:[Rh("div",{className:"question-container",children:Rh(qh,{question:e,forceDisableHtml:r})}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Wh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=pu((()=>ai(u)?u:Jr(u)&&u.length>0&&ai(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ai(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=yh(),p=t=>f?a(t):o(t);return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:r,forceDisableHtml:i}),Rh("div",{className:"rating-section",children:[Rh("div",{className:"rating-options",children:["emoji"===r.display&&Rh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=ec[r.scale])?void 0:e.map(((t,e)=>Rh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick:()=>{var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Rh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:rc(r.scale).map(((t,e)=>Rh(Xh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Rh("div",{className:"rating-text",children:[Rh("div",{children:r.lowerBoundLabel}),Rh("div",{children:r.upperBoundLabel})]})]})]}),Rh(Zh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:si(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Xh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Rh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Jh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=mu(null),h=yu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=fh(e,vh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=pu((()=>((t,e)=>ii(t)||Gh(t)?t:e===Mu.SingleChoice?null:[])(u,e.type))),[v,f]=pu((()=>((t,e)=>{if(ii(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Gh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=yh(),g=e.type===Mu.SingleChoice,m=e.type===Mu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&Jr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!e.optional&&(!!si(c)||(!(!Jr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),C=()=>{v.isSelected&&m?Jr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:e,forceDisableHtml:i}),Rh("fieldset",{className:"multiple-choice-options limit-height",children:[Rh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:Jr(c)&&c.includes(t);return Rh("label",{className:i?"choice-option-open":"",children:[Rh("div",{className:"response-choice",children:[Rh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Rh("span",{children:i?t+":":t})]}),i&&Rh("input",{type:"text",ref:l,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var Kh=[1,2,3,4,5],Qh=[1,2,3,4,5,6,7],tc=[0,1,2,3,4,5,6,7,8,9,10],ec={2:[Lh,Dh],3:[Fh,Mh,Nh],5:[Oh,Fh,Mh,Nh,Ph]};function rc(t){switch(t){case 5:default:return Kh;case 7:return Qh;case 10:return tc}}var ic=ds("[Surveys]");function nc(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Fu.End:s;if(n.branching.type===Fu.End)return Fu.End;if(n.branching.type===Fu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Fu.ResponseBased){if(n.type===Mu.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Fu.End?Fu.End:s}}else if(n.type===Mu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Fu.End?Fu.End:s}}return s}return ic.warn("Falling back to next question index due to unexpected branching type"),s}var sc=Un,oc=ts,ac="ph:show_survey_widget",uc="PHWidgetSurveyClickListener",lc=250,hc=20,cc=12;function dc(t,e){try{var r=t.getBoundingClientRect(),i=sc.innerHeight,n=sc.innerWidth,s=lc,o=r.left+r.width/2-e/2;o+e>n-hc&&(o=n-e-hc),o<hc&&(o=hc);var a=cc,u=i-r.bottom,l=r.top,h=u<s&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:rh.zIndex}}catch(t){return Bu.warn("Failed to calculate trigger position:",t),null}}class vc{constructor(t){var e=this;this.$=new Map,this.Z=new Map,this.q=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(to);if(t)for(var e of t)kh(e)&&dh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=null!=e&&e.position||null!=e&&e.selector?r({},t,{appearance:r({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.H(a.id);var{properties:u,initialResponses:l}=null!=e?e:{},h=!!(l&&Object.keys(l).length>0)&&this.V(a,l,u);if(!h||null!=(i=a.appearance)&&i.displayThankYouMessage){this.G(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Eu.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var d,v=oc.querySelector(a.appearance.widgetSelector);if(v)c=dc(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||rh.maxWidth))||{}}var f=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:p}=oh(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Y,properties:u,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(f<=0)return Qa(Rh(mc,r({},g)),p);var m=setTimeout((()=>{if(this.$.delete(a.id),!_h(a))return this.Y(a);Qa(Rh(mc,r({},g,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.$.set(a.id,m)}},this.U=t=>{var{shadow:e,isNewlyCreated:r}=oh(t,this._posthog);r&&Qa(Rh(bc,{posthog:this._posthog,survey:t},t.id),e)},this.W=t=>{this.X(t);var e=this.Z.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(uc),this.Z.delete(t.id),Bu.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=oc.querySelector(e),i=this.Z.get(t.id);if(r){if(this.U(t),i){if(r===i.element)return;Bu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.W(t)}if(!r.hasAttribute(uc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Eu.NextToTrigger?dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||rh.maxWidth)):{};sc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:t.id,position:n}}))};xs(r,"click",n),r.setAttribute(uc,"true"),this.Z.set(t.id,{element:r,listener:n,survey:t}),Bu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.W(t)},this.renderPopover=t=>{var{shadow:e}=oh(t,this._posthog);Qa(Rh(mc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.K(t),Qa(Rh(mc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.tt(t)&&e.et(t)&&e.rt(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Nu.Popover||t.type===Nu.Widget)),i=e.it(r),n=new Set;i.forEach((t=>{if(t.type===Nu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===Tu.Tab)return void e.U(t);if((null==(i=t.appearance)?void 0:i.widgetType)===Tu.Selector&&null!=(s=t.appearance)&&s.widgetSelector)n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector)}si(e.nt)&&t.type===Nu.Popover&&e.handlePopoverSurvey(t)})),e.Z.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.W(r)}))}),t)},this.G=t=>{si(this.nt)||Bu.error("Survey "+this.nt+" already in focus. Cannot add survey "+t.id+"."),this.nt=t.id},this.Y=t=>{this.nt!==t.id&&Bu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.H(t.id),this.nt=null,this.X(t)},this._posthog=t,this.nt=null}H(t){var e=this.$.get(t);e&&(clearTimeout(e),this.$.delete(t))}cancelSurvey(t){this.$.has(t)&&(Bu.info("Cancelled pending survey "+t),this.H(t),this.nt===t&&(this.nt=null))}it(t){return t.sort(((t,e)=>{var r,i,n=kh(t),s=kh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Ou.Always,a=e.schedule===Ou.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}K(t){if(!this.q.has(t.id)){var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!ri(a)){var u=decodeURIComponent(o),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(sc.location.search);if(0!==Object.keys(e).length){Bu.info("[Survey Prefill] Detected URL prefill parameters");var r=this.st(t,e);if(r){var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;(Object.keys(o).length>0&&t.enable_partial_responses||s)&&uh({responses:s?i:o,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this.q.add(t.id)}}}}V(t,e,r){var i={};for(var[n,s]of Object.entries(e)){i[parseInt(n)]=Jr(s)?s.map(String):[String(s)]}Bu.info("[Survey] Processing initial responses");var o=this.st(t,i);if(!o)return!1;var{responses:a,submissionId:u,isSurveyCompleted:l}=o;return uh({responses:a,survey:t,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}st(t,e){try{var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=th(t.id);try{switch(t.type){case Mu.SingleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=t.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Mu.MultipleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case Mu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void cs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:cs.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){cs.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return Bu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=rl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;i<t.questions.length&&0<s&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=th(o.id);ri(r[a])||(n[a]=r[a])}var u=nc(t,i,o.id?r[th(o.id)]:null);if(u===Fu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=s>=t.questions.length;return Ch(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Bu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(t){return Bu.error("[Survey Prefill] Error handling prefill:",t),null}}ot(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}tt(t){return!t.conditions||_h(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!ss)return!1;var n=wn(ss);return Ul[wh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Ql||!Ql.querySelector(t.conditions.selector))}(t)}ut(t){return gh(t)||this.ot(t.internal_targeting_flag_key)||kh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!ju(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Uu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.ot(t.linked_flag_key,n)?this.ot(t.targeting_flag_key)?this.ut(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Gu(t))&&!gh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}et(t){var e;if(!$u(t)&&!Zu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}rt(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ot(r)}))}X(t){try{var e=oc.querySelector(Ah(t,!0));null!=e&&e.shadowRoot&&Qa(null,e.shadowRoot),null==e||e.remove()}catch(e){Bu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.nt,surveyTimeouts:this.$,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.it,checkFlags:this.rt.bind(this),isSurveyFeatureFlagEnabled:this.ot.bind(this)}}}function fc(t,e){if(oc&&sc){var r,i=new vc(t);if(t.config.disable_surveys_automatic_display)return Bu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Bu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),xs(oc,"visibilitychange",(()=>{oc.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function pc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;gu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Nu.Widget,s=_h(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===Tu.Tab&&n;if(!s)return Bu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Bu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};xs(sc,"popstate",s),xs(sc,"hashchange",s);var o=sc.history.pushState,a=sc.history.replaceState;return sc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e),s()},sc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{sc.removeEventListener("popstate",s),sc.removeEventListener("hashchange",s),sc.history.pushState=o,sc.history.replaceState=a}}}),[n,e,r,i])}function gc(t){switch(void 0===t&&(t=Ru.Right),t){case Ru.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ru.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ru.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Ru.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function mc(t){var e,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=mu(null),I=Number.isInteger(d),C=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,r,i,n,s,o,a){var[u,l]=pu(i||0===r||t.type===Nu.ExternalSurvey),[h,c]=pu(!1),d=()=>{var e=()=>{s&&n(t),l(!1)};oc.startViewTransition?oc.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return gu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{_h(t)&&(l(!0),sc.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Pu.SHOWN,{[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(xs(sc,"PHSurveyClosed",v),xs(sc,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}return s(),()=>{sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}}else Bu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),pc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:u,isSurveySent:h,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(u,h,C,I,v,f,_,w),A=k||d===u.questions.length||!0===b,T=yu((()=>{var t=Sh(u);return{isPreviewMode:I,previewPageIndex:d,onPopupSurveyDismissed:()=>{ch(u,h,I),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||rl(),onPreviewSubmit:p,posthog:h,properties:y}}),[I,d,f,h,u,g,p,y]);return S?Rh(mh.Provider,{value:T,children:Rh("div",{className:"ph-survey",style:r({},Th(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:_,children:A?Rh(zh,{header:(null==(s=u.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||rh,onClose:()=>{x(),m()}}):Rh(yc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function yc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=pu((()=>{var t=Sh(i);return null!=t&&t.responses&&Bu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=bu(mh),[p,g]=pu((()=>{var t=Sh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=yu((()=>ph(i)),[i]);gu((()=>{v&&!ri(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Rh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Rh(Hh,{onClick:()=>{l()}}),Rh("div",{className:"survey-box",children:wc({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||rh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=th(u),h=r({},o,{[l]:e});a(h);var c=nc(i,n,e),v=c===Fu.End;v||(g(c),Ch(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&uh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f})}else Bu.error("onNextButtonClick called without a questionId.");else Bu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?o[th(y.id)]:void 0})})]}):null}function bc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=pu(!0),[f,p]=pu(!1),[g,m]=pu({}),y=()=>{p(!f)};if(gu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Bu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return xs(sc,ac,e),()=>{sc.removeEventListener(ac,e)}}}else Bu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),pc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Ou.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Rh(Pa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Rh("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===Ru.Top?"widget-tab-top":""),onClick:y,disabled:c,style:gc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Rh(mc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var wc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:s,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{o(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Mu.Open:return Fa(Yh,r({},l,{question:e,key:e.id}));case Mu.Link:return Fa(Uh,r({},l,{question:e,key:e.id}));case Mu.Rating:return Fa(Wh,r({},l,{question:e,key:e.id}));case Mu.SingleChoice:case Mu.MultipleChoice:return Fa(Jh,r({},l,{question:e,key:e.id}));default:return Bu.error("Unsupported question type: "+e.type),null}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.generateSurveys=fc,os.extendPostHogWithSurveys=fc;class _c{emit(t){}}var Ic=new _c;var Cc=new class{getLogger(t,e,r){return new _c}};class Sc{constructor(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}emit(t){this.ct().emit(t)}ct(){if(this.dt)return this.dt;var t=this.ht.vt(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ic}}class kc{getLogger(t,e,r){var i;return null!==(i=this.vt(t,e,r))&&void 0!==i?i:new Sc(this,t,e,r)}ft(){var t;return null!==(t=this.dt)&&void 0!==t?t:Cc}yt(t){this.dt=t}vt(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getLogger(t,e,r)}}var xc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Ac=Symbol.for("io.opentelemetry.js.api.logs"),Tc=xc;class Ec{constructor(){this.bt=new kc}static getInstance(){return this._instance||(this._instance=new Ec),this._instance}setGlobalLoggerProvider(t){return Tc[Ac]?this.getLoggerProvider():(Tc[Ac]=(e=1,r=t,i=Cc,t=>t===e?r:i),this.bt.yt(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=Tc[Ac])||void 0===t?void 0:t.call(Tc,1))&&void 0!==e?e:this.bt}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Tc[Ac],this.bt=new kc}}var Rc=Ec.getInstance();class Nc{constructor(t){this.dt=void 0,this.dt=t}export(t,e){this.dt.export(t,e)}forceFlush(){return this.dt.forceFlush()}shutdown(){return this.dt.shutdown()}}class Mc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Fc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Oc{constructor(t){this.wt=void 0,this._t=[],this.wt=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._t.push(t);var e=()=>{var e=this._t.indexOf(t);this._t.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this._t.length>=this.wt}awaitAll(){var t=this;return e((function*(){yield Promise.all(t._t)}))()}}function Pc(t){return new Oc(t.concurrencyLimit)}var Lc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Dc="1.9.0",Bc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var jc=function(t){var e=new Set([t]),r=new Set,i=t.match(Bc);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(Bc);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?s===h&&o<=c?u(t):a(t):s<=h?u(t):a(t)}}(Dc),$c=Dc.split(".")[0],Zc=Symbol.for("opentelemetry.js.api."+$c),qc=Lc;function Hc(t,e,r,i){var n;void 0===i&&(i=!1);var s=qc[Zc]=null!==(n=qc[Zc])&&void 0!==n?n:{version:Dc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}if(s.version!==Dc){o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Dc);return r.error(o.stack||o.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Dc+"."),!0}function Vc(t){var e,r,i=null===(e=qc[Zc])||void 0===e?void 0:e.version;if(i&&jc(i))return null===(r=qc[Zc])||void 0===r?void 0:r[t]}function zc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Dc+".");var r=qc[Zc];r&&delete r[t]}var Gc,Yc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Uc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Wc=function(){function t(t){this.It=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("debug",this.It,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("error",this.It,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("info",this.It,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("warn",this.It,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("verbose",this.It,t)},t}();function Xc(t,e,r){var i=Vc("diag");if(i)return r.unshift(e),i[t].apply(i,Uc([],Yc(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Gc||(Gc={}));var Jc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Kc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Qc=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=Vc("diag");if(i)return i[t].apply(i,Kc([],Jc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:Gc.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Vc("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Gc.NONE?t=Gc.NONE:t>Gc.ALL&&(t=Gc.ALL),e=e||{},{error:r("error",Gc.ERROR),warn:r("warn",Gc.WARN),info:r("info",Gc.INFO),debug:r("debug",Gc.DEBUG),verbose:r("verbose",Gc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Gc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Hc("diag",u,e,!0)},e.disable=function(){zc("diag",e)},e.createComponentLogger=function(t){return new Wc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function td(t){return Symbol.for(t)}var ed,rd=function t(e){var r=this;r.Ct=e?new Map(e):new Map,r.getValue=function(t){return r.Ct.get(t)},r.setValue=function(e,i){var n=new t(r.Ct);return n.Ct.set(e,i),n},r.deleteValue=function(e){var i=new t(r.Ct);return i.Ct.delete(e),i}},id=new rd,nd=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},sd=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},od=function(){function t(){}return t.prototype.active=function(){return id},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,sd([r],nd(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),ad=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},ud=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},ld="context",hd=new od,cd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Hc(ld,t,Qc.instance())},t.prototype.active=function(){return this.St().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return(i=this.St()).with.apply(i,ud([t,e,r],ad(n),!1))},t.prototype.bind=function(t,e){return this.St().bind(t,e)},t.prototype.St=function(){return Vc(ld)||hd},t.prototype.disable=function(){this.St().disable(),zc(ld,Qc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(ed||(ed={}));var dd="0000000000000000",vd="00000000000000000000000000000000",fd={traceId:vd,spanId:dd,traceFlags:ed.NONE},pd=function(){function t(t){void 0===t&&(t=fd),this.kt=t}return t.prototype.spanContext=function(){return this.kt},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),gd=td("OpenTelemetry Context Key SPAN");function md(t){return t.getValue(gd)||void 0}function yd(){return md(cd.getInstance().active())}function bd(t,e){return t.setValue(gd,e)}function wd(t){return t.deleteValue(gd)}function _d(t,e){return bd(t,new pd(e))}function Id(t){var e;return null===(e=md(t))||void 0===e?void 0:e.spanContext()}var Cd=/^([0-9a-f]{32})$/i,Sd=/^[0-9a-f]{16}$/i;function kd(t){return r=t.traceId,Cd.test(r)&&r!==vd&&(e=t.spanId,Sd.test(e)&&e!==dd);var e,r}function xd(t){return new pd(t)}var Ad=cd.getInstance(),Td=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ad.active()),Boolean(null==e?void 0:e.root))return new pd;var i,n=r&&Id(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&kd(n)?new pd(n):new pd},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(!(arguments.length<2)){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:Ad.active(),u=this.startSpan(t,n,a),l=bd(a,u);return Ad.with(l,o,void 0,u)}},t}();var Ed=new Td,Rd=function(){function t(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.xt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.xt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.xt=function(){if(this.dt)return this.dt;var t=this.ht.getDelegateTracer(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ed},t}(),Nd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Td},t}()),Md=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new Rd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.dt)&&void 0!==t?t:Nd},t.prototype.setDelegate=function(t){this.dt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Fd=cd.getInstance(),Od=Qc.instance(),Pd="trace",Ld=function(){function t(){this.At=new Md,this.wrapSpanContext=xd,this.isSpanContextValid=kd,this.deleteSpan=wd,this.getSpan=md,this.getActiveSpan=yd,this.getSpanContext=Id,this.setSpan=bd,this.setSpanContext=_d}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Hc(Pd,this.At,Qc.instance());return e&&this.At.setDelegate(t),e},t.prototype.getTracerProvider=function(){return Vc(Pd)||this.At},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){zc(Pd,Qc.instance()),this.At=new Md},t}(),Dd=Ld.getInstance(),Bd=td("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function jd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if($d(i)){e=i;continue}return!1}return!1}}return!0}(t):$d(typeof t))}function $d(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var Zd=t=>{Od.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))};function qd(t){try{Zd(t)}catch(t){}}var Hd,Vd=performance,zd="telemetry.sdk.language",Gd="telemetry.sdk.name",Yd="telemetry.sdk.version",Ud={[Gd]:"opentelemetry","process.runtime.name":"browser",[zd]:"webjs",[Yd]:"2.2.0"},Wd=Math.pow(10,6),Xd=Math.pow(10,9);function Jd(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Wd)]}function Kd(){var t=Vd.timeOrigin;if("number"!=typeof t){var e=Vd;t=e.timing&&e.timing.fetchStart}return t}function Qd(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Xd&&(r[1]-=Xd,r[0]+=1);return r}(Jd(Kd()),Jd("number"==typeof t?t:Vd.now()))}function tv(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Kd()?Qd(t):Jd(t);if(t instanceof Date)return Jd(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Hd||(Hd={}));var ev="[object Object]",rv="[object Null]",iv="[object Undefined]",nv=Function.prototype.toString,sv=nv.call(Object),ov=Object.getPrototypeOf,av=Object.prototype,uv=av.hasOwnProperty,lv=Symbol?Symbol.toStringTag:void 0,hv=av.toString;function cv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?iv:rv;return lv&&lv in Object(t)?function(t){var e=uv.call(t,lv),r=t[lv],i=!1;try{t[lv]=void 0,i=!0}catch(t){}var n=hv.call(t);i&&(e?t[lv]=r:delete t[lv]);return n}(t):function(t){return hv.call(t)}(t)}(t)!==ev)return!1;var e=ov(t);if(null===e)return!0;var r=uv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&nv.call(r)===sv}var dv=20;function vv(t){return gv(t)?t.slice():t}function fv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>dv)){if(r++,bv(t)||bv(e)||mv(e))n=vv(e);else if(gv(t)){if(n=t.slice(),gv(e))for(var s=0,o=e.length;s<o;s++)n.push(vv(e[s]));else if(yv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=vv(e[h])}}else if(yv(t))if(yv(e)){if(!function(t,e){if(!cv(t)||!cv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(bv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(pv(t,f,i)||pv(e,f,i))delete n[f];else{if(yv(g)&&yv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=fv(n[f],p,r,i)}}}}else n=e;return n}}function pv(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;n<s;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function gv(t){return Array.isArray(t)}function mv(t){return"function"==typeof t}function yv(t){return!bv(t)&&!gv(t)&&!mv(t)&&"object"==typeof t}function bv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class wv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,wv.prototype)}}function _v(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new wv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Iv{constructor(){this.Tt=void 0,this.Et=void 0,this.Rt=void 0,this.Tt=new Promise(((t,e)=>{this.Et=t,this.Rt=e}))}get promise(){return this.Tt}resolve(t){this.Et(t)}reject(t){this.Rt(t)}}class Cv{constructor(t,e){this.Nt=void 0,this.Mt=void 0,this.Ft=!1,this.Ot=new Iv,this.Nt=t,this.Mt=e}get isCalled(){return this.Ft}get promise(){return this.Ot.promise}call(){if(!this.Ft){this.Ft=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.Nt.call(this.Mt,...e)).then((t=>this.Ot.resolve(t)),(t=>this.Ot.reject(t)))}catch(t){this.Ot.reject(t)}}return this.Ot.promise}}var Sv={Pt:function(t,e){return new Promise((r=>{Fd.with(function(t){return t.setValue(Bd,!0)}(Fd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function kv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Od.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class xv{constructor(t,e,r,i,n){this.Lt=void 0,this.Dt=void 0,this.Bt=void 0,this.jt=void 0,this.$t=void 0,this.Zt=void 0,this.Lt=t,this.Dt=e,this.Bt=r,this.jt=i,this.$t=n,this.Zt=Od.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Zt.debug("items to be sent",t),this.jt.hasReachedLimit())e({code:Hd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Dt.serializeRequest(t);null!=r?this.jt.pushPromise(this.Lt.send(r,this.$t).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Hd.FAILED,error:t.error}):"retryable"===t.status?e({code:Hd.FAILED,error:new Mc("Export failed with retryable status")}):e({code:Hd.FAILED,error:new Mc("Export failed with unknown error")});else{if(null!=t.data)try{this.Bt.handleResponse(this.Dt.deserializeResponse(t.data))}catch(e){this.Zt.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Hd.SUCCESS})}}),(t=>e({code:Hd.FAILED,error:t})))):e({code:Hd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.jt.awaitAll()}shutdown(){var t=this;return e((function*(){t.Zt.debug("shutdown started"),yield t.forceFlush(),t.Lt.shutdown()}))()}}function Av(t,e,r){return i={transport:r,serializer:e,promiseHandler:Pc(t)},n={timeout:t.timeoutMillis},new xv(i.transport,i.serializer,kv(),i.promiseHandler,n.timeout);var i,n}function Tv(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Ev(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=Tv(t.charCodeAt(i)),s=Tv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Rv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Nv(t){var e,r=Rv(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Mv="undefined"!=typeof BigInt?function(t){return Rv(t).toString()}:function(t){return t[0]*Xd+t[1]};function Fv(t){return t}function Ov(t){if(void 0!==t)return Ev(t)}var Pv={encodeHrTime:Nv,encodeSpanContext:Ev,encodeOptionalSpanContext:Ov};function Lv(t,e){return{key:t,value:Dv(e)}}function Dv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Dv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Lv(e,r)}))}}:{}}function Bv(t,e){var r=function(t){var e,r;if(void 0===t)return Pv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Nv:Mv,encodeSpanContext:n?Fv:Ev,encodeOptionalSpanContext:n?Fv:Ov}}(e);return{resourceLogs:jv(t,r)}}function jv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+s+":"+o,l=a.get(u);l||(l=[],a.set(u,l)),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Lv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Dv(t.body),eventName:t.eventName,attributes:$v(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function $v(t){return Object.keys(t).map((e=>Lv(e,t[e])))}var Zv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class qv{static FromAttributeList(t,e){var r=new qv({},e);return r.qt=Vv(t),r.Ht=t.filter((t=>{var[e,r]=t;return Zv(r)})).length>0,r}constructor(t,e){var r;this.qt=void 0,this.Ht=!1,this.Vt=void 0,this.zt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.qt=Object.entries(i).map((t=>{var[e,r]=t;return Zv(r)&&(this.Ht=!0),[e,r]})),this.qt=Vv(this.qt),this.Vt=function(t){if("string"==typeof t||void 0===t)return t;return void Od.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Ht}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.qt.length;e++){var[r,i]=t.qt[e];t.qt[e]=[r,Zv(i)?yield i:i]}t.Ht=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Od.error("Accessing resource attributes before async attributes settled"),this.zt)return this.zt;var t={};for(var[e,r]of this.qt){var i;if(Zv(r))Od.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Ht||(this.zt=t),t}getRawAttributes(){return this.qt}get schemaUrl(){return this.Vt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,s=void 0===i||""===i;if(n)return i;if(s)return r;if(r===i)return r;return void Od.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return qv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Hv(t,e){return qv.FromAttributeList(Object.entries(t),e)}function Vv(t){return t.map((t=>{var[e,r]=t;return Zv(r)?[e,r.catch((t=>{Od.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var zv={serializeRequest:t=>{var e=Bv(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Gv{constructor(t){this.Lt=void 0,this.Lt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Lt.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Lt.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Lt.shutdown()}}function Yv(t){return new Gv(t.transport)}function Uv(t){return[429,502,503,504].includes(t)}function Wv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}}class Xv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Gt.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Gt.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{s.status>=200&&s.status<=299?(Od.debug("XHR success"),n({status:"success"})):s.status&&Uv(s.status)?n({status:"retryable",retryInMillis:Wv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Jv{constructor(t){this.Yt=void 0,this.Yt=t}send(t){var r=this;return e((function*(){var e=(yield r.Yt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Yt.url,new Blob([t],{type:e}))?(Od.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Kv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Gt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Gt.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Od.debug("response success"),{status:"success"}):Uv(u.status)?{status:"retryable",retryInMillis:Wv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Qv(t,e){return Av(t,e,Yv({transport:(r=t,new Xv(r))}));var r}function tf(t,e){return Av(t,e,Yv({transport:(r=t,new Kv(r))}));var r}function ef(t,e){return Av(t,e,Yv({transport:(r={url:t.url,headers:t.headers},new Jv(r))}));var r}function rf(t,i,n){return e((function*(){var e=r({},yield n()),s={};return null!=i&&Object.assign(s,yield i()),null!=t&&Object.assign(s,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Od.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(s,e)}))}function nf(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function sf(t,e,i){var n,s;return r({},function(t,e,r){var i,n,s,o,a,u;return{timeoutMillis:Fc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:rf(t.headers,e.headers,i.headers),url:null!==(n=null!==(s=nf(t.url))&&void 0!==s?s:e.url)&&void 0!==n?n:i.url})}function of(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function af(t,i,n){return sf({url:t.url,timeoutMillis:t.timeoutMillis,headers:of(t),concurrencyLimit:t.concurrencyLimit},{},function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function uf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tf:Qv:ef)(af(t,r,i),e)}class lf extends Nc{constructor(t){void 0===t&&(t={}),super(uf(t,zv,"v1/logs",{"Content-Type":"application/json"}))}}class hf{set severityText(t){this.Ut()||(this.Wt=t)}get severityText(){return this.Wt}set severityNumber(t){this.Ut()||(this.Xt=t)}get severityNumber(){return this.Xt}set body(t){this.Ut()||(this.Jt=t)}get body(){return this.Jt}get eventName(){return this.Kt}set eventName(t){this.Ut()||(this.Kt=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Wt=void 0,this.Xt=void 0,this.Jt=void 0,this.Kt=void 0,this.totalAttributesCount=0,this.Qt=!1,this.te=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=tv(null!=i?i:c),this.hrTimeObserved=tv(null!=n?n:c),h){var d=Dd.getSpanContext(h);d&&kd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.te=t.logRecordLimits,this.Kt=s,this.setAttributes(l)}setAttribute(t,e){return this.Ut()||null===e?this:0===t.length?(Od.warn("Invalid attribute key: "+t),this):jd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.te.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Od.warn("Dropping extra attributes."),this):(jd(e)?this.attributes[t]=this.ee(e):this.attributes[t]=e,this)):(Od.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}re(){this.Qt=!0}ee(t){var e=this.te.attributeValueLengthLimit;return e<=0?(Od.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.ie(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.ie(t,e):t)):t}ie(t,e){return t.length<=e?t:t.substring(0,e)}Ut(){return this.Qt&&Od.warn("Can not execute the operation on emitted log record"),this.Qt}}class cf{constructor(t,e){this.instrumentationScope=void 0,this.ne=void 0,this.instrumentationScope=t,this.ne=e}emit(t){var e=t.context||Fd.active(),i=new hf(this.ne,this.instrumentationScope,r({context:e},t));this.ne.activeProcessor.onEmit(i,e),i.re()}}class df{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class vf{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>_v(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class ff{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new vf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new df}}class pf{constructor(t){var e,r,i;void 0===t&&(t={}),this.se=void 0,this.ne=void 0;var n,s,o,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=fv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Hv({"service.name":"unknown_service",[zd]:Ud[zd],[Gd]:Ud[Gd],[Yd]:Ud[Yd]});this.ne=new ff(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(s=null!==(o=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.se=new Cv(this.oe,this)}getLogger(t,e,r){if(this.se.isCalled)return Od.warn("A shutdown LoggerProvider cannot provide a Logger"),Ic;t||Od.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.ne.loggers.has(n)||this.ne.loggers.set(n,new cf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.ne)),this.ne.loggers.get(n)}forceFlush(){return this.se.isCalled?(Od.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.se.promise):this.ne.activeProcessor.forceFlush()}shutdown(){return this.se.isCalled?(Od.warn("shutdown may only be called once per LoggerProvider"),this.se.promise):this.se.call()}oe(){return this.ne.activeProcessor.shutdown()}}class gf{constructor(t,e){var r,i,n,s,o,a,u,l;this.ae=void 0,this.ue=void 0,this.le=void 0,this.he=void 0,this.ce=void 0,this.de=!1,this.ve=[],this.fe=void 0,this.se=void 0,this.ae=t,this.ue=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.le=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.he=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.ce=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.se=new Cv(this.oe,this),this.ue>this.le&&(Od.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.ue=this.le)}onEmit(t){this.se.isCalled||this.pe(t)}forceFlush(){return this.se.isCalled?this.se.promise:this.ge()}shutdown(){return this.se.call()}oe(){var t=this;return e((function*(){t.onShutdown(),yield t.ge(),yield t.ae.shutdown()}))()}pe(t){this.ve.length>=this.le||(this.ve.push(t),this.me())}ge(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ve.length/this.ue),n=0;n<i;n++)r.push(this.ye());Promise.all(r).then((()=>{t()})).catch(e)}))}ye(){return this.be(),0===this.ve.length?Promise.resolve():new Promise(((t,e)=>{_v(this.Pt(this.ve.splice(0,this.ue)),this.ce).then((()=>t())).catch(e)}))}me(){if(!this.de){var t=()=>{this.de=!0,this.ye().then((()=>{this.de=!1,this.ve.length>0&&(this.be(),this.me())})).catch((t=>{this.de=!1,qd(t)}))};if(this.ve.length>=this.ue)return t();void 0===this.fe&&(this.fe=setTimeout((()=>t()),this.he),"number"!=typeof this.fe&&this.fe.unref())}}be(){void 0!==this.fe&&(clearTimeout(this.fe),this.fe=void 0)}Pt(t){var e=()=>Sv.Pt(this.ae,t).then((t=>{var e;t.code!==Hd.SUCCESS&&qd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(qd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,qd)}}class mf extends gf{constructor(t,e){super(t,e),this.we=void 0,this._e=void 0,this.Ie(e)}onShutdown(){"undefined"!=typeof document&&(this.we&&document.removeEventListener("visibilitychange",this.we),this._e&&document.removeEventListener("pagehide",this._e))}Ie(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.we=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._e=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.we),document.addEventListener("pagehide",this._e))}}var yf=1e4,bf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=yf),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;for(var o in s.add(t),t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o],u=e?e+"."+o:o;if(ti(a))bf(a,u,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=u.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[u]=a}}return r},wf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:os.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Rc.setGlobalLoggerProvider(new pf({resource:Hv(e),processors:[new mf(new lf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Rc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s=os.console[n];os.console[n]=(s=>function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];if(a.length>0){var l=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!si(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>yf&&(l=l.slice(0,yf)+"...",i.body_truncated="true"),e.emit({severityText:wf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":os.location.href},i,ti(a[0])?bf(a[0]):{})}),s.apply(os.console,a)}})(s)};for(var a of["debug","log","warn","error","info"])o(a)}};var _f=ds("[Error tracking]");function If(){return new Cn([new Dn,new Yn,new jn,new Bn,new zn,new Vn,new Zn,new Gn],Ln())}class Cf{constructor(t){var e,r;this.Ce=[],this.Se=If(),this._instance=t,this.Ce=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property($s))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.Ce=n,this._instance.persistence&&this._instance.persistence.register({[$s]:this.Ce,[Zs]:s})}get ke(){var t,e=!!this._instance.get_property(Zs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Se.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.xe(e)){if(this.Ae(e))return void _f.info("Skipping exception capture because a suppression rule matched");if(!this.ke&&this.Te(e))return void _f.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ee(e))return void _f.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Ae(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ii(r)&&r.length>0&&t.$exception_types.push(r),ii(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ce.some((t=>{var r=t.values.map((t=>{var r,i=Ul[t.operator],n=Jr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Te(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}Ee(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}xe(t){return!oi(t)&&Jr(t)}}var Sf=ds("[ExceptionAutocapture]"),kf=If(),xf={wrapOnError:t=>{var e=Un;e||Sf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],u=kf.buildFromUnknown(o||a,{mechanism:{handled:!1}});return t(u),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Un;e||Sf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,s=kf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(s),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||Sf.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=kf.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.errorWrappingFunctions=xf,os.posthogErrorWrappingFunctions=xf;var Af=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Jr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==co&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};os.__PosthogExtensions__=os.__PosthogExtensions__||{};var Tf={_patchFetch:(t,r,i)=>Ms(Un,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Af(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Ms(Un.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=new Request(s);return Af(t,e,r,l),i.call(this,n,l.url,o,a,u)}))};os.__PosthogExtensions__.tracingHeadersPatchFns=Tf,os.postHogTracingHeadersPatchFns=Tf;var Ef=-1,Rf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ef=e.timeStamp,t(e))}),!0)},Nf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&(((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e)))}},Mf=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ff=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Of=()=>{var t,e=Ff();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},Pf=function(t,e){void 0===e&&(e=-1);var r=Ff(),i="navigate";return Ef>=0?i="back-forward-cache":r&&(document.prerendering||Of()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Lf=new WeakMap;function Df(t,e){return Lf.get(t)||Lf.set(t,new e),Lf.get(t)}class Bf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&t.startTime-i.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var jf,$f=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Zf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},qf=-1,Hf=new Set,Vf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Hf)e();isFinite(qf)||(qf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zf,!0))}},Gf=()=>{if(qf<0){var t,e=Of(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;qf=null!=r?r:Vf(),addEventListener("visibilitychange",zf,!0),addEventListener("prerenderingchange",zf,!0),Rf((()=>{setTimeout((()=>{qf=Vf()}))}))}return{get firstHiddenTime(){return qf},onHidden(t){Hf.add(t)}}},Yf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Uf=[1800,3e3],Wf=function(t,e){void 0===e&&(e={}),Yf((()=>{var r,i=Gf(),n=Pf("FCP"),s=$f("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Of(),0),n.entries.push(e),r(!0)))}));s&&(r=Nf(t,n,Uf,e.reportAllChanges),Rf((i=>{n=Pf("FCP"),r=Nf(t,n,Uf,e.reportAllChanges),Mf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xf=[.1,.25],Jf=0,Kf=1/0,Qf=0,tp=t=>{for(var e of t)e.interactionId&&(Kf=Math.min(Kf,e.interactionId),Qf=Math.max(Qf,e.interactionId),Jf=Qf?(Qf-Kf)/7+1:0)},ep=()=>{var t;return jf?Jf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},rp=0;class ip{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){rp=ep(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((ep()-rp)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var np=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Zf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},sp=[200,500];class op{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var ap=[2500,4e3],up={onLCP:function(t,e){void 0===e&&(e={}),Yf((()=>{var r,i=Gf(),n=Pf("LCP"),s=Df(e,op),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),o.startTime<i.firstHiddenTime&&(n.value=Math.max(o.startTime-Of(),0),n.entries=[o],r())},a=$f("largest-contentful-paint",o);if(a){r=Nf(t,n,ap,e.reportAllChanges);var u=Zf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(np(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Rf((i=>{n=Pf("LCP"),r=Nf(t,n,ap,e.reportAllChanges),Mf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(t,e){void 0===e&&(e={});var r=Gf();Wf(Zf((()=>{var i,n=Pf("CLS",0),s=Df(e,Bf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=$f("layout-shift",o);a&&(i=Nf(t,n,Xf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Rf((()=>{s.i=0,n=Pf("CLS",0),i=Nf(t,n,Xf,e.reportAllChanges),Mf((()=>i()))})),setTimeout(i))})))},onFCP:Wf,onINP:function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Gf();Yf((()=>{var i;"interactionCount"in performance||jf||(jf=$f("event",tp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Pf("INP"),o=Df(e,ip),a=t=>{np((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},u=$f("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Nf(t,s,sp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Rf((()=>{o.v(),s=Pf("INP"),n=Nf(t,s,sp,e.reportAllChanges)})))}))}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.postHogWebVitalsCallbacks=up,os.postHogWebVitalsCallbacks=up,os.__PosthogExtensions__.loadWebVitalsCallbacks=()=>up;class lp{constructor(t){this.disabled=!1===t;var e=ti(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var hp="$copy_autocapture",cp=ds("[AutoCapture]");function dp(t,e){return e.length>t?e.slice(0,t)+"...":e}function vp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!po(e));return e}function fp(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};ko.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=dp(1024,Vo(t)):s.$el_text=dp(1024,Co(t)));var o=_o(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),ps(t.attributes,(function(r){var n;if((!Lo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Ho(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=bo(o).join(" ")),s["attr__"+r.name]=dp(1024,o)}}));for(var a=1,u=1,l=t;l=vp(l);)a++,l.tagName===t.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}function pp(t,e){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!go(h,"body");)yo(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(ps(l,(t=>{var e=Po(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Ho(f)&&f),Vr(_o(t),"ph-no-capture")&&(p=!0),d.push(fp(t,s,o,a));var r=function(t){if(!Po(t))return{};var e={};return ps(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ho(i)&&(e[r]=i)}})),e}(t);gs(v,r)})),p)return{props:{},explicitNoCapture:p};if(o||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Vo(t):d[0].$el_text=Co(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=As(f))?void 0:g.host,b=null==Un||null==(m=Un.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:gs({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Go(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class gp{constructor(t){this.Re=!1,this.Ne=null,this.Me=!1,this.instance=t,this.rageclicks=new lp(t.config.rageclick),this.Fe=null}get Oe(){var t,e,r=ti(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Pe(){if(this.isBrowserSupported()){if(Un&&ts){var t=t=>{t=t||(null==Un?void 0:Un.event);try{this.Le(t)}catch(t){cp.error("Failed to capture event",t)}};if(xs(ts,"submit",t,{capture:!0}),xs(ts,"change",t,{capture:!0}),xs(ts,"click",t,{capture:!0}),this.Oe.capture_copied_text){var e=t=>{t=t||(null==Un?void 0:Un.event),this.Le(t,hp)};xs(ts,"copy",e,{capture:!0}),xs(ts,"cut",e,{capture:!0})}}}else cp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Re&&(this.Pe(),this.Re=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Me=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ds]:!!t.autocapture_opt_out}),this.Ne=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fe=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fe)||e.forEach((e=>{var i=null==ts?void 0:ts.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Ds],i=this.Ne;if(si(i)&&!li(r)&&!this.instance.De())return!1;var n=null!==(e=this.Ne)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Le(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=So(t);if(mo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&No(i,this.instance.config.rageclick)&&this.Le(t,"$rageclick");var n=e===hp;if(i&&Oo(i,t,this.Oe,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=pp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:this.Me});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===hp){var u,l=Io(null==Un||null==(u=Un.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Kr(null==ts?void 0:ts.querySelectorAll)}}var mp={};function yp(t){return function(t,e){var r=mp[t];if(r)return r;var i=e[t];if(Qr(i)&&!as())return mp[t]=i.bind(e);var n=e.document;if(n&&Kr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[t]&&(i=o[t]),n.head.removeChild(s)}catch(e){cs.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Kr(i)?mp[t]=i.bind(e):i}("MutationObserver",t)}function bp(t,e){return ai(t)&&t>=e}class wp{Be(t){var e,r,i,n,s,o=this.je((null==t?void 0:t.__onCapture)||this.$e.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.Ze=[],this.je=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.qe=t=>{var e=function(t){var e=So(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);si(e)||this.He(e)||this.Ze.push(e),this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))},this.Ge=()=>{var t=Date.now();t%50==0&&this.Ze.forEach((e=>{ri(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ye=()=>{this.Ue=Date.now()},this.instance=t,this.Oe=this.Be(e),this._onCapture=this.Oe.__onCapture}start(t){this.We(),this.Xe(),this.Je(),this.Ke(t)}Ke(t){if(!this.Qe){var e=yp(os);this.Qe=new e((t=>{this.tr(t)})),this.Qe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qe)||t.disconnect(),this.Qe=void 0,os.removeEventListener("click",this.qe),os.removeEventListener("scroll",this.Ge,{capture:!0}),os.removeEventListener("selectionchange",this.Ye)}tr(t){this.er=Date.now()}We(){xs(os,"click",this.qe)}Xe(){xs(os,"scroll",this.Ge,{capture:!0})}Je(){xs(os,"selectionchange",this.Ye)}He(t){if(!t)return!0;if(!this.Oe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(fo(t.node))return!0;var r=this.Ze.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!go(t.node,"html")&&po(t.node)&&!ko.includes(t.node.tagName.toLowerCase()))}ze(){if(this.Ze.length){clearTimeout(this.Ve),this.Ve=void 0;var t=this.Ze;for(var e of(this.Ze=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.er&&e.timestamp<=this.er?this.er-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ue&&e.timestamp<=this.Ue?this.Ue-e.timestamp:void 0;var i=bp(e.scrollDelayMs,this.Oe.scroll_threshold_ms),n=bp(e.selectionChangedDelayMs,this.Oe.selection_change_threshold_ms),s=bp(e.mutationDelayMs,this.Oe.mutation_threshold_ms),o=bp(e.absoluteDelayMs,1.1*this.Oe.mutation_threshold_ms),a=ai(e.scrollDelayMs)&&e.scrollDelayMs<this.Oe.scroll_threshold_ms,u=ai(e.mutationDelayMs)&&e.mutationDelayMs<this.Oe.mutation_threshold_ms,l=ai(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.Oe.selection_change_threshold_ms;a||u||l||(i||s||o||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.er,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.Oe.mutation_threshold_ms&&this.Ze.push(e))}this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))}}$e(t,e){this.instance.capture("$dead_click",r({},e,pp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new wp(t,e);var _p=ds("[ExternalScriptsLoader]"),Ip=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return _p.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==ts?void 0:ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;o<i.length;o++)if(n=s())return n.v;var a=()=>{if(!ts)return r("document not found");var i=ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)ts.head.appendChild(i);else{var n,s=ts.querySelectorAll("body > script");if(s.length>0)null==(n=s[0].parentNode)||n.insertBefore(i,s[0]);else ts.body.appendChild(i)}};null!=ts&&ts.body?a():null==ts||ts.addEventListener("DOMContentLoaded",a)};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",i);Ip(t,s,r)},os.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Ip(t,i,r)};var Cp="";var Sp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function kp(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=ts),Cp)return Cp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+rl();!Cp&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Cp=s)}return Cp}(t);if(!r){var i=(t=>{var e=t.match(Sp);return e?e[0]:""})(t);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var xp={rr:()=>!!ts,ir:function(t){cs.error("cookieStore error: "+t)},nr:function(t){if(ts){try{for(var e=t+"=",r=ts.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},sr:function(t){var e;try{e=JSON.parse(xp.nr(t))||{}}catch(t){}return e},ar:function(t,e,r,i,n){if(ts)try{var s="",o="",a=kp(ts.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),s="; expires="+u.toUTCString()}n&&(o="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+l.length),ts.cookie=l,l}catch(t){return}},ur:function(t,e){if(null!=ts&&ts.cookie)try{xp.ar(t,"",-1,e)}catch(t){return}}},Ap=null,Tp={rr:function(){if(!si(Ap))return Ap;var t=!0;if(ri(Un))t=!1;else try{var e="__mplssupport__";Tp.ar(e,"xyz"),'"xyz"'!==Tp.nr(e)&&(t=!1),Tp.ur(e)}catch(e){t=!1}return t||cs.error("localStorage unsupported; falling back to cookie store"),Ap=t,t},ir:function(t){cs.error("localStorage error: "+t)},nr:function(t){try{return null==Un?void 0:Un.localStorage.getItem(t)}catch(t){Tp.ir(t)}return null},sr:function(t){try{return JSON.parse(Tp.nr(t))||{}}catch(t){}return null},ar:function(t,e){try{null==Un||Un.localStorage.setItem(t,JSON.stringify(e))}catch(t){Tp.ir(t)}},ur:function(t){try{null==Un||Un.localStorage.removeItem(t)}catch(t){Tp.ir(t)}}},Ep=["$device_id","distinct_id",Ys,Us,lo,uo],Rp={},Np={rr:function(){return!0},ir:function(t){cs.error("memoryStorage error: "+t)},nr:function(t){return Rp[t]||null},sr:function(t){return Rp[t]||null},ar:function(t,e){Rp[t]=e},ur:function(t){delete Rp[t]}},Mp=null,Fp={rr:function(){if(!si(Mp))return Mp;if(Mp=!0,ri(Un))Mp=!1;else try{var t="__support__";Fp.ar(t,"xyz"),'"xyz"'!==Fp.nr(t)&&(Mp=!1),Fp.ur(t)}catch(t){Mp=!1}return Mp},ir:function(t){cs.error("sessionStorage error: ",t)},nr:function(t){try{return null==Un?void 0:Un.sessionStorage.getItem(t)}catch(t){Fp.ir(t)}return null},sr:function(t){try{return JSON.parse(Fp.nr(t))||null}catch(t){}return null},ar:function(t,e){try{null==Un||Un.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Fp.ir(t)}},ur:function(t){try{null==Un||Un.sessionStorage.removeItem(t)}catch(t){Fp.ir(t)}}},Op=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Pp{constructor(t){this._instance=t}get Oe(){return this._instance.config}get consent(){return this.lr()?Op.DENIED:this.hr}isOptedOut(){return"always"===this.Oe.cookieless_mode||(this.consent===Op.DENIED||this.consent===Op.PENDING&&(this.Oe.opt_out_capturing_by_default||"on_reject"===this.Oe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Op.DENIED}optInOut(t){this.cr.ar(this.dr,t?1:0,this.Oe.cookie_expiration,this.Oe.cross_subdomain_cookie,this.Oe.secure_cookie)}reset(){this.cr.ur(this.dr,this.Oe.cross_subdomain_cookie)}get dr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get hr(){var t=this.cr.nr(this.dr);return gi(t)?Op.GRANTED:Vr(mi,t)?Op.DENIED:Op.PENDING}get cr(){if(!this.vr){var t=this.Oe.opt_out_capturing_persistence_type;this.vr="localStorage"===t?Tp:xp;var e="localStorage"===t?xp:Tp;e.nr(this.dr)&&(this.vr.nr(this.dr)||this.optInOut(gi(e.nr(this.dr))),e.ur(this.dr,this.Oe.cross_subdomain_cookie))}return this.vr}lr(){return!!this.Oe.respect_dnt&&!!ks([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,os.doNotTrack],(t=>gi(t)))}}var Lp=ds("[Dead Clicks]"),Dp=()=>!0,Bp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Hs)),i=t.instance.config.capture_dead_clicks;return li(i)?i:!!ti(i)||r};class jp{get lazyLoadedDeadClicksAutocapture(){return this.pr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[Hs]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this.gr((()=>{this.mr()})):this.stop()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Lp.error("failed to load script",e):t()}))}mr(){var t;if(ts){if(!this.pr&&null!=(t=os.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=ti(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.pr=os.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.pr.start(ts),Lp.info("starting...")}}else Lp.error("`document` not found. Cannot start.")}stop(){this.pr&&(this.pr.stop(),this.pr=void 0,Lp.info("stopping..."))}}var $p=ds("[ExceptionAutocapture]");class Zp{constructor(t){var e,r,i;this.yr=()=>{var t;if(Un&&this.isEnabled&&null!=(t=os.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=os.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=os.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=os.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.br&&this.Oe.capture_unhandled_errors&&(this.br=e(this.captureException.bind(this))),!this.wr&&this.Oe.capture_unhandled_rejections&&(this.wr=r(this.captureException.bind(this))),!this._r&&this.Oe.capture_console_errors&&(this._r=i(this.captureException.bind(this)))}catch(t){$p.error("failed to start",t),this.Ir()}}},this._instance=t,this.Cr=!(null==(e=this._instance.persistence)||!e.props[js]),this.Sr=new bi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,k:$p}),this.Oe=this.kr(),this.startIfEnabledOrStop()}kr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(t)?e=r({},e,t):(ri(t)?this.Cr:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Oe.capture_console_errors||this.Oe.capture_unhandled_errors||this.Oe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?($p.info("enabled"),this.Ir(),this.gr(this.yr)):this.Ir()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return $p.error("failed to load script",e);t()}))}Ir(){var t,e,r;null==(t=this.br)||t.call(this),this.br=void 0,null==(e=this.wr)||e.call(this),this.wr=void 0,null==(r=this._r)||r.call(this),this._r=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.Cr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[js]:this.Cr}),this.Oe=this.kr(),this.startIfEnabledOrStop()}onConfigChange(){this.Oe=this.kr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Sr.consumeRateLimit(i)?$p.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class qp{constructor(t){var e;this._instance=t,this.Ar=(null==Un||null==(e=Un.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Tr&&this.Tr(),this.Tr=void 0,cs.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Un&&Un.history){var r=this;null!=(t=Un.history.pushState)&&t.__posthog_wrapped__||Ms(Un.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("pushState")})),null!=(e=Un.history.replaceState)&&e.__posthog_wrapped__||Ms(Un.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("replaceState")})),this.Rr()}}Er(t){try{var e,r=null==Un||null==(e=Un.location)?void 0:e.pathname;if(!r)return;r!==this.Ar&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Ar=r}catch(e){cs.error("Error capturing "+t+" pageview",e)}}Rr(){if(!this.Tr){var t=()=>{this.Er("popstate")};xs(Un,"popstate",t),this.Tr=()=>{Un&&Un.removeEventListener("popstate",t)}}}}var Hp=ds("[SegmentIntegration]");function Vp(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||rl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(io,"identified")),e()},n=r.user();"then"in n&&Kr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Hp.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Hp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Hp.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var zp="posthog-js";function Gp(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Yp{constructor(t,e,r,i,n,s){this.name=zp,this.setupOnce=function(o){o(Gp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var Up=null!=Un&&Un.location?Ns(Un.location.hash,"__posthog")||Ns(location.hash,"state"):null,Wp="_postHogToolbarParams",Xp=ds("[Toolbar]"),Jp=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Jp||{});class Kp{constructor(t){this.instance=t}Nr(t){os.ph_toolbar_state=t}Mr(){var t;return null!==(t=os.ph_toolbar_state)&&void 0!==t?t:Jp.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Un||!ts)return!1;t=null!=t?t:Un.location,r=null!=r?r:Un.history;try{if(!e){try{Un.localStorage.setItem("test","test"),Un.localStorage.removeItem("test")}catch(t){return!1}e=null==Un?void 0:Un.localStorage}var i,n=Up||Ns(t.hash,"__posthog")||Ns(t.hash,"state"),s=n?bs((()=>JSON.parse(atob(decodeURIComponent(n)))))||bs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Wp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Fr(t){var e=os.ph_load_toolbar||os.ph_load_editor;!oi(e)&&Kr(e)?e(t,this.instance):Xp.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==ts||!ts.getElementById(ho));if(!Un||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Un.localStorage.setItem(Wp,JSON.stringify(r({},n,{source:void 0}))),this.Mr()===Jp.LOADED)this.Fr(n);else if(this.Mr()===Jp.UNINITIALIZED){var s;this.Nr(Jp.LOADING),null==(s=os.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Xp.error("[Toolbar] Failed to load",t),void this.Nr(Jp.UNINITIALIZED);this.Nr(Jp.LOADED),this.Fr(n)})),xs(Un,"turbolinks:load",(()=>{this.Nr(Jp.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Or(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var Qp=ds("[TracingHeaders]");class tg{constructor(t){this.Pr=void 0,this.Lr=void 0,this.yr=()=>{var t,e;ri(this.Pr)&&(null==(t=os.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this.Lr)&&(null==(e=os.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Qp.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.gr(this.yr):(null==(t=this.Pr)||t.call(this),null==(e=this.Lr)||e.call(this),this.Pr=void 0,this.Lr=void 0)}}var eg="https?://(.*)",rg=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ig=ms(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rg),ng="<masked>",sg=["li_fat_id"];function og(t,e,r){if(!ts)return{};var i,n=e?ms([],rg,r||[]):[],s=ag(Rs(ts.URL,n,ng),t),o=(i={},ps(sg,(function(t){var e=xp.nr(t);i[t]=e||null})),i);return gs(o,s)}function ag(t,e){var r=ig.concat(e||[]),i={};return ps(r,(function(e){var r=Es(t,e);i[e]=r||null})),i}function ug(t){var e=function(t){return t?0===t.search(eg+"google.([^/?]*)")?"google":0===t.search(eg+"bing.com")?"bing":0===t.search(eg+"yahoo.com")?"yahoo":0===t.search(eg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!si(e)){i.$search_engine=e;var n=ts?Es(ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function lg(){return navigator.language||navigator.userLanguage}function hg(){return(null==ts?void 0:ts.referrer)||"$direct"}function cg(t,e){var r=t?ms([],rg,e||[]):[],i=null==es?void 0:es.href.substring(0,1e3);return{r:hg().substring(0,1e3),u:i?Rs(i,r,ng):void 0}}function dg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=As(r))?void 0:e.host};if(i){n.$current_url=i;var s=As(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=ag(i);gs(n,o)}if(r){var a=ug(r);gs(n,a)}return n}function vg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function fg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function pg(t,e){if(!ss)return{};var r,i=t?ms([],rg,e||[]):[],[n,s]=function(t){for(var e=0;e<yn.length;e++){var[r,i]=yn[e],n=r.exec(t),s=n&&(Kr(i)?i(n,t):i);if(s)return s}return["",""]}(ss);return gs(_s({$os:n,$os_version:s,$browser:pn(ss,navigator.vendor),$device:bn(ss),$device_type:wn(ss),$timezone:vg(),$timezone_offset:fg()}),{$current_url:Rs(null==es?void 0:es.href,i,ng),$host:null==es?void 0:es.host,$pathname:null==es?void 0:es.pathname,$raw_user_agent:ss.length>1e3?ss.substring(0,997)+"...":ss,$browser_version:mn(ss,navigator.vendor),$browser_language:lg(),$browser_language_prefix:(r=lg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Un?void 0:Un.screen.height,$screen_width:null==Un?void 0:Un.screen.width,$viewport_height:null==Un?void 0:Un.innerHeight,$viewport_width:null==Un?void 0:Un.innerWidth,$lib:"web",$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var gg=ds("[Web Vitals]"),mg=9e5;class yg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Br=()=>{clearTimeout(this.jr),0!==this.B.metrics.length&&(this._instance.capture("$web_vitals",this.B.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.pe=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ri(i))gg.error("Could not read session ID. Dropping metrics!");else{this.B=this.B||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.$r();if(!ri(n))if(oi(null==t?void 0:t.name)||oi(null==t?void 0:t.value))gg.error("Invalid metric received",t);else if(this.Zr&&t.value>=this.Zr)gg.error("Ignoring metric with value >= "+this.Zr,t);else this.B.url!==n&&(this.Br(),this.jr=setTimeout(this.Br,this.flushToCaptureTimeoutMs)),ri(this.B.url)&&(this.B.url=n),this.B.firstMetricTimestamp=ri(this.B.firstMetricTimestamp)?Date.now():this.B.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.B.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.B.metrics.length===this.allowedMetrics.length&&this.Br()}},this.yr=()=>{if(!this.Re){var t,e,r,i,n=os.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.pe.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.pe.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.pe.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.pe.bind(this)),this.Re=!0):gg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Dr=!(null==(e=this._instance.persistence)||!e.props[qs]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=ti(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return oi(r)?(null==(e=this._instance.persistence)?void 0:e.props[zs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=t&&t}get Zr(){var t=ti(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:mg;return 0<t&&t<=6e4?mg:t}get isEnabled(){var t=null==es?void 0:es.protocol;if("http:"!==t&&"https:"!==t)return gg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:li(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return li(e)?e:this.Dr}startIfEnabled(){this.isEnabled&&!this.Re&&(gg.info("enabled, starting..."),this.gr(this.yr))}onRemoteConfig(t){var e=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qs]:e}),this._instance.persistence.register({[zs]:r})),this.Dr=e,this.startIfEnabled()}gr(t){var e,r;if(null!=(e=os.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks)t();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(e=>{e?gg.error("failed to load script",e):t()}))}}$r(){var t=Un?Un.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?ms([],rg,r||[]):[];return Rs(t,i,ng)}gg.error("Could not determine current URL")}}var bg=ds("[Heatmaps]");function wg(t){return ti(t)&&"clientX"in t&&"clientY"in t&&ai(t.clientX)&&ai(t.clientY)}class _g{constructor(t){var e;this.Dr=!1,this.Re=!1,this.qr=null,this.instance=t,this.Dr=!(null==(e=this.instance.persistence)||!e.props[Bs]),this.rageclicks=new lp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return ti(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return oi(this.instance.config.capture_heatmaps)?oi(this.instance.config.enable_heatmaps)?this.Dr:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Re)return;bg.info("starting..."),this.Hr(),this.Vr()}else{var t;clearInterval(null!==(t=this.qr)&&void 0!==t?t:void 0),this.zr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bs]:e}),this.Dr=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.B;return this.B=void 0,t}Gr(t){this.qe(t.originalEvent,"deadclick")}Vr(){this.qr&&clearInterval(this.qr),this.qr=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(ts)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Hr(){Un&&ts&&(this.Ur=this.Yr.bind(this),xs(Un,"beforeunload",this.Ur),this.Wr=t=>this.qe(t||(null==Un?void 0:Un.event)),xs(ts,"click",this.Wr,{capture:!0}),this.Xr=t=>this.Jr(t||(null==Un?void 0:Un.event)),xs(ts,"mousemove",this.Xr,{capture:!0}),this.Kr=new jp(this.instance,Dp,this.Gr.bind(this)),this.Kr.startIfEnabledOrStop(),this.Qr=this.Vr.bind(this),xs(ts,"visibilitychange",this.Qr),this.Re=!0)}zr(){var t;Un&&ts&&(this.Ur&&Un.removeEventListener("beforeunload",this.Ur),this.Wr&&ts.removeEventListener("click",this.Wr,{capture:!0}),this.Xr&&ts.removeEventListener("mousemove",this.Xr,{capture:!0}),this.Qr&&ts.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.ti),null==(t=this.Kr)||t.stop(),this.Re=!1)}ei(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&po(i)&&!go(i,"body");){if(i===r)return!1;if(Vr(e,null==Un?void 0:Un.getComputedStyle(i).position))return!0;i=Ao(i)}return!1}(So(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}qe(t,e){var i;if(void 0===e&&(e="click"),!fo(t.target)&&wg(t)){var n=this.ei(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.ri(r({},n,{type:"rageclick"})),this.ri(n)}}Jr(t){!fo(t.target)&&wg(t)&&(clearTimeout(this.ti),this.ti=setTimeout((()=>{this.ri(this.ei(t,"mousemove"))}),500))}ri(t){if(Un){var e=Un.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?ms([],rg,i||[]):[],s=Rs(e,n,ng);this.B=this.B||{},this.B[s]||(this.B[s]=[]),this.B[s].push(t)}}Yr(){this.B&&!ei(this.B)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ig{constructor(t){this.ii=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ni=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.si()}si(){var t;this.oi=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ii)}destroy(){var t;null==(t=this.oi)||t.call(this),this.oi=void 0}doPageView(t,e){var r,i=this.ai(t,e);return this.ni={pathname:null!==(r=null==Un?void 0:Un.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ai(t,null==(e=this.ni)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ni)?void 0:t.pageViewId}}ai(t,e){var r=this.ni;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ri(s)||ri(o)||ri(a)||ri(u)||ri(l)||ri(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=s<=1?1:yi(o/s,0,1,cs),d=s<=1?1:yi(a/s,0,1,cs),v=u<=1?1:yi(l/u,0,1,cs),f=u<=1?1:yi(h/u,0,1,cs);i=gs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Cg=ds("[FeatureFlags]"),Sg=ds("[FeatureFlags]",{debugEnabled:!0}),kg="errors_while_computing_flags",xg="flag_missing",Ag="quota_limited",Tg="timeout",Eg="connection_error",Rg="unknown_error",Ng=t=>"api_error_"+t,Mg="$active_feature_flags",Fg="$override_feature_flags",Og="$feature_flag_payloads",Pg="$override_feature_flag_payloads",Lg="$feature_flag_request_id",Dg="$feature_flag_evaluated_at",Bg=t=>{var e={};for(var[r,i]of ys(t||{}))i&&(e[r]=i);return e},jg=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Cg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},$g=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Zg{constructor(t){this.ui=!1,this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.pi=!1,this._instance=t,this.featureFlagEventHandlers=[]}gi(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.pi||(Cg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.pi=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Cg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}mi(){return this.gi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.vi=!0;else{var t=!this.yi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.bi({disableFlags:t})}}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Js),e=this._instance.get_property(Fg),i=this._instance.get_property(Pg);if(!i&&!e)return t||{};var n=gs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,u,l=n[o],h=null==e?void 0:e[o],c=ri(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ri(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[o]=f}return this.ui||(Cg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ui=!0),n}getFlagVariants(){var t=this._instance.get_property(Ws),e=this._instance.get_property(Fg);if(!e)return t||{};for(var r=gs({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Cg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ui=!0),r}getFlagPayloads(){var t=this._instance.get_property(Og),e=this._instance.get_property(Pg);if(!e)return t||{};for(var r=gs({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Cg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ui=!0),r}reloadFeatureFlags(){this.ci||this._instance.config.advanced_disable_feature_flags||this.yi||(this._instance.wi.emit("featureFlagsReloading",!0),this.yi=setTimeout((()=>{this.bi()}),5))}Ii(){clearTimeout(this.yi),this.yi=void 0}ensureFlagsLoaded(){this.li||this.hi||this.yi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ci=t}bi(t){var e;if(this.Ii(),!this._instance.De())if(this.hi)this.di=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Ks)||{}),group_properties:this._instance.get_property(Qs)};si(n)||ri(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.mi()&&(s.evaluation_contexts=this.gi());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);o&&(s.timezone=vg()),this.hi=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this._instance.config.disable_compression?void 0:nl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n,o=!0;(200===t.statusCode&&(this.di||(this.$anon_distinct_id=void 0),o=!1),this.hi=!1,this.vi)||(this.vi=!0,this._instance.Ci(null!==(n=t.json)&&void 0!==n?n:{}));if(!s.disable_flags||this.di){this.fi=!o;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?Tg:Eg):a.push(Rg):200!==t.statusCode&&a.push(Ng(t.statusCode)),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push(kg);var u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes($g.FeatureFlags));if(u&&a.push(Ag),null==(i=this._instance.persistence)||i.register({[ro]:a}),u)Cg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var l;if(!s.disable_flags)this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},o);this.di&&(this.di=!1,this.bi())}}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}Cg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this._instance.get_property(Lg)||void 0,u=this._instance.get_property(Dg)||void 0,l=this._instance.get_property(eo)||{};if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(o))){var h,c,d,v,f,p,g,m,y,b;Jr(l[t])?l[t].push(o):l[t]=[o],null==(h=this._instance.persistence)||h.register({[eo]:l});var w=this.getFeatureFlagDetails(t),_=[...null!==(c=this._instance.get_property(ro))&&void 0!==c?c:[]];ri(n)&&_.push(xg);var I={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(d=this._instance.config.bootstrap)||null==(d=d.featureFlags)?void 0:d[t])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[t])||null,$used_bootstrap_value:!this.fi};ri(null==w||null==(f=w.metadata)?void 0:f.version)||(I.$feature_flag_version=w.metadata.version);var C,S=null!==(p=null==w||null==(g=w.reason)?void 0:g.description)&&void 0!==p?p:null==w||null==(m=w.reason)?void 0:m.code;if(S&&(I.$feature_flag_reason=S),null!=w&&null!=(y=w.metadata)&&y.id&&(I.$feature_flag_id=w.metadata.id),ri(null==w?void 0:w.original_variant)&&ri(null==w?void 0:w.original_enabled)||(I.$feature_flag_original_response=ri(w.original_variant)?w.original_enabled:w.original_variant),null!=w&&null!=(b=w.metadata)&&b.original_payload)I.$feature_flag_original_payload=null==w||null==(C=w.metadata)?void 0:C.original_payload;_.length&&(I.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",I)}if(i){var k=s;if(!ri(s))try{k=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else Cg.warn('getFeatureFlagResult for key "'+t+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.mi()&&(i.evaluation_contexts=this.gi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:nl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ri(r)?void 0:!!r}Cg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=jg(t),a=o.flags,u=o.featureFlags,l=o.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Jr(u)){Cg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[Mg]:u,[Ws]:d})}else{var f=u,p=l,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=r({},i,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=r({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=r({},s,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=r({},i,f),p=r({},n,p),g=r({},s,g);e&&e.register(r({[Mg]:Object.keys(Bg(f)),[Ws]:f||{},[Og]:p||{},[Js]:g||{}},h?{[Lg]:h}:{},c?{[Dg]:c}:{}))}}}(t,this._instance.persistence,i,n,s),this.Si(e)}}override(t,e){void 0===e&&(e=!1),Cg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Cg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Fg),this._instance.persistence.unregister(Pg),this.Si(),Sg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ui=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Fg),Sg.info("Flag overrides cleared");else if(r.flags){if(Jr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Fg]:i})}else this._instance.persistence.register({[Fg]:r.flags});Sg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Pg),Sg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Pg]:r.payloads}),Sg.info("Payload overrides set",{payloads:r.payloads}))),void this.Si()}this.Si()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.li){var{flags:e,flagVariants:r}=this.ki();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this._instance.get_property(Xs)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Mg]:Object.keys(Bg(u)),[Ws]:u}),this.Si()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Xs),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Xs),null==(i=this._instance.persistence)||i.register({[Xs]:n}),t(n)}}})}ki(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Si(t){var{flags:e,flagVariants:r}=this.ki();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Ks)||{};this._instance.register({[Ks]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ks)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Qs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Qs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Qs)||{};this._instance.register({[Qs]:r({},e,{[t]:{}})})}else this._instance.unregister(Qs)}reset(){this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.$anon_distinct_id=void 0,this.Ii(),this.ui=!1}}var qg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Hg{constructor(t,e){this.Oe=t,this.props={},this.xi=!1,this.Ai=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.cr=this.Ti(t),this.load(),t.debug&&cs.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Ei}Ti(t){-1===qg.indexOf(t.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Ep,...t];return r({},Tp,{sr:function(t){try{var e={};try{e=xp.sr(t)||{}}catch(t){}var r=gs(e,JSON.parse(Tp.nr(t)||"{}"));return Tp.ar(t,r),r}catch(t){}return null},ar:function(t,r,i,n,s,o){try{Tp.ar(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&xp.ar(t,a,i,n,s,o)}catch(t){Tp.ir(t)}},ur:function(t,e){try{null==Un||Un.localStorage.removeItem(t),xp.ur(t,e)}catch(t){Tp.ir(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Tp.rr()?Tp:"localstorage+cookie"===i&&e.rr()?e:"sessionstorage"===i&&Fp.rr()?Fp:"memory"===i?Np:"cookie"===i?xp:e.rr()?e:xp}properties(){var t={};return ps(this.props,(function(e,r){if(r===Ws&&ti(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else o=r,a=!1,(si(s=vo)?a:Kn&&s.indexOf===Kn?-1!=s.indexOf(o):(ps(s,(function(t){if(a||(a=t===o))return vs})),a))||(t[r]=e);var s,o,a})),t}load(){if(!this.Ei){var t=this.cr.sr(this.Ai);t&&(this.props=gs({},t))}}save(){this.Ei||this.cr.ar(this.Ai,this.props,this.Ri,this.Ni,this.Mi,this.Oe.debug)}remove(){this.cr.ur(this.Ai,!1),this.cr.ur(this.Ai,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(ti(t)){ri(e)&&(e="None"),this.Ri=ri(r)?this.Fi:r;var i=!1;if(ps(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(ti(t)){this.Ri=ri(e)?this.Fi:e;var r=!1;if(ps(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.xi){var t=og(this.Oe.custom_campaign_params,this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties);ei(_s(t))||this.register(t),this.xi=!0}}update_search_keyword(){var t;this.register((t=null==ts?void 0:ts.referrer)?ug(t):{})}update_referrer_info(){var t;this.register_once({$referrer:hg(),$referring_domain:null!=ts&&ts.referrer&&(null==(t=As(ts.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[ao]||this.register_once({[uo]:cg(this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ps([ao,oo],(e=>{var r=this.props[e];r&&ps(r,(function(e,r){t["$initial_"+Gr(r)]=e}))}));var e,r,i=this.props[uo];if(i){var n=(e=dg(i),r={},ps(e,(function(t,e){r["$initial_"+Gr(e)]=t})),r);gs(t,n)}return t}safe_merge(t){return ps(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Fi=this.Ri=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.Ti(t),n=this.props;this.clear(),this.cr=i,this.props=n,this.save()}}set_disabled(t){this.Ei=t,this.Ei?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ni&&(this.Ni=t,this.remove(),this.save())}set_secure(t){t!==this.Mi&&(this.Mi=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Ls]||{};r[t]=e,this.props[Ls]=r,this.save()}remove_event_timer(t){var e=(this.props[Ls]||{})[t];return ri(e)||(delete this.props[Ls][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Vg=ds("[Product Tours]"),zg="ph_product_tours";class Gg{constructor(t){this.Oi=null,this.Pi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Vs]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.Oi||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Vs))||this.gr((()=>this.Li()))}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Vg.error("Could not load product tours script",e):t()}))}Li(){var t;!this.Oi&&null!=(t=os.__PosthogExtensions__)&&t.generateProductTours&&(this.Oi=os.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Jr(this.Pi)||e){var r=this._instance.persistence;if(r){var i=r.props[zg];if(Jr(i)&&!e)return this.Pi=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Vg.error(n),void t([],{isLoaded:!1,error:n})}var s=Jr(e.json.product_tours)?e.json.product_tours:[];this.Pi=s,r&&r.register({[zg]:s}),t(s,{isLoaded:!0})}})}else t(this.Pi,{isLoaded:!0})}getActiveProductTours(t){oi(this.Oi)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Oi.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Oi)||e.showTourById(t)}previewTour(t){this.Oi?this.Oi.previewTour(t):this.gr((()=>{var e;this.Li(),null==(e=this.Oi)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Oi)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Oi)||t.nextStep()}previousStep(){var t;null==(t=this.Oi)||t.previousStep()}clearCache(){var t;this.Pi=null,null==(t=this._instance.persistence)||t.unregister(zg)}resetTour(t){var e;null==(e=this.Oi)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Oi)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Oi)||e.cancelPendingTour(t)}}class Yg{constructor(){this.Di={},this.Di={}}on(t,e){return this.Di[t]||(this.Di[t]=[]),this.Di[t].push(e),()=>{this.Di[t]=this.Di[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Di[t]||[])r(e);for(var i of this.Di["*"]||[])i(t,e)}}function Ug(t,e,r){if(oi(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Wg{constructor(t){this.Bi=new Yg,this.ji=(t,e)=>this.$i(t,e)&&this.Zi(t,e)&&this.qi(t,e)&&this.Hi(t,e),this.$i=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Vi=new Set,this.zi=new Set}init(){var t;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)){var e;null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zi)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Vi)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.Vi.has(t)||this.Vi.has(null==e?void 0:e.event))&&this.zi&&(null==(r=this.zi)?void 0:r.size)>0&&this.zi.forEach((t=>{this.Gi(e,t)&&this.Bi.emit("actionCaptured",t.name)}))}Yi(t){this.onAction("actionCaptured",(e=>t(e)))}Gi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.ji(t,r))return!0;return!1}onAction(t,e){return this.Bi.on(t,e)}Zi(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Ug(i,e.url,e.url_matching||"contains"))return!1}return!0}qi(t,e){return!!this.Ui(t,e)&&(!!this.Wi(t,e)&&!!this.Xi(t,e))}Ui(t,e){var r;if(null==e||!e.href)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Ug(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Ug((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Wi(t,e){var r;if(null==e||!e.text)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Ug(t.text,e.text,e.text_matching||"exact")||Ug(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!oi(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Ug(t,s,o))))}Xi(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Ji(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Hi(t,e){return null==e||!e.properties||0===e.properties.length||Xl(e.properties.reduce(((t,e)=>{var r=Jr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Xg{constructor(t){this._instance=t,this.Ki=new Map,this.Qi=new Map,this.tn=new Map}en(t,e){return!!t&&Xl(t.propertyFilters,null==e?void 0:e.properties)}rn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}nn(t,e,r){var i=(r===Au.Activation?this.Ki:this.Qi).get(t),n=[];return this.sn((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.en(s,e)}))}register(t){var e;ri(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.an(t),this.un(t))}un(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.ln){this.ln=new Wg(this._instance),this.ln.init();this.ln.Yi((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ln)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.tn.get(e.name);r&&r.push(t.id),this.tn.set(e.name,r||[t.id])}})))}))}}an(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Ki=this.rn(t,Au.Activation),this.Qi=this.rn(t,Au.Cancellation)}}onEvent(t,e){var r,i=this.ct(),n=this.hn(),s=this.cn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=o.indexOf(l);h>=0&&(o.splice(h,1),this.dn(o))}}else{if(this.Qi.has(t)){var c=this.nn(t,e,Au.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);e>=0&&o.splice(e,1),this.vn(t.id)})),this.dn(o))}if(this.Ki.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Ki.get(t)});var d=this.nn(t,e,Au.Activation);this.dn(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.hn(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.tn.has(t)&&this.dn(i.concat(this.tn.get(t)||[]))}dn(t){var e,r=this.ct(),i=this.hn(),n=[...new Set(t)].filter((t=>!this.fn(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.hn(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Ki}pn(){return this.ln}}class Jg extends Xg{constructor(t){super(t)}hn(){return"$surveys_activated"}cn(){return Pu.SHOWN}sn(t){var e;null==(e=this._instance)||e.getSurveys(t)}vn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ct(){return Bu}fn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Kg{constructor(t){this.gn=void 0,this._surveyManager=null,this.mn=!1,this.yn=[],this.bn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(oi(e))return Bu.warn("Flags not loaded yet. Not loading surveys.");var r=Jr(e);this.gn=r?e.length>0:e,Bu.info("flags response received, isSurveysEnabled: "+this.gn),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(qu)||null!=r&&r.startsWith(Hu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.mn)Bu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Bu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==os?void 0:os.__PosthogExtensions__;if(t){if(!ri(this.gn)||this._instance.config.advanced_enable_surveys){var e=this.gn||this._instance.config.advanced_enable_surveys;this.mn=!0;try{var r=t.generateSurveys;if(r)return void this.wn(r,e);var i=t.loadExternalDependency;if(!i)return void this._n("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this._n("Could not load surveys script",r):this.wn(t.generateSurveys,e)}))}catch(t){throw this._n("Error initializing surveys",t),t}finally{this.mn=!1}}}else Bu.error("PostHog Extensions not found.")}}wn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Jg(this._instance),Bu.info("Surveys loaded successfully"),this.In({isLoaded:!0})}_n(t,e){Bu.error(t,e),this.In({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.yn.push(t),this._surveyManager&&this.In({isLoaded:!0}),()=>{this.yn=this.yn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(to);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.bn?this.bn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.bn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.bn=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Bu.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,u=e.json.surveys||[],l=u.filter((t=>ju(t)&&($u(t)||Zu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[to]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}In(t){for(var e of this.yn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!oi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bu.warn("init was not called")}Cn(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Sn(t){if(oi(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.Cn(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(oi(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Sn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return oi(this._surveyManager)?(Bu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.Sn(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n="string"==typeof t?this.Cn(t):t;if(null!=n&&n.id)if(Uu.includes(n.type)){var s=null==ts?void 0:ts.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Bu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Bu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Bu.warn("Survey element not found")}else Bu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bu.warn("Survey not found")}}displaySurvey(t,e){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n=this.Cn(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Du.Popover&&e.initialResponses&&Bu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Bu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Du.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Bu.warn("Survey not found")}}cancelPendingSurvey(t){oi(this._surveyManager)?Bu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var Qg=ds("[Conversations]");class tm{constructor(t){this.kn=void 0,this._conversationsManager=null,this.xn=!1,this.An=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;oi(e)||(li(e)?this.kn=e:(this.kn=e.enabled,this.An=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.kn=void 0,this.An=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==os?void 0:os.__PosthogExtensions__;if(t&&!ri(this.kn)&&this.kn)if(this.An&&this.An.token){this.xn=!0;try{var e=t.initConversations;if(e)return this.Tn(e),void(this.xn=!1);var r=t.loadExternalDependency;if(!r)return void this.En("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.En("Could not load conversations script",e):this.Tn(t.initConversations),this.xn=!1}))}catch(t){this.En("Error initializing conversations",t),this.xn=!1}}else Qg.error("Conversations enabled but missing token in remote config.")}}Tn(t){if(this.An)try{this._conversationsManager=t(this.An,this._instance),Qg.info("Conversations loaded successfully")}catch(t){this.En("Error completing conversations initialization",t)}else Qg.error("Cannot complete initialization: remote config is null")}En(t,e){Qg.error(t,e),this._conversationsManager=null,this.xn=!1}show(){this._conversationsManager?this._conversationsManager.show():Qg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.kn&&!si(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(Qg.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Qg.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Qg.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Qg.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class em{constructor(t){var e;this.Rn=!1,this.Nn=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Rn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!oi(r)&&r&&(this.Rn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Rn&&!this.Nn){var t=ds("[logs]"),e=null==os?void 0:os.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=e.logs)||!i.initializeLogs?t.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.Nn=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var rm=ds("[RateLimiter]");class im{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{rm.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void rm.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(so))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(so,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var nm=ds("[RemoteConfig]");class sm{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mn(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(nm.error("PostHog Extensions not found. Cannot load remote config."),t())}Fn(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return nm.info("Using preloaded remote config",this.remoteConfig),void this.Ci(this.remoteConfig);if(this._instance.De())return void nm.warn("Remote config is disabled. Falling back to local config.");this.Mn((t=>{if(!t)return nm.info("No config found after loading remote JS config. Falling back to JSON."),void this.Fn((t=>{this.Ci(t)}));this.Ci(t)}))}catch(t){nm.error("Error loading remote config",t)}}Ci(t){t?this._instance.config.__preview_remote_config?(this._instance.Ci(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nm.info("__preview_remote_config is disabled. Logging config instead",t):nm.error("Failed to fetch remote config from PostHog.")}}var om=3e3;class am{constructor(t,e){this.On=!0,this.Pn=[],this.Ln=yi((null==e?void 0:e.flush_interval_ms)||om,250,5e3,cs.createLogger("flush interval"),om),this.Dn=t}enqueue(t){this.Pn.push(t),this.Bn||this.jn()}unload(){this.$n();var t=this.Pn.length>0?this.Zn():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Dn(r({},t,{transport:"sendBeacon"}))}))}enable(){this.On=!1,this.jn()}jn(){var t=this;this.On||(this.Bn=setTimeout((()=>{if(this.$n(),this.Pn.length>0){var e=this.Zn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Jr(r.data)&&ps(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dn(r)};for(var i in e)r()}}),this.Ln))}$n(){clearTimeout(this.Bn),this.Bn=void 0}Zn(){var t={};return ps(this.Pn,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;ri(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Pn=[],t}}var um=["retriesPerformedSoFar"];class lm{constructor(t){this.qn=!1,this.Hn=3e3,this.Pn=[],this._instance=t,this.Pn=[],this.Vn=!0,!ri(Un)&&"onLine"in Un.navigator&&(this.Vn=Un.navigator.onLine,this.zn=()=>{this.Vn=!0,this.Yr()},this.Gn=()=>{this.Vn=!1},xs(Un,"online",this.zn),xs(Un,"offline",this.Gn))}get length(){return this.Pn.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,um);ui(e)&&(n.url=ql(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Yn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Yn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Pn.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cs.warn(n),this.qn||(this.qn=!0,this.Un())}Un(){if(this.Wn&&clearTimeout(this.Wn),0===this.Pn.length)return this.qn=!1,void(this.Wn=void 0);this.Wn=setTimeout((()=>{this.Vn&&this.Pn.length>0&&this.Yr(),this.Un()}),this.Hn)}Yr(){var t=Date.now(),e=[],r=this.Pn.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Pn=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Wn&&(clearTimeout(this.Wn),this.Wn=void 0),this.qn=!1,ri(Un)||(this.zn&&(Un.removeEventListener("online",this.zn),this.zn=void 0),this.Gn&&(Un.removeEventListener("offline",this.Gn),this.Gn=void 0)),this.Pn))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){cs.error(t)}this.Pn=[]}}class hm{constructor(t){this.Xn=()=>{var t,e,r,i;this.Jn||(this.Jn={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),u=(null==n?void 0:n.scrollHeight)||0;this.Jn.lastScrollY=Math.ceil(s),this.Jn.maxScrollY=Math.max(s,null!==(t=this.Jn.maxScrollY)&&void 0!==t?t:0),this.Jn.maxScrollHeight=Math.max(o,null!==(e=this.Jn.maxScrollHeight)&&void 0!==e?e:0),this.Jn.lastContentY=a,this.Jn.maxContentY=Math.max(a,null!==(r=this.Jn.maxContentY)&&void 0!==r?r:0),this.Jn.maxContentHeight=Math.max(u,null!==(i=this.Jn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Jn}resetContext(){var t=this.Jn;return setTimeout(this.Xn,0),t}startMeasuringScrollPosition(){xs(Un,"scroll",this.Xn,{capture:!0}),xs(Un,"scrollend",this.Xn,{capture:!0}),xs(Un,"resize",this.Xn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Un?void 0:Un.document.documentElement;var t=Jr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Un?void 0:Un.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Un&&(Un.scrollY||Un.pageYOffset||Un.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Un&&(Un.scrollX||Un.pageXOffset||Un.document.documentElement.scrollLeft)||0}}var cm=t=>cg(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class dm{constructor(t,e,r,i){this.Kn=t=>{var e=this.Qn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ts(this._instance)};this.es.register({[no]:r})}},this._instance=t,this.rs=e,this.es=r,this.ts=i||cm,this.rs.onSessionId(this.Kn)}Qn(){return this.es.props[no]}getSetOnceProps(){var t,e=null==(t=this.Qn())?void 0:t.props;return e?"r"in e?dg(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ps(_s(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Gr(r)]=e})),t}}var vm=ds("[SessionId]");class fm{on(t,e){return this.ns.on(t,e)}constructor(t,e,r){var i;if(this.ss=[],this.os=void 0,this.ns=new Yg,this.us=(t,e)=>!(!ui(t)||!ui(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oe=t.config,this.es=t.persistence,this.ls=void 0,this.hs=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.cs=e||rl,this.ds=r||rl;var n=this.Oe.persistence_name||this.Oe.token,s=this.Oe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yi(s,60,36e3,vm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vs(),this.fs="ph_"+n+"_window_id",this.ps="ph_"+n+"_primary_window_exists",this.gs()){var o=Fp.sr(this.fs),a=Fp.sr(this.ps);o&&!a?this.ls=o:Fp.ur(this.fs),Fp.ar(this.ps,!0)}if(null!=(i=this.Oe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.Oe.bootstrap.sessionID);this.ys(this.Oe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){vm.error("Invalid sessionID in bootstrap",t)}this.bs()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ri(this.ss)&&(this.ss=[]),this.ss.push(t),this.hs&&t(this.hs,this.ls),()=>{this.ss=this.ss.filter((e=>e!==t))}}gs(){return"memory"!==this.Oe.persistence&&!this.es.Ei&&Fp.rr()}ws(t){t!==this.ls&&(this.ls=t,this.gs()&&Fp.ar(this.fs,t))}_s(){return this.ls?this.ls:this.gs()?Fp.sr(this.fs):null}ys(t,e,r){t===this.hs&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.hs=t,this.es.register({[Ys]:[e,t,r]}))}Is(){var t=this.es.props[Ys];return Jr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ys(null,null,null)}destroy(){clearTimeout(this.Cs),this.Cs=void 0,this.os&&Un&&(Un.removeEventListener("beforeunload",this.os,{capture:!1}),this.os=void 0),this.ss=[]}bs(){this.os=()=>{this.gs()&&Fp.ur(this.ps)},xs(Un,"beforeunload",this.os,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.Oe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.Is(),o=this._s(),a=ui(s)&&Math.abs(r-s)>864e5,u=!1,l=!n,h=!l&&!t&&this.us(r,i);l||h||a?(n=this.cs(),o=this.ds(),vm.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,u=!0):o||(o=this.ds(),u=!0);var c=!!ui(i)&&t&&!a?i:r,d=!ui(s)?(new Date).getTime():s;return this.ws(o),this.ys(n,c,d),t||this.vs(),u&&this.ss.forEach((t=>t(n,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}vs(){clearTimeout(this.Cs),this.Cs=setTimeout((()=>{var[t]=this.Is();if(this.us((new Date).getTime(),t)){var e=this.hs;this.resetSessionId(),this.ns.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var pm=["$set_once","$set"],gm=ds("[SiteApps]");class mm{constructor(t){this._instance=t,this.Ss=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ks(t,e){if(e){var r=this.globalsForEvent(e);this.Ss.push(r),this.Ss.length>1e3&&(this.Ss=this.Ss.slice(10))}}get siteAppLoaders(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ks.bind(this));this.xs=()=>{t(),this.Ss=[],this.xs=void 0}}}globalsForEvent(t){var e,n,s,o,a,u,l;if(!t)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,pm),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Ss.length&&(gm.info("Processing "+this.Ss.length+" events for site app with id "+t.id),this.Ss.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.xs)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,gm.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback:t=>{n(t)}});s&&(e.processEvent=s),i=!0}catch(e){gm.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){gm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}As(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Ts(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){gm.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.As(),void this._instance.on("eventCaptured",(t=>this.Ts(t)))):void gm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.xs)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;os["__$$ph_site_app_"+t]=n._instance,null==(e=os.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return gm.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else gm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ym=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Hr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Hr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},bm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),wm="i.posthog.com";class _m{constructor(t){this.Es={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+wm,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Es[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=bm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=bm.EU:this.Es[this.apiHost]=bm.CUSTOM),this.Es[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===bm.CUSTOM)return this.apiHost+e;var r=wm+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Im={icontains:(t,e)=>!!Un&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Un&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Un&&Gl(e.href,t),not_regex:(t,e)=>!!Un&&!Gl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Cm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Cm.Rs("retrieved web experiments from the server"),e.Ns=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Ns)Cm.Rs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ns)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&e.Ms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Cm.Fs(s)&&e.Ms(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Cm.Rs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(oi(this.Ns))return this.Ns=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Cm.Rs("applying feature flags",t),t.forEach((t=>{var e;if(this.Ns&&null!=(e=this.Ns)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ns)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Cm.getWindowLocation();if(null!=t&&t.search){var e=Es(null==t?void 0:t.search,"__experiment_id"),r=Es(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Cm.Rs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Os(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Os(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Cm.Rs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ms(i[0].name,e,i[0].variants[e].transforms))}static Fs(t){return!oi(t.conditions)&&(Cm.Ps(t)&&Cm.Ls(t))}static Ps(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Cm.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Im[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Un?void 0:Un.location}static Ls(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.utm))return!0;var r=og();if(r.utm_source){var i,n,s,o,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Rs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+t,r)}Ms(t,e,r){this._is_bot()?Cm.Rs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Cm.Rs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Cm.Rs("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?ym(Qn,this._instance.config.custom_blocked_useragents):void 0}}var Sm=ds("[PostHog ExternalIntegrations]"),km={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xm{constructor(t){this._instance=t}gr(t,e){var r;null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Sm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;(!i||null!=(r=os.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.gr(km[e],(()=>{var r;null==(r=os.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=os.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(s=os.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}ds("[SessionRecording]");var Am="[SessionRecording]",Tm=ds(Am);class Em{get started(){var t;return!(null==(t=this.Ds)||!t.isStarted)}get status(){return this.Ds?this.Ds.status:this.Bs&&!this.js?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Bs=!1,this.$s=!1,this.Zs=void 0,this._instance=t,!this._instance.sessionManager)throw Tm.error("started without valid sessionManager"),new Error(Am+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Am+' cannot be used with cookieless_mode="always"')}get js(){var t,e=!(null==(t=this._instance.get_property(Gs))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Un&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.js||null==(e=this.Ds)||!e.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this.js&&r?(this.qs(t),Tm.info("starting")):this.stopRecording()}}qs(t){var e,r,i;this.js&&(null!=os&&null!=(e=os.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=os.__PosthogExtensions__)&&r.initSessionRecording?this.Hs(t):null==(i=os.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Vs,(e=>{if(e)return Tm.error("could not load recorder",e);this.Hs(t)})))}stopRecording(){var t,e;null==(t=this.Zs)||t.call(this),this.Zs=void 0,null==(e=this.Ds)||e.stop()}zs(){var t;null==(t=this._instance.persistence)||t.unregister(Us)}Gs(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,s=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,s=oi(i)?null:parseFloat(i);oi(s)&&this.zs();var o=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Gs]:r({cache_timestamp:Date.now(),enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ri(o)?null:o,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};s(),null==(e=this.Zs)||e.call(this),this.Zs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.$s=!1,this.Gs(t),this.Bs=!0,this.startIfEnabledOrStop()):this.Bs=!0:Tm.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Ds)&&r.log?this.Ds.log(t,e):Tm.warn("log called before recorder was ready")}get Vs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Gs);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ys(){var t,e=this._instance.get_property(Gs);if(!e)return!1;var r=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return Date.now()-r<=3e5}Hs(t){var e,r;if(null==(e=os.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Ds||(this.Ds=null==(r=os.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Ds._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Ys()?this.Ds.start(t):this.$s||(this.$s=!0,Tm.info("persisted remote config is stale, requesting fresh config before starting"),new sm(this._instance).load())}onRRwebEmit(t){var e;null==(e=this.Ds)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.Ds)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.Ds)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Ds||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.Ds)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ds)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Ds)||!r.tryAddCustomEvent(t,e))}}var Rm={},Nm=()=>{},Mm="posthog",Fm=!$l&&-1===(null==ss?void 0:ss.indexOf("MSIE"))&&-1===(null==ss?void 0:ss.indexOf("Mozilla")),Om=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ss(null==ts?void 0:ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:es&&ii(null==es?void 0:es.search)&&-1!==es.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Un||null==(e=Un.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;cs.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:om},error_tracking:{},_onCapture:Nm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Pm=t=>{var e={};ri(t.process_person)||(e.person_profiles=t.process_person),ri(t.xhr_headers)||(e.request_headers=t.xhr_headers),ri(t.cookie_name)||(e.persistence_name=t.cookie_name),ri(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ri(t.store_google)||(e.save_campaign_params=t.store_google),ri(t.verbose)||(e.debug=t.verbose);var r=gs({},e,t);return Jr(t.property_blacklist)&&(ri(t.property_denylist)?r.property_denylist=t.property_blacklist:Jr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:cs.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Lm{constructor(){this.__forceAllowLocalhost=!1}get Us(){return this.__forceAllowLocalhost}set Us(t){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Dm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Lm,this.Ws=!1,this.version=ls.LIB_VERSION,this.wi=new Yg,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Om(),this.SentryIntegration=Yp,this.sentryIntegration=t=>function(t,e){var r=Gp(t,e);return{name:zp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Xs=!1,this.Js=null,this.Ks=null,this.Qs=null,this.featureFlags=new Zg(this),this.toolbar=new Kp(this),this.scrollManager=new hm(this),this.pageViewManager=new Ig(this),this.surveys=new Kg(this),this.conversations=new tm(this),this.logs=new em(this),this.experiments=new Cm(this),this.exceptions=new Cf(this),this.rateLimiter=new im(this),this.requestRouter=new _m(this),this.consent=new Pp(this),this.externalIntegrations=new xm(this),this.people={set:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>cs.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Mm){var i,n=null!==(i=Rm[r])&&void 0!==i?i:new Dm;return n._init(t,e,r),Rm[r]=n,Rm[Mm][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ri(t)||ni(t))return cs.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.eo(e.debug),this.ro=e,this.io=[],e.person_profiles&&(this.Ks=e.person_profiles),this.set_config(gs({},Om(e.defaults),Pm(e),{name:i,token:t})),this.config.on_xhr_error&&cs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:nl.GZipJS;var s=this.no();this.persistence=new Hg(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Hg(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.so=new am((t=>this.oo(t)),this.config.request_queue_config),this.ao=new lm(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new fm(this),this.sessionPropsManager=new dm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.uo(u)}),0)):(cs.info("Initializing extensions synchronously"),this.uo(u)),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&cs.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(rl()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(io,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.lo()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:co,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(rl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(io,"anonymous")}return xs(Un,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Vp(this,(()=>this.ho())):this.ho(),Kr(this.config._onCapture)&&this.config._onCapture!==Nm&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&cs.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}uo(t){var e=performance.now();this.historyAutocapture=new qp(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new tg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new mm(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Em(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new gp(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Gg(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new _g(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new yg(this)})),r.push((()=>{this.exceptionObserver=new Zp(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new jp(this,Bp),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this.co){var t=this.co;this.co=void 0,this.Ci(t)}})),this.do(r,e)}do(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.do(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){cs.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Ci(t){var e,r,i,n,s,o,a,u,l;if(!ts||!ts.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.co=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(t.supportedCompression,nl.GZipJS)?nl.GZipJS:Vr(t.supportedCompression,nl.Base64)?nl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ks?this.Ks:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(s=this.heatmaps)||s.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(o=this.productTours)||o.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}ho(){try{this.config.loaded(this)}catch(t){cs.critical("`loaded` function failed",t)}if(this.vo(),this.config.internal_or_test_user_hostname&&null!=es&&es.hostname){var t=es.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.fo()}),1),new sm(this).load(),this.featureFlags.flags()}vo(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.so)||t.enable()))}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(t=>this.oo(t))),this.__request_queue=[],this.vo()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.po()&&this.capture("$pageleave"),null==(t=this.so)||t.unload(),null==(e=this.ao)||e.unload()):this.po()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Fm?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=ql(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4,s.url=ql(s.url,{_:(new Date).getTime().toString(),ver:ls.LIB_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=zl.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),u=null!==(i=null==(n=ks(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(s)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}oo(t){this.ao?this.ao.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];fs(t,(t=>{t&&(e=t[0],Jr(e)?n.push(t):Kr(t)?t.call(this):Jr(t)&&"alias"===e?r.push(t):Jr(t)&&-1!==e.indexOf("capture")&&Kr(this[e])?n.push(t):i.push(t))}));var s=function(t,e){fs(t,(function(t){if(Jr(t[0])){var r=e;ps(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};s(r,this),s(i,this),s(n,this)}lo(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.so){if(this.is_capturing())if(!ri(t)&&ii(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!ii(null==e?void 0:e.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),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 a=new Date,u=(null==i?void 0:i.timestamp)||a,l=rl(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.mo(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=Is(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ri(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Pu.DISMISSED||t===Pu.SENT){var v=null==e?void 0:e[Lu.SURVEY_ID],f=null==e?void 0:e[Lu.SURVEY_ITERATION];Yu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Vu({id:v,current_iteration:f},t===Pu.SENT?"responded":"dismissed")]:!0})}else t===Pu.SHOWN&&(h.$set=r({},h.$set,{[Lu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(ei(p)||this.setPersonPropertiesForFlags(p),!oi(this.config.before_send)){var g=this.yo(h);if(!g)return;h=g}this.wi.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.oo(m):this.so.enqueue(m),h}cs.critical("This capture call is ignored due to client rate limiting.")}}else cs.error("No event name provided to posthog.capture")}else cs.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&cs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=pg(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&gs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.ao)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===bm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,l),"$pageview"===t&&ts&&(a.title=ts.title),!ri(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}ss&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=gs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Jr(this.config.property_denylist)?ps(this.config.property_denylist,(function(t){delete a[t]})):cs.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.bo();return a.$process_person_profile=g,g&&!s&&this.wo("_calculate_event_properties"),a}mo(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.bo())return t;if(this.Ws)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=gs({},i,n||{},t||{}),o=this.config.sanitize_properties;return o&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),e&&(this.Ws=!0),ei(s)?void 0:s}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}_o(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){return this.featureFlags.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ri(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.wi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Wu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if(ai(t)&&(t=t.toString(),cs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==co){if(this.wo("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==n&&t!==this.get_property(Ps)&&(this.unregister(Ps),this.register({distinct_id:t}));var o="anonymous"===(this.persistence.get_property(io)||"anonymous");t!==n&&o?(this.persistence.set_property(io,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Qs=Yl(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(eo))}}else cs.critical('The string "'+co+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else cs.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.wo("posthog.setPersonProperties")){var i=Yl(this.get_distinct_id(),t,e);this.Qs!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Qs=i):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else cs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.wo("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(cs.info("reset"),!this.__loaded)return cs.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(io,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Qs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:co,$device_id:null},"");else{var o=this.config.get_device_id(rl());this.register_once({distinct_id:o,$device_id:t?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(Os)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.wo("posthog.alias")?(ri(e)&&(e=this.get_distinct_id()),t!==e?(this._o(Ps,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(ti(t)){var i,n,s,o,a,u,l,h;gs(this.config,Pm(t));var c=this.no();null==(i=this.persistence)||i.update_config(this.config,e,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Hg(r({},this.config,{persistence:"sessionStorage"}),c);var d=this.eo(this.config.debug);li(d)&&(this.config.debug=d),li(this.config.debug)&&(this.config.debug?(ls.DEBUG=!0,Tp.rr()&&Tp.ar("ph_debug","true"),cs.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ls.DEBUG=!1,Tp.rr()&&Tp.ur("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Io(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Mm;return e!==Mm&&(e=Mm+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(io))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(io))}bo(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ei(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Ps])&&(null==(e=this.persistence)||null==(e=e.props)||!e[lo]))}po(){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.bo()||this.wo("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wo("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wo(t){return"never"===this.config.person_profiles?(cs.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._o(lo,!0),!0)}no(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Io(){var t,e,r,i,n=this.no();(null==(t=this.persistence)?void 0:t.Ei)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Ei)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new fm(this),this.pageViewManager=new Ig(this),this.persistence&&(this.sessionPropsManager=new dm(this,this.sessionManager,this.persistence)),this.sessionRecording=new Em(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Io(),this.vo(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.fo()}else cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Io(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:co,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.fo())):cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Op.GRANTED?"granted":t===Op.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Io()}_is_bot(){return Qn?ym(Qn,this.config.custom_blocked_useragents):void 0}fo(){ts&&("visible"===ts.visibilityState?this.Xs||(this.Xs=!0,this.capture("$pageview",{title:ts.title},{send_instantly:!0}),this.Js&&(ts.removeEventListener("visibilitychange",this.Js),this.Js=null)):this.Js||(this.Js=this.fo.bind(this),xs(ts,"visibilitychange",this.Js)))}debug(t){!1===t?(null==Un||Un.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Un||Un.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}))}De(){var t,e,r,i,n,s,o,a=this.ro||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=cs,s=(e="advanced_disable_flags")in(t=a)&&!oi(t[e]),o=r in t&&!oi(t[r]),s?t[e]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}yo(t){if(oi(this.config.before_send))return t;var e=Jr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),oi(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return ci(t.event)?cs.warn(n+". This can cause unexpected behavior."):cs.info(n),null}r.properties&&!ei(r.properties)||cs.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.ni)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}eo(t){var e=li(t)&&!t,r=Tp.rr()&&"true"===Tp.nr("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=ws(t.prototype[e[r]])}(Dm,["identify"]);var Bm,jm;Bm=Rm[Mm]=new Dm,(jm=os.posthog)&&ps(jm._i,(function(t){if(t&&Jr(t)){var e=Bm.init(t[0],t[1],t[2]),r=jm[t[2]]||jm;e&&(e._execute_array.call(e.people,r.people),e._execute_array(r))}})),os.posthog=Bm,function(){function t(){t.done||(t.done=!0,Fm=!1,ps(Rm,(function(t){t._dom_loaded()})))}null!=ts&&ts.addEventListener?"complete"===ts.readyState?t():xs(ts,"DOMContentLoaded",t,{capture:!1}):Un&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=Object.defineProperty,l=(t,e,r)=>((t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?v[t]=l:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,r){var i,n=t+"."+String(r);if(p[n])return p[n].call(e);var s=f(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.call(e)):e[r]}var m={};function y(t,e,r){var i=t+"."+String(r);if(m[i])return m[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(m[i]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function w(t){return t.nodeType===t.ELEMENT_NODE}function _(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>S(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=C(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?L(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){l(this,"idNodeMap",new Map),l(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&T(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function R(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(M,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(F.test(u)||O.test(u))return"url("+l+u+l+")";if(P.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var D,B,j=1,Z=new RegExp("[^a-z0-9-_:]"),q=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function Y(t,e){return e&&""!==e.trim()?W(t,e):e}function U(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function W(t,e){var r=G.get(t);if(r||(r=t.createElement("a"),G.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function X(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(z),!(r>=e.length);){var s=i(V);if(","===s.slice(-1))s=Y(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Y(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?L(i,W(t)):"object"===e&&"data"===r?Y(t,i):i:Y(t,i):i}function J(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&K(b.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&K(b.parentNode(t),e,r)}function Q(t,e,r,i){var n;if(w(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function tt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return Z.test(e)?"div":e}(t),y={},w=t.attributes.length,_=0;_<w;_++){var I=t.attributes[_];J(m,I.name,I.value)||(y[I.name]=X(i,m,T(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(i,S);if(!x&&S.includes(".css"))x=k(i,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=C(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var M=C(t.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:R(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:u}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,s=E in n?n[E]:n;if(new Uint32Array(s.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var P=t.toDataURL(l.type,l.quality),L=i.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(l.type,l.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=t,q=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;z.rr_mediaState=t.paused?"paused":"played",z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:Y}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:U(t)||void 0,needBlock:g,rootId:p,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,u=b.textContent(t),l="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(u=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=L(u,W(e.doc))}c&&(u="SCRIPT_PLACEHOLDER");!l&&!c&&u&&i&&(u=n?n(u,b.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:h.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function rt(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:R=!0}=e;E||(E=Q(t,o,a,void 0===E));var M,F=tt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;M=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?H():q;var O=Object.assign(F,{id:M});if(i.add(t,O),M===q)return null;y&&y(t);var P=!u;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var j=rt(B,D);j&&O.childNodes.push(j)}var Z=null;if(w(t)&&(Z=b.shadowRoot(t)))for(var V of Array.from(b.childNodes(Z))){var z=rt(V,D);z&&(I(Z)&&(z.isShadow=!0),O.childNodes.push(z))}}var G=b.parentNode(t);return G&&_(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&C){var r=rt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});r&&C(t,r)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=rt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let it=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},st={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ot={};function at(t){if(ot[t])return ot[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in nt?nt[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in st?st[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ot[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ot[t]=l:r}catch(t){return r}}var ut={};function lt(t,e,r){var i,n=t+"."+String(r);if(ut[n])return ut[n].call(e);var s=at(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ut[n]=o,o.call(e)):e[r]}var ht={};function ct(t,e,r){var i=t+"."+String(r);if(ht[i])return ht[i].bind(e);var n=at(t)[r];return"function"!=typeof n?e[r]:(ht[i]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return lt("Node",t,"childNodes")},parentNode:function(t){return lt("Node",t,"parentNode")},parentElement:function(t){return lt("Node",t,"parentElement")},textContent:function(t){return lt("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?lt("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?lt("Element",t,"shadowRoot"):null},querySelector:function(t,e){return lt("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return lt("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function yt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}function bt(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,r)=>("map"===e&&console.error(pt),Reflect.get(t,e,r))}));var wt=Date.now;function _t(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vt.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=vt.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,r,i){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(K(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===q}function At(t,e){if(_(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=vt.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||At(i,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof it&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());let Mt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(r=vt.host(vt.getRootNode(t))),r}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return vt.contains(e,r)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),jt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(jt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),Zt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Zt||{});function qt(t){return"__ln"in t}class Ht{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&qt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&qt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Vt,zt=(t,e)=>t+"@"+e;class Gt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ht,i=t=>{for(var e=t,r=q;r===q;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=vt.parentNode(n);if(s&&Pt(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=rt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removes,s,this.mirror)&&!this.movedSet.has(vt.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||Ut(this.removes,o,this.mirror)?Wt(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(vt.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=vt.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.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.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=R(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!J(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=_(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[zt(r,i)]?Yt(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!_(t.target)||!I(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[zt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>Yt(t,e)))}function Ut(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=vt.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(t,e,r)}function Wt(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var r=vt.parentNode(e);return!!r&&(!!t.has(r)||Xt(t,r))}var Jt=t=>{if(!Vt)return t;return function(){try{return t(...arguments)}catch(t){if(Vt&&!0===Vt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var r=new Gt;Kt.push(r),r.init(t);var i=new(dt())(Jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ee(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=T(t),u=(t=>i=>{var a=Qt(i);if(!kt(a,s,o,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=jt.Mouse;break;case"touch":u=jt.Touch;break;case"pen":u=jt.Pen}u===jt.Touch?Bt[t]===Bt.MouseDown?l="TouchStart":Bt[t]===Bt.MouseUp&&(l="TouchEnd"):jt.Pen}else Tt(i)&&(u=jt.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===jt.Touch||l.startsWith("Mouse")&&u===jt.Mouse)&&(u=null)):Bt[t]===Bt.Click&&(u=h,h=null);var c=Tt(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(r({type:Bt[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}l.push(ft(a,u,i))})),Jt((()=>{l.forEach((t=>t()))}))}function re(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",Jt(mt(Jt((t=>{var o=Qt(t);if(o&&!kt(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var u=_t(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var ie=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function se(t){return function(t,e){if(le("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||le("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||le("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||le("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function oe(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ae(t,e){var r,i,n,{mirror:s,stylesheetManager:o}=t,a=null;a="#document"===e.nodeName?s.getId(e):s.getId(vt.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{o.adoptStyleSheets(t,a)}catch(t){}return r}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ue(t,e){void 0===e&&(e={});var i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(i=te(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=mt(Jt((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;s||(s=wt()),u.push({x:r,y:i,id:n.getId(e),timeOffset:wt()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),o,{trailing:!1})),c=[ft("mousemove",h,i),ft("touchmove",h,i),ft("drag",h,i)];return Jt((()=>{c.forEach((t=>t()))}))}(t),o=ee(t),a=re(t),u=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",Jt(mt(Jt((()=>{var t=It(),e=Ct();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:n}),l=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(ie.indexOf(n)<0)&&!kt(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=R(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=A({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=ne.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ne.set(t,i);var o=n.getId(t);Jt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Jt((t=>mt(Jt((s=>{var o=Qt(s);if(o&&!kt(o,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),s.media||500))),u=[ft("play",a(Zt.Play),o),ft("pause",a(Zt.Pause),o),ft("seeked",a(Zt.Seeked),o),ft("volumechange",a(Zt.VolumeChange),o),ft("ratechange",a(Zt.RateChange),o)];return Jt((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=oe(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...se(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=oe(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...se(e),o]}]}),t.apply(e,s)}))})})),Jt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=l,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,o)=>{var u,[l,h,c]=o;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=oe(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:se(e.parentRule)}),t.apply(e,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Jt(((t,e,o)=>{var a,[l]=o;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=oe(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:se(e.parentRule)}),t.apply(e,o)}))}),Jt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=bt(r.fonts,"add",(function(t){return function(r){return setTimeout(Jt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,i,n,!0)||kt(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?bt(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==i||i.disconnect(),s(),o(),a(),u(),l(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function le(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var i=te(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(re(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=vt.shadowRoot(this);return s&&Pt(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,r)=>{if(t&&(_e(t,e)||"object"==typeof t)){var i=function(t,e){var r=me.get(t);return r||(r=new Map,me.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function be(t,e,r){if(t instanceof Array)return t.map((t=>be(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=fe[r[e]>>2],n+=fe[(3&r[e])<<4|r[e+1]>>4],n+=fe[(15&r[e+1])<<2|r[e+2]>>6],n+=fe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,r),t.width,t.height]}:_e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,r)}:t}var we=(t,e,r)=>t.map((t=>be(t,e,r))),_e=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Ie(t,e,r,i){var n=[];try{var s=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!kt(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ce(t,e,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=bt(t,a,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];var h=t.apply(this,u);if(ye(h,s,this),"tagName"in this.canvas&&!kt(this.canvas,i,n,!0)){var c=we(u,s,this),d={type:e,property:a,args:c};r(this.canvas,d)}return h}}));o.push(u)}catch(i){var l=yt(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(l)}};for(var l of a)u(l);return o}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Re(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this,a=Ie(r,i,n,!0),u=new Map,l=new Re;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(r.document),a).forEach(function(){var t=e((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});l.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Ie(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=bt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return kt(this.canvas,r,i,!0)||setTimeout((()=>{var r=we(a,e,this);t(this.canvas,{type:$t["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=yt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:$t["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...Ce(e.WebGLRenderingContext.prototype,$t.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ce(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Mt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:S(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function je(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=t;Vt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Be.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var j=0,Z=t=>{for(var e of R||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,r)=>{var s,o=t;if(o.timestamp=wt(),!(null==(s=Kt[0])?void 0:s.isFrozen())||o.type===Lt.FullSnapshot||o.type===Lt.IncrementalSnapshot&&o.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(Z(o),r);else if(P){var a={type:"rrweb",event:Z(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Lt.FullSnapshot)L=o,j=0;else if(o.type===Lt.IncrementalSnapshot){if(o.data.source===Dt.Mutation&&o.data.isAttachIframe)return;j++;var u=n&&j>=n,l=i&&o.timestamp-L.timestamp>i;(u||l)&&xe(!0)}};var q=t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Mutation},t)})},H=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Scroll},t)}),V=t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CanvasMutation},t)}),z=new Me({mutationCb:q,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:q,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:ke});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Fe;Ae=new Ne({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Be,sampling:b.canvas,dataURLOptions:w});var W=new ve({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:z,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:U},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),I){ke({type:Lt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),z.reset(),W.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new x,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=e||{};return rt(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Rt(t,Be)&&z.trackLinkElement(t),Nt(t)&&W.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),W.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{z.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:_t(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(ue)({mutationCb:q,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MouseInteraction},t)}),scrollCb:H,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:r({source:Dt.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Be,iframeManager:G,stylesheetManager:z,shadowDomManager:W,processedNodeManager:U,canvasManager:Ae,ignoreCSSAttributes:M,plugins:(null==(e=null==R?void 0:R.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),U.destroy(),Oe=!1,Vt=void 0}}catch(t){console.warn(t)}}je.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},je.freezePage=()=>{Kt.forEach((t=>t.freeze()))},je.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},je.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,Ze=Object.defineProperty,qe=(t,e,r)=>((t,e,r)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),He=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ze=Object.defineProperty,Ge=(t,e,r)=>((t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ye={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ue={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={};function Xe(t){if(We[t])return We[t];var e=globalThis[t],r=e.prototype,i=t in Ye?Ye[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Ue?Ue[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return We[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?We[t]=l:r}catch(t){return r}}var Je={};function Ke(t,e,r){var i,n=t+"."+String(r);if(Je[n])return Je[n].call(e);var s=Xe(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Je[n]=o,o.call(e)):e[r]}var Qe={};function tr(t,e,r){var i=t+"."+String(r);if(Qe[i])return Qe[i].bind(e);var n=Xe(t)[r];return"function"!=typeof n?e[r]:(Qe[i]=n,n.bind(e))}var er={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return tr("Node",t,"contains")(e)},getRootNode:function(t){return tr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class rr{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ir(er.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&ir(er.parentNode(t),e,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nr))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function ur(t){if(ar[t])return ar[t];var e=globalThis[t],r=e.prototype,i=t in sr?sr[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in or?or[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ar[t]=l:r}catch(t){return r}}var lr={};function hr(t,e,r){var i,n=t+"."+String(r);if(lr[n])return lr[n].call(e);var s=ur(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(lr[n]=o,o.call(e)):e[r]}var cr={};function dr(t,e,r){var i=t+"."+String(r);if(cr[i])return cr[i].bind(e);var n=ur(t)[r];return"function"!=typeof n?e[r]:(cr[i]=n,n.bind(e))}var vr={childNodes:function(t){return hr("Node",t,"childNodes")},parentNode:function(t){return hr("Node",t,"parentNode")},parentElement:function(t){return hr("Node",t,"parentElement")},textContent:function(t){return hr("Node",t,"textContent")},contains:function(t,e){return dr("Node",t,"contains")(e)},getRootNode:function(t){return dr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hr("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ur("MutationObserver").constructor}};var fr="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.",pr={map:{},getId:()=>(console.error(fr),-1),getNode:()=>(console.error(fr),null),removeNodeFromMap(){console.error(fr)},has:()=>(console.error(fr),!1),reset(){console.error(fr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pr=new Proxy(pr,{get:(t,e,r)=>("map"===e&&console.error(fr),Reflect.get(t,e,r))}));var gr=Date.now;function mr(t){return t?t.nodeType===t.ELEMENT_NODE?t:vr.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gr=()=>(new Date).getTime());function yr(t){var e,r=null;return"getRootNode"in t&&(null==(e=vr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(t))&&(r=vr.host(vr.getRootNode(t))),r}function br(t){for(var e,r=t;e=yr(r);)r=e;return r}function wr(t){var e=t.ownerDocument;if(!e)return!1;var r=br(t);return vr.contains(e,r)}for(var _r=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ve(this,"id",1),Ve(this,"styleIDMap",new WeakMap),Ve(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pr},closestElementOfNode:mr,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),u=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vr.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=vr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof nr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vr.shadowRoot(t)))},hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vr.contains(e,t)||wr(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&er.host(i)||null,Boolean(n&&"shadowRoot"in n&&er.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=vr.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=mr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ir(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gr},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:wr,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sr=0;Sr<64;Sr++)Cr[Ir.charCodeAt(Sr)]=Sr;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($e=xr.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xr)}}catch(t){console.debug("Unable to override Array.from",t)}new rr,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(kr||(kr={}));class Ar{constructor(t){qe(this,"fileName"),qe(this,"functionName"),qe(this,"lineNumber"),qe(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Tr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Nr={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ar({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Rr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ar({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ar({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=e.exec(r[n]);o&&i.push(new Ar({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ar({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Mr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;s<i.children.length;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Fr(t){return"[object Object]"===Object.prototype.toString.call(t)}function Or(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Fr(t[i])&&Or(t[i],e-1))return!0;return!1}function Pr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fr(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fr(t)&&Or(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var a in e){var u=e[a];Array.isArray(u)?o[a]=Mr(u.length?u[0]:null):o[a]=u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Lr={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 Dr(t,e,r){var i,n=r?Object.assign({},Lr,r):Lr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,s=Nr.parse(i).map((t=>t.toString())),o=[Pr(r,n.stringifyOptions)];t({level:"error",trace:s,payload:o})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Pr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Pr("Uncaught (in promise)",n.stringifyOptions),Pr(e.reason,n.stringifyOptions)]);var s=Nr.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?_r.patch(e,r,(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=Nr.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Pr(t,n.stringifyOptions)));++o<n.lengthThreshold?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:Dr,options:t}),jr=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),$r=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Zr(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var qr=["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"],Hr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return qr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Vr(t,e){return-1!==t.indexOf(e)}var zr=function(t){return t.trim()},Gr=function(t){return t.replace(/^\$/,"")};var Yr=Array.isArray,Ur=Object.prototype,Wr=Ur.hasOwnProperty,Xr=Ur.toString,Jr=Yr||function(t){return"[object Array]"===Xr.call(t)},Kr=t=>"function"==typeof t,Qr=t=>Kr(t)&&-1!==t.toString().indexOf("[native code]"),ti=t=>t===Object(t)&&!Jr(t),ei=t=>{if(ti(t)){for(var e in t)if(Wr.call(t,e))return!1;return!0}return!1},ri=t=>void 0===t,ii=t=>"[object String]"==Xr.call(t),ni=t=>ii(t)&&0===t.trim().length,si=t=>null===t,oi=t=>ri(t)||si(t),ai=t=>"[object Number]"==Xr.call(t)&&t==t,ui=t=>ai(t)&&t>0,li=t=>"[object Boolean]"===Xr.call(t),hi=t=>t instanceof FormData,ci=t=>Vr($r,t);function di(t){return null===t||"object"!=typeof t}function vi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fi(t){return!ri(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var pi=[!0,"true",1,"1","yes"],gi=t=>Vr(pi,t),mi=[!1,"false",0,"0","no"];function yi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ai(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),yi(n||r,e,r,i))}class bi{constructor(t){this.I={},this.C=t.C,this.S=yi(t.bucketSize,0,100,t.k),this.A=yi(t.refillRate,0,this.S,t.k),this.T=yi(t.refillInterval,0,864e5,t.k)}R(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.T);if(i>0){var n=i*this.A;t.tokens=Math.min(t.tokens+n,this.S),t.lastAccess=t.lastAccess+i*this.T}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.I[i];return n?this.R(n,r):(n={tokens:this.S,lastAccess:r},this.I[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.C)||e.call(this,t)),0===n.tokens)}stop(){this.I={}}}var wi="Mobile",_i="iOS",Ii="Android",Ci="Tablet",Si=Ii+" "+Ci,ki="iPad",xi="Apple",Ai=xi+" Watch",Ti="Safari",Ei="BlackBerry",Ri="Samsung",Ni=Ri+"Browser",Mi=Ri+" Internet",Fi="Chrome",Oi=Fi+" OS",Pi=Fi+" "+_i,Li="Internet Explorer",Di=Li+" "+wi,Bi="Opera",ji=Bi+" Mini",$i="Edge",Zi="Microsoft "+$i,qi="Firefox",Hi=qi+" "+_i,Vi="Nintendo",zi="PlayStation",Gi="Xbox",Yi=Ii+" "+wi,Ui=wi+" "+Ti,Wi="Windows",Xi=Wi+" Phone",Ji="Nokia",Ki="Ouya",Qi="Generic",tn=Qi+" "+wi.toLowerCase(),en=Qi+" "+Ci.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+nn),on=new RegExp(Gi,"i"),an=new RegExp(zi+" \\w+","i"),un=new RegExp(Vi+" \\w+","i"),ln=new RegExp(Ei+"|PlayBook|BB10","i"),hn={"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"};var cn,dn,vn,fn=(t,e)=>e&&Vr(e,xi)||function(t){return Vr(t,Ti)&&!Vr(t,Fi)&&!Vr(t,Ii)}(t),pn=function(t,e){return e=e||"",Vr(t," OPR/")&&Vr(t,"Mini")?ji:Vr(t," OPR/")?Bi:ln.test(t)?Ei:Vr(t,"IE"+wi)||Vr(t,"WPDesktop")?Di:Vr(t,Ni)?Mi:Vr(t,$i)||Vr(t,"Edg/")?Zi:Vr(t,"FBIOS")?"Facebook "+wi:Vr(t,"UCWEB")||Vr(t,"UCBrowser")?"UC Browser":Vr(t,"CriOS")?Pi:Vr(t,"CrMo")||Vr(t,Fi)?Fi:Vr(t,Ii)&&Vr(t,Ti)?Yi:Vr(t,"FxiOS")?Hi:Vr(t.toLowerCase(),rn.toLowerCase())?rn:fn(t,e)?Vr(t,wi)?Ui:Ti:Vr(t,qi)?qi:Vr(t,"MSIE")||Vr(t,"Trident/")?Li:Vr(t,"Gecko")?qi:""},gn={[Di]:[new RegExp("rv:"+nn)],[Zi]:[new RegExp($i+"?\\/"+nn)],[Fi]:[new RegExp("("+Fi+"|CrMo)\\/"+nn)],[Pi]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[sn],[Ui]:[sn],[Bi]:[new RegExp("(Opera|OPR)\\/"+nn)],[qi]:[new RegExp(qi+"\\/"+nn)],[Hi]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Ei]:[new RegExp(Ei+" "+nn),sn],[Yi]:[new RegExp("android\\s"+nn,"i")],[Mi]:[new RegExp(Ni+"\\/"+nn)],[Li]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},mn=function(t,e){var r=pn(t,e),i=gn[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},yn=[[new RegExp(Gi+"; "+Gi+" (.*?)[);]","i"),t=>[Gi,t&&t[1]||""]],[new RegExp(Vi,"i"),[Vi,""]],[new RegExp(zi,"i"),[zi,""]],[ln,[Ei,""]],[new RegExp(Wi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Xi,""];if(new RegExp(wi).test(e)&&!/IEMobile\b/.test(e))return[Wi+" "+wi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=r[1],n=hn[i]||"";return/arm/i.test(e)&&(n="RT"),[Wi,n]}return[Wi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[_i,e.join(".")]}return[_i,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ri(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ii+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ii+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Ii,e.join(".")]}return[Ii,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Oi,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return un.test(t)?Vi:an.test(t)?zi:on.test(t)?Gi:new RegExp(Ki,"i").test(t)?Ki:new RegExp("("+Xi+"|WPDesktop)","i").test(t)?Xi:/iPad/.test(t)?ki:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ai:ln.test(t)?Ei:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ji,"i").test(t)?Ji:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(wi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Ii:Si:new RegExp("(pda|"+wi+")","i").test(t)?tn:new RegExp(Ci,"i").test(t)&&!new RegExp(Ci+" pc","i").test(t)?en:""},wn=function(t){var e=bn(t);return e===ki||e===Si||"Kobo"===e||"Kindle Fire"===e||e===en?Ci:e===Vi||e===Gi||e===zi||e===Ki?"Console":e===Ai?"Wearable":e?wi:"Desktop"},_n=t=>t instanceof Error;function In(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return vn&&r.length===dn||(dn=r.length,vn=r.reduce(((r,i)=>{cn||(cn={});var n=cn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,cn[i]=[u,l];break}}return r}),{})),vn}}class Cn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Jr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:In(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Sn="?";function kn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Sn:r,in_app:!0};return ri(i)||(s.lineno=i),ri(n)||(s.colno=n),s}var xn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Sn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},An=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=(t,e)=>{var r=An.exec(t);if(r){var[,i,n,s]=r;return kn(e,i,Sn,+n,+s)}var o=Tn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=En.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=xn(o[1]||Sn,o[2]);return kn(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fn=(t,e)=>{var r=Nn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Mn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Sn;return[s,n]=xn(s,n),kn(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Pn=50;function Ln(){return function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;a<o.length;a++){var u=o[a];if(!(u.length>1024)){var l=On.test(u)?u.replace(On,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){s.push(c);break}}if(s.length>=Pn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Pn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Sn});var i}))}(s)}}("web:javascript",Rn,Fn)}class Dn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=ii(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return vi(t,"DOMException")}isDOMError(t){return vi(t,"DOMError")}}class Bn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class jn{constructor(){}match(t){return vi(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r,i=e.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var $n=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Zn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match($n);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Hn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(!(n.length>e))return i===r.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class Vn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return fi(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Hn(t)}isSeverityLevel(t){return ii(t)&&!ni(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(_n(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class zn{match(t){return fi(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Hn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Gn{match(t){return di(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Yn{match(t){return vi(t,"PromiseRejectionEvent")}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return di(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){if(di(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Un="undefined"!=typeof window?window:void 0,Wn="undefined"!=typeof globalThis?globalThis:Un;"undefined"==typeof self&&(Wn.self=Wn),"undefined"==typeof File&&(Wn.File=function(){});var Xn=Array.prototype,Jn=Xn.forEach,Kn=Xn.indexOf,Qn=null==Wn?void 0:Wn.navigator,ts=null==Wn?void 0:Wn.document,es=null==Wn?void 0:Wn.location,rs=null==Wn?void 0:Wn.fetch,is=null!=Wn&&Wn.XMLHttpRequest&&"withCredentials"in new Wn.XMLHttpRequest?Wn.XMLHttpRequest:void 0,ns=null==Wn?void 0:Wn.AbortController,ss=null==Qn?void 0:Qn.userAgent,os=null!=Un?Un:{},as=()=>!!Un.Zone,us=t=>t instanceof Document,ls={DEBUG:!1,LIB_VERSION:"1.349.0"},hs=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={N:function(e){if(Un&&(ls.DEBUG||os.POSTHOG_DEBUG||r)&&!ri(Un.console)&&Un.console){for(var i=("__rrweb_original__"in Un.console[e]?Un.console[e].__rrweb_original__:Un.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(t,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.N("error",...e)},critical:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>hs(t+" "+e,r)};return i},cs=hs("[PostHog.js]"),ds=cs.createLogger,vs={};function fs(t,e,r){if(Jr(t))if(Jn&&t.forEach===Jn)t.forEach(e,r);else if("length"in t&&t.length===+t.length)for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===vs)return}function ps(t,e,r){if(!oi(t)){if(Jr(t))return fs(t,e,r);if(hi(t)){for(var i of t.entries())if(e.call(r,i[1],i[0])===vs)return}else for(var n in t)if(Wr.call(t,n)&&e.call(r,t[n],n)===vs)return}}var gs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){for(var r in e)void 0!==e[r]&&(t[r]=e[r])})),t},ms=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return fs(r,(function(e){fs(e,(function(e){t.push(e)}))})),t};function ys(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var bs=function(t){try{return t()}catch(t){return}},ws=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){cs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cs.critical(t)}}},_s=function(t){var e={};return ps(t,(function(t,r){(ii(t)&&t.length>0||ai(t))&&(e[r]=t)})),e};function Is(t,e){return r=t,i=t=>ii(t)&&!si(e)?t.slice(0,e):t,n=new Set,function t(e,r){return e!==Object(e)?i?i(e,r):e:n.has(e)?void 0:(n.add(e),Jr(e)?(s=[],fs(e,(e=>{s.push(t(e))}))):(s={},ps(e,((e,r)=>{n.has(e)||(s[r]=t(e,r))}))),s);var s}(r);var r,i,n}var Cs=["herokuapp.com","vercel.app","netlify.app"];function Ss(t){var e=null==t?void 0:t.hostname;if(!ii(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Cs)if(r===i)return!1;return!0}function ks(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function xs(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var As=t=>{var e=null==ts?void 0:ts.createElement("a");return ri(e)?null:(e.href=t,e)},Ts=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ps(t,(function(t,e){ri(t)||ri(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Es=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Jr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Rs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],u=o[0],l=(a||"").split("&"),h=[],c=0;c<l.length;c++){var d=l[c].split("=");Jr(d)&&(e.includes(d[0])?h.push(d[0]+"="+r):h.push(l[c]))}var v=u;return null!=a&&(v+="?"+h.join("&")),null!=s&&(v+="#"+s),v},Ns=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Ms(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Fs(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Os="$people_distinct_id",Ps="__alias",Ls="__timers",Ds="$autocapture_disabled_server_side",Bs="$heatmaps_enabled_server_side",js="$exception_capture_enabled_server_side",$s="$error_tracking_suppression_rules",Zs="$error_tracking_capture_extension_exceptions",qs="$web_vitals_enabled_server_side",Hs="$dead_clicks_enabled_server_side",Vs="$product_tours_enabled_server_side",zs="$web_vitals_allowed_metrics",Gs="$session_recording_remote_config",Ys="$sesid",Us="$session_is_sampled",Ws="$enabled_feature_flags",Xs="$early_access_features",Js="$feature_flag_details",Ks="$stored_person_properties",Qs="$stored_group_properties",to="$surveys",eo="$flag_call_reported",ro="$feature_flag_errors",io="$user_state",no="$client_session_props",so="$capture_rate_limit",oo="$initial_campaign_params",ao="$initial_referrer_info",uo="$initial_person_info",lo="$epp",ho="__POSTHOG_TOOLBAR__",co="$posthog_cookieless",vo=[Os,Ps,"__cmpns",Ls,"$session_recording_enabled_server_side",Bs,Ys,Ws,$s,io,Xs,Js,Qs,Ks,to,eo,ro,no,so,oo,ao,lo,uo,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function fo(t){return t instanceof Element&&(t.id===ho||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function po(t){return!!t&&1===t.nodeType}function go(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mo(t){return!!t&&3===t.nodeType}function yo(t){return!!t&&11===t.nodeType}function bo(t){return t?zr(t).split(/\s+/):[]}function wo(t){var e=null==Un?void 0:Un.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function _o(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return bo(e)}function Io(t){return oi(t)?null:zr(t).split(/(\s+)/).filter((t=>Ho(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(t){var e="";return Po(t)&&!Lo(t)&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;mo(t)&&t.textContent&&(e+=null!==(r=Io(t.textContent))&&void 0!==r?r:"")})),zr(e)}function So(t){return ri(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ko=["a","button","form","input","select","textarea","label"];function xo(t,e){if(ri(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Ao(t){var e=t.parentNode;return!(!e||!po(e))&&e}var To=["next","previous","prev",">","<"],Eo=10;var Ro=[".ph-no-rageclick",".ph-no-capture"];function No(t,e){if(!Un||Mo(t))return!1;var r,i,n;li(e)?(r=!!e&&Ro,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ro,i=null==e?void 0:e.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Fo(t,!1);return!function(t,e){if(!1===t||ri(t))return!1;var r;if(!0===t)r=To;else{if(!Jr(t))return!1;if(t.length>Eo)return cs.error("[PostHog] content_ignorelist array cannot exceed "+Eo+" items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,s.map((t=>{var e;return{safeText:Co(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!xo(s,r)}var Mo=t=>!t||go(t,"html")||!po(t),Fo=(t,e)=>{if(!Un||Mo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!go(n,"body");)if(yo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Ao(n);if(!s)break;if(e||ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Un.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Oo(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!Un||Mo(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!wo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&wo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Fo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(ri(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!xo(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=Un.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ko.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Po(t){for(var e=t;e.parentNode&&!go(e,"body");e=e.parentNode){var r=_o(e);if(Vr(r,"ph-sensitive")||Vr(r,"ph-no-capture"))return!1}if(Vr(_o(t),"ph-include"))return!0;var i=t.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Lo(t){return!!(go(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||go(t,"select")||go(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Do="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Bo=new RegExp("^(?:"+Do+")$"),jo=new RegExp(Do),$o="\\d{3}-?\\d{2}-?\\d{4}",Zo=new RegExp("^("+$o+")$"),qo=new RegExp("("+$o+")");function Ho(t,e){if(void 0===e&&(e=!0),oi(t))return!1;if(ii(t)){if(t=zr(t),(e?Bo:jo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Zo:qo).test(t))return!1}return!0}function Vo(t){var e=Co(t);return Ho(e=(e+" "+zo(t)).trim())?e:""}function zo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Co(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+zo(t)).trim())}catch(t){cs.error("[AutoCapture]",t)}})),e}function Go(t){return function(t){var e=t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ys(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Yo(e.toString())]=Yo(r.toString())})),n+=":",n+=ys(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Uo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ys(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(t))}function Yo(t){return t.replace(/"|\\"/g,'\\"')}function Uo(t){var e=t.attr__class;return e?Jr(e)?e:bo(e):void 0}var Wo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xo=ds("[Recorder]"),Jo=t=>"navigation"===t.entryType,Ko=t=>"resource"===t.entryType;function Qo(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>oa({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Jo(t)||Ko(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>oa({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function ta(t,e){return!!e&&(li(e)||e[t])}function ea(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(li(r))return!0;if(Jr(r))return s(r);var o=r[e];return li(o)?o:s(o)}function ra(t,e,r,i,n,s){return ia.apply(this,arguments)}function ia(){return ia=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Xo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>Ko(t)&&t.initiatorType===e&&(ri(i)||t.startTime>=i)&&(ri(n)||t.startTime<=n)));return o||(yield new Promise((t=>setTimeout(t,50*s))),ra(t,e,r,i,n,s+1))})),ia.apply(this,arguments)}function na(t){var{body:e,options:r,url:i}=t;if(oi(e))return null;var{hostname:n,isHostDenied:s}=Fs(i,r);if(s)return n+" is in deny list";if(ii(e))return e;if(us(e))return e.textContent;if(hi(e))return Ts(e);if(ti(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var sa=t=>!si(t)&&("navigation"===t.entryType||"resource"===t.entryType);function oa(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(sa(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var aa=["video/","audio/"];function ua(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function la(){return la=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Fs(i,r);return s?Promise.resolve(n+" is in deny list"):ua(e)})),la.apply(this,arguments)}function ha(){return ha=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=aa.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Fs(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return si(n)?ua(e):Promise.resolve(n)})),ha.apply(this,arguments)}function ca(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ta("request",i.recordHeaders),s=ta("response",i.recordHeaders),o=Ms(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),ea({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return la.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield o(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),ea({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return ha.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{ra(r,"fetch",c.url,l,h).then((e=>{var r,i=oa({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}var da=null;function va(t,e,i){if(!("performance"in e))return()=>{};if(da)return Xo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Wo,i):Wo,s=e=>{var i=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},o=Qo(s,e,n),a=()=>{},u=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ta("request",r.recordHeaders),n=ta("response",r.recordHeaders),s=Ms(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,u,l,h){void 0===u&&(u=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=na({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=na({body:v.response,options:r,url:a})),ra(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=oa({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),u,l,h)}));return()=>{s()}}(s,e,n),u=ca(s,e,n)),da=()=>{o(),a(),u(),da=null}}var fa=t=>({name:"rrweb/network@1",observer:va,options:t});os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:fa},os.__PosthogExtensions__.rrweb={record:je,version:"v2"},os.rrweb={record:je,version:"v2"},os.rrwebConsoleRecord={getRecordConsolePlugin:Br},os.getRecordNetworkPlugin=fa;var pa,ga,ma,ya,ba,wa,_a,Ia,Ca,Sa,ka,xa,Aa={},Ta=[],Ea=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ra=Array.isArray;function Na(t,e){for(var r in e)t[r]=e[r];return t}function Ma(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?pa.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Oa(t,o,i,n,null)}function Oa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++ma:n,__i:-1,__u:0};return null==n&&null!=ga.vnode&&ga.vnode(s),s}function Pa(t){return t.children}function La(t,e){this.props=t,this.context=e}function Da(t,e){if(null==e)return t.__?Da(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Da(t):null}function Ba(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ba(t)}}function ja(t){(!t.__d&&(t.__d=!0)&&ya.push(t)&&!$.__r++||ba!=ga.debounceRendering)&&((ba=ga.debounceRendering)||wa)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ya.length;)ya.length>a&&ya.sort(_a),t=ya.shift(),a=ya.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Na({},i)).__v=i.__v+1,ga.vnode&&ga.vnode(r),Ga(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Da(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ua(s,r,o),i.__e=i.__=null,r.__e!=n&&Ba(r)));$.__r=0}function $a(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Ta,b=e.length;for(u=function(t,e,r,i,n){var s,o,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;s<n;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Oa(null,o,null,null,null):Ra(o)?o=t.__k[s]=Oa(Pa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Oa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(l=o.__i=qa(o,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:n<h&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<h;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ja(a,a));return i}(r,e,y,u,b),c=0;c<b;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Aa:y[v.__i]||Aa,v.__i=c,g=Ga(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Za(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Za(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=t,e=Za(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Da(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function qa(t,e,r,i){var n,s,o,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||s<e.length;)if(null!=(l=e[o=n>=0?n--:s++])&&0==(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function Ha(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Ea.test(e)?r:r+"px"}function Va(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Ha(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ha(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ia,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=Ca,t.addEventListener(e,s?ka:Sa,s)):t.removeEventListener(e,s?ka:Sa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function za(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ca++;else if(e.t<r.u)return;return r(ga.event?ga.event(e):e)}}}function Ga(t,e,r,i,n,s,o,a,u,l){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,k,x=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ga.__b)&&h(e);t:if("function"==typeof x)try{if(m=e.props,y="prototype"in x&&x.prototype.render,b=(h=x.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new x(m,w):(e.__c=c=new La(m,w),c.constructor=x,c.render=Ka),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=x.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Na({},c.__s)),Na(c.__s,x.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==x.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),$=0;$<c._sb.length;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=t,c.__e=!1,_=ga.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),C=0;C<c._sb.length;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,_&&_(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++I<25);c.state=c.__s,null!=c.getChildContext&&(i=Na(Na({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===Pa&&null==h.key&&(S=Wa(h.props.children)),a=$a(t,Ra(S)?S:[S],e,r,i,n,s,o,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=s)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(k=s.length;k--;)Ma(s[k]);Ya(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ya(e);ga.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,u){var l,h,c,d,v,f,p,g=r.props||Aa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;l<s.length;l++)if((v=s[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ga.__m&&ga.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&pa.call(t.childNodes),!a&&null!=s)for(g={},l=0;l<t.attributes.length;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Va(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Va(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),$a("template"==e.type?t.content:t,Ra(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Da(r,0),a,u),null!=s)for(l=s.length;l--;)Ma(s[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Va(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Va(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ga.diffed)&&h(e),128&e.__u?void 0:a}function Ya(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ya)}function Ua(t,e,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);ga.__c&&ga.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ga.__e(t,e.__v)}}))}function Wa(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:Ra(t)?t.map(Wa):Na({},t)}function Xa(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ga.__e(t,r)}}function Ja(t,e,r){var i,n;if(ga.unmount&&ga.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ga.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&Ja(i[n],e,r||"function"!=typeof t.type);r||Ma(t.__e),t.__c=t.__=t.__e=void 0}function Ka(t,e,r){return this.constructor(t,r)}function Qa(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ga.__&&ga.__(t,e),i=!1?null:e.__k,n=[],s=[],Ga(e,t=e.__k=Fa(Pa,null,[t]),i||Aa,Aa,e.namespaceURI,i?null:e.firstChild?pa.call(e.childNodes):null,n,i?i.__e:e.firstChild,false,s),Ua(n,t,s)}function tu(t,e,r){var i,n,s,o,a=Na({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?pa.call(arguments,2):r),Oa(t.type,a,i||t.key,n||t.ref,null)}pa=Ta.slice,ga={__e:function(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},ma=0,La.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Na({},this.state),"function"==typeof t&&(t=t(Na({},r),this.props)),t&&Na(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),ja(this))},La.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ja(this))},La.prototype.render=Pa,ya=[],wa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_a=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ia=/(PointerCapture)$|Capture$/i,Ca=0,Sa=za(!1),ka=za(!0),xa=0;var eu,ru,iu,nu,su=0,ou=[],au=ga,uu=au.__b,lu=au.__r,hu=au.diffed,cu=au.__c,du=au.unmount,vu=au.__;function fu(t,e){au.__h&&au.__h(ru,t,su||e),su=0;var r=ru.__H||(ru.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function pu(t){return su=1,function(t,e,r){var i=fu(eu++,2);if(i.t=t,!i.__c&&(i.__=[xu(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=ru,!ru.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};ru.__f=!0;var s=ru.shouldComponentUpdate,o=ru.componentWillUpdate;ru.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},ru.shouldComponentUpdate=n}return i.__N||i.__}(xu,t)}function gu(t,e){var r=fu(eu++,3);!au.__s&&ku(r.__H,e)&&(r.__=t,r.u=e,ru.__H.__h.push(r))}function mu(t){return su=5,yu((function(){return{current:t}}),[])}function yu(t,e){var r=fu(eu++,7);return ku(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function bu(t){var e=ru.context[t.__c],r=fu(eu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(ru)),e.props.value):t.__}function wu(){for(var t;t=ou.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Cu),t.__H.__h.forEach(Su),t.__H.__h=[]}catch(e){t.__H.__h=[],au.__e(e,t.__v)}}au.__b=function(t){ru=null,uu&&uu(t)},au.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vu&&vu(t,e)},au.__r=function(t){lu&&lu(t),eu=0;var e=(ru=t.__c).__H;e&&(iu===ru?(e.__h=[],ru.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Cu),e.__h.forEach(Su),e.__h=[],eu=0)),iu=ru},au.diffed=function(t){hu&&hu(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==ou.push(e)&&nu===au.requestAnimationFrame||((nu=au.requestAnimationFrame)||Iu)(wu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),iu=ru=null},au.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Cu),t.__h=t.__h.filter((function(t){return!t.__||Su(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],au.__e(r,t.__v)}})),cu&&cu(t,e)},au.unmount=function(t){du&&du(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Cu(t)}catch(t){e=t}})),r.__H=void 0,e&&au.__e(e,r.__v))};var _u="function"==typeof requestAnimationFrame;function Iu(t){var e,r=function(){clearTimeout(i),_u&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);_u&&(e=requestAnimationFrame(r))}function Cu(t){var e=ru,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),ru=e}function Su(t){var e=ru;t.__c=t.__(),ru=e}function ku(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function xu(t,e){return"function"==typeof e?e(t):e}var Au=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),Tu=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),Eu=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),Ru=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Nu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Mu=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Fu=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),Ou=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),Pu=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Lu=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Du=function(t){return t.Popover="popover",t.Inline="inline",t}({}),Bu=ds("[Surveys]");function ju(t){return!(!t.start_date||t.end_date)}function $u(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Zu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var qu="seenSurvey_",Hu="inProgressSurvey_",Vu=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},zu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Gu=t=>zu(qu,t),Yu=t=>{localStorage.getItem(Gu(t))||localStorage.setItem(Gu(t),"true")},Uu=[Nu.Popover,Nu.Widget,Nu.API],Wu={ignoreConditions:!1,ignoreDelay:!1,displayType:Du.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ai(t)&&isFinite(t)&&Math.floor(t)===t});var Xu="0123456789abcdef";class Ju{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||e<0||r<0||i<0||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Ju(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+Xu.charAt(this.bytes[e]>>>4)+Xu.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Ju(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Ku{constructor(){this.M=0,this.F=0,this.O=new el}generate(){var t=this.generateOrAbort();if(ri(t)){this.M=0;var e=this.generateOrAbort();if(ri(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.M)this.M=t,this.D();else{if(!(t+1e4>this.M))return;this.F++,this.F>4398046511103&&(this.M++,this.D())}return Ju.fromFieldsV7(this.M,Math.trunc(this.F/Math.pow(2,30)),this.F&Math.pow(2,30)-1,this.O.nextUint32())}D(){this.F=1024*this.O.nextUint32()+(1023&this.O.nextUint32())}}var Qu,tl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Un&&!ri(Un.crypto)&&crypto.getRandomValues&&(tl=t=>crypto.getRandomValues(t));class el{constructor(){this.B=new Uint32Array(8),this.j=1/0}nextUint32(){return this.j>=this.B.length&&(tl(this.B),this.j=0),this.B[this.j++]}}var rl=()=>il().toString(),il=()=>(Qu||(Qu=new Ku)).generate(),nl=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),sl=Uint8Array,ol=Uint16Array,al=Uint32Array,ul=new sl([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]),ll=new sl([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]),hl=new sl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cl=function(t,e){for(var r=new ol(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new al(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},dl=cl(ul,2),vl=dl[0],fl=dl[1];vl[28]=258,fl[258]=28;for(var pl=cl(ll,0)[1],gl=new ol(32768),ml=0;ml<32768;++ml){var yl=(43690&ml)>>>1|(21845&ml)<<1;yl=(61680&(yl=(52428&yl)>>>2|(13107&yl)<<2))>>>4|(3855&yl)<<4,gl[ml]=((65280&yl)>>>8|(255&yl)<<8)>>>1}var bl=function(t,e,r){for(var i=t.length,n=0,s=new ol(e);n<i;++n)++s[t[n]-1];var o,a=new ol(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new ol(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[gl[c]>>>u]=l}else for(o=new ol(i),n=0;n<i;++n)o[n]=gl[a[t[n]-1]++]>>>15-t[n];return o},wl=new sl(288);for(ml=0;ml<144;++ml)wl[ml]=8;for(ml=144;ml<256;++ml)wl[ml]=9;for(ml=256;ml<280;++ml)wl[ml]=7;for(ml=280;ml<288;++ml)wl[ml]=8;var _l=new sl(32);for(ml=0;ml<32;++ml)_l[ml]=5;var Il=bl(wl,9,0),Cl=bl(_l,5,0),Sl=function(t){return(t/8>>0)+(7&t&&1)},kl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof ol?ol:t instanceof al?al:sl)(r-e);return i.set(t.subarray(e,r)),i},xl=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Al=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Tl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new sl(0),0];if(1==n){var o=new sl(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=h&&r[l].f<r[c].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;i<n;++i)s[i].s>d&&(d=s[i].s);var v=new ol(d+1),f=El(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var y=s[i].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;v[b]<e?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new sl(v),f]},El=function(t,e,r){return-1==t.s?Math.max(El(t.l,e,r+1),El(t.r,e,r+1)):e[t.s]=r},Rl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ol(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},Nl=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Ml=function(t,e,r){var i=r.length,n=Sl(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Fl=function(t,e,r,i,n,s,o,a,u,l,h){xl(e,h++,r),++n[256];for(var c=Tl(n,15),d=c[0],v=c[1],f=Tl(s,15),p=f[0],g=f[1],m=Rl(d),y=m[0],b=m[1],w=Rl(p),_=w[0],I=w[1],C=new ol(19),S=0;S<y.length;++S)C[31&y[S]]++;for(S=0;S<_.length;++S)C[31&_[S]]++;for(var k=Tl(C,7),x=k[0],A=k[1],T=19;T>4&&!x[hl[T-1]];--T);var E,R,N,M,F=l+5<<3,O=Nl(n,wl)+Nl(s,_l)+o,P=Nl(n,d)+Nl(s,p)+o+14+3*T+Nl(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Ml(e,h,t.subarray(u,u+l));if(xl(e,h,1+(P<O)),h+=2,P<O){E=bl(d,v,0),R=d,N=bl(p,g,0),M=p;var L=bl(x,A,0);xl(e,h,b-257),xl(e,h+5,I-1),xl(e,h+10,T-4),h+=14;for(S=0;S<T;++S)xl(e,h+3*S,x[hl[S]]);h+=3*T;for(var D=[y,_],B=0;B<2;++B){var j=D[B];for(S=0;S<j.length;++S){var Z=31&j[S];xl(e,h,L[Z]),h+=x[Z],Z>15&&(xl(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}}else E=Il,R=wl,N=Cl,M=_l;for(S=0;S<a;++S)if(i[S]>255){Z=i[S]>>>18&31;Al(e,h,E[Z+257]),h+=R[Z+257],Z>7&&(xl(e,h,i[S]>>>23&31),h+=ul[Z]);var q=31&i[S];Al(e,h,N[q]),h+=M[q],q>3&&(Al(e,h,i[S]>>>5&8191),h+=ll[q])}else Al(e,h,E[i[S]]),h+=R[i[S]];return Al(e,h,E[256]),h+R[256]},Ol=new al([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pl=function(){for(var t=new al(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Ll=function(t,e,r,i,n){return function(t,e,r,i,n,s){var o=t.length,a=new sl(i+o+5*(1+Math.floor(o/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c<o?l=Ml(u,l,t.subarray(h,c)):(u[h]=s,l=Ml(u,l,t.subarray(h,o)))}else{for(var d=Ol[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new ol(32768),m=new ol(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new al(25e3),I=new ol(288),C=new ol(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<o;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,A<=h){var M=o-h;if((S>7e3||x>24576)&&M>423){l=Fl(t,u,0,_,I,C,k,x,T,h-T,l),x=S=k=0,T=h;for(var F=0;F<286;++F)I[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),Z=Math.min(258,M);D<=j&&--L&&R!=N;){if(t[h+O]==t[h+O-D]){for(var q=0;q<Z&&t[h+q]==t[h+q-D];++q);if(q>O){if(O=q,P=D,q>B)break;var H=Math.min(D,q-2),V=0;for(F=0;F<H;++F){var z=h-D+F+32768&32767,G=z-g[z]+32768&32767;G>V&&(V=G,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[x++]=268435456|fl[O]<<18|pl[P];var Y=31&fl[O],U=31&pl[P];k+=ul[Y]+ll[U],++I[257+Y],++C[U],A=h+O,++S}else _[x++]=t[h],++I[t[h]]}}l=Fl(t,u,s,_,I,C,k,x,T,h-T,l)}return kl(a,0,i+Sl(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},Dl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Bl(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Pl[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}}(),i=t.length;r.p(t);var n=Ll(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),s=n.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Dl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}}(n,e),Dl(n,s-8,r.d()),Dl(n,s-4,i),n}var jl=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=t.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),si(a)||(r>e&&(s+=t.substring(e,r)),s+=a,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},$l=!!is||!!rs,Zl="text/plain",ql=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],l=Ts(a);return l&&u.push(l),s+"?"+u.join("&")},Hl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Vl=t=>{var{data:e,compression:r}=t;if(e){if(r===nl.GZipJS){var i=Bl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new sl(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;o<r;++o){if(n+5>i.length){var a=new sl(n+8+(r-o<<1));a.set(i),i=a}var u=t.charCodeAt(o);u<128||e?s(u):u<2048?(s(192|u>>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return kl(i,0,n)}(Hl(e)),{mtime:0}),n=new Blob([i],{type:Zl});return{contentType:Zl,body:n,estimatedSize:n.size}}if(r===nl.Base64){var s=function(t){var e,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",h=[];if(!t)return t;t=jl(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,h[u++]=o.charAt(e)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<t.length);switch(l=h.join(""),t.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Hl(e)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:Hl(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Hl(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},zl=[];rs&&zl.push({transport:"fetch",method:t=>{var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=Vl(t))&&void 0!==e?e:{},a=new Headers;ps(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(ns){var h=new ns;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}rs(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(o||0)<52428.8,body:s,signal:null==(i=l)?void 0:i.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){cs.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{cs.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),is&&zl.push({transport:"XHR",method:t=>{var e,r=new is;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Vl(t))&&void 0!==e?e:{};ps(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&zl.push({transport:"sendBeacon",method:t=>{var e=ql(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Vl(t))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(e,s)}catch(t){}}});var Gl=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Yl(t,e,r){return Hl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Ul={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Gl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Gl(e,t))))),icontains:(t,e)=>e.map(Wl).some((e=>t.map(Wl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Wl).every((e=>t.map(Wl).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Wl=t=>t.toLowerCase();function Xl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(ri(n)||si(n))return!1;var s=[String(n)],o=Ul[i.operator];return!!o&&o(i.values,s)}))}var Jl=ds("[Stylesheet Loader]"),Kl=Un,Ql=ts;function th(t){return"$survey_response_"+t}var eh="#020617",rh={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:Eu.Right,widgetType:Tu.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:eh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function ih(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function nh(t){var e;void 0===t&&(t=rh.backgroundColor),"#"===t[0]&&(e=ih(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=ih(r)),!e)return eh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?eh:"white"}return eh}function sh(t){var e=((t,e,r)=>{var i,n=t.createElement("style");return n.innerText=e,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Jl.error("prepare_external_dependency_stylesheet returned null"),null)})(Ql,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var oh=(t,e,i)=>{var n=Ah(t),s=Ql.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Ql.createElement("div");((t,e,i)=>{var n=r({},rh,i),s=t.style,o=![Eu.Center,Eu.Left,Eu.Right].includes(n.position)||e===Nu.Widget&&(null==i?void 0:i.widgetType)===Tu.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||nh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",nh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||nh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",nh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),s.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||nh(u);s.setProperty("--ph-survey-input-text-color",l),s.setProperty("--ph-survey-rating-text-color",l),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),u=sh(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return Ql.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ah=(t,e)=>{if(!e)return null;var r=t[th(e)];return Jr(r)?[...r]:r},uh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=t;s?(Yu(i),s.capture(Pu.SENT,r({[Lu.SURVEY_NAME]:i.name,[Lu.SURVEY_ID]:i.id,[Lu.SURVEY_ITERATION]:i.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Lu.SURVEY_QUESTIONS]:i.questions.map((t=>({id:t.id,question:t.question,response:ah(e,t.id)}))),[Lu.SURVEY_SUBMISSION_ID]:n,[Lu.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,a,{$set:{[Vu(i,"responded")]:!0}})),o&&(Kl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xh(i))):Bu.error("[survey sent] event not captured, PostHog instance not found.")},lh=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!oi(t))).length>0,hh=(t,e,i)=>r({[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Lu.SURVEY_PARTIALLY_COMPLETED]:lh(e),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==e?void 0:e.responses,{[Lu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Lu.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:ah((null==e?void 0:e.responses)||{},t.id)})))}),ch=(t,e,i)=>{if(e){if(!i){var n=Sh(t);e.capture(Pu.DISMISSED,r({},hh(t,n,e),{$set:{[Vu(t,"dismissed")]:!0}})),xh(t),Yu(t),Kl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bu.error("[survey dismissed] event not captured, PostHog instance not found.")},dh=(t,e)=>{if(e){var r=(t=>zu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Sh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Pu.ABANDONED,hh(t,i,e),{transport:"sendBeacon"})}}else Bu.error("[survey abandoned] event not captured, PostHog instance not found.")},vh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),fh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,ph=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?fh(t.questions,vh(t.questions)):t.questions,gh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===Ou.Always||kh(t)},mh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,ja(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+xa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),yh=()=>bu(mh),bh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return tu(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function wh(t){return null!=t?t:"icontains"}function _h(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Kl||null==(r=Kl.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=wh(null==(i=t.conditions)?void 0:i.urlMatchType);return Ul[o](s,[n])}var Ih=t=>{var e=""+Hu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Hu+t.id+"_"+t.current_iteration),e},Ch=(t,e)=>{try{localStorage.setItem(Ih(t),JSON.stringify(e))}catch(t){Bu.error("Error setting in-progress survey state in localStorage",t)}},Sh=t=>{try{var e=localStorage.getItem(Ih(t));if(e)return JSON.parse(e)}catch(t){Bu.error("Error getting in-progress survey state from localStorage",t)}return null},kh=t=>{var e=Sh(t);return!oi(null==e?void 0:e.surveySubmissionId)},xh=t=>{try{localStorage.removeItem(Ih(t))}catch(t){Bu.error("Error clearing in-progress survey state from localStorage",t)}};function Ah(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Th(t,e,r){if(void 0===e&&(e=Eu.Right),t===Nu.ExternalSurvey)return{};switch(e){case Eu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Eu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Eu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Eu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Eu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Eu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Eu.Left:return{left:"30px"};case Eu.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Eu.Right:return{right:t===Nu.Widget&&r===Tu.Tab?"60px":"30px"}}}var Eh=0;function Rh(t,e,r,i,n,s){e||(e={});var o,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?o=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Eh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return ga.vnode&&ga.vnode(l),l}var Nh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Mh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Oh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("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"})}),Ph=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Lh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rh("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"})}),Dh=Rh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rh("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"})}),Bh=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Rh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Rh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Rh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:e})]})},jh=Rh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Rh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Rh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Rh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Rh("g",{mask:"url(#mask0_2415_6911)",children:[Rh("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"}),Rh("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"}),Rh("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"}),Rh("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"}),Rh("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Rh("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"})]})]}),Rh("defs",{children:Rh("clipPath",{id:"clip0_2415_6911",children:Rh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function $h(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Rh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",jh]})}function Zh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=bu(mh);return Rh("div",{className:"bottom-section",children:[!a&&Rh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Un||Un.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Rh($h,{urlParams:{utm_source:"survey-footer"}})]})}function qh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Rh("div",{class:"question-header",children:[Rh(e.type===Mu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&bh({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Hh(t){var{onClick:e}=t,{isPreviewMode:r}=bu(mh);return Rh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Bh({fill:"black"})})}Rh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Rh("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 Vh=Un;function zh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=bu(mh);return gu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return xs(Vh,"keydown",t),()=>{Vh.removeEventListener("keydown",t)}}),[o]),Rh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Rh(Hh,{onClick:()=>o()}),Rh("h3",{className:"thank-you-message-header",children:e}),r&&bh({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Rh(Zh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Gh=t=>Jr(t)&&t.every((t=>ii(t)));function Yh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=yh(),l=mu(null),[h,c]=pu((()=>ii(a)?a:""));gu((()=>{setTimeout((()=>{var t;u||(null==(t=l.current)||t.focus())}),100)}),[u]);var d="surveyQuestion"+o,v=yu((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case jr.MinLength:if(void 0!==o.value&&s.length<o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case jr.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Zr(e.validation,jr.MinLength),p=Zr(e.validation,jr.MaxLength),g=yu((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]);return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:e,forceDisableHtml:r,htmlFor:d}),Rh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h}),g&&Rh("div",{className:"validation-hint",children:g})]}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:()=>{v||n(h.trim())},onPreviewSubmit:()=>{v||s(h.trim())}})]})}function Uh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Rh(Pa,{children:[Rh("div",{className:"question-container",children:Rh(qh,{question:e,forceDisableHtml:r})}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Wh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=pu((()=>ai(u)?u:Jr(u)&&u.length>0&&ai(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ai(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=yh(),p=t=>f?a(t):o(t);return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:r,forceDisableHtml:i}),Rh("div",{className:"rating-section",children:[Rh("div",{className:"rating-options",children:["emoji"===r.display&&Rh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=ec[r.scale])?void 0:e.map(((t,e)=>Rh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick:()=>{var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Rh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:rc(r.scale).map(((t,e)=>Rh(Xh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber:t=>{d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Rh("div",{className:"rating-text",children:[Rh("div",{children:r.lowerBoundLabel}),Rh("div",{children:r.upperBoundLabel})]})]})]}),Rh(Zh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:si(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Xh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Rh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Jh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=mu(null),h=yu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=fh(e,vh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=pu((()=>((t,e)=>ii(t)||Gh(t)?t:e===Mu.SingleChoice?null:[])(u,e.type))),[v,f]=pu((()=>((t,e)=>{if(ii(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Gh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=yh(),g=e.type===Mu.SingleChoice,m=e.type===Mu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&Jr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},w=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},_=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!e.optional&&(!!si(c)||(!(!Jr(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),C=()=>{v.isSelected&&m?Jr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Rh(Pa,{children:[Rh("div",{className:"question-container",children:[Rh(qh,{question:e,forceDisableHtml:i}),Rh("fieldset",{className:"multiple-choice-options limit-height",children:[Rh("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:Jr(c)&&c.includes(t);return Rh("label",{className:i?"choice-option-open":"",children:[Rh("div",{className:"response-choice",children:[Rh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Rh("span",{children:i?t+":":t})]}),i&&Rh("input",{type:"text",ref:l,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Rh(Zh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var Kh=[1,2,3,4,5],Qh=[1,2,3,4,5,6,7],tc=[0,1,2,3,4,5,6,7,8,9,10],ec={2:[Lh,Dh],3:[Fh,Mh,Nh],5:[Oh,Fh,Mh,Nh,Ph]};function rc(t){switch(t){case 5:default:return Kh;case 7:return Qh;case 10:return tc}}var ic=ds("[Surveys]");function nc(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Fu.End:s;if(n.branching.type===Fu.End)return Fu.End;if(n.branching.type===Fu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Fu.ResponseBased){if(n.type===Mu.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===Fu.End?Fu.End:s}}else if(n.type===Mu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(t<1||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===Fu.End?Fu.End:s}}return s}return ic.warn("Falling back to next question index due to unexpected branching type"),s}var sc=Un,oc=ts,ac="ph:show_survey_widget",uc="PHWidgetSurveyClickListener",lc=250,hc=20,cc=12;function dc(t,e){try{var r=t.getBoundingClientRect(),i=sc.innerHeight,n=sc.innerWidth,s=lc,o=r.left+r.width/2-e/2;o+e>n-hc&&(o=n-e-hc),o<hc&&(o=hc);var a=cc,u=i-r.bottom,l=r.top,h=u<s&&l>u;return{position:"fixed",top:h?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:h?i-r.top+a+"px":"auto",zIndex:rh.zIndex}}catch(t){return Bu.warn("Failed to calculate trigger position:",t),null}}class vc{constructor(t){var e=this;this.$=new Map,this.Z=new Map,this.q=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(to);if(t)for(var e of t)kh(e)&&dh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=null!=e&&e.position||null!=e&&e.selector?r({},t,{appearance:r({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t;this.H(a.id);var{properties:u,initialResponses:l}=null!=e?e:{},h=!!(l&&Object.keys(l).length>0)&&this.V(a,l,u);if(!h||null!=(i=a.appearance)&&i.displayThankYouMessage){this.G(a);var c={};if((null==(n=a.appearance)?void 0:n.position)===Eu.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var d,v=oc.querySelector(a.appearance.widgetSelector);if(v)c=dc(v,parseInt((null==(d=a.appearance)?void 0:d.maxWidth)||rh.maxWidth))||{}}var f=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:p}=oh(a,this._posthog),g={posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Y,properties:u,style:c,isSurveyCompleted:h,skipShownEvent:null==e?void 0:e.skipShownEvent};if(f<=0)return Qa(Rh(mc,r({},g)),p);var m=setTimeout((()=>{if(this.$.delete(a.id),!_h(a))return this.Y(a);Qa(Rh(mc,r({},g,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),p)}),1e3*f);this.$.set(a.id,m)}},this.U=t=>{var{shadow:e,isNewlyCreated:r}=oh(t,this._posthog);r&&Qa(Rh(bc,{posthog:this._posthog,survey:t},t.id),e)},this.W=t=>{this.X(t);var e=this.Z.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(uc),this.Z.delete(t.id),Bu.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=oc.querySelector(e),i=this.Z.get(t.id);if(r){if(this.U(t),i){if(r===i.element)return;Bu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.W(t)}if(!r.hasAttribute(uc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Eu.NextToTrigger?dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||rh.maxWidth)):{};sc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:t.id,position:n}}))};xs(r,"click",n),r.setAttribute(uc,"true"),this.Z.set(t.id,{element:r,listener:n,survey:t}),Bu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.W(t)},this.renderPopover=t=>{var{shadow:e}=oh(t,this._posthog);Qa(Rh(mc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y}),e)},this.renderSurvey=(t,e,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.K(t),Qa(Rh(mc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.tt(t)&&e.et(t)&&e.rt(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Nu.Popover||t.type===Nu.Widget)),i=e.it(r),n=new Set;i.forEach((t=>{if(t.type===Nu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===Tu.Tab)return void e.U(t);if((null==(i=t.appearance)?void 0:i.widgetType)===Tu.Selector&&null!=(s=t.appearance)&&s.widgetSelector)n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector)}si(e.nt)&&t.type===Nu.Popover&&e.handlePopoverSurvey(t)})),e.Z.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.W(r)}))}),t)},this.G=t=>{si(this.nt)||Bu.error("Survey "+this.nt+" already in focus. Cannot add survey "+t.id+"."),this.nt=t.id},this.Y=t=>{this.nt!==t.id&&Bu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.H(t.id),this.nt=null,this.X(t)},this._posthog=t,this.nt=null}H(t){var e=this.$.get(t);e&&(clearTimeout(e),this.$.delete(t))}cancelSurvey(t){this.$.has(t)&&(Bu.info("Cancelled pending survey "+t),this.H(t),this.nt===t&&(this.nt=null))}it(t){return t.sort(((t,e)=>{var r,i,n=kh(t),s=kh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Ou.Always,a=e.schedule===Ou.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}K(t){if(!this.q.has(t.id)){var{params:e}=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!ri(a)){var u=decodeURIComponent(o),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(sc.location.search);if(0!==Object.keys(e).length){Bu.info("[Survey Prefill] Detected URL prefill parameters");var r=this.st(t,e);if(r){var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;(Object.keys(o).length>0&&t.enable_partial_responses||s)&&uh({responses:s?i:o,survey:t,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this.q.add(t.id)}}}}V(t,e,r){var i={};for(var[n,s]of Object.entries(e)){i[parseInt(n)]=Jr(s)?s.map(String):[String(s)]}Bu.info("[Survey] Processing initial responses");var o=this.st(t,i);if(!o)return!1;var{responses:a,submissionId:u,isSurveyCompleted:l}=o;return uh({responses:a,survey:t,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:l,properties:r}),l}st(t,e){try{var r=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=th(t.id);try{switch(t.type){case Mu.SingleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=t.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Mu.MultipleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];u.length<a.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case Mu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||l<0||l>h)return void cs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:cs.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){cs.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(r).length)return Bu.warn("[Survey Prefill] No valid responses after conversion"),null;var i=rl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;i<t.questions.length&&0<s&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=th(o.id);ri(r[a])||(n[a]=r[a])}var u=nc(t,i,o.id?r[th(o.id)]:null);if(u===Fu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,n,r),a=s>=t.questions.length;return Ch(t,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Bu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(t){return Bu.error("[Survey Prefill] Error handling prefill:",t),null}}ot(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),i=!0;e&&(i=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return r&&i}tt(t){return!t.conditions||_h(t)&&function(t){var e,r,i;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(r=t.conditions)?void 0:r.deviceTypes.length))return!0;if(!ss)return!1;var n=wn(ss);return Ul[wh(null==(i=t.conditions)?void 0:i.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Ql||!Ql.querySelector(t.conditions.selector))}(t)}ut(t){return gh(t)||this.ot(t.internal_targeting_flag_key)||kh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!ju(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Uu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.ot(t.linked_flag_key,n)?this.ot(t.targeting_flag_key)?this.ut(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t})(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Gu(t))&&!gh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}et(t){var e;if(!$u(t)&&!Zu(t))return!0;var r=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}rt(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ot(r)}))}X(t){try{var e=oc.querySelector(Ah(t,!0));null!=e&&e.shadowRoot&&Qa(null,e.shadowRoot),null==e||e.remove()}catch(e){Bu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.nt,surveyTimeouts:this.$,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.it,checkFlags:this.rt.bind(this),isSurveyFeatureFlagEnabled:this.ot.bind(this)}}}function fc(t,e){if(oc&&sc){var r,i=new vc(t);if(t.config.disable_surveys_automatic_display)return Bu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Bu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),xs(oc,"visibilitychange",(()=>{oc.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function pc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;gu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Nu.Widget,s=_h(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===Tu.Tab&&n;if(!s)return Bu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Bu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};xs(sc,"popstate",s),xs(sc,"hashchange",s);var o=sc.history.pushState,a=sc.history.replaceState;return sc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e),s()},sc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{sc.removeEventListener("popstate",s),sc.removeEventListener("hashchange",s),sc.history.pushState=o,sc.history.replaceState=a}}}),[n,e,r,i])}function gc(t){switch(void 0===t&&(t=Ru.Right),t){case Ru.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ru.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ru.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Ru.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function mc(t){var e,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w}=t,_=mu(null),I=Number.isInteger(d),C=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:S,isSurveySent:k,hidePopupWithViewTransition:x}=function(t,e,r,i,n,s,o,a){var[u,l]=pu(i||0===r||t.type===Nu.ExternalSurvey),[h,c]=pu(!1),d=()=>{var e=()=>{s&&n(t),l(!1)};oc.startViewTransition?oc.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},v=e=>{e.detail.surveyId===t.id&&d()};return gu((()=>{if(e){if(!i){var n=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return d();c(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{d()}),5e3)}},s=()=>{_h(t)&&(l(!0),sc.dispatchEvent(new Event("PHSurveyShown")),a||e.capture(Pu.SHOWN,{[Lu.SURVEY_NAME]:t.name,[Lu.SURVEY_ID]:t.id,[Lu.SURVEY_ITERATION]:t.current_iteration,[Lu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(xs(sc,"PHSurveyClosed",v),xs(sc,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}return s(),()=>{sc.removeEventListener("PHSurveyClosed",v),sc.removeEventListener("PHSurveySent",n)}}}else Bu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),pc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:i}),{isPopupVisible:u,isSurveySent:h,setIsPopupVisible:l,hidePopupWithViewTransition:d}}(u,h,C,I,v,f,_,w),A=k||d===u.questions.length||!0===b,T=yu((()=>{var t=Sh(u);return{isPreviewMode:I,previewPageIndex:d,onPopupSurveyDismissed:()=>{ch(u,h,I),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||rl(),onPreviewSubmit:p,posthog:h,properties:y}}),[I,d,f,h,u,g,p,y]);return S?Rh(mh.Provider,{value:T,children:Rh("div",{className:"ph-survey",style:r({},Th(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:_,children:A?Rh(zh,{header:(null==(s=u.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||rh,onClose:()=>{x(),m()}}):Rh(yc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function yc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=pu((()=>{var t=Sh(i);return null!=t&&t.responses&&Bu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f}=bu(mh),[p,g]=pu((()=>{var t=Sh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),m=yu((()=>ph(i)),[i]);gu((()=>{v&&!ri(u)&&g(u)}),[u,v]);var y=m.at(p);return y?Rh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Rh(Hh,{onClick:()=>{l()}}),Rh("div",{className:"survey-box",children:wc({question:y,forceDisableHtml:n,displayQuestionIndex:p,appearance:i.appearance||rh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=th(u),h=r({},o,{[l]:e});a(h);var c=nc(i,n,e),v=c===Fu.End;v||(g(c),Ch(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(i.enable_partial_responses||v)&&uh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f})}else Bu.error("onNextButtonClick called without a questionId.");else Bu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:p,questionId:y.id}),onPreviewSubmit:c,initialValue:y.id?o[th(y.id)]:void 0})})]}):null}function bc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c}=t,[d,v]=pu(!0),[f,p]=pu(!1),[g,m]=pu({}),y=()=>{p(!f)};if(gu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Bu.info("Received show event for feedback button survey "+u.id),m(r.detail.position||{}),y())};return xs(sc,ac,e),()=>{sc.removeEventListener(ac,e)}}}else Bu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),pc({survey:u,setSurveyVisible:v}),!d)return null;var b=()=>{u.schedule!==Ou.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return Rh(Pa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Rh("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===Ru.Top?"widget-tab-top":""),onClick:y,disabled:c,style:gc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),f&&Rh(mc,{posthog:h,survey:u,forceDisableHtml:l,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var wc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:s,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{o(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case Mu.Open:return Fa(Yh,r({},l,{question:e,key:e.id}));case Mu.Link:return Fa(Uh,r({},l,{question:e,key:e.id}));case Mu.Rating:return Fa(Wh,r({},l,{question:e,key:e.id}));case Mu.SingleChoice:case Mu.MultipleChoice:return Fa(Jh,r({},l,{question:e,key:e.id}));default:return Bu.error("Unsupported question type: "+e.type),null}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.generateSurveys=fc,os.extendPostHogWithSurveys=fc;class _c{emit(t){}}var Ic=new _c;var Cc=new class{getLogger(t,e,r){return new _c}};class Sc{constructor(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}emit(t){this.ct().emit(t)}ct(){if(this.dt)return this.dt;var t=this.ht.vt(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ic}}class kc{getLogger(t,e,r){var i;return null!==(i=this.vt(t,e,r))&&void 0!==i?i:new Sc(this,t,e,r)}ft(){var t;return null!==(t=this.dt)&&void 0!==t?t:Cc}yt(t){this.dt=t}vt(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getLogger(t,e,r)}}var xc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Ac=Symbol.for("io.opentelemetry.js.api.logs"),Tc=xc;class Ec{constructor(){this.bt=new kc}static getInstance(){return this._instance||(this._instance=new Ec),this._instance}setGlobalLoggerProvider(t){return Tc[Ac]?this.getLoggerProvider():(Tc[Ac]=(e=1,r=t,i=Cc,t=>t===e?r:i),this.bt.yt(t),t);var e,r,i}getLoggerProvider(){var t,e;return null!==(e=null===(t=Tc[Ac])||void 0===t?void 0:t.call(Tc,1))&&void 0!==e?e:this.bt}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Tc[Ac],this.bt=new kc}}var Rc=Ec.getInstance();class Nc{constructor(t){this.dt=void 0,this.dt=t}export(t,e){this.dt.export(t,e)}forceFlush(){return this.dt.forceFlush()}shutdown(){return this.dt.shutdown()}}class Mc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Fc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Oc{constructor(t){this.wt=void 0,this._t=[],this.wt=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._t.push(t);var e=()=>{var e=this._t.indexOf(t);this._t.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this._t.length>=this.wt}awaitAll(){var t=this;return e((function*(){yield Promise.all(t._t)}))()}}function Pc(t){return new Oc(t.concurrencyLimit)}var Lc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Dc="1.9.0",Bc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var jc=function(t){var e=new Set([t]),r=new Set,i=t.match(Bc);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(Bc);if(!i)return a(t);var l=+i[1],h=+i[2],c=+i[3];return null!=i[4]||n!==l?a(t):0===n?s===h&&o<=c?u(t):a(t):s<=h?u(t):a(t)}}(Dc),$c=Dc.split(".")[0],Zc=Symbol.for("opentelemetry.js.api."+$c),qc=Lc;function Hc(t,e,r,i){var n;void 0===i&&(i=!1);var s=qc[Zc]=null!==(n=qc[Zc])&&void 0!==n?n:{version:Dc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}if(s.version!==Dc){o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Dc);return r.error(o.stack||o.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Dc+"."),!0}function Vc(t){var e,r,i=null===(e=qc[Zc])||void 0===e?void 0:e.version;if(i&&jc(i))return null===(r=qc[Zc])||void 0===r?void 0:r[t]}function zc(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Dc+".");var r=qc[Zc];r&&delete r[t]}var Gc,Yc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Uc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Wc=function(){function t(t){this.It=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("debug",this.It,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("error",this.It,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("info",this.It,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("warn",this.It,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xc("verbose",this.It,t)},t}();function Xc(t,e,r){var i=Vc("diag");if(i)return r.unshift(e),i[t].apply(i,Uc([],Yc(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(Gc||(Gc={}));var Jc=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Kc=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},Qc=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=Vc("diag");if(i)return i[t].apply(i,Kc([],Jc(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:Gc.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Vc("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"==typeof n&&t>=i?n.bind(e):function(){}}return t<Gc.NONE?t=Gc.NONE:t>Gc.ALL&&(t=Gc.ALL),e=e||{},{error:r("error",Gc.ERROR),warn:r("warn",Gc.WARN),info:r("info",Gc.INFO),debug:r("debug",Gc.DEBUG),verbose:r("verbose",Gc.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Gc.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return Hc("diag",u,e,!0)},e.disable=function(){zc("diag",e)},e.createComponentLogger=function(t){return new Wc(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function td(t){return Symbol.for(t)}var ed,rd=function t(e){var r=this;r.Ct=e?new Map(e):new Map,r.getValue=function(t){return r.Ct.get(t)},r.setValue=function(e,i){var n=new t(r.Ct);return n.Ct.set(e,i),n},r.deleteValue=function(e){var i=new t(r.Ct);return i.Ct.delete(e),i}},id=new rd,nd=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},sd=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},od=function(){function t(){}return t.prototype.active=function(){return id},t.prototype.with=function(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return e.call.apply(e,sd([r],nd(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),ad=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},ud=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},ld="context",hd=new od,cd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Hc(ld,t,Qc.instance())},t.prototype.active=function(){return this.St().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return(i=this.St()).with.apply(i,ud([t,e,r],ad(n),!1))},t.prototype.bind=function(t,e){return this.St().bind(t,e)},t.prototype.St=function(){return Vc(ld)||hd},t.prototype.disable=function(){this.St().disable(),zc(ld,Qc.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(ed||(ed={}));var dd="0000000000000000",vd="00000000000000000000000000000000",fd={traceId:vd,spanId:dd,traceFlags:ed.NONE},pd=function(){function t(t){void 0===t&&(t=fd),this.kt=t}return t.prototype.spanContext=function(){return this.kt},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),gd=td("OpenTelemetry Context Key SPAN");function md(t){return t.getValue(gd)||void 0}function yd(){return md(cd.getInstance().active())}function bd(t,e){return t.setValue(gd,e)}function wd(t){return t.deleteValue(gd)}function _d(t,e){return bd(t,new pd(e))}function Id(t){var e;return null===(e=md(t))||void 0===e?void 0:e.spanContext()}var Cd=/^([0-9a-f]{32})$/i,Sd=/^[0-9a-f]{16}$/i;function kd(t){return r=t.traceId,Cd.test(r)&&r!==vd&&(e=t.spanId,Sd.test(e)&&e!==dd);var e,r}function xd(t){return new pd(t)}var Ad=cd.getInstance(),Td=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ad.active()),Boolean(null==e?void 0:e.root))return new pd;var i,n=r&&Id(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&kd(n)?new pd(n):new pd},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(!(arguments.length<2)){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:Ad.active(),u=this.startSpan(t,n,a),l=bd(a,u);return Ad.with(l,o,void 0,u)}},t}();var Ed=new Td,Rd=function(){function t(t,e,r,i){this.ht=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.xt().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.xt();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.xt=function(){if(this.dt)return this.dt;var t=this.ht.getDelegateTracer(this.name,this.version,this.options);return t?(this.dt=t,this.dt):Ed},t}(),Nd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Td},t}()),Md=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new Rd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.dt)&&void 0!==t?t:Nd},t.prototype.setDelegate=function(t){this.dt=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.dt)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),Fd=cd.getInstance(),Od=Qc.instance(),Pd="trace",Ld=function(){function t(){this.At=new Md,this.wrapSpanContext=xd,this.isSpanContextValid=kd,this.deleteSpan=wd,this.getSpan=md,this.getActiveSpan=yd,this.getSpanContext=Id,this.setSpan=bd,this.setSpanContext=_d}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Hc(Pd,this.At,Qc.instance());return e&&this.At.setDelegate(t),e},t.prototype.getTracerProvider=function(){return Vc(Pd)||this.At},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){zc(Pd,Qc.instance()),this.At=new Md},t}(),Dd=Ld.getInstance(),Bd=td("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function jd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if($d(i)){e=i;continue}return!1}return!1}}return!0}(t):$d(typeof t))}function $d(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var Zd=t=>{Od.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))};function qd(t){try{Zd(t)}catch(t){}}var Hd,Vd=performance,zd="telemetry.sdk.language",Gd="telemetry.sdk.name",Yd="telemetry.sdk.version",Ud={[Gd]:"opentelemetry","process.runtime.name":"browser",[zd]:"webjs",[Yd]:"2.2.0"},Wd=Math.pow(10,6),Xd=Math.pow(10,9);function Jd(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Wd)]}function Kd(){var t=Vd.timeOrigin;if("number"!=typeof t){var e=Vd;t=e.timing&&e.timing.fetchStart}return t}function Qd(t){return function(t,e){var r=[t[0]+e[0],t[1]+e[1]];r[1]>=Xd&&(r[1]-=Xd,r[0]+=1);return r}(Jd(Kd()),Jd("number"==typeof t?t:Vd.now()))}function tv(t){if(e=t,Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return t;if("number"==typeof t)return t<Kd()?Qd(t):Jd(t);if(t instanceof Date)return Jd(t.getTime());throw TypeError("Invalid input type");var e}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Hd||(Hd={}));var ev="[object Object]",rv="[object Null]",iv="[object Undefined]",nv=Function.prototype.toString,sv=nv.call(Object),ov=Object.getPrototypeOf,av=Object.prototype,uv=av.hasOwnProperty,lv=Symbol?Symbol.toStringTag:void 0,hv=av.toString;function cv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?iv:rv;return lv&&lv in Object(t)?function(t){var e=uv.call(t,lv),r=t[lv],i=!1;try{t[lv]=void 0,i=!0}catch(t){}var n=hv.call(t);i&&(e?t[lv]=r:delete t[lv]);return n}(t):function(t){return hv.call(t)}(t)}(t)!==ev)return!1;var e=ov(t);if(null===e)return!0;var r=uv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&nv.call(r)===sv}var dv=20;function vv(t){return gv(t)?t.slice():t}function fv(t,e,r,i){var n;if(void 0===r&&(r=0),!(r>dv)){if(r++,bv(t)||bv(e)||mv(e))n=vv(e);else if(gv(t)){if(n=t.slice(),gv(e))for(var s=0,o=e.length;s<o;s++)n.push(vv(e[s]));else if(yv(e))for(var a=Object.keys(e),u=0,l=a.length;u<l;u++){var h=a[u];n[h]=vv(e[h])}}else if(yv(t))if(yv(e)){if(!function(t,e){if(!cv(t)||!cv(e))return!1;return!0}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;d<v;d++){var f=c[d],p=e[f];if(bv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(pv(t,f,i)||pv(e,f,i))delete n[f];else{if(yv(g)&&yv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=fv(n[f],p,r,i)}}}}else n=e;return n}}function pv(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;n<s;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function gv(t){return Array.isArray(t)}function mv(t){return"function"==typeof t}function yv(t){return!bv(t)&&!gv(t)&&!mv(t)&&"object"==typeof t}function bv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class wv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,wv.prototype)}}function _v(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new wv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Iv{constructor(){this.Tt=void 0,this.Et=void 0,this.Rt=void 0,this.Tt=new Promise(((t,e)=>{this.Et=t,this.Rt=e}))}get promise(){return this.Tt}resolve(t){this.Et(t)}reject(t){this.Rt(t)}}class Cv{constructor(t,e){this.Nt=void 0,this.Mt=void 0,this.Ft=!1,this.Ot=new Iv,this.Nt=t,this.Mt=e}get isCalled(){return this.Ft}get promise(){return this.Ot.promise}call(){if(!this.Ft){this.Ft=!0;try{for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Promise.resolve(this.Nt.call(this.Mt,...e)).then((t=>this.Ot.resolve(t)),(t=>this.Ot.reject(t)))}catch(t){this.Ot.reject(t)}}return this.Ot.promise}}var Sv={Pt:function(t,e){return new Promise((r=>{Fd.with(function(t){return t.setValue(Bd,!0)}(Fd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))}};function kv(){return{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Od.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class xv{constructor(t,e,r,i,n){this.Lt=void 0,this.Dt=void 0,this.Bt=void 0,this.jt=void 0,this.$t=void 0,this.Zt=void 0,this.Lt=t,this.Dt=e,this.Bt=r,this.jt=i,this.$t=n,this.Zt=Od.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.Zt.debug("items to be sent",t),this.jt.hasReachedLimit())e({code:Hd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Dt.serializeRequest(t);null!=r?this.jt.pushPromise(this.Lt.send(r,this.$t).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:Hd.FAILED,error:t.error}):"retryable"===t.status?e({code:Hd.FAILED,error:new Mc("Export failed with retryable status")}):e({code:Hd.FAILED,error:new Mc("Export failed with unknown error")});else{if(null!=t.data)try{this.Bt.handleResponse(this.Dt.deserializeResponse(t.data))}catch(e){this.Zt.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Hd.SUCCESS})}}),(t=>e({code:Hd.FAILED,error:t})))):e({code:Hd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.jt.awaitAll()}shutdown(){var t=this;return e((function*(){t.Zt.debug("shutdown started"),yield t.forceFlush(),t.Lt.shutdown()}))()}}function Av(t,e,r){return i={transport:r,serializer:e,promiseHandler:Pc(t)},n={timeout:t.timeoutMillis},new xv(i.transport,i.serializer,kv(),i.promiseHandler,n.timeout);var i,n}function Tv(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Ev(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;i<t.length;i+=2){var n=Tv(t.charCodeAt(i)),s=Tv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Rv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Nv(t){var e,r=Rv(t);return e=r,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Mv="undefined"!=typeof BigInt?function(t){return Rv(t).toString()}:function(t){return t[0]*Xd+t[1]};function Fv(t){return t}function Ov(t){if(void 0!==t)return Ev(t)}var Pv={encodeHrTime:Nv,encodeSpanContext:Ev,encodeOptionalSpanContext:Ov};function Lv(t,e){return{key:t,value:Dv(e)}}function Dv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Dv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Lv(e,r)}))}}:{}}function Bv(t,e){var r=function(t){var e,r;if(void 0===t)return Pv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Nv:Mv,encodeSpanContext:n?Fv:Ev,encodeOptionalSpanContext:n?Fv:Ov}}(e);return{resourceLogs:jv(t,r)}}function jv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+s+":"+o,l=a.get(u);l||(l=[],a.set(u,l)),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Lv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Dv(t.body),eventName:t.eventName,attributes:$v(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function $v(t){return Object.keys(t).map((e=>Lv(e,t[e])))}var Zv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class qv{static FromAttributeList(t,e){var r=new qv({},e);return r.qt=Vv(t),r.Ht=t.filter((t=>{var[e,r]=t;return Zv(r)})).length>0,r}constructor(t,e){var r;this.qt=void 0,this.Ht=!1,this.Vt=void 0,this.zt=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.qt=Object.entries(i).map((t=>{var[e,r]=t;return Zv(r)&&(this.Ht=!0),[e,r]})),this.qt=Vv(this.qt),this.Vt=function(t){if("string"==typeof t||void 0===t)return t;return void Od.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Ht}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;e<t.qt.length;e++){var[r,i]=t.qt[e];t.qt[e]=[r,Zv(i)?yield i:i]}t.Ht=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Od.error("Accessing resource attributes before async attributes settled"),this.zt)return this.zt;var t={};for(var[e,r]of this.qt){var i;if(Zv(r))Od.debug("Unsettled resource attribute "+e+" skipped");else if(null!=r)null!==(i=t[e])&&void 0!==i||(t[e]=r)}return this.Ht||(this.zt=t),t}getRawAttributes(){return this.qt}get schemaUrl(){return this.Vt}merge(t){if(null==t)return this;var e=function(t,e){var r=null==t?void 0:t.schemaUrl,i=null==e?void 0:e.schemaUrl,n=void 0===r||""===r,s=void 0===i||""===i;if(n)return i;if(s)return r;if(r===i)return r;return void Od.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,t),r=e?{schemaUrl:e}:void 0;return qv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function Hv(t,e){return qv.FromAttributeList(Object.entries(t),e)}function Vv(t){return t.map((t=>{var[e,r]=t;return Zv(r)?[e,r.catch((t=>{Od.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var zv={serializeRequest:t=>{var e=Bv(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Gv{constructor(t){this.Lt=void 0,this.Lt=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Lt.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Lt.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Lt.shutdown()}}function Yv(t){return new Gv(t.transport)}function Uv(t){return[429,502,503,504].includes(t)}function Wv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}}class Xv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=yield i.Gt.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Gt.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{s.status>=200&&s.status<=299?(Od.debug("XHR success"),n({status:"success"})):s.status&&Uv(s.status)?n({status:"retryable",retryInMillis:Wv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Jv{constructor(t){this.Yt=void 0,this.Yt=t}send(t){var r=this;return e((function*(){var e=(yield r.Yt.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Yt.url,new Blob([t],{type:e}))?(Od.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Kv{constructor(t){this.Gt=void 0,this.Gt=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Gt.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Gt.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return u.status>=200&&u.status<=299?(Od.debug("response success"),{status:"success"}):Uv(u.status)?{status:"retryable",retryInMillis:Wv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Qv(t,e){return Av(t,e,Yv({transport:(r=t,new Xv(r))}));var r}function tf(t,e){return Av(t,e,Yv({transport:(r=t,new Kv(r))}));var r}function ef(t,e){return Av(t,e,Yv({transport:(r={url:t.url,headers:t.headers},new Jv(r))}));var r}function rf(t,i,n){return e((function*(){var e=r({},yield n()),s={};return null!=i&&Object.assign(s,yield i()),null!=t&&Object.assign(s,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Od.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield t())),Object.assign(s,e)}))}function nf(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function sf(t,e,i){var n,s;return r({},function(t,e,r){var i,n,s,o,a,u;return{timeoutMillis:Fc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(t,e,i),{headers:rf(t.headers,e.headers,i.headers),url:null!==(n=null!==(s=nf(t.url))&&void 0!==s?s:e.url)&&void 0!==n?n:i.url})}function of(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function af(t,i,n){return sf({url:t.url,timeoutMillis:t.timeoutMillis,headers:of(t),concurrencyLimit:t.concurrencyLimit},{},function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function uf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tf:Qv:ef)(af(t,r,i),e)}class lf extends Nc{constructor(t){void 0===t&&(t={}),super(uf(t,zv,"v1/logs",{"Content-Type":"application/json"}))}}class hf{set severityText(t){this.Ut()||(this.Wt=t)}get severityText(){return this.Wt}set severityNumber(t){this.Ut()||(this.Xt=t)}get severityNumber(){return this.Xt}set body(t){this.Ut()||(this.Jt=t)}get body(){return this.Jt}get eventName(){return this.Kt}set eventName(t){this.Ut()||(this.Kt=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Wt=void 0,this.Xt=void 0,this.Jt=void 0,this.Kt=void 0,this.totalAttributesCount=0,this.Qt=!1,this.te=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=tv(null!=i?i:c),this.hrTimeObserved=tv(null!=n?n:c),h){var d=Dd.getSpanContext(h);d&&kd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.te=t.logRecordLimits,this.Kt=s,this.setAttributes(l)}setAttribute(t,e){return this.Ut()||null===e?this:0===t.length?(Od.warn("Invalid attribute key: "+t),this):jd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this.te.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(1===this.droppedAttributesCount&&Od.warn("Dropping extra attributes."),this):(jd(e)?this.attributes[t]=this.ee(e):this.attributes[t]=e,this)):(Od.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}re(){this.Qt=!0}ee(t){var e=this.te.attributeValueLengthLimit;return e<=0?(Od.warn("Attribute value limit must be positive, got "+e),t):"string"==typeof t?this.ie(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.ie(t,e):t)):t}ie(t,e){return t.length<=e?t:t.substring(0,e)}Ut(){return this.Qt&&Od.warn("Can not execute the operation on emitted log record"),this.Qt}}class cf{constructor(t,e){this.instrumentationScope=void 0,this.ne=void 0,this.instrumentationScope=t,this.ne=e}emit(t){var e=t.context||Fd.active(),i=new hf(this.ne,this.instrumentationScope,r({context:e},t));this.ne.activeProcessor.onEmit(i,e),i.re()}}class df{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class vf{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>_v(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class ff{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new vf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new df}}class pf{constructor(t){var e,r,i;void 0===t&&(t={}),this.se=void 0,this.ne=void 0;var n,s,o,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=fv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Hv({"service.name":"unknown_service",[zd]:Ud[zd],[Gd]:Ud[Gd],[Yd]:Ud[Yd]});this.ne=new ff(d,c.forceFlushTimeoutMillis,(n=c.logRecordLimits,{attributeCountLimit:null!==(s=null!==(o=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0}),null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.se=new Cv(this.oe,this)}getLogger(t,e,r){if(this.se.isCalled)return Od.warn("A shutdown LoggerProvider cannot provide a Logger"),Ic;t||Od.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.ne.loggers.has(n)||this.ne.loggers.set(n,new cf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.ne)),this.ne.loggers.get(n)}forceFlush(){return this.se.isCalled?(Od.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.se.promise):this.ne.activeProcessor.forceFlush()}shutdown(){return this.se.isCalled?(Od.warn("shutdown may only be called once per LoggerProvider"),this.se.promise):this.se.call()}oe(){return this.ne.activeProcessor.shutdown()}}class gf{constructor(t,e){var r,i,n,s,o,a,u,l;this.ae=void 0,this.ue=void 0,this.le=void 0,this.he=void 0,this.ce=void 0,this.de=!1,this.ve=[],this.fe=void 0,this.se=void 0,this.ae=t,this.ue=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.le=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.he=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.ce=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.se=new Cv(this.oe,this),this.ue>this.le&&(Od.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.ue=this.le)}onEmit(t){this.se.isCalled||this.pe(t)}forceFlush(){return this.se.isCalled?this.se.promise:this.ge()}shutdown(){return this.se.call()}oe(){var t=this;return e((function*(){t.onShutdown(),yield t.ge(),yield t.ae.shutdown()}))()}pe(t){this.ve.length>=this.le||(this.ve.push(t),this.me())}ge(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ve.length/this.ue),n=0;n<i;n++)r.push(this.ye());Promise.all(r).then((()=>{t()})).catch(e)}))}ye(){return this.be(),0===this.ve.length?Promise.resolve():new Promise(((t,e)=>{_v(this.Pt(this.ve.splice(0,this.ue)),this.ce).then((()=>t())).catch(e)}))}me(){if(!this.de){var t=()=>{this.de=!0,this.ye().then((()=>{this.de=!1,this.ve.length>0&&(this.be(),this.me())})).catch((t=>{this.de=!1,qd(t)}))};if(this.ve.length>=this.ue)return t();void 0===this.fe&&(this.fe=setTimeout((()=>t()),this.he),"number"!=typeof this.fe&&this.fe.unref())}}be(){void 0!==this.fe&&(clearTimeout(this.fe),this.fe=void 0)}Pt(t){var e=()=>Sv.Pt(this.ae,t).then((t=>{var e;t.code!==Hd.SUCCESS&&qd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(qd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,qd)}}class mf extends gf{constructor(t,e){super(t,e),this.we=void 0,this._e=void 0,this.Ie(e)}onShutdown(){"undefined"!=typeof document&&(this.we&&document.removeEventListener("visibilitychange",this.we),this._e&&document.removeEventListener("pagehide",this._e))}Ie(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.we=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._e=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.we),document.addEventListener("pagehide",this._e))}}var yf=1e4,bf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=yf),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;for(var o in s.add(t),t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o],u=e?e+"."+o:o;if(ti(a))bf(a,u,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=u.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[u]=a}}return r},wf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.logs={initializeLogs:t=>{(t=>{var e={"service.name":"posthog-browser-logs",host:os.location.host};if(t.sessionManager){var{sessionId:i,windowId:n}=t.sessionManager.checkAndGetSessionAndWindowId(!0);e=r({},e,{"session.id":i,"window.id":n})}Rc.setGlobalLoggerProvider(new pf({resource:Hv(e),processors:[new mf(new lf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Rc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s=os.console[n];os.console[n]=(s=>function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];if(a.length>0){var l=a.map((t=>{return JSON.stringify(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!si(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>yf&&(l=l.slice(0,yf)+"...",i.body_truncated="true"),e.emit({severityText:wf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":os.location.href},i,ti(a[0])?bf(a[0]):{})}),s.apply(os.console,a)}})(s)};for(var a of["debug","log","warn","error","info"])o(a)}};var _f=ds("[Error tracking]");function If(){return new Cn([new Dn,new Yn,new jn,new Bn,new zn,new Vn,new Zn,new Gn],Ln())}class Cf{constructor(t){var e,r;this.Ce=[],this.Se=If(),this._instance=t,this.Ce=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property($s))&&void 0!==e?e:[]}onRemoteConfig(t){var e,r,i,n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.Ce=n,this._instance.persistence&&this._instance.persistence.register({[$s]:this.Ce,[Zs]:s})}get ke(){var t,e=!!this._instance.get_property(Zs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Se.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.xe(e)){if(this.Ae(e))return void _f.info("Skipping exception capture because a suppression rule matched");if(!this.ke&&this.Te(e))return void _f.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ee(e))return void _f.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Ae(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return ii(r)&&r.length>0&&t.$exception_types.push(r),ii(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ce.some((t=>{var r=t.values.map((t=>{var r,i=Ul[t.operator],n=Jr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Te(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}Ee(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}xe(t){return!oi(t)&&Jr(t)}}var Sf=ds("[ExceptionAutocapture]"),kf=If(),xf={wrapOnError:t=>{var e=Un;e||Sf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],u=kf.buildFromUnknown(o||a,{mechanism:{handled:!1}});return t(u),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection:t=>{var e=Un;e||Sf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(i){var n,s=kf.buildFromUnknown(i,{mechanism:{handled:!1}});return t(s),null!==(n=null==r?void 0:r.apply(e,[i]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError:t=>{var e=console;e||Sf.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=kf.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.errorWrappingFunctions=xf,os.posthogErrorWrappingFunctions=xf;var Af=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!Jr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==co&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};os.__PosthogExtensions__=os.__PosthogExtensions__||{};var Tf={_patchFetch:(t,r,i)=>Ms(Un,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Af(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Ms(Un.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=new Request(s);return Af(t,e,r,l),i.call(this,n,l.url,o,a,u)}))};os.__PosthogExtensions__.tracingHeadersPatchFns=Tf,os.postHogTracingHeadersPatchFns=Tf;var Ef=-1,Rf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ef=e.timeStamp,t(e))}),!0)},Nf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&(((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e)))}},Mf=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ff=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Of=()=>{var t,e=Ff();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},Pf=function(t,e){void 0===e&&(e=-1);var r=Ff(),i="navigate";return Ef>=0?i="back-forward-cache":r&&(document.prerendering||Of()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Lf=new WeakMap;function Df(t,e){return Lf.get(t)||Lf.set(t,new e),Lf.get(t)}class Bf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&t.startTime-i.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var jf,$f=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Zf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},qf=-1,Hf=new Set,Vf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Hf)e();isFinite(qf)||(qf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zf,!0))}},Gf=()=>{if(qf<0){var t,e=Of(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;qf=null!=r?r:Vf(),addEventListener("visibilitychange",zf,!0),addEventListener("prerenderingchange",zf,!0),Rf((()=>{setTimeout((()=>{qf=Vf()}))}))}return{get firstHiddenTime(){return qf},onHidden(t){Hf.add(t)}}},Yf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Uf=[1800,3e3],Wf=function(t,e){void 0===e&&(e={}),Yf((()=>{var r,i=Gf(),n=Pf("FCP"),s=$f("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-Of(),0),n.entries.push(e),r(!0)))}));s&&(r=Nf(t,n,Uf,e.reportAllChanges),Rf((i=>{n=Pf("FCP"),r=Nf(t,n,Uf,e.reportAllChanges),Mf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xf=[.1,.25],Jf=0,Kf=1/0,Qf=0,tp=t=>{for(var e of t)e.interactionId&&(Kf=Math.min(Kf,e.interactionId),Qf=Math.max(Qf,e.interactionId),Jf=Qf?(Qf-Kf)/7+1:0)},ep=()=>{var t;return jf?Jf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},rp=0;class ip{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){rp=ep(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((ep()-rp)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var np=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Zf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},sp=[200,500];class op{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var ap=[2500,4e3],up={onLCP:function(t,e){void 0===e&&(e={}),Yf((()=>{var r,i=Gf(),n=Pf("LCP"),s=Df(e,op),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),o.startTime<i.firstHiddenTime&&(n.value=Math.max(o.startTime-Of(),0),n.entries=[o],r())},a=$f("largest-contentful-paint",o);if(a){r=Nf(t,n,ap,e.reportAllChanges);var u=Zf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(np(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Rf((i=>{n=Pf("LCP"),r=Nf(t,n,ap,e.reportAllChanges),Mf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(t,e){void 0===e&&(e={});var r=Gf();Wf(Zf((()=>{var i,n=Pf("CLS",0),s=Df(e,Bf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=$f("layout-shift",o);a&&(i=Nf(t,n,Xf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Rf((()=>{s.i=0,n=Pf("CLS",0),i=Nf(t,n,Xf,e.reportAllChanges),Mf((()=>i()))})),setTimeout(i))})))},onFCP:Wf,onINP:function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Gf();Yf((()=>{var i;"interactionCount"in performance||jf||(jf=$f("event",tp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Pf("INP"),o=Df(e,ip),a=t=>{np((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},u=$f("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Nf(t,s,sp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Rf((()=>{o.v(),s=Pf("INP"),n=Nf(t,s,sp,e.reportAllChanges)})))}))}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.postHogWebVitalsCallbacks=up,os.postHogWebVitalsCallbacks=up,os.__PosthogExtensions__.loadWebVitalsCallbacks=()=>up;class lp{constructor(t){this.disabled=!1===t;var e=ti(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var hp="$copy_autocapture",cp=ds("[AutoCapture]");function dp(t,e){return e.length>t?e.slice(0,t)+"...":e}function vp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!po(e));return e}function fp(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};ko.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=dp(1024,Vo(t)):s.$el_text=dp(1024,Co(t)));var o=_o(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),ps(t.attributes,(function(r){var n;if((!Lo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!e&&Ho(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=bo(o).join(" ")),s["attr__"+r.name]=dp(1024,o)}}));for(var a=1,u=1,l=t;l=vp(l);)a++,l.tagName===t.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}function pp(t,e){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:u}=e,l=[t],h=t;h.parentNode&&!go(h,"body");)yo(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(ps(l,(t=>{var e=Po(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Ho(f)&&f),Vr(_o(t),"ph-no-capture")&&(p=!0),d.push(fp(t,s,o,a));var r=function(t){if(!Po(t))return{};var e={};return ps(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ho(i)&&(e[r]=i)}})),e}(t);gs(v,r)})),p)return{props:{},explicitNoCapture:p};if(o||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=Vo(t):d[0].$el_text=Co(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=As(f))?void 0:g.host,b=null==Un||null==(m=Un.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:gs({$event_type:n.type,$ce_version:1},u?{}:{$elements:d},{$elements_chain:Go(d)},null!=(r=d[0])&&r.$el_text?{$el_text:null==(i=d[0])?void 0:i.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class gp{constructor(t){this.Re=!1,this.Ne=null,this.Me=!1,this.instance=t,this.rageclicks=new lp(t.config.rageclick),this.Fe=null}get Oe(){var t,e,r=ti(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Pe(){if(this.isBrowserSupported()){if(Un&&ts){var t=t=>{t=t||(null==Un?void 0:Un.event);try{this.Le(t)}catch(t){cp.error("Failed to capture event",t)}};if(xs(ts,"submit",t,{capture:!0}),xs(ts,"change",t,{capture:!0}),xs(ts,"click",t,{capture:!0}),this.Oe.capture_copied_text){var e=t=>{t=t||(null==Un?void 0:Un.event),this.Le(t,hp)};xs(ts,"copy",e,{capture:!0}),xs(ts,"cut",e,{capture:!0})}}}else cp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Re&&(this.Pe(),this.Re=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Me=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ds]:!!t.autocapture_opt_out}),this.Ne=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fe=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fe)||e.forEach((e=>{var i=null==ts?void 0:ts.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Ds],i=this.Ne;if(si(i)&&!li(r)&&!this.instance.De())return!1;var n=null!==(e=this.Ne)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!n}Le(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=So(t);if(mo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&No(i,this.instance.config.rageclick)&&this.Le(t,"$rageclick");var n=e===hp;if(i&&Oo(i,t,this.Oe,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=pp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:this.Me});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===hp){var u,l=Io(null==Un||null==(u=Un.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Kr(null==ts?void 0:ts.querySelectorAll)}}var mp={};function yp(t){return function(t,e){var r=mp[t];if(r)return r;var i=e[t];if(Qr(i)&&!as())return mp[t]=i.bind(e);var n=e.document;if(n&&Kr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[t]&&(i=o[t]),n.head.removeChild(s)}catch(e){cs.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Kr(i)?mp[t]=i.bind(e):i}("MutationObserver",t)}function bp(t,e){return ai(t)&&t>=e}class wp{Be(t){var e,r,i,n,s,o=this.je((null==t?void 0:t.__onCapture)||this.$e.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.Ze=[],this.je=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.qe=t=>{var e=function(t){var e=So(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);si(e)||this.He(e)||this.Ze.push(e),this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))},this.Ge=()=>{var t=Date.now();t%50==0&&this.Ze.forEach((e=>{ri(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Ye=()=>{this.Ue=Date.now()},this.instance=t,this.Oe=this.Be(e),this._onCapture=this.Oe.__onCapture}start(t){this.We(),this.Xe(),this.Je(),this.Ke(t)}Ke(t){if(!this.Qe){var e=yp(os);this.Qe=new e((t=>{this.tr(t)})),this.Qe.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Qe)||t.disconnect(),this.Qe=void 0,os.removeEventListener("click",this.qe),os.removeEventListener("scroll",this.Ge,{capture:!0}),os.removeEventListener("selectionchange",this.Ye)}tr(t){this.er=Date.now()}We(){xs(os,"click",this.qe)}Xe(){xs(os,"scroll",this.Ge,{capture:!0})}Je(){xs(os,"selectionchange",this.Ye)}He(t){if(!t)return!0;if(!this.Oe.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(fo(t.node))return!0;var r=this.Ze.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!r||!(!go(t.node,"html")&&po(t.node)&&!ko.includes(t.node.tagName.toLowerCase()))}ze(){if(this.Ze.length){clearTimeout(this.Ve),this.Ve=void 0;var t=this.Ze;for(var e of(this.Ze=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.er&&e.timestamp<=this.er?this.er-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Ue&&e.timestamp<=this.Ue?this.Ue-e.timestamp:void 0;var i=bp(e.scrollDelayMs,this.Oe.scroll_threshold_ms),n=bp(e.selectionChangedDelayMs,this.Oe.selection_change_threshold_ms),s=bp(e.mutationDelayMs,this.Oe.mutation_threshold_ms),o=bp(e.absoluteDelayMs,1.1*this.Oe.mutation_threshold_ms),a=ai(e.scrollDelayMs)&&e.scrollDelayMs<this.Oe.scroll_threshold_ms,u=ai(e.mutationDelayMs)&&e.mutationDelayMs<this.Oe.mutation_threshold_ms,l=ai(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.Oe.selection_change_threshold_ms;a||u||l||(i||s||o||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.er,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.Oe.mutation_threshold_ms&&this.Ze.push(e))}this.Ze.length&&ri(this.Ve)&&(this.Ve=os.setTimeout((()=>{this.ze()}),1e3))}}$e(t,e){this.instance.capture("$dead_click",r({},e,pp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oe.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new wp(t,e);var _p=ds("[ExternalScriptsLoader]"),Ip=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return _p.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==ts?void 0:ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;o<i.length;o++)if(n=s())return n.v;var a=()=>{if(!ts)return r("document not found");var i=ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)ts.head.appendChild(i);else{var n,s=ts.querySelectorAll("body > script");if(s.length>0)null==(n=s[0].parentNode)||n.insertBefore(i,s[0]);else ts.body.appendChild(i)}};null!=ts&&ts.body?a():null==ts||ts.addEventListener("DOMContentLoaded",a)};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var i="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(i="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",i);Ip(t,s,r)},os.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Ip(t,i,r)};var Cp="";var Sp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function kp(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=ts),Cp)return Cp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+rl();!Cp&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Cp=s)}return Cp}(t);if(!r){var i=(t=>{var e=t.match(Sp);return e?e[0]:""})(t);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var xp={rr:()=>!!ts,ir:function(t){cs.error("cookieStore error: "+t)},nr:function(t){if(ts){try{for(var e=t+"=",r=ts.cookie.split(";").filter((t=>t.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},sr:function(t){var e;try{e=JSON.parse(xp.nr(t))||{}}catch(t){}return e},ar:function(t,e,r,i,n){if(ts)try{var s="",o="",a=kp(ts.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),s="; expires="+u.toUTCString()}n&&(o="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+l.length),ts.cookie=l,l}catch(t){return}},ur:function(t,e){if(null!=ts&&ts.cookie)try{xp.ar(t,"",-1,e)}catch(t){return}}},Ap=null,Tp={rr:function(){if(!si(Ap))return Ap;var t=!0;if(ri(Un))t=!1;else try{var e="__mplssupport__";Tp.ar(e,"xyz"),'"xyz"'!==Tp.nr(e)&&(t=!1),Tp.ur(e)}catch(e){t=!1}return t||cs.error("localStorage unsupported; falling back to cookie store"),Ap=t,t},ir:function(t){cs.error("localStorage error: "+t)},nr:function(t){try{return null==Un?void 0:Un.localStorage.getItem(t)}catch(t){Tp.ir(t)}return null},sr:function(t){try{return JSON.parse(Tp.nr(t))||{}}catch(t){}return null},ar:function(t,e){try{null==Un||Un.localStorage.setItem(t,JSON.stringify(e))}catch(t){Tp.ir(t)}},ur:function(t){try{null==Un||Un.localStorage.removeItem(t)}catch(t){Tp.ir(t)}}},Ep=["$device_id","distinct_id",Ys,Us,lo,uo],Rp={},Np={rr:function(){return!0},ir:function(t){cs.error("memoryStorage error: "+t)},nr:function(t){return Rp[t]||null},sr:function(t){return Rp[t]||null},ar:function(t,e){Rp[t]=e},ur:function(t){delete Rp[t]}},Mp=null,Fp={rr:function(){if(!si(Mp))return Mp;if(Mp=!0,ri(Un))Mp=!1;else try{var t="__support__";Fp.ar(t,"xyz"),'"xyz"'!==Fp.nr(t)&&(Mp=!1),Fp.ur(t)}catch(t){Mp=!1}return Mp},ir:function(t){cs.error("sessionStorage error: ",t)},nr:function(t){try{return null==Un?void 0:Un.sessionStorage.getItem(t)}catch(t){Fp.ir(t)}return null},sr:function(t){try{return JSON.parse(Fp.nr(t))||null}catch(t){}return null},ar:function(t,e){try{null==Un||Un.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Fp.ir(t)}},ur:function(t){try{null==Un||Un.sessionStorage.removeItem(t)}catch(t){Fp.ir(t)}}},Op=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Pp{constructor(t){this._instance=t}get Oe(){return this._instance.config}get consent(){return this.lr()?Op.DENIED:this.hr}isOptedOut(){return"always"===this.Oe.cookieless_mode||(this.consent===Op.DENIED||this.consent===Op.PENDING&&(this.Oe.opt_out_capturing_by_default||"on_reject"===this.Oe.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Op.DENIED}optInOut(t){this.cr.ar(this.dr,t?1:0,this.Oe.cookie_expiration,this.Oe.cross_subdomain_cookie,this.Oe.secure_cookie)}reset(){this.cr.ur(this.dr,this.Oe.cross_subdomain_cookie)}get dr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get hr(){var t=this.cr.nr(this.dr);return gi(t)?Op.GRANTED:Vr(mi,t)?Op.DENIED:Op.PENDING}get cr(){if(!this.vr){var t=this.Oe.opt_out_capturing_persistence_type;this.vr="localStorage"===t?Tp:xp;var e="localStorage"===t?xp:Tp;e.nr(this.dr)&&(this.vr.nr(this.dr)||this.optInOut(gi(e.nr(this.dr))),e.ur(this.dr,this.Oe.cross_subdomain_cookie))}return this.vr}lr(){return!!this.Oe.respect_dnt&&!!ks([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,os.doNotTrack],(t=>gi(t)))}}var Lp=ds("[Dead Clicks]"),Dp=()=>!0,Bp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Hs)),i=t.instance.config.capture_dead_clicks;return li(i)?i:!!ti(i)||r};class jp{get lazyLoadedDeadClicksAutocapture(){return this.pr}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[Hs]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this.gr((()=>{this.mr()})):this.stop()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Lp.error("failed to load script",e):t()}))}mr(){var t;if(ts){if(!this.pr&&null!=(t=os.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=ti(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.pr=os.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.pr.start(ts),Lp.info("starting...")}}else Lp.error("`document` not found. Cannot start.")}stop(){this.pr&&(this.pr.stop(),this.pr=void 0,Lp.info("stopping..."))}}var $p=ds("[ExceptionAutocapture]");class Zp{constructor(t){var e,r,i;this.yr=()=>{var t;if(Un&&this.isEnabled&&null!=(t=os.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=os.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=os.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=os.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.br&&this.Oe.capture_unhandled_errors&&(this.br=e(this.captureException.bind(this))),!this.wr&&this.Oe.capture_unhandled_rejections&&(this.wr=r(this.captureException.bind(this))),!this._r&&this.Oe.capture_console_errors&&(this._r=i(this.captureException.bind(this)))}catch(t){$p.error("failed to start",t),this.Ir()}}},this._instance=t,this.Cr=!(null==(e=this._instance.persistence)||!e.props[js]),this.Sr=new bi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,k:$p}),this.Oe=this.kr(),this.startIfEnabledOrStop()}kr(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(t)?e=r({},e,t):(ri(t)?this.Cr:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Oe.capture_console_errors||this.Oe.capture_unhandled_errors||this.Oe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?($p.info("enabled"),this.Ir(),this.gr(this.yr)):this.Ir()}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return $p.error("failed to load script",e);t()}))}Ir(){var t,e,r;null==(t=this.br)||t.call(this),this.br=void 0,null==(e=this.wr)||e.call(this),this.wr=void 0,null==(r=this._r)||r.call(this),this._r=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.Cr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[js]:this.Cr}),this.Oe=this.kr(),this.startIfEnabledOrStop()}onConfigChange(){this.Oe=this.kr()}captureException(t){var e,r,i=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Sr.consumeRateLimit(i)?$p.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(t)}}class qp{constructor(t){var e;this._instance=t,this.Ar=(null==Un||null==(e=Un.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Tr&&this.Tr(),this.Tr=void 0,cs.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Un&&Un.history){var r=this;null!=(t=Un.history.pushState)&&t.__posthog_wrapped__||Ms(Un.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("pushState")})),null!=(e=Un.history.replaceState)&&e.__posthog_wrapped__||Ms(Un.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Er("replaceState")})),this.Rr()}}Er(t){try{var e,r=null==Un||null==(e=Un.location)?void 0:e.pathname;if(!r)return;r!==this.Ar&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Ar=r}catch(e){cs.error("Error capturing "+t+" pageview",e)}}Rr(){if(!this.Tr){var t=()=>{this.Er("popstate")};xs(Un,"popstate",t),this.Tr=()=>{Un&&Un.removeEventListener("popstate",t)}}}}var Hp=ds("[SegmentIntegration]");function Vp(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||rl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(io,"identified")),e()},n=r.user();"then"in n&&Kr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Hp.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Hp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Hp.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var zp="posthog-js";function Gp(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,h,c,d;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(u=e.exception)?void 0:u.values)||[],p=f.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(l=f[0])?void 0:l.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class Yp{constructor(t,e,r,i,n,s){this.name=zp,this.setupOnce=function(o){o(Gp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var Up=null!=Un&&Un.location?Ns(Un.location.hash,"__posthog")||Ns(location.hash,"state"):null,Wp="_postHogToolbarParams",Xp=ds("[Toolbar]"),Jp=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(Jp||{});class Kp{constructor(t){this.instance=t}Nr(t){os.ph_toolbar_state=t}Mr(){var t;return null!==(t=os.ph_toolbar_state)&&void 0!==t?t:Jp.UNINITIALIZED}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Un||!ts)return!1;t=null!=t?t:Un.location,r=null!=r?r:Un.history;try{if(!e){try{Un.localStorage.setItem("test","test"),Un.localStorage.removeItem("test")}catch(t){return!1}e=null==Un?void 0:Un.localStorage}var i,n=Up||Ns(t.hash,"__posthog")||Ns(t.hash,"state"),s=n?bs((()=>JSON.parse(atob(decodeURIComponent(n)))))||bs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Wp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(t){return!1}}Fr(t){var e=os.ph_load_toolbar||os.ph_load_editor;!oi(e)&&Kr(e)?e(t,this.instance):Xp.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==ts||!ts.getElementById(ho));if(!Un||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Un.localStorage.setItem(Wp,JSON.stringify(r({},n,{source:void 0}))),this.Mr()===Jp.LOADED)this.Fr(n);else if(this.Mr()===Jp.UNINITIALIZED){var s;this.Nr(Jp.LOADING),null==(s=os.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Xp.error("[Toolbar] Failed to load",t),void this.Nr(Jp.UNINITIALIZED);this.Nr(Jp.LOADED),this.Fr(n)})),xs(Un,"turbolinks:load",(()=>{this.Nr(Jp.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Or(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}var Qp=ds("[TracingHeaders]");class tg{constructor(t){this.Pr=void 0,this.Lr=void 0,this.yr=()=>{var t,e;ri(this.Pr)&&(null==(t=os.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this.Lr)&&(null==(e=os.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Qp.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.gr(this.yr):(null==(t=this.Pr)||t.call(this),null==(e=this.Lr)||e.call(this),this.Pr=void 0,this.Lr=void 0)}}var eg="https?://(.*)",rg=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ig=ms(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rg),ng="<masked>",sg=["li_fat_id"];function og(t,e,r){if(!ts)return{};var i,n=e?ms([],rg,r||[]):[],s=ag(Rs(ts.URL,n,ng),t),o=(i={},ps(sg,(function(t){var e=xp.nr(t);i[t]=e||null})),i);return gs(o,s)}function ag(t,e){var r=ig.concat(e||[]),i={};return ps(r,(function(e){var r=Es(t,e);i[e]=r||null})),i}function ug(t){var e=function(t){return t?0===t.search(eg+"google.([^/?]*)")?"google":0===t.search(eg+"bing.com")?"bing":0===t.search(eg+"yahoo.com")?"yahoo":0===t.search(eg+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!si(e)){i.$search_engine=e;var n=ts?Es(ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function lg(){return navigator.language||navigator.userLanguage}function hg(){return(null==ts?void 0:ts.referrer)||"$direct"}function cg(t,e){var r=t?ms([],rg,e||[]):[],i=null==es?void 0:es.href.substring(0,1e3);return{r:hg().substring(0,1e3),u:i?Rs(i,r,ng):void 0}}function dg(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(e=As(r))?void 0:e.host};if(i){n.$current_url=i;var s=As(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=ag(i);gs(n,o)}if(r){var a=ug(r);gs(n,a)}return n}function vg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function fg(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function pg(t,e){if(!ss)return{};var r,i=t?ms([],rg,e||[]):[],[n,s]=function(t){for(var e=0;e<yn.length;e++){var[r,i]=yn[e],n=r.exec(t),s=n&&(Kr(i)?i(n,t):i);if(s)return s}return["",""]}(ss);return gs(_s({$os:n,$os_version:s,$browser:pn(ss,navigator.vendor),$device:bn(ss),$device_type:wn(ss),$timezone:vg(),$timezone_offset:fg()}),{$current_url:Rs(null==es?void 0:es.href,i,ng),$host:null==es?void 0:es.host,$pathname:null==es?void 0:es.pathname,$raw_user_agent:ss.length>1e3?ss.substring(0,997)+"...":ss,$browser_version:mn(ss,navigator.vendor),$browser_language:lg(),$browser_language_prefix:(r=lg(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Un?void 0:Un.screen.height,$screen_width:null==Un?void 0:Un.screen.width,$viewport_height:null==Un?void 0:Un.innerHeight,$viewport_width:null==Un?void 0:Un.innerWidth,$lib:"web",$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var gg=ds("[Web Vitals]"),mg=9e5;class yg{constructor(t){var e;this.Dr=!1,this.Re=!1,this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Br=()=>{clearTimeout(this.jr),0!==this.B.metrics.length&&(this._instance.capture("$web_vitals",this.B.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.B={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.pe=t=>{var e,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(ri(i))gg.error("Could not read session ID. Dropping metrics!");else{this.B=this.B||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.$r();if(!ri(n))if(oi(null==t?void 0:t.name)||oi(null==t?void 0:t.value))gg.error("Invalid metric received",t);else if(this.Zr&&t.value>=this.Zr)gg.error("Ignoring metric with value >= "+this.Zr,t);else this.B.url!==n&&(this.Br(),this.jr=setTimeout(this.Br,this.flushToCaptureTimeoutMs)),ri(this.B.url)&&(this.B.url=n),this.B.firstMetricTimestamp=ri(this.B.firstMetricTimestamp)?Date.now():this.B.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.B.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.B.metrics.length===this.allowedMetrics.length&&this.Br()}},this.yr=()=>{if(!this.Re){var t,e,r,i,n=os.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.pe.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.pe.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.pe.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.pe.bind(this)),this.Re=!0):gg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Dr=!(null==(e=this._instance.persistence)||!e.props[qs]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=ti(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return oi(r)?(null==(e=this._instance.persistence)?void 0:e.props[zs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=t&&t}get Zr(){var t=ti(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:mg;return 0<t&&t<=6e4?mg:t}get isEnabled(){var t=null==es?void 0:es.protocol;if("http:"!==t&&"https:"!==t)return gg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ti(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:li(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return li(e)?e:this.Dr}startIfEnabled(){this.isEnabled&&!this.Re&&(gg.info("enabled, starting..."),this.gr(this.yr))}onRemoteConfig(t){var e=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qs]:e}),this._instance.persistence.register({[zs]:r})),this.Dr=e,this.startIfEnabled()}gr(t){var e,r;if(null!=(e=os.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks)t();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(e=>{e?gg.error("failed to load script",e):t()}))}}$r(){var t=Un?Un.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=e?ms([],rg,r||[]):[];return Rs(t,i,ng)}gg.error("Could not determine current URL")}}var bg=ds("[Heatmaps]");function wg(t){return ti(t)&&"clientX"in t&&"clientY"in t&&ai(t.clientX)&&ai(t.clientY)}class _g{constructor(t){var e;this.Dr=!1,this.Re=!1,this.qr=null,this.instance=t,this.Dr=!(null==(e=this.instance.persistence)||!e.props[Bs]),this.rageclicks=new lp(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return ti(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return oi(this.instance.config.capture_heatmaps)?oi(this.instance.config.enable_heatmaps)?this.Dr:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Re)return;bg.info("starting..."),this.Hr(),this.Vr()}else{var t;clearInterval(null!==(t=this.qr)&&void 0!==t?t:void 0),this.zr(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bs]:e}),this.Dr=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.B;return this.B=void 0,t}Gr(t){this.qe(t.originalEvent,"deadclick")}Vr(){this.qr&&clearInterval(this.qr),this.qr=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(ts)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Hr(){Un&&ts&&(this.Ur=this.Yr.bind(this),xs(Un,"beforeunload",this.Ur),this.Wr=t=>this.qe(t||(null==Un?void 0:Un.event)),xs(ts,"click",this.Wr,{capture:!0}),this.Xr=t=>this.Jr(t||(null==Un?void 0:Un.event)),xs(ts,"mousemove",this.Xr,{capture:!0}),this.Kr=new jp(this.instance,Dp,this.Gr.bind(this)),this.Kr.startIfEnabledOrStop(),this.Qr=this.Vr.bind(this),xs(ts,"visibilitychange",this.Qr),this.Re=!0)}zr(){var t;Un&&ts&&(this.Ur&&Un.removeEventListener("beforeunload",this.Ur),this.Wr&&ts.removeEventListener("click",this.Wr,{capture:!0}),this.Xr&&ts.removeEventListener("mousemove",this.Xr,{capture:!0}),this.Qr&&ts.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.ti),null==(t=this.Kr)||t.stop(),this.Re=!1)}ei(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&po(i)&&!go(i,"body");){if(i===r)return!1;if(Vr(e,null==Un?void 0:Un.getComputedStyle(i).position))return!0;i=Ao(i)}return!1}(So(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}qe(t,e){var i;if(void 0===e&&(e="click"),!fo(t.target)&&wg(t)){var n=this.ei(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.ri(r({},n,{type:"rageclick"})),this.ri(n)}}Jr(t){!fo(t.target)&&wg(t)&&(clearTimeout(this.ti),this.ti=setTimeout((()=>{this.ri(this.ei(t,"mousemove"))}),500))}ri(t){if(Un){var e=Un.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?ms([],rg,i||[]):[],s=Rs(e,n,ng);this.B=this.B||{},this.B[s]||(this.B[s]=[]),this.B[s].push(t)}}Yr(){this.B&&!ei(this.B)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ig{constructor(t){this.ii=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ni=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.si()}si(){var t;this.oi=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ii)}destroy(){var t;null==(t=this.oi)||t.call(this),this.oi=void 0}doPageView(t,e){var r,i=this.ai(t,e);return this.ni={pathname:null!==(r=null==Un?void 0:Un.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ai(t,null==(e=this.ni)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ni)?void 0:t.pageViewId}}ai(t,e){var r=this.ni;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(ri(s)||ri(o)||ri(a)||ri(u)||ri(l)||ri(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=s<=1?1:yi(o/s,0,1,cs),d=s<=1?1:yi(a/s,0,1,cs),v=u<=1?1:yi(l/u,0,1,cs),f=u<=1?1:yi(h/u,0,1,cs);i=gs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Cg=ds("[FeatureFlags]"),Sg=ds("[FeatureFlags]",{debugEnabled:!0}),kg="errors_while_computing_flags",xg="flag_missing",Ag="quota_limited",Tg="timeout",Eg="connection_error",Rg="unknown_error",Ng=t=>"api_error_"+t,Mg="$active_feature_flags",Fg="$override_feature_flags",Og="$feature_flag_payloads",Pg="$override_feature_flag_payloads",Lg="$feature_flag_request_id",Dg="$feature_flag_evaluated_at",Bg=t=>{var e={};for(var[r,i]of ys(t||{}))i&&(e[r]=i);return e},jg=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Cg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},$g=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class Zg{constructor(t){this.ui=!1,this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.pi=!1,this._instance=t,this.featureFlagEventHandlers=[]}gi(){var t,e=null!==(t=this._instance.config.evaluation_contexts)&&void 0!==t?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.pi||(Cg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.pi=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Cg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}mi(){return this.gi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.vi=!0;else{var t=!this.yi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.bi({disableFlags:t})}}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Js),e=this._instance.get_property(Fg),i=this._instance.get_property(Pg);if(!i&&!e)return t||{};var n=gs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,u,l=n[o],h=null==e?void 0:e[o],c=ri(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=ri(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});if(c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v)f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload});n[o]=f}return this.ui||(Cg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ui=!0),n}getFlagVariants(){var t=this._instance.get_property(Ws),e=this._instance.get_property(Fg);if(!e)return t||{};for(var r=gs({},t),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Cg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ui=!0),r}getFlagPayloads(){var t=this._instance.get_property(Og),e=this._instance.get_property(Pg);if(!e)return t||{};for(var r=gs({},t||{}),i=Object.keys(e),n=0;n<i.length;n++)r[i[n]]=e[i[n]];return this.ui||(Cg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ui=!0),r}reloadFeatureFlags(){this.ci||this._instance.config.advanced_disable_feature_flags||this.yi||(this._instance.wi.emit("featureFlagsReloading",!0),this.yi=setTimeout((()=>{this.bi()}),5))}Ii(){clearTimeout(this.yi),this.yi=void 0}ensureFlagsLoaded(){this.li||this.hi||this.yi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ci=t}bi(t){var e;if(this.Ii(),!this._instance.De())if(this.hi)this.di=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Ks)||{}),group_properties:this._instance.get_property(Qs)};si(n)||ri(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.mi()&&(s.evaluation_contexts=this.gi());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",a+u);o&&(s.timezone=vg()),this.hi=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this._instance.config.disable_compression?void 0:nl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n,o=!0;(200===t.statusCode&&(this.di||(this.$anon_distinct_id=void 0),o=!1),this.hi=!1,this.vi)||(this.vi=!0,this._instance.Ci(null!==(n=t.json)&&void 0!==n?n:{}));if(!s.disable_flags||this.di){this.fi=!o;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?Tg:Eg):a.push(Rg):200!==t.statusCode&&a.push(Ng(t.statusCode)),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push(kg);var u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes($g.FeatureFlags));if(u&&a.push(Ag),null==(i=this._instance.persistence)||i.register({[ro]:a}),u)Cg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var l;if(!s.disable_flags)this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},o);this.di&&(this.di=!1,this.bi())}}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}Cg.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this._instance.get_property(Lg)||void 0,u=this._instance.get_property(Dg)||void 0,l=this._instance.get_property(eo)||{};if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(o))){var h,c,d,v,f,p,g,m,y,b;Jr(l[t])?l[t].push(o):l[t]=[o],null==(h=this._instance.persistence)||h.register({[eo]:l});var w=this.getFeatureFlagDetails(t),_=[...null!==(c=this._instance.get_property(ro))&&void 0!==c?c:[]];ri(n)&&_.push(xg);var I={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(d=this._instance.config.bootstrap)||null==(d=d.featureFlags)?void 0:d[t])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[t])||null,$used_bootstrap_value:!this.fi};ri(null==w||null==(f=w.metadata)?void 0:f.version)||(I.$feature_flag_version=w.metadata.version);var C,S=null!==(p=null==w||null==(g=w.reason)?void 0:g.description)&&void 0!==p?p:null==w||null==(m=w.reason)?void 0:m.code;if(S&&(I.$feature_flag_reason=S),null!=w&&null!=(y=w.metadata)&&y.id&&(I.$feature_flag_id=w.metadata.id),ri(null==w?void 0:w.original_variant)&&ri(null==w?void 0:w.original_enabled)||(I.$feature_flag_original_response=ri(w.original_variant)?w.original_enabled:w.original_variant),null!=w&&null!=(b=w.metadata)&&b.original_payload)I.$feature_flag_original_payload=null==w||null==(C=w.metadata)?void 0:C.original_payload;_.length&&(I.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",I)}if(i){var k=s;if(!ri(s))try{k=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else Cg.warn('getFeatureFlagResult for key "'+t+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(t,e){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.mi()&&(i.evaluation_contexts=this.gi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:nl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return ri(r)?void 0:!!r}Cg.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=jg(t),a=o.flags,u=o.featureFlags,l=o.featureFlagPayloads;if(u){var h=t.requestId,c=t.evaluatedAt;if(Jr(u)){Cg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(u)for(var v=0;v<u.length;v++)d[u[v]]=!0;e&&e.register({[Mg]:u,[Ws]:d})}else{var f=u,p=l,g=a;if(t.errorsWhileComputingFlags)if(a){var m=new Set(Object.keys(a).filter((t=>{var e;return!(null!=(e=a[t])&&e.failed)})));f=r({},i,Object.fromEntries(Object.entries(f).filter((t=>{var[e]=t;return m.has(e)})))),p=r({},n,Object.fromEntries(Object.entries(p||{}).filter((t=>{var[e]=t;return m.has(e)})))),g=r({},s,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return m.has(e)}))))}else f=r({},i,f),p=r({},n,p),g=r({},s,g);e&&e.register(r({[Mg]:Object.keys(Bg(f)),[Ws]:f||{},[Og]:p||{},[Js]:g||{}},h?{[Lg]:h}:{},c?{[Dg]:c}:{}))}}}(t,this._instance.persistence,i,n,s),this.Si(e)}}override(t,e){void 0===e&&(e=!1),Cg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Cg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Fg),this._instance.persistence.unregister(Pg),this.Si(),Sg.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,r=t;if(this.ui=Boolean(null!==(e=r.suppressWarning)&&void 0!==e&&e),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Fg),Sg.info("Flag overrides cleared");else if(r.flags){if(Jr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Fg]:i})}else this._instance.persistence.register({[Fg]:r.flags});Sg.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Pg),Sg.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Pg]:r.payloads}),Sg.info("Payload overrides set",{payloads:r.payloads}))),void this.Si()}this.Si()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.li){var{flags:e,flagVariants:r}=this.ki();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this._instance.get_property(Xs)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Mg]:Object.keys(Bg(u)),[Ws]:u}),this.Si()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this._instance.get_property(Xs),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Xs),null==(i=this._instance.persistence)||i.register({[Xs]:n}),t(n)}}})}ki(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Si(t){var{flags:e,flagVariants:r}=this.ki();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Ks)||{};this._instance.register({[Ks]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ks)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this._instance.get_property(Qs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Qs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Qs)||{};this._instance.register({[Qs]:r({},e,{[t]:{}})})}else this._instance.unregister(Qs)}reset(){this.li=!1,this.hi=!1,this.ci=!1,this.di=!1,this.vi=!1,this.fi=!1,this.$anon_distinct_id=void 0,this.Ii(),this.ui=!1}}var qg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Hg{constructor(t,e){this.Oe=t,this.props={},this.xi=!1,this.Ai=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.cr=this.Ti(t),this.load(),t.debug&&cs.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.Ei}Ti(t){-1===qg.indexOf(t.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Ep,...t];return r({},Tp,{sr:function(t){try{var e={};try{e=xp.sr(t)||{}}catch(t){}var r=gs(e,JSON.parse(Tp.nr(t)||"{}"));return Tp.ar(t,r),r}catch(t){}return null},ar:function(t,r,i,n,s,o){try{Tp.ar(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&xp.ar(t,a,i,n,s,o)}catch(t){Tp.ir(t)}},ur:function(t,e){try{null==Un||Un.localStorage.removeItem(t),xp.ur(t,e)}catch(t){Tp.ir(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Tp.rr()?Tp:"localstorage+cookie"===i&&e.rr()?e:"sessionstorage"===i&&Fp.rr()?Fp:"memory"===i?Np:"cookie"===i?xp:e.rr()?e:xp}properties(){var t={};return ps(this.props,(function(e,r){if(r===Ws&&ti(e))for(var i=Object.keys(e),n=0;n<i.length;n++)t["$feature/"+i[n]]=e[i[n]];else o=r,a=!1,(si(s=vo)?a:Kn&&s.indexOf===Kn?-1!=s.indexOf(o):(ps(s,(function(t){if(a||(a=t===o))return vs})),a))||(t[r]=e);var s,o,a})),t}load(){if(!this.Ei){var t=this.cr.sr(this.Ai);t&&(this.props=gs({},t))}}save(){this.Ei||this.cr.ar(this.Ai,this.props,this.Ri,this.Ni,this.Mi,this.Oe.debug)}remove(){this.cr.ur(this.Ai,!1),this.cr.ur(this.Ai,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(ti(t)){ri(e)&&(e="None"),this.Ri=ri(r)?this.Fi:r;var i=!1;if(ps(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(ti(t)){this.Ri=ri(e)?this.Fi:e;var r=!1;if(ps(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.props[i]=e,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.xi){var t=og(this.Oe.custom_campaign_params,this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties);ei(_s(t))||this.register(t),this.xi=!0}}update_search_keyword(){var t;this.register((t=null==ts?void 0:ts.referrer)?ug(t):{})}update_referrer_info(){var t;this.register_once({$referrer:hg(),$referring_domain:null!=ts&&ts.referrer&&(null==(t=As(ts.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[ao]||this.register_once({[uo]:cg(this.Oe.mask_personal_data_properties,this.Oe.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ps([ao,oo],(e=>{var r=this.props[e];r&&ps(r,(function(e,r){t["$initial_"+Gr(r)]=e}))}));var e,r,i=this.props[uo];if(i){var n=(e=dg(i),r={},ps(e,(function(t,e){r["$initial_"+Gr(e)]=t})),r);gs(t,n)}return t}safe_merge(t){return ps(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Fi=this.Ri=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.Ti(t),n=this.props;this.clear(),this.cr=i,this.props=n,this.save()}}set_disabled(t){this.Ei=t,this.Ei?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ni&&(this.Ni=t,this.remove(),this.save())}set_secure(t){t!==this.Mi&&(this.Mi=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Ls]||{};r[t]=e,this.props[Ls]=r,this.save()}remove_event_timer(t){var e=(this.props[Ls]||{})[t];return ri(e)||(delete this.props[Ls][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var Vg=ds("[Product Tours]"),zg="ph_product_tours";class Gg{constructor(t){this.Oi=null,this.Pi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[Vs]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.Oi||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(Vs))||this.gr((()=>this.Li()))}gr(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Vg.error("Could not load product tours script",e):t()}))}Li(){var t;!this.Oi&&null!=(t=os.__PosthogExtensions__)&&t.generateProductTours&&(this.Oi=os.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Jr(this.Pi)||e){var r=this._instance.persistence;if(r){var i=r.props[zg];if(Jr(i)&&!e)return this.Pi=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Vg.error(n),void t([],{isLoaded:!1,error:n})}var s=Jr(e.json.product_tours)?e.json.product_tours:[];this.Pi=s,r&&r.register({[zg]:s}),t(s,{isLoaded:!0})}})}else t(this.Pi,{isLoaded:!0})}getActiveProductTours(t){oi(this.Oi)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Oi.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Oi)||e.showTourById(t)}previewTour(t){this.Oi?this.Oi.previewTour(t):this.gr((()=>{var e;this.Li(),null==(e=this.Oi)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Oi)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Oi)||t.nextStep()}previousStep(){var t;null==(t=this.Oi)||t.previousStep()}clearCache(){var t;this.Pi=null,null==(t=this._instance.persistence)||t.unregister(zg)}resetTour(t){var e;null==(e=this.Oi)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Oi)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Oi)||e.cancelPendingTour(t)}}class Yg{constructor(){this.Di={},this.Di={}}on(t,e){return this.Di[t]||(this.Di[t]=[]),this.Di[t].push(e),()=>{this.Di[t]=this.Di[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Di[t]||[])r(e);for(var i of this.Di["*"]||[])i(t,e)}}function Ug(t,e,r){if(oi(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Wg{constructor(t){this.Bi=new Yg,this.ji=(t,e)=>this.$i(t,e)&&this.Zi(t,e)&&this.qi(t,e)&&this.Hi(t,e),this.$i=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Vi=new Set,this.zi=new Set}init(){var t;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)){var e;null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)}))}}register(t){var e,r;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zi)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.Vi)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.Vi.has(t)||this.Vi.has(null==e?void 0:e.event))&&this.zi&&(null==(r=this.zi)?void 0:r.size)>0&&this.zi.forEach((t=>{this.Gi(e,t)&&this.Bi.emit("actionCaptured",t.name)}))}Yi(t){this.onAction("actionCaptured",(e=>t(e)))}Gi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.ji(t,r))return!0;return!1}onAction(t,e){return this.Bi.on(t,e)}Zi(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Ug(i,e.url,e.url_matching||"contains"))return!1}return!0}qi(t,e){return!!this.Ui(t,e)&&(!!this.Wi(t,e)&&!!this.Xi(t,e))}Ui(t,e){var r;if(null==e||!e.href)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Ug(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Ug((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Wi(t,e){var r;if(null==e||!e.text)return!0;var i=this.Ji(t);if(i.length>0)return i.some((t=>Ug(t.text,e.text,e.text_matching||"exact")||Ug(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!oi(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Ug(t,s,o))))}Xi(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Ji(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Hi(t,e){return null==e||!e.properties||0===e.properties.length||Xl(e.properties.reduce(((t,e)=>{var r=Jr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Xg{constructor(t){this._instance=t,this.Ki=new Map,this.Qi=new Map,this.tn=new Map}en(t,e){return!!t&&Xl(t.propertyFilters,null==e?void 0:e.properties)}rn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}nn(t,e,r){var i=(r===Au.Activation?this.Ki:this.Qi).get(t),n=[];return this.sn((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.en(s,e)}))}register(t){var e;ri(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.an(t),this.un(t))}un(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==e.length){if(null==this.ln){this.ln=new Wg(this._instance),this.ln.init();this.ln.Yi((t=>{this.onAction(t)}))}e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ln)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.tn.get(e.name);r&&r.push(t.id),this.tn.set(e.name,r||[t.id])}})))}))}}an(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Ki=this.rn(t,Au.Activation),this.Qi=this.rn(t,Au.Cancellation)}}onEvent(t,e){var r,i=this.ct(),n=this.hn(),s=this.cn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=o.indexOf(l);h>=0&&(o.splice(h,1),this.dn(o))}}else{if(this.Qi.has(t)){var c=this.nn(t,e,Au.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);e>=0&&o.splice(e,1),this.vn(t.id)})),this.dn(o))}if(this.Ki.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Ki.get(t)});var d=this.nn(t,e,Au.Activation);this.dn(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.hn(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.tn.has(t)&&this.dn(i.concat(this.tn.get(t)||[]))}dn(t){var e,r=this.ct(),i=this.hn(),n=[...new Set(t)].filter((t=>!this.fn(t)));r.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[i]:n})}getActivatedIds(){var t,e=this.hn(),r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r||[]}getEventToItemsMap(){return this.Ki}pn(){return this.ln}}class Jg extends Xg{constructor(t){super(t)}hn(){return"$surveys_activated"}cn(){return Pu.SHOWN}sn(t){var e;null==(e=this._instance)||e.getSurveys(t)}vn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ct(){return Bu}fn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Kg{constructor(t){this.gn=void 0,this._surveyManager=null,this.mn=!1,this.yn=[],this.bn=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(oi(e))return Bu.warn("Flags not loaded yet. Not loading surveys.");var r=Jr(e);this.gn=r?e.length>0:e,Bu.info("flags response received, isSurveysEnabled: "+this.gn),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(qu)||null!=r&&r.startsWith(Hu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.mn)Bu.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Bu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==os?void 0:os.__PosthogExtensions__;if(t){if(!ri(this.gn)||this._instance.config.advanced_enable_surveys){var e=this.gn||this._instance.config.advanced_enable_surveys;this.mn=!0;try{var r=t.generateSurveys;if(r)return void this.wn(r,e);var i=t.loadExternalDependency;if(!i)return void this._n("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this._n("Could not load surveys script",r):this.wn(t.generateSurveys,e)}))}catch(t){throw this._n("Error initializing surveys",t),t}finally{this.mn=!1}}}else Bu.error("PostHog Extensions not found.")}}wn(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Jg(this._instance),Bu.info("Surveys loaded successfully"),this.In({isLoaded:!0})}_n(t,e){Bu.error(t,e),this.In({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.yn.push(t),this._surveyManager&&this.In({isLoaded:!0}),()=>{this.yn=this.yn.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),t([]);var r,i=this._instance.get_property(to);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.bn?this.bn.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.bn=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var i;this.bn=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Bu.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,u=e.json.surveys||[],l=u.filter((t=>ju(t)&&($u(t)||Zu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l));null==(i=this._instance.persistence)||i.register({[to]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}In(t){for(var e of this.yn)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!oi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bu.warn("init was not called")}Cn(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Sn(t){if(oi(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.Cn(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(oi(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.Sn(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return oi(this._surveyManager)?(Bu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.Sn(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n="string"==typeof t?this.Cn(t):t;if(null!=n&&n.id)if(Uu.includes(n.type)){var s=null==ts?void 0:ts.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Bu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Bu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Bu.warn("Survey element not found")}else Bu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bu.warn("Survey not found")}}displaySurvey(t,e){var i;if(oi(this._surveyManager))Bu.warn("init was not called");else{var n=this.Cn(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Du.Popover&&e.initialResponses&&Bu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Bu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Du.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Bu.warn("Survey not found")}}cancelPendingSurvey(t){oi(this._surveyManager)?Bu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var Qg=ds("[Conversations]");class tm{constructor(t){this.kn=void 0,this._conversationsManager=null,this.xn=!1,this.An=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;oi(e)||(li(e)?this.kn=e:(this.kn=e.enabled,this.An=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.kn=void 0,this.An=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xn&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==os?void 0:os.__PosthogExtensions__;if(t&&!ri(this.kn)&&this.kn)if(this.An&&this.An.token){this.xn=!0;try{var e=t.initConversations;if(e)return this.Tn(e),void(this.xn=!1);var r=t.loadExternalDependency;if(!r)return void this.En("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(e=>{e||!t.initConversations?this.En("Could not load conversations script",e):this.Tn(t.initConversations),this.xn=!1}))}catch(t){this.En("Error initializing conversations",t),this.xn=!1}}else Qg.error("Conversations enabled but missing token in remote config.")}}Tn(t){if(this.An)try{this._conversationsManager=t(this.An,this._instance),Qg.info("Conversations loaded successfully")}catch(t){this.En("Error completing conversations initialization",t)}else Qg.error("Cannot complete initialization: remote config is null")}En(t,e){Qg.error(t,e),this._conversationsManager=null,this.xn=!1}show(){this._conversationsManager?this._conversationsManager.show():Qg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.kn&&!si(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(Qg.warn("Conversations not available yet."),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Qg.warn("Conversations not available yet."),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Qg.warn("Conversations not available yet."),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Qg.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}}class em{constructor(t){var e;this.Rn=!1,this.Nn=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Rn=!0)}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!oi(r)&&r&&(this.Rn=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Rn&&!this.Nn){var t=ds("[logs]"),e=null==os?void 0:os.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=e.logs)||!i.initializeLogs?t.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.Nn=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var rm=ds("[RateLimiter]");class im{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{rm.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void rm.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(so))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var u=a.tokens<1;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(so,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var nm=ds("[RemoteConfig]");class sm{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mn(t){var e,r;null!=(e=os.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(nm.error("PostHog Extensions not found. Cannot load remote config."),t())}Fn(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return nm.info("Using preloaded remote config",this.remoteConfig),void this.Ci(this.remoteConfig);if(this._instance.De())return void nm.warn("Remote config is disabled. Falling back to local config.");this.Mn((t=>{if(!t)return nm.info("No config found after loading remote JS config. Falling back to JSON."),void this.Fn((t=>{this.Ci(t)}));this.Ci(t)}))}catch(t){nm.error("Error loading remote config",t)}}Ci(t){t?this._instance.config.__preview_remote_config?(this._instance.Ci(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nm.info("__preview_remote_config is disabled. Logging config instead",t):nm.error("Failed to fetch remote config from PostHog.")}}var om=3e3;class am{constructor(t,e){this.On=!0,this.Pn=[],this.Ln=yi((null==e?void 0:e.flush_interval_ms)||om,250,5e3,cs.createLogger("flush interval"),om),this.Dn=t}enqueue(t){this.Pn.push(t),this.Bn||this.jn()}unload(){this.$n();var t=this.Pn.length>0?this.Zn():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Dn(r({},t,{transport:"sendBeacon"}))}))}enable(){this.On=!1,this.jn()}jn(){var t=this;this.On||(this.Bn=setTimeout((()=>{if(this.$n(),this.Pn.length>0){var e=this.Zn(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Jr(r.data)&&ps(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dn(r)};for(var i in e)r()}}),this.Ln))}$n(){clearTimeout(this.Bn),this.Bn=void 0}Zn(){var t={};return ps(this.Pn,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;ri(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Pn=[],t}}var um=["retriesPerformedSoFar"];class lm{constructor(t){this.qn=!1,this.Hn=3e3,this.Pn=[],this._instance=t,this.Pn=[],this.Vn=!0,!ri(Un)&&"onLine"in Un.navigator&&(this.Vn=Un.navigator.onLine,this.zn=()=>{this.Vn=!0,this.Yr()},this.Gn=()=>{this.Vn=!1},xs(Un,"online",this.zn),xs(Un,"offline",this.Gn))}get length(){return this.Pn.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,um);ui(e)&&(n.url=ql(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Yn(r({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Yn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(e),i=Date.now()+r;this.Pn.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cs.warn(n),this.qn||(this.qn=!0,this.Un())}Un(){if(this.Wn&&clearTimeout(this.Wn),0===this.Pn.length)return this.qn=!1,void(this.Wn=void 0);this.Wn=setTimeout((()=>{this.Vn&&this.Pn.length>0&&this.Yr(),this.Un()}),this.Hn)}Yr(){var t=Date.now(),e=[],r=this.Pn.filter((r=>r.retryAt<t||(e.push(r),!1)));if(this.Pn=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Wn&&(clearTimeout(this.Wn),this.Wn=void 0),this.qn=!1,ri(Un)||(this.zn&&(Un.removeEventListener("online",this.zn),this.zn=void 0),this.Gn&&(Un.removeEventListener("offline",this.Gn),this.Gn=void 0)),this.Pn))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){cs.error(t)}this.Pn=[]}}class hm{constructor(t){this.Xn=()=>{var t,e,r,i;this.Jn||(this.Jn={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),u=(null==n?void 0:n.scrollHeight)||0;this.Jn.lastScrollY=Math.ceil(s),this.Jn.maxScrollY=Math.max(s,null!==(t=this.Jn.maxScrollY)&&void 0!==t?t:0),this.Jn.maxScrollHeight=Math.max(o,null!==(e=this.Jn.maxScrollHeight)&&void 0!==e?e:0),this.Jn.lastContentY=a,this.Jn.maxContentY=Math.max(a,null!==(r=this.Jn.maxContentY)&&void 0!==r?r:0),this.Jn.maxContentHeight=Math.max(u,null!==(i=this.Jn.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}getContext(){return this.Jn}resetContext(){var t=this.Jn;return setTimeout(this.Xn,0),t}startMeasuringScrollPosition(){xs(Un,"scroll",this.Xn,{capture:!0}),xs(Un,"scrollend",this.Xn,{capture:!0}),xs(Un,"resize",this.Xn)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Un?void 0:Un.document.documentElement;var t=Jr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var r=null==Un?void 0:Un.document.querySelector(e);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Un&&(Un.scrollY||Un.pageYOffset||Un.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Un&&(Un.scrollX||Un.pageXOffset||Un.document.documentElement.scrollLeft)||0}}var cm=t=>cg(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class dm{constructor(t,e,r,i){this.Kn=t=>{var e=this.Qn();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ts(this._instance)};this.es.register({[no]:r})}},this._instance=t,this.rs=e,this.es=r,this.ts=i||cm,this.rs.onSessionId(this.Kn)}Qn(){return this.es.props[no]}getSetOnceProps(){var t,e=null==(t=this.Qn())?void 0:t.props;return e?"r"in e?dg(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ps(_s(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+Gr(r)]=e})),t}}var vm=ds("[SessionId]");class fm{on(t,e){return this.ns.on(t,e)}constructor(t,e,r){var i;if(this.ss=[],this.os=void 0,this.ns=new Yg,this.us=(t,e)=>!(!ui(t)||!ui(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oe=t.config,this.es=t.persistence,this.ls=void 0,this.hs=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.cs=e||rl,this.ds=r||rl;var n=this.Oe.persistence_name||this.Oe.token,s=this.Oe.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yi(s,60,36e3,vm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vs(),this.fs="ph_"+n+"_window_id",this.ps="ph_"+n+"_primary_window_exists",this.gs()){var o=Fp.sr(this.fs),a=Fp.sr(this.ps);o&&!a?this.ls=o:Fp.ur(this.fs),Fp.ar(this.ps,!0)}if(null!=(i=this.Oe.bootstrap)&&i.sessionID)try{var u=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.Oe.bootstrap.sessionID);this.ys(this.Oe.bootstrap.sessionID,(new Date).getTime(),u)}catch(t){vm.error("Invalid sessionID in bootstrap",t)}this.bs()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ri(this.ss)&&(this.ss=[]),this.ss.push(t),this.hs&&t(this.hs,this.ls),()=>{this.ss=this.ss.filter((e=>e!==t))}}gs(){return"memory"!==this.Oe.persistence&&!this.es.Ei&&Fp.rr()}ws(t){t!==this.ls&&(this.ls=t,this.gs()&&Fp.ar(this.fs,t))}_s(){return this.ls?this.ls:this.gs()?Fp.sr(this.fs):null}ys(t,e,r){t===this.hs&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.hs=t,this.es.register({[Ys]:[e,t,r]}))}Is(){var t=this.es.props[Ys];return Jr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ys(null,null,null)}destroy(){clearTimeout(this.Cs),this.Cs=void 0,this.os&&Un&&(Un.removeEventListener("beforeunload",this.os,{capture:!1}),this.os=void 0),this.ss=[]}bs(){this.os=()=>{this.gs()&&Fp.ur(this.ps)},xs(Un,"beforeunload",this.os,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.Oe.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.Is(),o=this._s(),a=ui(s)&&Math.abs(r-s)>864e5,u=!1,l=!n,h=!l&&!t&&this.us(r,i);l||h||a?(n=this.cs(),o=this.ds(),vm.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,u=!0):o||(o=this.ds(),u=!0);var c=!!ui(i)&&t&&!a?i:r,d=!ui(s)?(new Date).getTime():s;return this.ws(o),this.ys(n,c,d),t||this.vs(),u&&this.ss.forEach((t=>t(n,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}vs(){clearTimeout(this.Cs),this.Cs=setTimeout((()=>{var[t]=this.Is();if(this.us((new Date).getTime(),t)){var e=this.hs;this.resetSessionId(),this.ns.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var pm=["$set_once","$set"],gm=ds("[SiteApps]");class mm{constructor(t){this._instance=t,this.Ss=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ks(t,e){if(e){var r=this.globalsForEvent(e);this.Ss.push(r),this.Ss.length>1e3&&(this.Ss=this.Ss.slice(10))}}get siteAppLoaders(){var t;return null==(t=os._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ks.bind(this));this.xs=()=>{t(),this.Ss=[],this.xs=void 0}}}globalsForEvent(t){var e,n,s,o,a,u,l;if(!t)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=t;return{event:r({},i(t,pm),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;(!e.errored&&this.Ss.length&&(gm.info("Processing "+this.Ss.length+" events for site app with id "+t.id),this.Ss.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(r=this.xs)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,gm.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback:t=>{n(t)}});s&&(e.processEvent=s),i=!0}catch(e){gm.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){gm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}As(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Ts(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){gm.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.As(),void this._instance.on("eventCaptured",(t=>this.Ts(t)))):void gm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.xs)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;os["__$$ph_site_app_"+t]=n._instance,null==(e=os.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return gm.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else gm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ym=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Hr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Hr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},bm=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),wm="i.posthog.com";class _m{constructor(t){this.Es={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+wm,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Es[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=bm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Es[this.apiHost]=bm.EU:this.Es[this.apiHost]=bm.CUSTOM),this.Es[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===bm.CUSTOM)return this.apiHost+e;var r=wm+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Im={icontains:(t,e)=>!!Un&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Un&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Un&&Gl(e.href,t),not_regex:(t,e)=>!!Un&&!Gl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Cm{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Cm.Rs("retrieved web experiments from the server"),e.Ns=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;if(e.Ns)Cm.Rs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Ns)||r.set(t.feature_flag_key,t);var i=e._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&e.Ms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Cm.Fs(s)&&e.Ms(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Cm.Rs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(oi(this.Ns))return this.Ns=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Cm.Rs("applying feature flags",t),t.forEach((t=>{var e;if(this.Ns&&null!=(e=this.Ns)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Ns)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Cm.getWindowLocation();if(null!=t&&t.search){var e=Es(null==t?void 0:t.search,"__experiment_id"),r=Es(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Cm.Rs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Os(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var r=e.json.experiments||[];return t(r)}})}Os(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Cm.Rs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ms(i[0].name,e,i[0].variants[e].transforms))}static Fs(t){return!oi(t.conditions)&&(Cm.Ps(t)&&Cm.Ls(t))}static Ps(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Cm.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Im[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Un?void 0:Un.location}static Ls(t){var e;if(oi(t.conditions)||oi(null==(e=t.conditions)?void 0:e.utm))return!0;var r=og();if(r.utm_source){var i,n,s,o,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Rs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+t,r)}Ms(t,e,r){this._is_bot()?Cm.Rs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?r.forEach((r=>{if(r.selector){var i;Cm.Rs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Cm.Rs("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?ym(Qn,this._instance.config.custom_blocked_useragents):void 0}}var Sm=ds("[PostHog ExternalIntegrations]"),km={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xm{constructor(t){this._instance=t}gr(t,e){var r;null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Sm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;(!i||null!=(r=os.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.gr(km[e],(()=>{var r;null==(r=os.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=os.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(s=os.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}ds("[SessionRecording]");var Am="[SessionRecording]",Tm=ds(Am);class Em{get started(){var t;return!(null==(t=this.Ds)||!t.isStarted)}get status(){return this.Ds?this.Ds.status:this.Bs&&!this.js?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Bs=!1,this.$s=!1,this.Zs=void 0,this._instance=t,!this._instance.sessionManager)throw Tm.error("started without valid sessionManager"),new Error(Am+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Am+' cannot be used with cookieless_mode="always"')}get js(){var t,e=!(null==(t=this._instance.get_property(Gs))||!t.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Un&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.js||null==(e=this.Ds)||!e.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this.js&&r?(this.qs(t),Tm.info("starting")):this.stopRecording()}}qs(t){var e,r,i;this.js&&(null!=os&&null!=(e=os.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=os.__PosthogExtensions__)&&r.initSessionRecording?this.Hs(t):null==(i=os.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Vs,(e=>{if(e)return Tm.error("could not load recorder",e);this.Hs(t)})))}stopRecording(){var t,e;null==(t=this.Zs)||t.call(this),this.Zs=void 0,null==(e=this.Ds)||e.stop()}zs(){var t;null==(t=this._instance.persistence)||t.unregister(Us)}Gs(t){if(this._instance.persistence){var e,i,n=this._instance.persistence,s=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,i=null==e?void 0:e.sampleRate,s=oi(i)?null:parseFloat(i);oi(s)&&this.zs();var o=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Gs]:r({cache_timestamp:Date.now(),enabled:!!e},e,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ri(o)?null:o,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};s(),null==(e=this.Zs)||e.call(this),this.Zs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.$s=!1,this.Gs(t),this.Bs=!0,this.startIfEnabledOrStop()):this.Bs=!0:Tm.info("skipping remote config with no sessionRecording",t)}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Ds)&&r.log?this.Ds.log(t,e):Tm.warn("log called before recorder was ready")}get Vs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Gs);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ys(){var t,e=this._instance.get_property(Gs);if(!e)return!1;var r=null!==(t=("object"==typeof e?e:JSON.parse(e)).cache_timestamp)&&void 0!==t?t:Date.now();return Date.now()-r<=3e5}Hs(t){var e,r;if(null==(e=os.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Ds||(this.Ds=null==(r=os.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Ds._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.Ys()?this.Ds.start(t):this.$s||(this.$s=!0,Tm.info("persisted remote config is stale, requesting fresh config before starting"),new sm(this._instance).load())}onRRwebEmit(t){var e;null==(e=this.Ds)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.Ds)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ds||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.Ds)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Ds||(null==(r=this._instance.persistence)||r.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.Ds)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ds)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Ds)||!r.tryAddCustomEvent(t,e))}}var Rm={},Nm=()=>{},Mm="posthog",Fm=!$l&&-1===(null==ss?void 0:ss.indexOf("MSIE"))&&-1===(null==ss?void 0:ss.indexOf("Mozilla")),Om=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ss(null==ts?void 0:ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:es&&ii(null==es?void 0:es.search)&&-1!==es.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Un||null==(e=Un.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;cs.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:om},error_tracking:{},_onCapture:Nm,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Pm=t=>{var e={};ri(t.process_person)||(e.person_profiles=t.process_person),ri(t.xhr_headers)||(e.request_headers=t.xhr_headers),ri(t.cookie_name)||(e.persistence_name=t.cookie_name),ri(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),ri(t.store_google)||(e.save_campaign_params=t.store_google),ri(t.verbose)||(e.debug=t.verbose);var r=gs({},e,t);return Jr(t.property_blacklist)&&(ri(t.property_denylist)?r.property_denylist=t.property_blacklist:Jr(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:cs.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Lm{constructor(){this.__forceAllowLocalhost=!1}get Us(){return this.__forceAllowLocalhost}set Us(t){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Dm{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Lm,this.Ws=!1,this.version=ls.LIB_VERSION,this.wi=new Yg,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Om(),this.SentryIntegration=Yp,this.sentryIntegration=t=>function(t,e){var r=Gp(t,e);return{name:zp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Xs=!1,this.Js=null,this.Ks=null,this.Qs=null,this.featureFlags=new Zg(this),this.toolbar=new Kp(this),this.scrollManager=new hm(this),this.pageViewManager=new Ig(this),this.surveys=new Kg(this),this.conversations=new tm(this),this.logs=new em(this),this.experiments=new Cm(this),this.exceptions=new Cf(this),this.rateLimiter=new im(this),this.requestRouter=new _m(this),this.consent=new Pp(this),this.externalIntegrations=new xm(this),this.people={set:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=ii(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>cs.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Mm){var i,n=null!==(i=Rm[r])&&void 0!==i?i:new Dm;return n._init(t,e,r),Rm[r]=n,Rm[Mm][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n;if(void 0===e&&(e={}),ri(t)||ni(t))return cs.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},e.debug=this.eo(e.debug),this.ro=e,this.io=[],e.person_profiles&&(this.Ks=e.person_profiles),this.set_config(gs({},Om(e.defaults),Pm(e),{name:i,token:t})),this.config.on_xhr_error&&cs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:nl.GZipJS;var s=this.no();this.persistence=new Hg(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Hg(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.so=new am((t=>this.oo(t)),this.config.request_queue_config),this.ao=new lm(this),this.__request_queue=[];var u="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new fm(this),this.sessionPropsManager=new dm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.uo(u)}),0)):(cs.info("Initializing extensions synchronously"),this.uo(u)),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&cs.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var l,h,c=this.config.get_device_id(rl()),d=null!=(l=e.bootstrap)&&l.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(io,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.lo()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var r;return!(null==(r=e.bootstrap)||null==(r=r.featureFlags)||!r[t])})).reduce(((t,r)=>{var i;return t[r]=(null==(i=e.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,r)=>{var i,n;null!=(i=e.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(t[r]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(u)this.register_once({distinct_id:co,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(rl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(io,"anonymous")}return xs(Un,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Vp(this,(()=>this.ho())):this.ho(),Kr(this.config._onCapture)&&this.config._onCapture!==Nm&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&cs.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}uo(t){var e=performance.now();this.historyAutocapture=new qp(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new tg(this).startIfEnabledOrStop()})),r.push((()=>{var t;this.siteApps=new mm(this),null==(t=this.siteApps)||t.init()})),t||r.push((()=>{this.sessionRecording=new Em(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new gp(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Gg(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new _g(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new yg(this)})),r.push((()=>{this.exceptionObserver=new Zp(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new jp(this,Bp),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this.co){var t=this.co;this.co=void 0,this.Ci(t)}})),this.do(r,e)}do(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.do(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){cs.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Ci(t){var e,r,i,n,s,o,a,u,l;if(!ts||!ts.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.co=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(t.supportedCompression,nl.GZipJS)?nl.GZipJS:Vr(t.supportedCompression,nl.Base64)?nl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ks?this.Ks:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(t),null==(i=this.sessionRecording)||i.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(s=this.heatmaps)||s.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(o=this.productTours)||o.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(u=this.exceptionObserver)||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(t)}ho(){try{this.config.loaded(this)}catch(t){cs.critical("`loaded` function failed",t)}if(this.vo(),this.config.internal_or_test_user_hostname&&null!=es&&es.hostname){var t=es.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.fo()}),1),new sm(this).load(),this.featureFlags.flags()}vo(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.so)||t.enable()))}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(t=>this.oo(t))),this.__request_queue=[],this.vo()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.po()&&this.capture("$pageleave"),null==(t=this.so)||t.unload(),null==(e=this.ao)||e.unload()):this.po()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Fm?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=ql(t.url,{ip:this.config.ip?1:0}),t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4,s.url=ql(s.url,{_:(new Date).getTime().toString(),ver:ls.LIB_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=zl.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),u=null!==(i=null==(n=ks(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");u(s)})(r({},t,{callback:e=>{var r,i;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,e));null==t.callback||t.callback(e)}}))))}oo(t){this.ao?this.ao.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,r=[],i=[],n=[];fs(t,(t=>{t&&(e=t[0],Jr(e)?n.push(t):Kr(t)?t.call(this):Jr(t)&&"alias"===e?r.push(t):Jr(t)&&-1!==e.indexOf("capture")&&Kr(this[e])?n.push(t):i.push(t))}));var s=function(t,e){fs(t,(function(t){if(Jr(t[0])){var r=e;ps(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};s(r,this),s(i,this),s(n,this)}lo(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.so){if(this.is_capturing())if(!ri(t)&&ii(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!ii(null==e?void 0:e.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),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 a=new Date,u=(null==i?void 0:i.timestamp)||a,l=rl(),h={uuid:l,event:t,properties:this.calculateEventProperties(t,e||{},u,l)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var c="$groupidentify"!==t,d=this.mo(null==i?void 0:i.$set_once,c);if(d&&(h.$set_once=d),(h=Is(h,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,ri(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===Pu.DISMISSED||t===Pu.SENT){var v=null==e?void 0:e[Lu.SURVEY_ID],f=null==e?void 0:e[Lu.SURVEY_ITERATION];Yu({id:v,current_iteration:f}),h.$set=r({},h.$set,{[Vu({id:v,current_iteration:f},t===Pu.SENT?"responded":"dismissed")]:!0})}else t===Pu.SHOWN&&(h.$set=r({},h.$set,{[Lu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=r({},h.properties.$set,h.$set);if(ei(p)||this.setPersonPropertiesForFlags(p),!oi(this.config.before_send)){var g=this.yo(h);if(!g)return;h=g}this.wi.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.oo(m):this.so.enqueue(m),h}cs.critical("This capture call is ignored due to client rate limiting.")}}else cs.error("No event name provided to posthog.capture")}else cs.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&cs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=pg(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&gs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.ao)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===bm.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,l),"$pageview"===t&&ts&&(a.title=ts.title),!ri(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}ss&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=gs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Jr(this.config.property_denylist)?ps(this.config.property_denylist,(function(t){delete a[t]})):cs.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.bo();return a.$process_person_profile=g,g&&!s&&this.wo("_calculate_event_properties"),a}mo(t,e){var r;if(void 0===e&&(e=!0),!this.persistence||!this.bo())return t;if(this.Ws)return t;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=gs({},i,n||{},t||{}),o=this.config.sanitize_properties;return o&&(cs.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),e&&(this.Ws=!0),ei(s)?void 0:s}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}_o(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){return this.featureFlags.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:ri(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(t,e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.wi.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=Wu),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,i){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if(ai(t)&&(t=t.toString(),cs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==co){if(this.wo("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==n&&t!==this.get_property(Ps)&&(this.unregister(Ps),this.register({distinct_id:t}));var o="anonymous"===(this.persistence.get_property(io)||"anonymous");t!==n&&o?(this.persistence.set_property(io,"identified"),this.setPersonPropertiesForFlags(r({},i||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:i||{}}),this.Qs=Yl(t,e,i),this.featureFlags.setAnonymousDistinctId(n)):(e||i)&&this.setPersonProperties(e,i),t!==n&&(this.reloadFeatureFlags(),this.unregister(eo))}}else cs.critical('The string "'+co+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else cs.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.wo("posthog.setPersonProperties")){var i=Yl(this.get_distinct_id(),t,e);this.Qs!==i?(this.setPersonPropertiesForFlags(r({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Qs=i):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),i&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:i}),this.setGroupPropertiesForFlags({[t]:i})),n[t]===e||i||this.reloadFeatureFlags()}else cs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.wo("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n;if(cs.info("reset"),!this.__loaded)return cs.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(io,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Qs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:co,$device_id:null},"");else{var o=this.config.get_device_id(rl());this.register_once({distinct_id:o,$device_id:t?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(Os)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.wo("posthog.alias")?(ri(e)&&(e=this.get_distinct_id()),t!==e?(this._o(Ps,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(ti(t)){var i,n,s,o,a,u,l,h;gs(this.config,Pm(t));var c=this.no();null==(i=this.persistence)||i.update_config(this.config,e,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Hg(r({},this.config,{persistence:"sessionStorage"}),c);var d=this.eo(this.config.debug);li(d)&&(this.config.debug=d),li(this.config.debug)&&(this.config.debug?(ls.DEBUG=!0,Tp.rr()&&Tp.ar("ph_debug","true"),cs.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(ls.DEBUG=!1,Tp.rr()&&Tp.ur("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Io(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,r={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Mm;return e!==Mm&&(e=Mm+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(io))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(io))}bo(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ei(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Ps])&&(null==(e=this.persistence)||null==(e=e.props)||!e[lo]))}po(){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.bo()||this.wo("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wo("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wo(t){return"never"===this.config.person_profiles?(cs.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._o(lo,!0),!0)}no(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Io(){var t,e,r,i,n=this.no();(null==(t=this.persistence)?void 0:t.Ei)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.Ei)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new fm(this),this.pageViewManager=new Ig(this),this.persistence&&(this.sessionPropsManager=new dm(this,this.sessionManager,this.persistence)),this.sessionRecording=new Em(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Io(),this.vo(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.fo()}else cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Io(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:co,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.fo())):cs.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===Op.GRANTED?"granted":t===Op.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Io()}_is_bot(){return Qn?ym(Qn,this.config.custom_blocked_useragents):void 0}fo(){ts&&("visible"===ts.visibilityState?this.Xs||(this.Xs=!0,this.capture("$pageview",{title:ts.title},{send_instantly:!0}),this.Js&&(ts.removeEventListener("visibilitychange",this.Js),this.Js=null)):this.Js||(this.Js=this.fo.bind(this),xs(ts,"visibilitychange",this.Js)))}debug(t){!1===t?(null==Un||Un.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Un||Un.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}))}De(){var t,e,r,i,n,s,o,a=this.ro||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,n=cs,s=(e="advanced_disable_flags")in(t=a)&&!oi(t[e]),o=r in t&&!oi(t[r]),s?t[e]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]):i)}yo(t){if(oi(this.config.before_send))return t;var e=Jr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),oi(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return ci(t.event)?cs.warn(n+". This can cause unexpected behavior."):cs.info(n),null}r.properties&&!ei(r.properties)||cs.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.ni)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}eo(t){var e=li(t)&&!t,r=Tp.rr()&&"true"===Tp.nr("ph_debug");return!e&&(!!r||t)}}!function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=ws(t.prototype[e[r]])}(Dm,["identify"]);var Bm,jm;Bm=Rm[Mm]=new Dm,(jm=os.posthog)&&ps(jm._i,(function(t){if(t&&Jr(t)){var e=Bm.init(t[0],t[1],t[2]),r=jm[t[2]]||jm;e&&(e._execute_array.call(e.people,r.people),e._execute_array(r))}})),os.posthog=Bm,function(){function t(){t.done||(t.done=!0,Fm=!1,ps(Rm,(function(t){t._dom_loaded()})))}null!=ts&&ts.addEventListener?"complete"===ts.readyState?t():xs(ts,"DOMContentLoaded",t,{capture:!1}):Un&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.js.map