posthog-js 1.244.0 → 1.245.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 (46) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/main.js +1 -1
  13. package/dist/main.js.map +1 -1
  14. package/dist/module.d.ts +9 -1
  15. package/dist/module.full.d.ts +9 -1
  16. package/dist/module.full.js +1 -1
  17. package/dist/module.full.js.map +1 -1
  18. package/dist/module.full.no-external.d.ts +9 -1
  19. package/dist/module.full.no-external.js +1 -1
  20. package/dist/module.full.no-external.js.map +1 -1
  21. package/dist/module.js +1 -1
  22. package/dist/module.js.map +1 -1
  23. package/dist/module.no-external.d.ts +9 -1
  24. package/dist/module.no-external.js +1 -1
  25. package/dist/module.no-external.js.map +1 -1
  26. package/dist/src/extensions/surveys/surveys-extension-utils.d.ts +5 -3
  27. package/dist/src/extensions/surveys.d.ts +7 -6
  28. package/dist/src/posthog-surveys-types.d.ts +8 -0
  29. package/dist/surveys-preview.d.ts +9 -1
  30. package/dist/surveys-preview.js +1 -1
  31. package/dist/surveys-preview.js.map +1 -1
  32. package/dist/surveys.js +1 -1
  33. package/dist/surveys.js.map +1 -1
  34. package/lib/package.json +1 -1
  35. package/lib/src/extensions/surveys/components/ConfirmationMessage.jsx +1 -1
  36. package/lib/src/extensions/surveys/components/ConfirmationMessage.jsx.map +1 -1
  37. package/lib/src/extensions/surveys/surveys-extension-utils.d.ts +5 -3
  38. package/lib/src/extensions/surveys/surveys-extension-utils.jsx +16 -3
  39. package/lib/src/extensions/surveys/surveys-extension-utils.jsx.map +1 -1
  40. package/lib/src/extensions/surveys.d.ts +7 -6
  41. package/lib/src/extensions/surveys.jsx +33 -31
  42. package/lib/src/extensions/surveys.jsx.map +1 -1
  43. package/lib/src/posthog-surveys-types.d.ts +8 -0
  44. package/lib/src/posthog-surveys-types.js +6 -0
  45. package/lib/src/posthog-surveys-types.js.map +1 -1
  46. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(this,arguments)}var n,i=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(l||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var f={};function h(e){if(f[e])return f[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return f[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?f[e]=l:t.prototype}catch(e){return t.prototype}}var v={};function p(e,t,r){var n,i=e+"."+String(r);if(v[i])return v[i].call(t);var o=h(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(v[i]=a,a.call(t)):t[r]}var m={};function g(e,t,r){var n=e+"."+String(r);if(m[n])return m[n].bind(t);var i=h(e)[r];return"function"!=typeof i?t[r]:(m[n]=i,i.bind(t))}var y={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return g("Node",e,"contains")(t)},getRootNode:function(e){return g("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return h("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function C(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function w(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>k(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function k(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?O(i,t):i}function S(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:a}=e,s=o||"",u=i&&T(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function T(e){return e.toLowerCase()}var N="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function _(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,Z=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(R,((e,r,n,i,o,a)=>{var s,u=n||o||a,l=r||i||"";if(!u)return e;if(F.test(u)||Z.test(u))return"url("+l+u+l+")";if(E.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var f of(c.pop(),d))"."!==f&&(".."===f?c.pop():c.push(f));return"url("+l+c.join("/")+l+")"}))}var B,L,D=1,q=new RegExp("[^a-z0-9-_:]"),V=-2;function Y(){return D++}var H=/^[^ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/;var P=new WeakMap;function W(e,t){return t&&""!==t.trim()?z(e,t):t}function j(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function z(e,t){var r=P.get(e);if(r||(r=e.createElement("a"),P.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?W(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(G),!(r>=t.length);){var o=n(H);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=W(e,o);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?O(n,z(e)):"object"===t&&"data"===r?W(e,n):n:W(e,n):n}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&J(y.parentNode(e),t,r)}function U(e,t,r,n){var i;if(b(e)){if(i=e,!y.childNodes(i).length)return!1}else{if(null===y.parentElement(e))return!1;i=y.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(J(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Q(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,dataURLOptions:f={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,g=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:l.Document,childNodes:[],compatMode:e.compatMode}:{type:l.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:p}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),g=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),b={},C=e.attributes.length,w=0;w<C;w++){var k=e.attributes[w];K(g,k.name,k.value)||(b[k.name]=X(n,g,T(k.name),k.value))}if("link"===g&&a){var x=function(e){return null==e?void 0:e.href}(e);if(x){var _=S(n,x);if(!_&&x.includes(".css"))_=S(n,window.location.origin+"/"+x.replace(window.location.href,""));var R=null;_&&(R=I(_)),R&&(delete b.rel,delete b.href,b._cssText=R)}}if("style"===g&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var F=I(e.sheet);F&&(b._cssText=F)}if("input"===g||"textarea"===g||"select"===g){var Z=e.value,E=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&Z?b.value=A({element:e,type:M(e),tagName:g,value:Z,maskInputOptions:s,maskInputFn:u}):E&&(b.checked=E)}"option"===g&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("dialog"===g&&e.open)try{b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){b.rr_open_mode="modal",b.ph_rr_could_not_detect_modal=!0}if("canvas"===g&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=N in i?i[N]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var O=e.toDataURL(c.type,c.quality),D=n.createElement("canvas");D.width=e.width,D.height=e.height,O!==D.toDataURL(c.type,c.quality)&&(b.rr_dataURL=O)}if("img"===g&&d){B||(B=n.createElement("canvas"),L=B.getContext("2d"));var V=e,Y=V.currentSrc||V.getAttribute("src")||"<unknown-src>",H=V.crossOrigin,G=()=>{V.removeEventListener("load",G);try{B.width=V.naturalWidth,B.height=V.naturalHeight,L.drawImage(V,0,0),b.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==V.crossOrigin)return V.crossOrigin="anonymous",void(V.complete&&0!==V.naturalWidth?G():V.addEventListener("load",G));console.warn("Cannot inline img src="+Y+"! Error: "+e)}"anonymous"===V.crossOrigin&&(H?b.crossOrigin=H:V.removeAttribute("crossorigin"))};V.complete&&0!==V.naturalWidth?G():V.addEventListener("load",G)}if("audio"===g||"video"===g){var P=b;P.rr_mediaState=e.paused?"paused":"played",P.rr_mediaCurrentTime=e.currentTime,P.rr_mediaPlaybackRate=e.playbackRate,P.rr_mediaMuted=e.muted,P.rr_mediaLoop=e.loop,P.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(m){var{width:W,height:z}=e.getBoundingClientRect();b={class:b.class,rr_width:W+"px",rr_height:z+"px"}}"iframe"!==g||h(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(g)&&(r=!0)}catch(e){}return{type:l.Element,tagName:g,attributes:b,childNodes:[],isSVG:j(e)||void 0,needBlock:m,rootId:p,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m,rootId:g});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,a=y.parentNode(e),s=a&&a.tagName,u=y.textContent(e),c="STYLE"===s||void 0,d="SCRIPT"===s||void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=I(a.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=O(u,z(t.doc))}d&&(u="SCRIPT_PLACEHOLDER");!c&&!d&&u&&n&&(u=i?i(u,y.parentElement(e)):u.replace(/[\S]/g,"*"));return{type:l.Text,textContent:u||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:g});case e.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:l.Comment,textContent:y.textContent(e)||"",rootId:g};default:return!1}}function $(e){return null==e?"":e.toLowerCase()}function ee(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=U(e,a,s,void 0===M));var F,Z=Q(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,dataURLOptions:p,inlineImages:m,recordCanvas:g,keepIframeSrcFn:T,newlyAddedElement:N});if(!Z)return console.warn(e,"not serialized"),null;F=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===l.Comment)return!0;if(e.type===l.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===_(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===$(e.attributes.name)||"icon"===$(e.attributes.rel)||"apple-touch-icon"===$(e.attributes.rel)||"shortcut icon"===$(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===$(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===$(e.attributes.name)||"googlebot"===$(e.attributes.name)||"bingbot"===$(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===$(e.attributes.name)||"generator"===$(e.attributes.name)||"framework"===$(e.attributes.name)||"publisher"===$(e.attributes.name)||"progid"===$(e.attributes.name)||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===$(e.attributes.name)||"yandex-verification"===$(e.attributes.name)||"csrf-token"===$(e.attributes.name)||"p:domain_verify"===$(e.attributes.name)||"verify-v1"===$(e.attributes.name)||"verification"===$(e.attributes.name)||"shopify-checkout-api-token"===$(e.attributes.name)))return!0}}return!1}(Z,v)&&(R||Z.type!==l.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?Y():V;var E=Object.assign(Z,{id:F});if(n.add(e,E),F===V)return null;I&&I(e);var O=!u;if(E.type===l.Element){O=O&&!E.needBlock,delete E.needBlock;var B=y.shadowRoot(e);B&&w(B)&&(E.isShadowHost=!0)}if((E.type===l.Document||E.type===l.Element)&&O){v.headWhitespace&&E.type===l.Element&&"head"===E.tagName&&(R=!1);var L={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T};if(E.type===l.Element&&"textarea"===E.tagName&&void 0!==E.attributes.value);else for(var D of Array.from(y.childNodes(e))){var q=ee(D,L);q&&E.childNodes.push(q)}var H=null;if(b(e)&&(H=y.shadowRoot(e)))for(var G of Array.from(y.childNodes(H))){var P=ee(G,L);P&&(w(H)&&(P.isShadow=!0),E.childNodes.push(P))}}var W=y.parentNode(e);return W&&C(W)&&w(W)&&(E.isShadow=!0),E.type===l.Element&&"iframe"===E.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(n.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&k){var r=ee(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});r&&k(e,r)}}),S),E.type===l.Element&&"link"===E.tagName&&"string"==typeof E.attributes.rel&&("stylesheet"===E.attributes.rel||"preload"===E.attributes.rel&&"string"==typeof E.attributes.href&&"css"===_(E.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(x){var t=ee(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});t&&x(e,t)}}),A),E}let te=class e{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ne={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ie={};function oe(e){if(ie[e])return ie[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in re?re[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ne?ne[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return ie[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?ie[e]=l:r}catch(e){return r}}var ae={};function se(e,t,r){var n,i=e+"."+String(r);if(ae[i])return ae[i].call(t);var o=oe(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(ae[i]=a,a.call(t)):t[r]}var ue={};function le(e,t,r){var n=e+"."+String(r);if(ue[n])return ue[n].bind(t);var i=oe(e)[r];return"function"!=typeof i?t[r]:(ue[n]=i,i.bind(t))}function ce(){return oe("MutationObserver").constructor}var de={childNodes:function(e){return se("Node",e,"childNodes")},parentNode:function(e){return se("Node",e,"parentNode")},parentElement:function(e){return se("Node",e,"parentElement")},textContent:function(e){return se("Node",e,"textContent")},contains:function(e,t){return le("Node",e,"contains")(t)},getRootNode:function(e){return le("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?se("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?se("Element",e,"shadowRoot"):null},querySelector:function(e,t){return se("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return se("Element",e,"querySelectorAll")(t)},mutationObserver:ce};function fe(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var he="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.",ve={map:{},getId:()=>(console.error(he),-1),getNode:()=>(console.error(he),null),removeNodeFromMap(){console.error(he)},has:()=>(console.error(he),!1),reset(){console.error(he)}};function pe(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}}function me(e,t,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>me(e,t,o||{},!0)}function ge(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ve=new Proxy(ve,{get:(e,t,r)=>("map"===t&&console.error(he),Reflect.get(e,t,r))}));var ye=Date.now;function be(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=de.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=de.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function we(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:de.parentElement(e):null}function ke(e,t,r,n){if(!e)return!1;var i=Ie(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(J(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Se(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function xe(e,t){if(C(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=de.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||xe(n,t))}function Ae(e){return Boolean(e.changedTouches)}function Te(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ne(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Me(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(de.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ye=()=>(new Date).getTime());let _e=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Re(e){var t,r=null;return"getRootNode"in e&&(null==(t=de.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&de.host(de.getRootNode(e))&&(r=de.host(de.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Re(r);)r=t;return r}(e);return de.contains(t,r)}function Ze(e){var t=e.ownerDocument;return!!t&&(de.contains(t,e)||Fe(e))}var Ee=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Ee||{}),Oe=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Oe||{}),Be=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Be||{}),Le=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Le||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),qe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qe||{});function Ve(e){return"__ln"in e}class Ye{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var He,Ge=(e,t)=>e+"@"+t;class Pe{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",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ye,n=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=de.parentNode(i);if(o&&Ze(i)&&"TEXTAREA"!==o.tagName){var a=C(o)?this.mirror.getId(Re(i)):this.mirror.getId(o),s=n(i);if(-1===a||-1===s)return r.addNode(i);var u=ee(i,{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:e=>{Te(e,this.mirror)&&this.iframeManager.addIframe(e),Ne(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Me(i)&&this.shadowDomManager.addShadowRoot(de.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:a,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)je(this.removes,o,this.mirror)&&!this.movedSet.has(de.parentNode(o))||i(o);for(var a of this.addedSet)ze(this.droppedSet,a)||je(this.removes,a,this.mirror)?ze(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(de.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var f=d;if(d=d.previous,f){var h=this.mirror.getId(de.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==h){u=f;break}var v=f.value,p=de.parentNode(v);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=de.host(p);if(-1!==this.mirror.getId(m)){u=f;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=de.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(de.childNodes(e),(e=>de.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Se(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=de.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:U(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=M(r);i=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var a=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,n))if(a.attributes[n]=X(this.doc,T(r.tagName),T(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&s.setAttribute("style",e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?a.styleDiff[u]=""===c?l:[l,c]:a._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=C(e.target)?this.mirror.getId(de.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||Se(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(We(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ge(r,n)]?We(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!C(e.target)||!w(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Se(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ge(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(de.childNodes(e).forEach((e=>this.genAdds(e))),Me(e)&&de.childNodes(de.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 We(e,t){e.delete(t),de.childNodes(t).forEach((t=>We(e,t)))}function je(e,t,r){return 0!==e.length&&function(e,t,r){var n=de.parentNode(t),i=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=de.parentNode(n)};for(;n;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,r)}function ze(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=de.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!He)return e;return function(){try{return e(...arguments)}catch(e){if(He&&!0===He(e))return;throw e}}},Je=[];function Ue(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Qe(e,t){var r=new Pe;Je.push(r),r.init(e);var n=new(ce())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function $e(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],c=null;return Object.keys(Be).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=T(e),u=(e=>n=>{var s=Ue(n);if(!ke(s,o,a,!0)){var u=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=Le.Mouse;break;case"touch":u=Le.Touch;break;case"pen":u=Le.Pen}u===Le.Touch?Be[e]===Be.MouseDown?l="TouchStart":Be[e]===Be.MouseUp&&(l="TouchEnd"):Le.Pen}else Ae(n)&&(u=Le.Touch);null!==u?(c=u,(l.startsWith("Touch")&&u===Le.Touch||l.startsWith("Mouse")&&u===Le.Mouse)&&(u=null)):Be[e]===Be.Click&&(u=c,c=null);var d=Ae(n)?n.changedTouches[0]:n;if(d){var f=i.getId(s),{clientX:h,clientY:v}=d;Ke(t)(r({type:Be[l],id:f,x:h,y:v},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(Be[e]){case Be.MouseDown:case Be.MouseUp:s=s.replace("mouse","pointer");break;case Be.TouchStart:case Be.TouchEnd:return}l.push(fe(s,u,n))})),Ke((()=>{l.forEach((e=>e()))}))}function et(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:a}=e;return fe("scroll",Ke(pe(Ke((e=>{var a=Ue(e);if(a&&!ke(a,i,o,!0)){var s=n.getId(a);if(a===r&&r.defaultView){var u=be(r.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var tt=["INPUT","TEXTAREA","SELECT"],rt=new WeakMap;function nt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function it(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function ot(e,t){var r,n,i,{mirror:o,stylesheetManager:a}=e,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(de.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function at(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:f,selectionCb:h,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),a(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),f(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(n=Qe(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=pe(Ke((e=>{var r=Date.now()-o;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],o=null})),s),c=Ke(pe(Ke((e=>{var t=Ue(e),{clientX:r,clientY:n}=Ae(e)?e.changedTouches[0]:e;o||(o=ye()),u.push({x:r,y:n,id:i.getId(t),timeOffset:ye()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Oe.Drag:e instanceof MouseEvent?Oe.MouseMove:Oe.TouchMove)})),a,{trailing:!1})),d=[fe("mousemove",c,n),fe("touchmove",c,n),fe("drag",c,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),a=$e(e),s=et(e),u=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return fe("resize",Ke(pe(Ke((()=>{var e=Ce(),t=we();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),l=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:f}=e;function h(e){var t=Ue(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=de.parentElement(t)),t&&i&&!(tt.indexOf(i)<0)&&!ke(t,o,a,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,h=!1,p=M(t)||"";"radio"===p||"checkbox"===p?h=t.checked:(l[i.toLowerCase()]||l[p])&&(d=A({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),v(t,f?{text:d,isChecked:h,userTriggered:r}:{text:d,isChecked:h});var m=t.name;"radio"===p&&m&&h&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,f?{text:r,isChecked:!h,userTriggered:!1}:{text:r,isChecked:!h})}}))}}function v(e,n){var o=rt.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){rt.set(e,n);var a=i.getId(e);Ke(t)(r({},n,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>fe(e,Ke(h),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...y.map((e=>me(e[0],e[1],{set(){Ke(h)({target:this,isTrusted:!1})}},!1,m)))),Ke((()=>{p.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:a}=e,s=Ke((e=>pe(Ke((o=>{var a=Ue(o);if(a&&!ke(a,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=a;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500))),u=[fe("play",s(qe.Play),a),fe("pause",s(qe.Pause),a),fe("seeked",s(qe.Seeked),a),fe("volumechange",s(qe.VolumeChange),a),fe("ratechange",s(qe.RateChange),a)];return Ke((()=>{u.forEach((e=>e()))}))}(e),d=()=>{},f=()=>{},h=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=it(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var n=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:a}),e.apply(t,o)}))}));var c={};ut("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ut("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ut("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ut("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=it(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...nt(t),s||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...nt(t),a]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),f=ot(e,e.doc),h=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:a}=t,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ke(((e,t,a)=>{var u,[l,c,d]=a;if(i.has(l))return s.apply(t,[l,c,d]);var{id:f,styleId:h}=it(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(f&&-1!==f||h&&-1!==h)&&r({id:f,styleId:h,set:{property:l,value:c,priority:d},index:nt(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ke(((e,t,a)=>{var s,[l]=a;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=it(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,o.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:nt(t.parentRule)}),e.apply(t,a)}))}),Ke((()=>{a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,r){var n=new a(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ge(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=a})),i.push(s),Ke((()=>{i.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,a=!0,s=Ke((()=>{var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:f,endContainer:h,endOffset:v}=c;ke(d,n,i,!0)||ke(h,n,i,!0)||s.push({start:r.getId(d),startOffset:f,end:r.getId(h),endOffset:v})}o({ranges:s})}}));return s(),fe("selectionchange",s)}(e),m=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?ge(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),g=[];for(var y of e.plugins)g.push(y.observer(y.callback,i,y.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==n||n.disconnect(),o(),a(),s(),u(),l(),c(),d(),f(),h(),v(),p(),m(),g.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ut(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class lt{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ct{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new lt(Y)),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=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Ee.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Ee.IncrementalSnapshot,data:{source:Oe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ee.Meta:case Ee.Load:case Ee.DomContentLoaded:return!1;case Ee.Plugin:return t;case Ee.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ee.IncrementalSnapshot:switch(t.data.source){case Oe.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.Drag:case Oe.TouchMove:case Oe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.ViewportResize:return!1;case Oe.MediaInteraction:case Oe.MouseInteraction:case Oe.Scroll:case Oe.CanvasMutation:case Oe.Input:return this.replaceIds(t.data,e,["id"]),t;case Oe.StyleSheetRule:case Oe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Oe.Font:return t;case Oe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Oe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===l.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class dt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(w(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=Qe(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(et(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(de.host(e))),this.restoreHandlers.push(ot({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ge(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=de.shadowRoot(this);return o&&Ze(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ht="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vt=0;vt<64;vt++)ht[ft.charCodeAt(vt)]=vt;var pt=new Map;var mt=(e,t,r)=>{if(e&&(bt(e,t)||"object"==typeof e)){var n=function(e,t){var r=pt.get(e);return r||(r=new Map,pt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function gt(e,t,r){if(e instanceof Array)return e.map((e=>gt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=ft[r[t]>>2],i+=ft[(3&r[t])<<4|r[t+1]>>4],i+=ft[(15&r[t+1])<<2|r[t+2]>>6],i+=ft[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[gt(e.data,t,r),e.width,e.height]}:bt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var yt=(e,t,r)=>e.map((e=>gt(e,t,r))),bt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,n){var i=[];try{var o=ge(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];if(!ke(this,t,r,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function wt(e,t,r,n,i,o){var a=[],s=Object.getOwnPropertyNames(e),u=function(s){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return"continue";try{if("function"!=typeof e[s])return"continue";var u=ge(e,s,(function(e){return function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];var c=e.apply(this,u);if(mt(c,o,this),"tagName"in this.canvas&&!ke(this.canvas,n,i,!0)){var d=yt(u,o,this),f={type:t,property:s,args:d};r(this.canvas,f)}return c}}));a.push(u)}catch(n){var l=me(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(l)}};for(var l of s)u(l);return a}var It,kt,St,xt,At="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Tt="undefined"!=typeof window&&window.Blob&&new Blob([(It=At,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Nt(e){var t;try{if(!(t=Tt&&(window.URL||window.webkitURL).createObjectURL(Tt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+At,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Mt{constructor(e){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",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}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(e,r,n,i,o){var a=this,s=Ct(r,n,i,!0),u=new Map,l=new Nt;l.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var c,d=1e3/e,f=0,h=e=>{var s,v;f&&e-f<d?c=requestAnimationFrame(h):(f=e,(s=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,n,i,!0)||s.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),s).forEach(function(){var e=t((function*(e){var t,r=a.mirror.getId(e);if(!u.get(r)&&0!==e.width&&0!==e.height){if(u.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,s=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:s});l.postMessage({id:r,bitmap:c,width:i,height:s,dataURLOptions:o.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(h))};c=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ct(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=ge(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return ke(this.canvas,r,n,!0)||setTimeout((()=>{var r=yt(s,t,this);e(this.canvas,{type:De["2D"],property:o,args:r})}),0),i.apply(this,s)}}));i.push(a)}catch(r){var s=me(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:De["2D"],property:o,args:[t],setter:!0})}});i.push(s)}};for(var s of o)a(s);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...wt(t.WebGLRenderingContext.prototype,De.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...wt(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,i);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class _t{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new _e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:k(t,e.href),index:r})))})),n.styleIds.push(t)};for(var a of e)o(a);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Zt=document.createElement("iframe");document.body.appendChild(Zt),Array.from=(null==(n=Zt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Zt)}}catch(e){console.debug("Unable to override Array.from",e)}var Et,Ot,Bt=new x;function Lt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:f,maskInputOptions:h,slimDOMOptions:v,maskInputFn:p,maskTextFn:m,hooks:g,packFn:y,sampling:b={},dataURLOptions:C={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:k=!1,recordCrossOriginIframes:S=!1,recordAfter:A=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:N=!1,inlineImages:M=!1,plugins:_,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:Z}=e;He=Z;var E=!S||window.parent===window,O=!1;if(!E)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(E&&!t)throw new Error("emit function is required");if(!E&&!O)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Bt.reset();var B,L=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},D=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var q=0,V=e=>{for(var t of _||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!O&&(e=y(e)),e};kt=(e,r)=>{var o,a=e;if(a.timestamp=ye(),!(null==(o=Je[0])?void 0:o.isFrozen())||a.type===Ee.FullSnapshot||a.type===Ee.IncrementalSnapshot&&a.data.source===Oe.Mutation||Je.forEach((e=>e.unfreeze())),E)null==t||t(V(a),r);else if(O){var s={type:"rrweb",event:V(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(s,"*")}if(a.type===Ee.FullSnapshot)B=a,q=0;else if(a.type===Ee.IncrementalSnapshot){if(a.data.source===Oe.Mutation&&a.data.isAttachIframe)return;q++;var u=i&&q>=i,l=n&&a.timestamp-B.timestamp>n;(u||l)&&St(!0)}};var Y=e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Mutation},e)})},H=e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Scroll},e)}),G=e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.CanvasMutation},e)}),P=new _t({mutationCb:Y,adoptedStyleSheetCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.AdoptedStyleSheet},e)})}),W=new ct({mirror:Bt,mutationCb:Y,stylesheetManager:P,recordCrossOriginIframes:S,wrappedEmit:kt});for(var j of _||[])j.getMirror&&j.getMirror({nodeMirror:Bt,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});var z=new Rt;xt=new Mt({recordCanvas:k,mutationCb:G,win:window,blockClass:o,blockSelector:a,mirror:Bt,sampling:b.canvas,dataURLOptions:C});var X=new dt({mutationCb:Y,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:L,dataURLOptions:C,maskTextFn:m,maskInputFn:p,recordCanvas:k,inlineImages:M,sampling:b,slimDOMOptions:D,iframeManager:W,stylesheetManager:P,canvasManager:xt,keepIframeSrcFn:R,processedNodeManager:z},mirror:Bt});St=function(e){if(void 0===e&&(e=!1),I){kt({type:Ee.Meta,data:{href:window.location.href,width:we(),height:Ce()}},e),P.reset(),X.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:f,slimDOM:h=!1,dataURLOptions:v,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w=(()=>!1)}=t||{};return ee(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===h,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===h?{}:h,dataURLOptions:v,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Bt,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:L,maskTextFn:m,maskInputFn:p,slimDOM:D,dataURLOptions:C,recordCanvas:k,inlineImages:M,onSerialize:e=>{Te(e,Bt)&&W.addIframe(e),Ne(e,Bt)&&P.trackLinkElement(e),Me(e)&&X.addShadowRoot(de.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{P.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kt({type:Ee.FullSnapshot,data:{node:t,initialOffset:be(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,Bt.getId(document))}};try{var K=[],J=e=>{var t;return Ke(at)({mutationCb:Y,mousemoveCb:(e,t)=>kt({type:Ee.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.MouseInteraction},e)}),scrollCb:H,viewportResizeCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.ViewportResize},e)}),inputCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Input},e)}),mediaInteractionCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.StyleDeclaration},e)}),canvasMutationCb:G,fontCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Font},e)}),selectionCb:e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Selection},e)})},customElementCb:e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.CustomElement},e)})},blockClass:o,ignoreClass:s,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:d,sampling:b,recordDOM:I,recordCanvas:k,inlineImages:M,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:R,blockSelector:a,slimDOMOptions:D,dataURLOptions:C,mirror:Bt,iframeManager:W,stylesheetManager:P,shadowDomManager:X,processedNodeManager:z,canvasManager:xt,ignoreCSSAttributes:F,plugins:(null==(t=null==_?void 0:_.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Ee.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},g)};W.addLoadListener((e=>{try{K.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var U=()=>{St(),K.push(J(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?U():(K.push(fe("DOMContentLoaded",(()=>{kt({type:Ee.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&U()}))),K.push(fe("load",(()=>{kt({type:Ee.Load,data:{}}),"load"===A&&U()}),window))),()=>{K.forEach((e=>e())),z.destroy(),Ft=!1,He=void 0}}catch(e){console.warn(e)}}Lt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Ee.Custom,data:{tag:e,payload:t}})},Lt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Lt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");St(e)},Lt.mirror=Bt,(Ot=Et||(Et={}))[Ot.NotStarted=0]="NotStarted",Ot[Ot.Running=1]="Running",Ot[Ot.Stopped=2]="Stopped";var Dt,qt=Object.defineProperty,Vt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Gt=Object.defineProperty,Pt=(e,t,r)=>((e,t,r)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={};function Xt(e){if(zt[e])return zt[e];var t=globalThis[e],r=t.prototype,n=e in Wt?Wt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in jt?jt[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return zt[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?zt[e]=l:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var n,i=e+"."+String(r);if(Kt[i])return Kt[i].call(t);var o=Xt(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(Kt[i]=a,a.call(t)):t[r]}var Ut={};function Qt(e,t,r){var n=e+"."+String(r);if(Ut[n])return Ut[n].bind(t);var i=Xt(e)[r];return"function"!=typeof i?t[r]:(Ut[n]=i,i.bind(t))}var $t={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return Qt("Node",e,"contains")(t)},getRootNode:function(e){return Qt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class er{constructor(){Pt(this,"idNodeMap",new Map),Pt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function tr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&tr($t.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&tr($t.parentNode(e),t,r)}class rr{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof rr))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var nr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ir={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},or={};function ar(e){if(or[e])return or[e];var t=globalThis[e],r=t.prototype,n=e in nr?nr[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ir?ir[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return or[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?or[e]=l:r}catch(e){return r}}var sr={};function ur(e,t,r){var n,i=e+"."+String(r);if(sr[i])return sr[i].call(t);var o=ar(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(sr[i]=a,a.call(t)):t[r]}var lr={};function cr(e,t,r){var n=e+"."+String(r);if(lr[n])return lr[n].bind(t);var i=ar(e)[r];return"function"!=typeof i?t[r]:(lr[n]=i,i.bind(t))}var dr={childNodes:function(e){return ur("Node",e,"childNodes")},parentNode:function(e){return ur("Node",e,"parentNode")},parentElement:function(e){return ur("Node",e,"parentElement")},textContent:function(e){return ur("Node",e,"textContent")},contains:function(e,t){return cr("Node",e,"contains")(t)},getRootNode:function(e){return cr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ur("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ur("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ur("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ur("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ar("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.",hr={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&&(hr=new Proxy(hr,{get:(e,t,r)=>("map"===t&&console.error(fr),Reflect.get(e,t,r))}));var vr=Date.now;function pr(e){return e?e.nodeType===e.ELEMENT_NODE?e:dr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(vr=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=dr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&dr.host(dr.getRootNode(e))&&(r=dr.host(dr.getRootNode(e))),r}function gr(e){for(var t,r=e;t=mr(r);)r=t;return r}function yr(e){var t=e.ownerDocument;if(!t)return!1;var r=gr(e);return dr.contains(t,r)}for(var br=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ht(this,"id",1),Ht(this,"styleIDMap",new WeakMap),Ht(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return hr},closestElementOfNode:pr,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=o.getBoundingClientRect(),s=e(o,r),u=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:u,absoluteScale:s.absoluteScale*u}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:gr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=dr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=dr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof rr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(dr.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>e(t,r,a||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(dr.contains(t,e)||yr(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&$t.host(n)||null,Boolean(i&&"shadowRoot"in i&&$t.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var a=dr.parentNode(t);return(!a||a.nodeType!==t.DOCUMENT_NODE)&&(!a||e(a,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=pr(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(tr(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return vr},on:function(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:a}=i;if(o&&o in t){var s=t[o];if(s.parent){var u=s.parent.children.indexOf(s);s.parent.children.splice(u,0,r(i,s.parent))}else{var l=n.indexOf(s);n.splice(l,0,r(i,null))}}else if(a in t){var c=t[a];c.children.push(r(i,c))}else n.push(r(i,null))}return n},shadowHostInDom:yr,throttle:function(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)wr[Cr.charCodeAt(Ir)]=Ir;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Sr=document.createElement("iframe");document.body.appendChild(Sr),Array.from=(null==(Dt=Sr.contentWindow)?void 0:Dt.Array.from)||Array.from,document.body.removeChild(Sr)}}catch(e){console.debug("Unable to override Array.from",e)}new er,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class xr{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Ar=/(^|@)\S+:\d+/,Tr=/^\s*at .*(\S+:\d+|\(native\))/m,Nr=/^(eval@)?(\[native code])?$/,Mr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new xr({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Nr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new xr({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new xr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new xr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ar)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new xr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var a=n.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&i.push(a)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Rr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Rr(e[n])&&Fr(e[n],t-1))return!0;return!1}function Zr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rr(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=_r(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Er={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 Or(e,t,r){var n,i=r?Object.assign({},Er,r):Er,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=t.error,o=Mr.parse(n).map((e=>e.toString())),a=[Zr(r,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Zr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Zr("Uncaught (in promise)",i.stringifyOptions),Zr(t.reason,i.stringifyOptions)]);var o=Mr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(f(n,d));return()=>{u.forEach((e=>e()))};function f(t,r){var n=this;return t[r]?br.patch(t,r,(t=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Mr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Zr(e,i.stringifyOptions)));++a<i.lengthThreshold?e({level:r,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Zr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})):()=>{}}}var Br=e=>({name:"rrweb/console@1",observer:Or,options:e}),Lr="undefined"!=typeof window?window:void 0,Dr="undefined"!=typeof globalThis?globalThis:Lr,qr=Array.prototype.forEach,Vr=null==Dr?void 0:Dr.navigator,Yr=null==Dr?void 0:Dr.document;null==Dr||Dr.location,null==Dr||Dr.fetch,null!=Dr&&Dr.XMLHttpRequest&&"withCredentials"in new Dr.XMLHttpRequest&&Dr.XMLHttpRequest,null==Dr||Dr.AbortController;var Hr,Gr=null==Vr?void 0:Vr.userAgent,Pr=null!=Lr?Lr:{};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Hr||(Hr={}));var Wr=["fatal","error","warning","log","info","debug"];function jr(e,t){return-1!==e.indexOf(t)}var zr=function(e){return e.trim()},Xr=Array.isArray,Kr=Object.prototype,Jr=Kr.hasOwnProperty,Ur=Kr.toString,Qr=Xr||function(e){return"[object Array]"===Ur.call(e)},$r=e=>"function"==typeof e,en=e=>$r(e)&&-1!==e.toString().indexOf("[native code]"),tn=()=>!!Lr.Zone,rn=e=>e===Object(e)&&!Qr(e),nn=e=>void 0===e,on=e=>"[object String]"==Ur.call(e),an=e=>on(e)&&0===e.trim().length,sn=e=>null===e,un=e=>nn(e)||sn(e),ln=e=>"[object Number]"==Ur.call(e),cn=e=>"[object Boolean]"===Ur.call(e),dn=e=>e instanceof Document,fn=e=>e instanceof FormData,hn=e=>{var t={o:function(t){if(Lr&&Pr.POSTHOG_DEBUG&&!nn(Lr.console)&&Lr.console){for(var r=("__rrweb_original__"in Lr.console[t]?Lr.console[t].__rrweb_original__:Lr.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r(e,...i)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>hn(e+" "+t)};return t},vn=hn("[PostHog.js]"),pn=vn.createLogger,mn={};function gn(e,t,r){if(Qr(e))if(qr&&e.forEach===qr)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===mn)return}function yn(e,t,r){if(!un(e)){if(Qr(e))return gn(e,t,r);if(fn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===mn)return}else for(var i in e)if(Jr.call(e,i)&&t.call(r,e[i],i)===mn)return}}var bn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e};function Cn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function wn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var In=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return yn(e,(function(e,t){nn(e)||nn(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function kn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return $r(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Sn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}function xn(e){return!!e&&1===e.nodeType}function An(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Tn(e){return e?zr(e).split(/\s+/):[]}function Nn(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Tn(t)}function Mn(e){var t="";return Rn(e)&&!Fn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var r;(function(e){return!!e&&3===e.nodeType})(e)&&e.textContent&&(t+=null!==(r=function(e){return un(e)?null:zr(e).split(/(\s+)/).filter((e=>qn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),zr(t)}var _n=["a","button","form","input","select","textarea","label"];function Rn(e){for(var t=e;t.parentNode&&!An(t,"body");t=t.parentNode){var r=Nn(t);if(jr(r,"ph-sensitive")||jr(r,"ph-no-capture"))return!1}if(jr(Nn(e),"ph-include"))return!0;var n=e.type||"";if(on(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(on(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fn(e){return!!(An(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||An(e,"select")||An(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Zn="(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})",En=new RegExp("^(?:"+Zn+")$"),On=new RegExp(Zn),Bn="\\d{3}-?\\d{2}-?\\d{4}",Ln=new RegExp("^("+Bn+")$"),Dn=new RegExp("("+Bn+")");function qn(e,t){if(void 0===t&&(t=!0),un(e))return!1;if(on(e)){if(e=zr(e),(t?En:On).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Ln:Dn).test(e))return!1}return!0}function Vn(e){var t=Mn(e);return qn(t=(t+" "+Yn(e)).trim())?t:""}function Yn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Mn(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Yn(e)).trim())}catch(e){vn.error("[AutoCapture]",e)}})),t}function Hn(e){return function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+="."+o.replace(/"/g,"");var a=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return Cn(a).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[Gn(t.toString())]=Gn(r.toString())})),i+=":",i+=Cn(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Pn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Cn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function Gn(e){return e.replace(/"|\\"/g,'\\"')}function Pn(e){var t=e.attr__class;return t?Qr(t)?t:Tn(t):void 0}var Wn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jn=pn("[Recorder]"),zn=e=>"navigation"===e.entryType,Xn=e=>"resource"===e.entryType;function Kn(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>zn(e)||Xn(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>zn(e)||Xn(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Jn(e,t){return!!t&&(cn(t)||t[e])}function Un(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if(cn(r))return!0;if(Qr(r))return o(r);var a=r[t];return cn(a)?a:o(a)}function Qn(e,t,r,n,i,o){return $n.apply(this,arguments)}function $n(){return $n=t((function*(e,t,r,n,i,o){if(void 0===o&&(o=0),o>10)return jn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var a=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Xn(e)&&e.initiatorType===t&&(nn(n)||e.startTime>=n)&&(nn(i)||e.startTime<=i)));return a||(yield new Promise((e=>setTimeout(e,50*o))),Qn(e,t,r,n,i,o+1))})),$n.apply(this,arguments)}function ei(e){var{body:t,options:r,url:n}=e;if(un(t))return null;var{hostname:i,isHostDenied:o}=Sn(n,r);if(o)return i+" is in deny list";if(on(t))return t;if(dn(t))return t.textContent;if(fn(t))return In(t);if(rn(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ti=e=>!sn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ri(e){var{entry:t,method:n,status:i,networkRequest:o,isInitial:a,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),f=Math.floor(d+(s||0)),h=[r({},t?t.toJSON():{name:l},{startTime:nn(s)?void 0:Math.round(s),endTime:nn(u)?void 0:Math.round(u),timeOrigin:d,timestamp:f,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(ti(t))for(var v of t.serverTiming||[])h.push({timeOrigin:d,timestamp:f,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return h}var ni=["video/","audio/"];function ii(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function oi(){return oi=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Sn(n,r);return o?Promise.resolve(i+" is in deny list"):ii(t)})),oi.apply(this,arguments)}function ai(){return ai=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),a=ni.some((e=>null==o?void 0:o.startsWith(e)));if(o&&a)return"Content-Type "+o+" is not supported";var{hostname:s,isHostDenied:u}=Sn(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return sn(i)?ii(t):Promise.resolve(i)})),ai.apply(this,arguments)}function si(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Jn("request",n.recordHeaders),o=Jn("response",n.recordHeaders),a=kn(r,"fetch",(a=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),f={};try{var h={};d.headers.forEach(((e,t)=>{h[t]=e})),i&&(f.requestHeaders=h),Un({type:"request",headers:h,url:t,recordBody:n.recordBody})&&(f.requestBody=yield function(e){return oi.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=yield a(d),c=r.performance.now();var v={};return u.headers.forEach(((e,t)=>{v[t]=e})),o&&(f.responseHeaders=v),Un({type:"response",headers:v,url:t,recordBody:n.recordBody})&&(f.responseBody=yield function(e){return ai.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Qn(r,"fetch",d.url,l,c).then((t=>{var r,n=ri({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:f,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{a()}}var ui=null;function li(e,t,n){if(!("performance"in t))return()=>{};if(ui)return jn.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},Wn,n):Wn,o=t=>{var n=[];t.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},a=Kn(o,t,i),s=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Jn("request",r.recordHeaders),i=Jn("response",r.recordHeaders),o=kn(t.XMLHttpRequest.prototype,"open",(o=>function(a,s,u,l,c){void 0===u&&(u=!0);var d,f,h=this,v=new Request(s),p={},m={},g=h.setRequestHeader.bind(h);h.setRequestHeader=(e,t)=>(m[e]=t,g(e,t)),n&&(p.requestHeaders=m);var y=h.send.bind(h);h.send=e=>(Un({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=ei({body:e,options:r,url:s})),d=t.performance.now(),y(e)),h.addEventListener("readystatechange",(()=>{if(h.readyState===h.DONE){f=t.performance.now();var n={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Un({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=ei({body:h.response,options:r,url:s})),Qn(t,"xmlhttprequest",v.url,d,f).then((t=>{var r=ri({entry:t,method:a,status:null==h?void 0:h.status,networkRequest:p,start:d,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}})),o.call(h,a,s,u,l,c)}));return()=>{o()}}(o,t,i),u=si(o,t,i)),ui=()=>{a(),s(),u()}}var ci=e=>({name:"rrweb/network@1",observer:li,options:e});Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ci},Pr.__PosthogExtensions__.rrweb={record:Lt,version:"v2"},Pr.rrweb={record:Lt,version:"v2"},Pr.rrwebConsoleRecord={getRecordConsolePlugin:Br},Pr.getRecordNetworkPlugin=ci;var di,fi,hi,vi,pi,mi,gi,yi,bi={},Ci=[],wi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ii=Array.isArray;function ki(e,t){for(var r in t)e[r]=t[r];return e}function Si(e){var t=e.parentNode;t&&t.removeChild(e)}function xi(e,t,r){var n,i,o,a={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?di.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Ai(e,a,n,i,null)}function Ai(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++hi:i,__i:-1,__u:0};return null==i&&null!=fi.vnode&&fi.vnode(o),o}function Ti(e){return e.children}function Ni(e,t){this.props=e,this.context=t}function Mi(e,t){if(null==t)return e.__?Mi(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Mi(e):null}function _i(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return _i(e)}}function Ri(e){(!e.__d&&(e.__d=!0)&&vi.push(e)&&!Fi.__r++||pi!==fi.debounceRendering)&&((pi=fi.debounceRendering)||mi)(Fi)}function Fi(){var e,t,r,n,i,o,a,s,u;for(vi.sort(gi);e=vi.shift();)e.__d&&(t=vi.length,n=void 0,o=(i=(r=e).__v).__e,s=[],u=[],(a=r.__P)&&((n=ki({},i)).__v=i.__v+1,fi.vnode&&fi.vnode(n),Vi(a,n,i,r.__n,void 0!==a.ownerSVGElement,32&i.__u?[o]:null,s,null==o?Mi(i):o,!!(32&i.__u),u),n.__.__k[n.__i]=n,Yi(s,n,u),n.__e!=o&&_i(n)),vi.length>t&&vi.sort(gi));Fi.__r=0}function Zi(e,t,r,n,i,o,a,s,u,l,c){var d,f,h,v,p,m=n&&n.__k||Ci,g=t.length;for(r.__d=u,function(e,t,r){var n,i,o,a,s,u=t.length,l=r.length,c=l,d=0;for(e.__k=[],n=0;n<u;n++)null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?Ai(null,i,null,null,i):Ii(i)?Ai(Ti,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?Ai(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=Oi(i,r,a=n+d,c),i.__i=s,o=null,-1!==s&&(c--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?c>u-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==n+d&&(i.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Mi(o)),Gi(o,o,!1),r[n]=null,c--);if(c)for(n=0;n<l;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Mi(o)),Gi(o,o))}(r,t,m),u=r.__d,d=0;d<g;d++)null!=(h=r.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(f=-1===h.__i?bi:m[h.__i]||bi,h.__i=d,Vi(e,h,f,i,o,a,s,u,l,c),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Hi(f.ref,null,h),c.push(h.ref,h.__c||v,h)),null==p&&null!=v&&(p=v),65536&h.__u||f.__k===h.__k?u=Ei(h,u,e):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:v&&(u=v.nextSibling),h.__d=void 0,h.__u&=-196609);r.__d=u,r.__e=p}function Ei(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ei(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Oi(e,t,r,n){var i=e.key,o=e.type,a=r-1,s=r+1,u=t[r];if(null===u||u&&i==u.key&&o===u.type)return r;if(n>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a--}if(s<t.length){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s++}}return-1}function Bi(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||wi.test(t)?r:r+"px"}function Li(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Bi(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Bi(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?qi:Di,o)):e.removeEventListener(t,o?qi:Di,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function Di(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(fi.event?fi.event(e):e)}function qi(e){return this.l[e.type+!0](fi.event?fi.event(e):e)}function Vi(e,t,r,n,i,o,a,s,u,l){var c,d,f,h,v,p,m,g,y,b,C,w,I,k,S,x=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(c=fi.__b)&&c(t);e:if("function"==typeof x)try{if(g=t.props,y=(c=x.contextType)&&n[c.__c],b=c?y?y.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:("prototype"in x&&x.prototype.render?t.__c=d=new x(g,b):(t.__c=d=new Ni(g,b),d.constructor=x,d.render=Pi),y&&y.sub(d),d.props=g,d.state||(d.state={}),d.context=b,d.__n=n,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ki({},d.__s)),ki(d.__s,x.getDerivedStateFromProps(g,d.__s))),h=d.props,v=d.state,d.__v=t,f)null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==x.getDerivedStateFromProps&&g!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,b)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,v,p)}))}if(d.context=b,d.props=g,d.__P=e,d.__e=!1,w=fi.__r,I=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(n=ki(ki({},n),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(p=d.getSnapshotBeforeUpdate(h,v)),Zi(e,Ii(S=null!=c&&c.type===Ti&&null==c.key?c.props.children:c)?S:[S],t,r,n,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=s,t.__u|=u?160:32,o[o.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),fi.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,o,a,s,u){var l,c,d,f,h,v,p,m=r.props,g=t.props,y=t.type;if("svg"===y&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((h=o[l])&&"setAttribute"in h==!!y&&(y?h.localName===y:3===h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null===y)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,g.is&&g),o=null,s=!1}if(null===y)m===g||s&&e.data===g||(e.data=g);else{if(o=o&&di.call(e.childNodes),m=r.props||bi,!s&&null!=o)for(m={},l=0;l<e.attributes.length;l++)m[(h=e.attributes[l]).name]=h.value;for(l in m)h=m[l],"children"==l||("dangerouslySetInnerHTML"==l?d=h:"key"===l||l in g||Li(e,l,null,h,i));for(l in g)h=g[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?v=h:"checked"==l?p=h:"key"===l||s&&"function"!=typeof h||m[l]===h||Li(e,l,h,m[l],i);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Zi(e,Ii(f)?f:[f],t,r,n,i&&"foreignObject"!==y,o,a,o?o[0]:r.__k&&Mi(r,0),s,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Si(o[l]);s||(l="value",void 0!==v&&(v!==e[l]||"progress"===y&&!v||"option"===y&&v!==m[l])&&Li(e,l,v,m[l],!1),l="checked",void 0!==p&&p!==e[l]&&Li(e,l,p,m[l],!1))}return e}(r.__e,t,r,n,i,o,a,u,l);(c=fi.diffed)&&c(t)}function Yi(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Hi(r[n],r[++n],r[++n]);fi.__c&&fi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){fi.__e(e,t.__v)}}))}function Hi(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){fi.__e(e,r)}}function Gi(e,t,r){var n,i;if(fi.unmount&&fi.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Hi(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){fi.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Gi(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||Si(e.__e),e.__=e.__e=e.__d=void 0}function Pi(e,t,r){return this.constructor(e,r)}function Wi(e,t,r){var n,i,o,a;fi.__&&fi.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],a=[],Vi(t,e=(!n&&r||t).__k=xi(Ti,null,[e]),i||bi,bi,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?di.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Yi(o,e,a)}function ji(e,t,r){var n,i,o,a,s=ki({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&void 0!==a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?di.call(arguments,2):r),Ai(e.type,s,n||e.key,i||e.ref,null)}di=Ci.slice,fi={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},hi=0,Ni.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ki({},this.state),"function"==typeof e&&(e=e(ki({},r),this.props)),e&&ki(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ri(this))},Ni.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ri(this))},Ni.prototype.render=Ti,vi=[],mi="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gi=function(e,t){return e.__v.__b-t.__v.__b},Fi.__r=0,yi=0;var zi,Xi,Ki,Ji,Ui=0,Qi=[],$i=[],eo=fi.__b,to=fi.__r,ro=fi.diffed,no=fi.__c,io=fi.unmount;function oo(e,t){fi.__h&&fi.__h(Xi,e,Ui||t),Ui=0;var r=Xi.__H||(Xi.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:$i}),r.__[e]}function ao(e){return Ui=1,function(e,t,r){var n=oo(zi++,2);if(n.t=e,!n.__c&&(n.__=[So(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Xi,!Xi.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};Xi.u=!0;var o=Xi.shouldComponentUpdate,a=Xi.componentWillUpdate;Xi.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},Xi.shouldComponentUpdate=i}return n.__N||n.__}(So,e)}function so(e,t){var r=oo(zi++,3);!fi.__s&&ko(r.__H,t)&&(r.__=e,r.i=t,Xi.__H.__h.push(r))}function uo(e){return Ui=5,lo((function(){return{current:e}}),[])}function lo(e,t){var r=oo(zi++,7);return ko(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function co(e){var t=Xi.context[e.__c],r=oo(zi++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Xi)),t.props.value):e.__}function fo(){for(var e;e=Qi.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(wo),e.__H.__h.forEach(Io),e.__H.__h=[]}catch(t){e.__H.__h=[],fi.__e(t,e.__v)}}fi.__b=function(e){Xi=null,eo&&eo(e)},fi.__r=function(e){to&&to(e),zi=0;var t=(Xi=e.__c).__H;t&&(Ki===Xi?(t.__h=[],Xi.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=$i,e.__N=e.i=void 0}))):(t.__h.forEach(wo),t.__h.forEach(Io),t.__h=[],zi=0)),Ki=Xi},fi.diffed=function(e){ro&&ro(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Qi.push(t)&&Ji===fi.requestAnimationFrame||((Ji=fi.requestAnimationFrame)||Co)(fo)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==$i&&(e.__=e.__V),e.i=void 0,e.__V=$i}))),Ki=Xi=null},fi.__c=function(e,t){t.some((function(e){try{e.__h.forEach(wo),e.__h=e.__h.filter((function(e){return!e.__||Io(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],fi.__e(r,e.__v)}})),no&&no(e,t)},fi.unmount=function(e){io&&io(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{wo(e)}catch(e){t=e}})),r.__H=void 0,t&&fi.__e(t,r.__v))};var ho,vo,po,mo,go,yo,bo="function"==typeof requestAnimationFrame;function Co(e){var t,r=function(){clearTimeout(n),bo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);bo&&(t=requestAnimationFrame(r))}function wo(e){var t=Xi,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Xi=t}function Io(e){var t=Xi;e.__c=e.__(),Xi=t}function ko(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function So(e,t){return"function"==typeof t?t(e):t}!function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(ho||(ho={})),function(e){e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}(vo||(vo={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(po||(po={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(mo||(mo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(go||(go={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(yo||(yo={}));var xo=pn("[Surveys]");var Ao="seenSurvey_",To="inProgressSurvey_";Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return ln(e)&&isFinite(e)&&Math.floor(e)===e});var No="0123456789abcdef";class Mo{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Mo(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+No.charAt(this.bytes[t]>>>4)+No.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Mo(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class _o{constructor(){this.h=0,this.p=0,this.m=new Zo}generate(){var e=this.generateOrAbort();if(nn(e)){this.h=0;var t=this.generateOrAbort();if(nn(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.h)this.h=e,this.C();else{if(!(e+1e4>this.h))return;this.p++,this.p>4398046511103&&(this.h++,this.C())}return Mo.fromFieldsV7(this.h,Math.trunc(this.p/Math.pow(2,30)),this.p&Math.pow(2,30)-1,this.m.nextUint32())}C(){this.p=1024*this.m.nextUint32()+(1023&this.m.nextUint32())}}var Ro,Fo=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Lr&&!nn(Lr.crypto)&&crypto.getRandomValues&&(Fo=e=>crypto.getRandomValues(e));class Zo{constructor(){this.I=new Uint32Array(8),this.k=1/0}nextUint32(){return this.k>=this.I.length&&(Fo(this.I),this.k=0),this.I[this.k++]}}var Eo=()=>Oo().toString(),Oo=()=>(Ro||(Ro=new _o)).generate(),Bo="Mobile",Lo="Android",Do="Tablet",qo=Lo+" "+Do,Vo="iPad",Yo="Apple Watch",Ho="BlackBerry",Go="Nintendo",Po="PlayStation",Wo="Xbox",jo="Windows Phone",zo="Nokia",Xo="Ouya",Ko="Generic",Jo=Ko+" "+Bo.toLowerCase(),Uo=Ko+" "+Do.toLowerCase(),Qo=new RegExp(Wo,"i"),$o=new RegExp(Po+" \\w+","i"),ea=new RegExp(Go+" \\w+","i"),ta=new RegExp(Ho+"|PlayBook|BB10","i"),ra=function(e){var t=function(e){return ea.test(e)?Go:$o.test(e)?Po:Qo.test(e)?Wo:new RegExp(Xo,"i").test(e)?Xo:new RegExp("("+jo+"|WPDesktop)","i").test(e)?jo:/iPad/.test(e)?Vo:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Yo:ta.test(e)?Ho:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(zo,"i").test(e)?zo:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Bo).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Lo:qo:Lo:new RegExp("(pda|"+Bo+")","i").test(e)?Jo:new RegExp(Do,"i").test(e)&&!new RegExp(Do+" pc","i").test(e)?Uo:""}(e);return t===Vo||t===qo||"Kobo"===t||"Kindle Fire"===t||t===Uo?Do:t===Go||t===Wo||t===Po||t===Xo?"Console":t===Yo?"Wearable":t?Bo:"Desktop"};null!=Vr&&Vr.sendBeacon;var na=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},ia={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>na(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!na(t,e))))),icontains:(e,t)=>t.map(oa).some((t=>e.map(oa).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(oa).every((t=>e.map(oa).every((e=>!t.includes(e)))))},oa=e=>e.toLowerCase(),aa=pn("[Stylesheet Loader]"),sa=Lr,ua=Yr;function la(e){return"$survey_response_"+e}var ca="#020617",da={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:vo.Right,widgetColor:"#e0a045",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",inputBackground:"white",boxPadding:"20px 24px"};function fa(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ha(e){var t;void 0===e&&(e=da.backgroundColor),"#"===e[0]&&(t=fa(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=fa(r)),!t)return ca;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?ca:"white"}return ca}function va(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(aa.error("prepare_external_dependency_stylesheet returned null"),null)})(ua,':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:2147483647;--ph-survey-border-color:#dcdcdc;--ph-survey-background-color:#eeeded;--ph-survey-disabled-button-opacity:0.6;--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-survey-input-background:#fff;--ph-survey-input-focus-shadow:rgba(0,0,0,.15);--ph-survey-choice-border-hover:rgba(0,0,0,.4);--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-input-text-color:#020617;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff}.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;font-family:inherit;font-size:1rem;font-weight:500;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .1s ease-in-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom:12px}@keyframes ph-survey-fade-in-up{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes ph-survey-fade-out-down{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}@keyframes ph-survey-question-slide-in{0%{opacity:.5;transform:translateX(15px)}to{opacity:1;transform:translateX(0)}}.survey-container{animation:ph-survey-fade-in-up .3s ease-out forwards;background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:0;border-top-left-radius:10px;border-top-right-radius:10px;bottom:0;box-shadow:-6px 0 16px -8px rgb(0 0 0/8%),-9px 0 28px 0 rgb(0 0 0/5%),-12px 0 48px 16px rgb(0 0 0/3%);color:var(--ph-survey-text-primary-color);flex-direction:column;font-family:var(--ph-survey-font-family);font-weight:400;margin:0;max-width:var(--ph-survey-max-width);position:fixed;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-box,.thank-you-message-container{border-radius:10px;display:flex;flex-direction:column;gap:16px;padding:var(--ph-survey-box-padding)}.bottom-section{display:flex;flex-direction:column;gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message-container{animation:ph-survey-question-slide-in .25s ease-out forwards;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}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form input[type=text],.survey-form textarea{background:var(--ph-survey-input-background);color:var(--ph-survey-input-text-color)}@media (max-width:768px){.survey-form input[type=text],.survey-form textarea{font-size:1rem}}.survey-form input[type=text],.survey-form textarea{font-family:inherit}.survey-form textarea{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;box-sizing:border-box;outline:none;padding:10px;width:100%}.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{display:flex;flex-direction:column;font-size:14px;gap:8px}.multiple-choice-options .choice-option{cursor:pointer;display:flex;font-size:13px;position:relative}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) label{border-color:var(--ph-survey-text-subtle-color)}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) .choice-check{opacity:.5}.multiple-choice-options input{cursor:pointer;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;z-index:1}:is(.multiple-choice-options input):checked+label{border:1.5px solid var(--ph-survey-text-subtle-color);font-weight:700}:is(:is(.multiple-choice-options input):checked+label)+.choice-check{opacity:1}:is(:is(.multiple-choice-options input):checked+label) input{font-weight:700}.multiple-choice-options label{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;box-sizing:border-box;color:var(--ph-survey-input-text-color);cursor:pointer;display:block;padding:10px 35px 10px 10px;position:relative;transition:border-color .15s ease,background-color .15s ease;width:100%}:is(.multiple-choice-options .choice-option-open) label{display:flex;flex-wrap:wrap;gap:4px;padding-right:10px}:is(.multiple-choice-options .choice-option-open) label span{width:100%}:is(.multiple-choice-options .choice-option-open) label input{border:0;flex-grow:1;opacity:1;outline:0;position:relative;z-index:2}:is(:is(.multiple-choice-options .choice-option-open) label input)::placeholder{color:var(--ph-survey-text-subtle-color)}.choice-check{background:transparent;color:var(--ph-survey-input-text-color);opacity:0;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:opacity .15s ease;z-index:2}.choice-check svg{fill:var(--ph-survey-rating-bg-color);display:block;height:16px;width:16px}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0;transition:transform .15s ease,opacity .15s ease}.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)}.rating-options-number{border:1.5px solid var(--ph-survey-border-color);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;text-align:center;transition:background-color .15s ease,color .15s ease}: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;font-size:16px;font-weight:600;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:1.5px solid transparent;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);box-sizing:border-box;color:var(--ph-survey-submit-button-text-color);cursor:pointer;display:inline-block;font-family:inherit;font-size:14px;font-weight:700;margin:0;outline:0;overflow:visible;padding:12px;position:relative;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.12);text-transform:none;touch-action:manipulation;transition:transform .15s ease,box-shadow .15s ease;user-select:none;white-space:nowrap;width:100%}.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;filter:grayscale(50%);opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border:1.5px solid var(--ph-survey-border-color);border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%);transition:opacity .15s ease,transform .15s ease}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;color:var(--ph-survey-text-primary-color);display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-align:center;text-decoration:none;transition:opacity .15s ease}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{color:var(--ph-survey-text-primary-color);font-size:16px;font-weight:600;margin:10px 0 0}.thank-you-message-body{color:var(--ph-survey-text-primary-color);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)}.bolded{font-weight:600}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var pa=(e,t,n)=>{var i=Oa(e),o=ua.querySelector("."+i);if(o&&o.shadowRoot)return o.shadowRoot;var a=ua.createElement("div");((e,t)=>{var n=r({},da,t),i=e.style;i.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),i.setProperty("--ph-survey-box-padding",n.boxPadding),i.setProperty("--ph-survey-max-width",n.maxWidth),i.setProperty("--ph-survey-z-index",n.zIndex),i.setProperty("--ph-survey-border-color",n.borderColor),i.setProperty("--ph-survey-background-color",n.backgroundColor),i.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==t?void 0:t.submitButtonTextColor)||ha(n.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),i.setProperty("--ph-survey-rating-text-color",ha(n.ratingButtonColor)),i.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",ha(n.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",ha(n.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),i.setProperty("--ph-survey-input-background",n.inputBackground),i.setProperty("--ph-survey-input-text-color",ha(n.inputBackground)),i.setProperty("--ph-widget-color",n.widgetColor),i.setProperty("--ph-widget-text-color",ha(n.widgetColor)),i.setProperty("--ph-widget-z-index",n.zIndex),"white"===n.backgroundColor&&i.setProperty("--ph-survey-input-background","#f8f8f8")})(a,e.appearance),a.className=i;var s=a.attachShadow({mode:"open"}),u=va(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return ua.body.appendChild(a),s},ma=(e,t)=>{if(!t)return null;var r=e[la(t)];return Qr(r)?[...r]:r},ga=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:o,isSurveyCompleted:a}=e;o?(localStorage.setItem(ka(n),"true"),o.capture("survey sent",r({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>({id:e.id,question:e.question,response:ma(t,e.id)}))),$survey_submission_id:i,$survey_completed:a,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,{$set:{[Sa(n,"responded")]:!0}})),a&&(sa.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),Ea(n))):xo.error("[survey sent] event not captured, PostHog instance not found.")},ya=(e,t,n)=>{if(t){if(!n){var i=Fa(e);t.capture("survey dismissed",r({$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,$survey_partially_completed:Object.values((null==i?void 0:i.responses)||{}).filter((e=>!un(e))).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==i?void 0:i.responses,{$survey_submission_id:null==i?void 0:i.surveySubmissionId,$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:ma((null==i?void 0:i.responses)||{},e.id)}))),$set:{[Sa(e,"dismissed")]:!0}})),Ea(e),localStorage.setItem(ka(e),"true"),sa.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else xo.error("[survey dismissed] event not captured, PostHog instance not found.")},ba=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Ca=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,wa=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Ca(e.questions,ba(e.questions)):e.questions,Ia=e=>{var t,r;return!(null==(t=e.conditions)||null==(r=t.events)||!r.repeatedActivation||!(e=>{var t,r,n,i,o,a;return null!=(null==(t=e.conditions)||null==(r=t.events)||null==(n=r.values)?void 0:n.length)&&(null==(i=e.conditions)||null==(o=i.events)||null==(a=o.values)?void 0:a.length)>0})(e))||e.schedule===yo.Always||Za(e)},ka=e=>{var t=""+Ao+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ao+e.id+"_"+e.current_iteration),t},Sa=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},xa=function(e,t){var r={__c:t="__cC"+yi++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Ri(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),Aa=()=>co(xa),Ta=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return ji(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function Na(e){return null!=e?e:"icontains"}function Ma(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==sa||null==(r=sa.location)?void 0:r.href;if(!i)return!1;var o=[e.conditions.url],a=Na(null==(n=e.conditions)?void 0:n.urlMatchType);return ia[a](o,[i])}var _a=e=>{var t=""+To+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+To+e.id+"_"+e.current_iteration),t},Ra=(e,t)=>{try{localStorage.setItem(_a(e),JSON.stringify(t))}catch(e){xo.error("Error setting in-progress survey state in localStorage",e)}},Fa=e=>{try{var t=localStorage.getItem(_a(e));if(t)return JSON.parse(t)}catch(e){xo.error("Error getting in-progress survey state from localStorage",e)}return null},Za=e=>{var t=Fa(e);return!un(null==t?void 0:t.surveySubmissionId)},Ea=e=>{try{localStorage.removeItem(_a(e))}catch(e){xo.error("Error clearing in-progress survey state from localStorage",e)}};function Oa(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var Ba=0;function La(e,t,r,n,i,o){var a,s,u={};for(s in t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ba,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return fi.vnode&&fi.vnode(l),l}var Da=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),qa=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Va=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ya=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ha=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ga=La("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:La("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:"black"})}),Pa=La("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[La("g",{"clip-path":"url(#clip0_2415_6911)",children:[La("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:La("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),La("g",{mask:"url(#mask0_2415_6911)",children:[La("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"}),La("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"}),La("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"}),La("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"}),La("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"}),La("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"})]})]}),La("defs",{children:La("clipPath",{id:"clip0_2415_6911",children:La("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Wa=La("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:La("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"})});function ja(){return La("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Pa]})}function za(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:a,skipSubmitButton:s}=e,{isPreviewMode:u}=co(xa);return La("div",{className:"bottom-section",children:[!s&&La("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Lr||Lr.open(o)),u?null==a||a():i()},children:t}),!n.whiteLabel&&La(ja,{})]})}function Xa(e){var{question:t,description:r,descriptionContentType:n,forceDisableHtml:i}=e;return La("div",{className:"question-header",children:[La("div",{className:"survey-question",children:t}),r&&Ta({component:xi("div",{className:"survey-question-description"}),children:r,renderAsHtml:!i&&"text"!==n})]})}function Ka(e){var{onClick:t}=e,{isPreviewMode:r}=co(xa);return La("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ga})}function Ja(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:o,onClose:a}=e,{isPopup:s}=co(xa);return La("div",{className:"thank-you-message",children:La("div",{className:"thank-you-message-container",children:[s&&La(Ka,{onClick:()=>a()}),La("h3",{className:"thank-you-message-header",children:t}),r&&Ta({component:xi("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&La(za,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})})}function Ua(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a}=e,[s,u]=ao((()=>on(a)?a:""));return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>{u(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:s})]}),La(za,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:n,onSubmit:()=>i(s),onPreviewSubmit:()=>o(s)})]})}function Qa(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return La(Ti,{children:[La("div",{className:"question-container",children:La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r})}),La(za,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function $a(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:a,initialValue:s}=e,u=t.scale,l=10===t.scale?0:1,[c,d]=ao((()=>ln(s)?s:Qr(s)&&s.length>0&&ln(parseInt(s[0]))?parseInt(s[0]):on(s)&&ln(parseInt(s))?parseInt(s):null)),{isPreviewMode:f}=Aa(),h=e=>f?a(e):o(e);return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("div",{className:"rating-section",children:[La("div",{className:"rating-options",children:["emoji"===t.display&&La("div",{className:"rating-options-emoji",children:(3===t.scale?ns:is).map(((e,r)=>La("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+n+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;d(e),t.skipSubmitButton&&h(e)},children:e},r)))}),"number"===t.display&&La("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-l+1)+", minmax(0, 1fr))"},children:us(t.scale).map(((e,r)=>La(es,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{d(e),t.skipSubmitButton&&h(e)}},r)))})]}),La("div",{className:"rating-text",children:[La("div",{children:t.lowerBoundLabel}),La("div",{children:t.upperBoundLabel})]})]})]}),La(za,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:sn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:t.skipSubmitButton})]})}function es(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return La("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{i(t)},children:t})}function ts(e,t,r,n){if(n)return!1;if(sn(e))return!0;if(Qr(e)){if(!t&&0===e.length)return!0;if(t&&!r&&0===e.length)return!0}return!1}function rs(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:a,initialValue:s}=e,u=uo(null),l=lo((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=Ca(t,ba(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,d]=ao((()=>on(s)||Qr(s)?s:t.type===mo.SingleChoice?null:[])),[f,h]=ao((()=>on(s)?!l.includes(s):!!Qr(s)&&!l.some((e=>s.includes(e))))),[v,p]=ao((()=>on(s)&&!l.includes(s)?s:Qr(s)&&s.find((e=>!l.includes(e)))||"")),{isPreviewMode:m}=Aa(),g=t.type===mo.SingleChoice?"radio":"checkbox",y=t.skipSubmitButton&&t.type===mo.SingleChoice&&!t.hasOpenChoice,b=(e,r)=>r?(h(!f),void(f||setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),0))):t.type===mo.SingleChoice?(d(e),h(!1),void(y&&(o(e),m&&a(e)))):void(t.type===mo.MultipleChoice&&Qr(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e])));return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("div",{className:"multiple-choice-options limit-height",children:l.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,o="choice-option"+(i?" choice-option-open":""),a=i?f:t.type===mo.SingleChoice?c===e:Qr(c)&&c.includes(e);return La("div",{className:o,children:[La("input",{type:g,id:"surveyQuestion"+n+"Choice"+r,name:"question"+n,checked:a,onClick:()=>b(e,i)}),La("label",{htmlFor:"surveyQuestion"+n+"Choice"+r,children:i?La(Ti,{children:[La("span",{children:[e,":"]}),La("input",{type:"text",ref:u,id:"surveyQuestion"+n+"Choice"+r+"Open",name:"question"+n,value:v,onKeyDown:e=>{e.stopPropagation()},onInput:e=>(e=>{e.stopPropagation(),p(e.currentTarget.value),t.type===mo.SingleChoice&&d(e.currentTarget.value)})(e),onClick:t=>{f||b(e,!0),t.stopPropagation()}})]}):e}),La("span",{className:"choice-check",children:Wa})]},r)}))})]}),La(za,{text:t.buttonText||"Submit",submitDisabled:ts(c,f,v,!!t.optional),appearance:i,onSubmit:()=>{f&&t.type===mo.MultipleChoice?Qr(c)&&o([...c,v]):o(c)},onPreviewSubmit:()=>{f&&t.type===mo.MultipleChoice?Qr(c)&&a([...c,v]):a(c)},skipSubmitButton:y})]})}var ns=[Va,qa,Da],is=[Ya,Va,qa,Da,Ha],os=[1,2,3,4,5],as=[1,2,3,4,5,6,7],ss=[0,1,2,3,4,5,6,7,8,9,10];function us(e){switch(e){case 5:default:return os;case 7:return as;case 10:return ss}}var ls=Lr,cs=Yr,ds="ph:show_survey_widget";function fs(e,t,r){var n,i=e.questions[t],o=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?go.End:o;if(i.branching.type===go.End)return go.End;if(i.branching.type===go.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===go.ResponseBased){if(i.type===mo.SingleChoice){var a,s,u=i.choices.indexOf(""+r);if(-1===u&&i.hasOpenChoice&&(u=i.choices.length-1),null!=(a=i.branching)&&null!=(s=a.responseValues)&&s.hasOwnProperty(u)){var l=i.branching.responseValues[u];return Number.isInteger(l)?l:l===go.End?go.End:o}}else if(i.type===mo.Rating){var c,d;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,i.scale);if(null!=(c=i.branching)&&null!=(d=c.responseValues)&&d.hasOwnProperty(f)){var h=i.branching.responseValues[f];return Number.isInteger(h)?h:h===go.End?go.End:o}}return o}return xo.warn("Falling back to next question index due to unexpected branching type"),o}class hs{constructor(e){var t=this;this.S=new Map,this.A=new Map,this.T=e=>{var t,n,i=null==(t=e.conditions)?void 0:t.seenSurveyWaitPeriodInDays;if(((e,t)=>{if(!t||!e)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(n/864e5)>t})(localStorage.getItem("lastSeenSurveyDate"),i)){var o=(e=>!!localStorage.getItem(ka(e))&&!Ia(e))(e);if(!o){this.N(e.id),this.M(e);var a=(null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0,s=pa(e,this._posthog);if(a<=0)return Wi(La(gs,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.R}),s);var u=setTimeout((()=>{if(!Ma(e))return this.R(e);Wi(La(gs,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.R}),s)}),1e3*a);this.S.set(e.id,u)}}},this.F=e=>{var t=pa(e,this._posthog);Wi(La(bs,{posthog:this._posthog,survey:e}),t)},this.Z=e=>{var t=this.A.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute("PHWidgetSurveyClickListener"),this.A.delete(e),xo.info("Removed click listener for survey "+e))},this.O=e=>{var t,r=null==(t=e.appearance)?void 0:t.widgetSelector;if(r){var n=cs.querySelector(r),i=this.A.get(e.id);if(n){if(this.F(e),i){if(n===i.element)return;xo.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.Z(e.id)}if(!n.hasAttribute("PHWidgetSurveyClickListener")){var o=t=>{var r,n,i;if(t.stopPropagation(),(null==(r=e.appearance)?void 0:r.position)===vo.NextToTrigger){var o=t.currentTarget.getBoundingClientRect(),a=ls.innerHeight,s=ls.innerWidth,u=parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||"300"),l=o.left+o.width/2-u/2;l+u>s-20&&(l=s-u-20),l<20&&(l=20);var c=a-o.bottom,d=o.top,f=c<250&&d>c,h={position:"fixed",top:f?"auto":o.bottom+12+"px",left:l+"px",right:"auto",bottom:f?a-o.top+12+"px":"auto",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderBottom:"1.5px solid "+((null==(i=e.appearance)?void 0:i.borderColor)||"#c9c6c6"),borderRadius:"10px",zIndex:da.zIndex};ls.dispatchEvent(new CustomEvent(ds,{detail:{surveyId:e.id,position:h}}))}else ls.dispatchEvent(new CustomEvent(ds,{detail:{surveyId:e.id,position:{}}}))};wn(n,"click",o),n.setAttribute("PHWidgetSurveyClickListener","true"),this.A.set(e.id,{element:n,listener:o}),xo.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.Z(e.id)}},this.renderSurvey=(e,t)=>{Wi(La(gs,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.R,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||n.surveys.getSurveys((r=>{var n=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.B(e)&&t.L(e)&&t.D(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type!==po.API)),n=t.q(r),i=new Set;n.forEach((e=>{var r,n,o;e.type===po.Widget&&((null==(r=e.appearance)?void 0:r.widgetType)===ho.Tab?t.F(e):(null==(n=e.appearance)?void 0:n.widgetType)===ho.Selector&&null!=(o=e.appearance)&&o.widgetSelector&&(i.add(e.id),t.O(e)));sn(t.V)&&e.type===po.Popover&&t.T(e)})),t.A.forEach(((e,r)=>{i.has(r)||t.Z(r)}))}),e)},this.M=e=>{sn(this.V)||xo.error("Survey "+[...this.V]+" already in focus. Cannot add survey "+e.id+"."),this.V=e.id},this.R=e=>{this.V!==e.id&&xo.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.N(e.id),this.V=null,Wi(null,pa(e,this._posthog));var t=cs.querySelector(Oa(e,!0));null==t||t.remove()},this._posthog=e,this.V=null}N(e){var t=this.S.get(e);t&&(clearTimeout(t),this.S.delete(e))}q(e){return e.sort(((e,t)=>{var r,n,i=Za(e),o=Za(t);if(i&&!o)return-1;if(!i&&o)return 1;var a=e.schedule===yo.Always,s=t.schedule===yo.Always;return a&&!s?1:!a&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}Y(e){return!e||!!this._posthog.featureFlags.isFeatureEnabled(e)}B(e){return!e.conditions||Ma(e)&&function(e){var t,r,n;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!Gr)return!1;var i=ra(Gr);return ia[Na(null==(n=e.conditions)?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ua||!ua.querySelector(e.conditions.selector))}(e)}H(e){return Ia(e)||this.Y(e.internal_targeting_flag_key)||Za(e)}checkSurveyEligibility(e){var t={eligible:!0,reason:void 0};return function(e){return!(!e.start_date||e.end_date)}(e)?this.Y(e.linked_flag_key)?this.Y(e.targeting_flag_key)?(this.H(e)||(t.eligible=!1,t.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress"),t):(t.eligible=!1,t.reason="Survey targeting feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey linked feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey is not running. It was completed on "+e.end_date,t)}L(e){var t;if(!function(e){var t,r,n;return!(null==(t=e.conditions)||null==(r=t.events)||null==(n=r.values)||!n.length)}(e)&&!function(e){var t,r,n;return!(null==(t=e.conditions)||null==(r=t.actions)||null==(n=r.values)||!n.length)}(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}D(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this._posthog.featureFlags.isFeatureEnabled(r)}))}getTestAPI(){return{addSurveyToFocus:this.M,removeSurveyFromFocus:this.R,surveyInFocus:this.V,surveyTimeouts:this.S,handleWidget:this.F,handlePopoverSurvey:this.T,manageWidgetSelectorListener:this.O,sortSurveysByAppearanceDelay:this.q,checkFlags:this.D.bind(this)}}}function vs(e){if(cs&&ls){var t=new hs(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function ps(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;so((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,i=t.type===po.Widget,o=Ma(t),a=(null==(e=t.appearance)?void 0:e.widgetType)===ho.Tab&&i;if(!o)return xo.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);a&&(xo.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};wn(ls,"popstate",o),wn(ls,"hashchange",o);var a=ls.history.pushState,s=ls.history.replaceState;return ls.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},ls.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},()=>{ls.removeEventListener("popstate",o),ls.removeEventListener("hashchange",o),ls.history.pushState=a,ls.history.replaceState=s}}}),[i,t,r,n])}function ms(e,t){switch(void 0===e&&(e=vo.Right),e){case vo.Left:return{left:"30px"};case vo.Center:return{left:"0",right:"0",marginLeft:"auto",marginRight:"auto"};default:case vo.Right:return{right:t&&t===ho.Tab?"60px":"30px"}}}function gs(e){var t,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,style:d,previewPageIndex:f,removeSurveyFromFocus:h=(()=>{}),isPopup:v=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:g=(()=>{})}=e,y=uo(null),b=Number.isInteger(f),C=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:w,isSurveySent:I,hidePopupWithViewTransition:k}=function(e,t,r,n,i,o){var[a,s]=ao(n||0===r),[u,l]=ao(!1),c=()=>{var t=()=>{e.type===po.Popover&&i(e),s(!1)};cs.startViewTransition?cs.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{t()})):t()},d=t=>{t.detail.surveyId===e.id&&c()};return so((()=>{if(t){if(!n){var i=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return c();l(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{Ma(e)&&(s(!0),ls.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((()=>{var t,r,n=null==(t=cs.querySelector(Oa(e,!0)))||null==(r=t.shadowRoot)?void 0:r.querySelector("textarea");n&&n.focus()}),100))};if(wn(ls,"PHSurveyClosed",d),wn(ls,"PHSurveySent",i),r>0){var a=setTimeout(o,r);return()=>{clearTimeout(a),ls.removeEventListener("PHSurveyClosed",d),ls.removeEventListener("PHSurveySent",i)}}return o(),()=>{ls.removeEventListener("PHSurveyClosed",d),ls.removeEventListener("PHSurveySent",i)}}}else xo.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ps({survey:e,removeSurveyFromFocus:i,setSurveyVisible:s,isPreviewMode:n}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:s,hidePopupWithViewTransition:c}}(u,c,C,b,h,y),S=I||f===u.questions.length,x=lo((()=>{var e=Fa(u);return{isPreviewMode:b,previewPageIndex:f,onPopupSurveyDismissed:()=>{ya(u,c,b),m()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Eo(),onPreviewSubmit:p,posthog:c}}),[b,f,v,c,u,m,p]);return b&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),w?La(xa.Provider,{value:x,children:La("div",{className:"survey-container",style:r({},ms(null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:y,children:S?La(Ja,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(a=u.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||da,onClose:()=>{k(),g()}}):La(ys,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function ys(e){var{survey:t,forceDisableHtml:n,posthog:i}=e,[o,a]=ao((()=>{var e=Fa(t);return null!=e&&e.responses&&xo.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:s,onPopupSurveyDismissed:u,isPopup:l,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:f}=co(xa),[h,v]=ao((()=>{var e=Fa(t);return s||(null==e?void 0:e.lastQuestionIndex)||0})),p=lo((()=>wa(t)),[t]);so((()=>{f&&!nn(s)&&v(s)}),[s,f]);var m=p.at(h);return m?La("form",{className:"survey-form",name:"surveyForm",children:[l&&La(Ka,{onClick:()=>{u()}}),La("div",{className:"survey-box",children:Cs({question:m,forceDisableHtml:n,displayQuestionIndex:h,appearance:t.appearance||da,onSubmit:e=>(e=>{var{res:n,displayQuestionIndex:s,questionId:u}=e;if(i)if(u){var l=la(u),c=r({},o,{[l]:n});a(c);var f=fs(t,s,n),h=f===go.End;h||(v(f),Ra(t,{surveySubmissionId:d,responses:c,lastQuestionIndex:f})),(t.enable_partial_responses||h)&&ga({responses:c,survey:t,surveySubmissionId:d,isSurveyCompleted:h,posthog:i})}else xo.error("onNextButtonClick called without a questionId.");else xo.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:h,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?o[la(m.id)]:void 0})})]}):null}function bs(e){var t,r,n,i,o,{survey:a,forceDisableHtml:s,posthog:u,readOnly:l}=e,[c,d]=ao(!0),[f,h]=ao(!1),[v,p]=ao({});if(so((()=>{var e;if(u){if(!l){var t;if("tab"===(null==(e=a.appearance)?void 0:e.widgetType))p({top:"50%",bottom:"auto",borderRadius:10,borderBottom:"1.5px solid "+((null==(t=a.appearance)?void 0:t.borderColor)||"#c9c6c6")});var r=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===a.id&&(xo.info("Received show event for feedback button survey "+a.id),p(r.detail.position||{}),h(!0))};return wn(ls,ds,r),()=>{ls.removeEventListener(ds,r)}}}else xo.error("FeedbackWidget called without a PostHog instance.")}),[u,l,a.id,null==(t=a.appearance)?void 0:t.widgetType,null==(r=a.appearance)?void 0:r.widgetSelector,null==(n=a.appearance)?void 0:n.borderColor]),ps({survey:a,setSurveyVisible:d}),!c)return null;var m=()=>{setTimeout((()=>{h(!1)}),200)};return La(Ti,{children:["tab"===(null==(i=a.appearance)?void 0:i.widgetType)&&La("button",{className:"ph-survey-widget-tab",onClick:()=>h(!f),disabled:l,children:(null==(o=a.appearance)?void 0:o.widgetLabel)||""}),f&&La(gs,{posthog:u,survey:a,forceDisableHtml:s,style:v,onPopupSurveyDismissed:m,onCloseConfirmationMessage:m})]})}var Cs=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l={[mo.Open]:Ua,[mo.Link]:Qa,[mo.Rating]:$a,[mo.SingleChoice]:rs,[mo.MultipleChoice]:rs},c={question:t,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{s(e)},onSubmit:e=>{a(e)},initialValue:u},d={[mo.Open]:{},[mo.Link]:{},[mo.Rating]:{displayQuestionIndex:i},[mo.SingleChoice]:{displayQuestionIndex:i},[mo.MultipleChoice]:{displayQuestionIndex:i}},f=l[t.type],h=r({},c,d[t.type]);return xi(f,r({},h,{key:t.id}))};function ws(e){return!nn(Event)&&Is(e,Event)}function Is(e,t){try{return e instanceof t}catch(e){return!1}}function ks(e){return sn(e)||!rn(e)&&!$r(e)}function Ss(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Is(e,Error)}}function xs(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function As(e){return xs(e,"DOMError")}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.generateSurveys=vs,Pr.extendPostHogWithSurveys=vs;var Ts=/\(error: (.*)\)/,Ns=50,Ms="?";function _s(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?Ms:t,in_app:!0};return nn(r)||(i.lineno=r),nn(n)||(i.colno=n),i}var Rs=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Fs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Zs=/\((\S*)(?::(\d+))(?::(\d+))\)/,Es=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Os=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bs=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e,t){void 0===t&&(t=0);for(var n=[],o=e.split("\n"),a=t;a<o.length;a++){var s=o[a];if(!(s.length>1024)){var u=Ts.test(s)?s.replace(Ts,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of i){var c=l(u);if(c){n.push(c);break}}if(n.length>=Ns)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Ns).map((e=>r({},e,{filename:e.filename||Ls(t).filename,function:e.function||Ms})))}(n)}}(...[[30,e=>{var t=Rs.exec(e);if(t){var[,r,n,i]=t;return _s(r,Ms,+n,+i)}var o=Fs.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Zs.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[s,u]=Ys(o[1]||Ms,o[2]);return _s(u,s,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=Es.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=Os.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var n=t[3],i=t[1]||Ms;return[i,n]=Ys(i,n),_s(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Ls(e){return e[e.length-1]||{}}var Ds,qs,Vs,Ys=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:Ms,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};var Hs=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Gs(e,t){void 0===t&&(t=0);var r=e.stacktrace||e.stack||"",n=function(e){if(e&&Ps.test(e.message))return 1;return 0}(e);try{var i=Bs,o=function(e,t){var r=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var r=Object.keys(t);return Vs&&r.length===qs||(qs=r.length,Vs=r.reduce(((r,n)=>{Ds||(Ds={});var i=Ds[n];if(i)r[i[0]]=i[1];else for(var o=e(n),a=o.length-1;a>=0;a--){var s=o[a],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,Ds[n]=[u,l];break}}return r}),{})),Vs}(t);return e.forEach((e=>{e.filename&&(e.chunk_id=r[e.filename])})),e}(i(r,n),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Ps=/Minified React error #\d+;/i;function Ws(e,t){var r,n,i=Gs(e),o=null===(r=null==t?void 0:t.handled)||void 0===r||r,a=null!==(n=null==t?void 0:t.synthetic)&&void 0!==n&&n;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:a}}}function js(e,t){var r=Ws(e,t);return e.cause&&Ss(e.cause)&&e.cause!==e?[r,...js(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})]:[r]}function zs(e,t){return{$exception_list:js(e,t),$exception_level:"error"}}function Xs(e,t){var r,n,i,o=null===(r=null==t?void 0:t.handled)||void 0===r||r,a=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,s={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(null!=t&&t.syntheticException){var u=Gs(t.syntheticException,1);u.length&&(s.stacktrace={frames:u,type:"raw"})}return{$exception_list:[s],$exception_level:"error"}}function Ks(e){return on(e)&&!an(e)&&Wr.indexOf(e)>=0}function Js(e,t){var r,n,i=null===(r=null==t?void 0:t.handled)||void 0===r||r,o=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,a=null!=t&&t.overrideExceptionType?t.overrideExceptionType:ws(e)?e.constructor.name:"Error",s="Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:i.slice(0,t)+"..."}return""}(e),u={type:a,value:s,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var l=Gs(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Ks(e.level)?e.level:"error"}}function Us(e,t){var{error:n,event:i}=e,o={$exception_list:[]},a=n||i;if(As(a)||function(e){return xs(e,"DOMException")}(a)){var s=a;if(function(e){return"stack"in e}(a))o=zs(a,t);else{var u=s.name||(As(s)?"DOMError":"DOMException"),l=s.message?u+": "+s.message:u;o=Xs(l,r({},t,{overrideExceptionType:As(s)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in s&&(o.$exception_DOMException_code=""+s.code),o}if(function(e){return xs(e,"ErrorEvent")}(a)&&a.error)return zs(a.error,t);if(Ss(a))return zs(a,t);if(function(e){return xs(e,"Object")}(a)||ws(a))return Js(a,t);if(nn(n)&&on(i)){var c="Error",d=i,f=i.match(Hs);return f&&(c=f[1],d=f[2]),Xs(d,r({},t,{overrideExceptionType:c,defaultExceptionMessage:d}))}return Xs(a,t)}function Qs(e){var[t]=e,r=function(e){if(ks(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return ks(r)?Xs("Non-Error promise rejection captured with value: "+String(r),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Us({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var $s=pn("[ExceptionAutocapture]"),eu={wrapOnError:e=>{var t=Lr;t||$s.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=Us({event:i[0],error:i[4]});return e(a),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=Lr;t||$s.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=Qs(o);return e(s),null!==(n=null==r?void 0:r.apply(t,o))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||$s.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=n.join(" "),a=n.find((e=>e instanceof Error)),s=a?Us({event:o,error:a}):Us({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(s),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.errorWrappingFunctions=eu,Pr.posthogErrorWrappingFunctions=eu;var tu=(e,t)=>{if(e){var{sessionId:r,windowId:n}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",n)}};Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{};var ru={_patchFetch:e=>kn(Lr,"fetch",(r=>function(){var n=t((function*(t,n){var i=new Request(t,n);return tu(e,i),r(i)}));return function(e,t){return n.apply(this,arguments)}}())),_patchXHR:e=>kn(Lr.XMLHttpRequest.prototype,"open",(t=>function(r,n,i,o,a){void 0===i&&(i=!0);var s=new Request(n);return tu(e,s),t.call(this,r,s.url,i,o,a)}))};Pr.__PosthogExtensions__.tracingHeadersPatchFns=ru,Pr.postHogTracingHeadersPatchFns=ru;var nu,iu,ou=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},au=function(e){if("loading"===document.readyState)return"loading";var t=ou();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},su=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},uu=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:su(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>(t||100)-1)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(e){}return r},lu=-1,cu=function(){return lu},du=function(e){addEventListener("pageshow",(function(t){t.persisted&&(lu=t.timeStamp,e(t))}),!0)},fu=function(){var e=ou();return e&&e.activationStart||0},hu=function(e,t){var r=ou(),n="navigate";return cu()>=0?n="back-forward-cache":r&&(document.prerendering||fu()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},vu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},pu=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},mu=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},gu=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},yu=function(e){var t=!1;return function(){t||(e(),t=!0)}},bu=-1,Cu=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},wu=function(e){"hidden"===document.visibilityState&&bu>-1&&(bu="visibilitychange"===e.type?e.timeStamp:0,ku())},Iu=function(){addEventListener("visibilitychange",wu,!0),addEventListener("prerenderingchange",wu,!0)},ku=function(){removeEventListener("visibilitychange",wu,!0),removeEventListener("prerenderingchange",wu,!0)},Su=function(){return bu<0&&(bu=Cu(),Iu(),du((function(){setTimeout((function(){bu=Cu(),Iu()}),0)}))),{get firstHiddenTime(){return bu}}},xu=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Au=[1800,3e3],Tu=function(e,t){t=t||{},xu((function(){var r,n=Su(),i=hu("FCP"),o=vu("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-fu(),0),i.entries.push(e),r(!0)))}))}));o&&(r=pu(e,i,Au,t.reportAllChanges),du((function(n){i=hu("FCP"),r=pu(e,i,Au,t.reportAllChanges),mu((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Nu=[.1,.25],Mu=0,_u=1/0,Ru=0,Fu=function(e){e.forEach((function(e){e.interactionId&&(_u=Math.min(_u,e.interactionId),Ru=Math.max(Ru,e.interactionId),Mu=Ru?(Ru-_u)/7+1:0)}))},Zu=function(){return nu?Mu:performance.interactionCount||0},Eu=function(){"interactionCount"in performance||nu||(nu=vu("event",Fu,{type:"event",buffered:!0,durationThreshold:0}))},Ou=[],Bu=new Map,Lu=0,Du=[],qu=function(e){if(Du.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ou[Ou.length-1],r=Bu.get(e.interactionId);if(r||Ou.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Bu.set(n.id,n),Ou.push(n)}Ou.sort((function(e,t){return t.latency-e.latency})),Ou.length>10&&Ou.splice(10).forEach((function(e){return Bu.delete(e.id)}))}}},Vu=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=yu(e),"hidden"===document.visibilityState?e():(r=t(e),gu(e)),r},Yu=[200,500],Hu=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},xu((function(){var r;Eu();var n,i=hu("INP"),o=function(e){Vu((function(){e.forEach(qu);var t=function(){var e=Math.min(Ou.length-1,Math.floor((Zu()-Lu)/50));return Ou[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,n())}))},a=vu("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=pu(e,i,Yu,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),gu((function(){o(a.takeRecords()),n(!0)})),du((function(){Lu=Zu(),Ou.length=0,Bu.clear(),i=hu("INP"),n=pu(e,i,Yu,t.reportAllChanges)})))})))},Gu=[],Pu=[],Wu=0,ju=new WeakMap,zu=new Map,Xu=-1,Ku=function(e){Gu=Gu.concat(e),Ju()},Ju=function(){Xu<0&&(Xu=Vu(Uu))},Uu=function(){zu.size>10&&zu.forEach((function(e,t){Bu.has(t)||zu.delete(t)}));var e=Ou.map((function(e){return ju.get(e.entries[0])})),t=Pu.length-50;Pu=Pu.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<Pu.length;n++){var i=Pu[n];Qu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}var o=Gu.length-1-50;Gu=Gu.filter((function(e,t){return e.startTime>Wu&&t>o||r.has(e)})),Xu=-1};Du.push((function(e){e.interactionId&&e.target&&!zu.has(e.interactionId)&&zu.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;Wu=Math.max(Wu,e.processingEnd);for(var n=Pu.length-1;n>=0;n--){var i=Pu[n];if(Math.abs(r-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},Pu.push(t)),(e.interactionId||"first-input"===e.entryType)&&ju.set(e,t),Ju()}));var Qu=function(e,t){for(var r,n=[],i=0;r=Gu[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},$u=[2500,4e3],el={},tl={onLCP:function(e,t){!function(e,t){t=t||{},xu((function(){var r,n=Su(),i=hu("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-fu(),0),i.entries=[e],r())}))},a=vu("largest-contentful-paint",o);if(a){r=pu(e,i,$u,t.reportAllChanges);var s=yu((function(){el[i.id]||(o(a.takeRecords()),a.disconnect(),el[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Vu(s)}),{once:!0,capture:!0})})),gu(s),du((function(n){i=hu("LCP"),r=pu(e,i,$u,t.reportAllChanges),mu((function(){i.value=performance.now()-n.timeStamp,el[i.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=ou();if(r){var n=r.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],a=Math.max(0,r.responseStart-n),s=Math.max(a,o?(o.requestStart||o.startTime)-n:0),u=Math.max(s,o?o.responseEnd-n:0),l=Math.max(u,i.startTime-n);t={element:uu(i.element),timeToFirstByte:a,resourceLoadDelay:s-a,resourceLoadDuration:u-s,elementRenderDelay:l-u,navigationEntry:r,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Tu(yu((function(){var r,n=hu("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>n.value&&(n.value=i,n.entries=o,r())},s=vu("layout-shift",a);s&&(r=pu(e,n,Nu,t.reportAllChanges),gu((function(){a(s.takeRecords()),r(!0)})),du((function(){i=0,n=hu("CLS",0),r=pu(e,n,Nu,t.reportAllChanges),mu((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var n=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(n&&n.sources&&n.sources.length){var i=(t=n.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(r={largestShiftTarget:uu(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:au(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Tu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:au(cu())};if(e.entries.length){var r=ou(),n=e.entries[e.entries.length-1];if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:au(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){iu||(iu=vu("long-animation-frame",Ku)),Hu((function(t){var r=function(e){var t=e.entries[0],r=ju.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=Qu(t.startTime,i),s=e.entries.find((function(e){return e.target})),u=s&&s.target||zu.get(t.interactionId),l=[t.startTime+t.duration,i].concat(a.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,l),d={interactionTarget:uu(u),interactionTargetElement:u,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:o,longAnimationFrameEntries:a,inputDelay:n-t.startTime,processingDuration:i-n,presentationDelay:Math.max(c-i,0),loadState:au(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};function rl(e,t){return t.length>e?t.slice(0,e)+"...":t}function nl(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!xn(t));return t}function il(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};_n.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=rl(1024,Vn(e)):o.$el_text=rl(1024,Mn(e)));var a=Nn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),yn(e.attributes,(function(r){var i;if((!Fn(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&qn(r.value)&&(i=r.name,!on(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var a=r.value;"class"===r.name&&(a=Tn(a).join(" ")),o["attr__"+r.name]=rl(1024,a)}}));for(var s=1,u=1,l=e;l=nl(l);)s++,l.tagName===e.tagName&&u++;return o.nth_child=s,o.nth_of_type=u,o}function ol(e,t){for(var r,n,i,{e:o,maskAllElementAttributes:a,maskAllText:s,elementAttributeIgnoreList:u,elementsChainAsString:l}=t,c=[e],d=e;d.parentNode&&!An(d,"body");)(i=d.parentNode)&&11===i.nodeType?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var f,h,v,p=[],m={},g=!1,y=!1;if(yn(c,(e=>{var t=Rn(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&qn(g)&&g),jr(Nn(e),"ph-no-capture")&&(y=!0),p.push(il(e,a,s,u));var r=function(e){if(!Rn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&qn(n)&&(t[r]=n)}})),t}(e);bn(m,r)})),y)return{props:{},explicitNoCapture:y};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=Vn(e):p[0].$el_text=Mn(e)),g){var b,C;p[0].attr__href=g;var w=null==(h=g,v=null==Yr?void 0:Yr.createElement("a"),b=nn(v)?null:(v.href=h,v))?void 0:b.host,I=null==Lr||null==(C=Lr.location)?void 0:C.host;w&&I&&w!==I&&(f=g)}return{props:bn({$event_type:o.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:Hn(p)},null!=(r=p[0])&&r.$el_text?{$el_text:null==(n=p[0])?void 0:n.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},m)}}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.postHogWebVitalsCallbacks=tl,Pr.postHogWebVitalsCallbacks=tl;var al={};function sl(e){return function(e,t){var r=al[e];if(r)return r;var n=t[e];if(en(n)&&!tn())return al[e]=n.bind(t);var i=t.document;if(i&&$r(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),i.head.removeChild(o)}catch(t){vn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&$r(n)?al[e]=n.bind(t):n}("MutationObserver",e)}function ul(e){var t=function(e){return nn(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}function ll(e,t){return ln(e)&&e>=t}class cl{G(e){var t,r,n,i,o=this.P((null==e?void 0:e.__onCapture)||this.W.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){this.j=[],this.P=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}),this.X=e=>{var t=ul(e);sn(t)||this.K(t)||this.j.push(t),this.j.length&&nn(this.J)&&(this.J=Pr.setTimeout((()=>{this.U()}),1e3))},this.$=()=>{var e=Date.now();e%50==0&&this.j.forEach((t=>{nn(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.ee=()=>{this.te=Date.now()},this.instance=e,this.re=this.G(t),this._onCapture=this.re.__onCapture}start(e){this.ne(),this.ie(),this.oe(),this.ae(e)}ae(e){if(!this.se){var t=sl(Pr);this.se=new t((e=>{this.ue(e)})),this.se.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.se)||e.disconnect(),this.se=void 0,Pr.removeEventListener("click",this.X),Pr.removeEventListener("scroll",this.$,{capture:!0}),Pr.removeEventListener("selectionchange",this.ee)}ue(e){this.le=Date.now()}ne(){wn(Pr,"click",this.X)}ie(){wn(Pr,"scroll",this.$,{capture:!0})}oe(){wn(Pr,"selectionchange",this.ee)}K(e){if(!e)return!0;if((t=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||null!=t.closest&&t.closest(".toolbar-global-fade-container")))return!0;var t,r=this.j.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!An(e.node,"html")&&xn(e.node)&&!_n.includes(e.node.tagName.toLowerCase()))}U(){if(this.j.length){clearTimeout(this.J),this.J=void 0;var e=this.j;for(var t of(this.j=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.le&&t.timestamp<=this.le?this.le-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.te&&t.timestamp<=this.te?this.te-t.timestamp:void 0;var n=ll(t.scrollDelayMs,this.re.scroll_threshold_ms),i=ll(t.selectionChangedDelayMs,this.re.selection_change_threshold_ms),o=ll(t.mutationDelayMs,this.re.mutation_threshold_ms),a=ll(t.absoluteDelayMs,1.1*this.re.mutation_threshold_ms),s=ln(t.scrollDelayMs)&&t.scrollDelayMs<this.re.scroll_threshold_ms,u=ln(t.mutationDelayMs)&&t.mutationDelayMs<this.re.mutation_threshold_ms,l=ln(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.re.selection_change_threshold_ms;s||u||l||(n||o||a||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.le,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:a,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this.re.mutation_threshold_ms&&this.j.push(t))}this.j.length&&nn(this.J)&&(this.J=Pr.setTimeout((()=>{this.U()}),1e3))}}W(e,t){this.instance.capture("$dead_click",r({},t,ol(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.re.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new cl(e,t)}();
1
+ !function(){"use strict";function e(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=t.apply(r,n);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(this,arguments)}var n,i=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(l||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var f={};function h(e){if(f[e])return f[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in d?d[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return f[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?f[e]=l:t.prototype}catch(e){return t.prototype}}var v={};function p(e,t,r){var n,i=e+"."+String(r);if(v[i])return v[i].call(t);var o=h(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(v[i]=a,a.call(t)):t[r]}var m={};function g(e,t,r){var n=e+"."+String(r);if(m[n])return m[n].bind(t);var i=h(e)[r];return"function"!=typeof i?t[r]:(m[n]=i,i.bind(t))}var y={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return g("Node",e,"contains")(t)},getRootNode:function(e){return g("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return h("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function C(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>k(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function k(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=I(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?O(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?O(i,t):i}function S(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:a}=e,s=o||"",u=i&&T(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function T(e){return e.toLowerCase()}var N="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function _(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,Z=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(R,((e,r,n,i,o,a)=>{var s,u=n||o||a,l=r||i||"";if(!u)return e;if(F.test(u)||Z.test(u))return"url("+l+u+l+")";if(E.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var f of(c.pop(),d))"."!==f&&(".."===f?c.pop():c.push(f));return"url("+l+c.join("/")+l+")"}))}var B,L,D=1,q=new RegExp("[^a-z0-9-_:]"),V=-2;function Y(){return D++}var H=/^[^ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/;var P=new WeakMap;function W(e,t){return t&&""!==t.trim()?z(e,t):t}function j(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function z(e,t){var r=P.get(e);if(r||(r=e.createElement("a"),P.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?W(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(G),!(r>=t.length);){var o=n(H);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=W(e,o);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?O(n,z(e)):"object"===t&&"data"===r?W(e,n):n:W(e,n):n}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&J(y.parentNode(e),t,r)}function U(e,t,r,n){var i;if(b(e)){if(i=e,!y.childNodes(i).length)return!1}else{if(null===y.parentElement(e))return!1;i=y.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(J(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Q(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,dataURLOptions:f={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,g=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:l.Document,childNodes:[],compatMode:e.compatMode}:{type:l.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:p}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),g=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var k=e.attributes[C];K(g,k.name,k.value)||(b[k.name]=X(n,g,T(k.name),k.value))}if("link"===g&&a){var x=function(e){return null==e?void 0:e.href}(e);if(x){var _=S(n,x);if(!_&&x.includes(".css"))_=S(n,window.location.origin+"/"+x.replace(window.location.href,""));var R=null;_&&(R=I(_)),R&&(delete b.rel,delete b.href,b._cssText=R)}}if("style"===g&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var F=I(e.sheet);F&&(b._cssText=F)}if("input"===g||"textarea"===g||"select"===g){var Z=e.value,E=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&Z?b.value=A({element:e,type:M(e),tagName:g,value:Z,maskInputOptions:s,maskInputFn:u}):E&&(b.checked=E)}"option"===g&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("dialog"===g&&e.open)try{b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){b.rr_open_mode="modal",b.ph_rr_could_not_detect_modal=!0}if("canvas"===g&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=N in i?i[N]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var O=e.toDataURL(c.type,c.quality),D=n.createElement("canvas");D.width=e.width,D.height=e.height,O!==D.toDataURL(c.type,c.quality)&&(b.rr_dataURL=O)}if("img"===g&&d){B||(B=n.createElement("canvas"),L=B.getContext("2d"));var V=e,Y=V.currentSrc||V.getAttribute("src")||"<unknown-src>",H=V.crossOrigin,G=()=>{V.removeEventListener("load",G);try{B.width=V.naturalWidth,B.height=V.naturalHeight,L.drawImage(V,0,0),b.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==V.crossOrigin)return V.crossOrigin="anonymous",void(V.complete&&0!==V.naturalWidth?G():V.addEventListener("load",G));console.warn("Cannot inline img src="+Y+"! Error: "+e)}"anonymous"===V.crossOrigin&&(H?b.crossOrigin=H:V.removeAttribute("crossorigin"))};V.complete&&0!==V.naturalWidth?G():V.addEventListener("load",G)}if("audio"===g||"video"===g){var P=b;P.rr_mediaState=e.paused?"paused":"played",P.rr_mediaCurrentTime=e.currentTime,P.rr_mediaPlaybackRate=e.playbackRate,P.rr_mediaMuted=e.muted,P.rr_mediaLoop=e.loop,P.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(m){var{width:W,height:z}=e.getBoundingClientRect();b={class:b.class,rr_width:W+"px",rr_height:z+"px"}}"iframe"!==g||h(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(g)&&(r=!0)}catch(e){}return{type:l.Element,tagName:g,attributes:b,childNodes:[],isSVG:j(e)||void 0,needBlock:m,rootId:p,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m,rootId:g});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,a=y.parentNode(e),s=a&&a.tagName,u=y.textContent(e),c="STYLE"===s||void 0,d="SCRIPT"===s||void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=I(a.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=O(u,z(t.doc))}d&&(u="SCRIPT_PLACEHOLDER");!c&&!d&&u&&n&&(u=i?i(u,y.parentElement(e)):u.replace(/[\S]/g,"*"));return{type:l.Text,textContent:u||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:g});case e.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:l.Comment,textContent:y.textContent(e)||"",rootId:g};default:return!1}}function $(e){return null==e?"":e.toLowerCase()}function ee(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:N=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=U(e,a,s,void 0===M));var F,Z=Q(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,dataURLOptions:p,inlineImages:m,recordCanvas:g,keepIframeSrcFn:T,newlyAddedElement:N});if(!Z)return console.warn(e,"not serialized"),null;F=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===l.Comment)return!0;if(e.type===l.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===_(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===$(e.attributes.name)||"icon"===$(e.attributes.rel)||"apple-touch-icon"===$(e.attributes.rel)||"shortcut icon"===$(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===$(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===$(e.attributes.name)||"googlebot"===$(e.attributes.name)||"bingbot"===$(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===$(e.attributes.name)||"generator"===$(e.attributes.name)||"framework"===$(e.attributes.name)||"publisher"===$(e.attributes.name)||"progid"===$(e.attributes.name)||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===$(e.attributes.name)||"yandex-verification"===$(e.attributes.name)||"csrf-token"===$(e.attributes.name)||"p:domain_verify"===$(e.attributes.name)||"verify-v1"===$(e.attributes.name)||"verification"===$(e.attributes.name)||"shopify-checkout-api-token"===$(e.attributes.name)))return!0}}return!1}(Z,v)&&(R||Z.type!==l.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?Y():V;var E=Object.assign(Z,{id:F});if(n.add(e,E),F===V)return null;I&&I(e);var O=!u;if(E.type===l.Element){O=O&&!E.needBlock,delete E.needBlock;var B=y.shadowRoot(e);B&&C(B)&&(E.isShadowHost=!0)}if((E.type===l.Document||E.type===l.Element)&&O){v.headWhitespace&&E.type===l.Element&&"head"===E.tagName&&(R=!1);var L={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T};if(E.type===l.Element&&"textarea"===E.tagName&&void 0!==E.attributes.value);else for(var D of Array.from(y.childNodes(e))){var q=ee(D,L);q&&E.childNodes.push(q)}var H=null;if(b(e)&&(H=y.shadowRoot(e)))for(var G of Array.from(y.childNodes(H))){var P=ee(G,L);P&&(C(H)&&(P.isShadow=!0),E.childNodes.push(P))}}var W=y.parentNode(e);return W&&w(W)&&C(W)&&(E.isShadow=!0),E.type===l.Element&&"iframe"===E.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(n.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&k){var r=ee(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});r&&k(e,r)}}),S),E.type===l.Element&&"link"===E.tagName&&"string"==typeof E.attributes.rel&&("stylesheet"===E.attributes.rel||"preload"===E.attributes.rel&&"string"==typeof E.attributes.href&&"css"===_(E.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(x){var t=ee(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:R,onSerialize:I,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:A,keepIframeSrcFn:T});t&&x(e,t)}}),A),E}let te=class e{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ne={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ie={};function oe(e){if(ie[e])return ie[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,n=e in re?re[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ne?ne[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return ie[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?ie[e]=l:r}catch(e){return r}}var ae={};function se(e,t,r){var n,i=e+"."+String(r);if(ae[i])return ae[i].call(t);var o=oe(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(ae[i]=a,a.call(t)):t[r]}var ue={};function le(e,t,r){var n=e+"."+String(r);if(ue[n])return ue[n].bind(t);var i=oe(e)[r];return"function"!=typeof i?t[r]:(ue[n]=i,i.bind(t))}function ce(){return oe("MutationObserver").constructor}var de={childNodes:function(e){return se("Node",e,"childNodes")},parentNode:function(e){return se("Node",e,"parentNode")},parentElement:function(e){return se("Node",e,"parentElement")},textContent:function(e){return se("Node",e,"textContent")},contains:function(e,t){return le("Node",e,"contains")(t)},getRootNode:function(e){return le("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?se("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?se("Element",e,"shadowRoot"):null},querySelector:function(e,t){return se("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return se("Element",e,"querySelectorAll")(t)},mutationObserver:ce};function fe(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var he="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.",ve={map:{},getId:()=>(console.error(he),-1),getNode:()=>(console.error(he),null),removeNodeFromMap(){console.error(he)},has:()=>(console.error(he),!1),reset(){console.error(he)}};function pe(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}}function me(e,t,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>me(e,t,o||{},!0)}function ge(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ve=new Proxy(ve,{get:(e,t,r)=>("map"===t&&console.error(he),Reflect.get(e,t,r))}));var ye=Date.now;function be(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=de.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=de.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function we(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:de.parentElement(e):null}function ke(e,t,r,n){if(!e)return!1;var i=Ie(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(J(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Se(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function xe(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=de.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||xe(n,t))}function Ae(e){return Boolean(e.changedTouches)}function Te(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ne(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Me(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(de.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ye=()=>(new Date).getTime());let _e=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Re(e){var t,r=null;return"getRootNode"in e&&(null==(t=de.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&de.host(de.getRootNode(e))&&(r=de.host(de.getRootNode(e))),r}function Fe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Re(r);)r=t;return r}(e);return de.contains(t,r)}function Ze(e){var t=e.ownerDocument;return!!t&&(de.contains(t,e)||Fe(e))}var Ee=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Ee||{}),Oe=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Oe||{}),Be=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Be||{}),Le=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Le||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),qe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qe||{});function Ve(e){return"__ln"in e}class Ye{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var He,Ge=(e,t)=>e+"@"+t;class Pe{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",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ye,n=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=de.parentNode(i);if(o&&Ze(i)&&"TEXTAREA"!==o.tagName){var a=w(o)?this.mirror.getId(Re(i)):this.mirror.getId(o),s=n(i);if(-1===a||-1===s)return r.addNode(i);var u=ee(i,{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:e=>{Te(e,this.mirror)&&this.iframeManager.addIframe(e),Ne(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Me(i)&&this.shadowDomManager.addShadowRoot(de.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:a,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)je(this.removes,o,this.mirror)&&!this.movedSet.has(de.parentNode(o))||i(o);for(var a of this.addedSet)ze(this.droppedSet,a)||je(this.removes,a,this.mirror)?ze(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(de.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var f=d;if(d=d.previous,f){var h=this.mirror.getId(de.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==h){u=f;break}var v=f.value,p=de.parentNode(v);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=de.host(p);if(-1!==this.mirror.getId(m)){u=f;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=de.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(de.childNodes(e),(e=>de.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Se(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=de.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:U(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=M(r);i=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var a=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,n))if(a.attributes[n]=X(this.doc,T(r.tagName),T(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&s.setAttribute("style",e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?a.styleDiff[u]=""===c?l:[l,c]:a._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=w(e.target)?this.mirror.getId(de.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||Se(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(We(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ge(r,n)]?We(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!w(e.target)||!C(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Se(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ge(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(de.childNodes(e).forEach((e=>this.genAdds(e))),Me(e)&&de.childNodes(de.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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 We(e,t){e.delete(t),de.childNodes(t).forEach((t=>We(e,t)))}function je(e,t,r){return 0!==e.length&&function(e,t,r){var n=de.parentNode(t),i=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=de.parentNode(n)};for(;n;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,r)}function ze(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=de.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!He)return e;return function(){try{return e(...arguments)}catch(e){if(He&&!0===He(e))return;throw e}}},Je=[];function Ue(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Qe(e,t){var r=new Pe;Je.push(r),r.init(e);var n=new(ce())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function $e(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],c=null;return Object.keys(Be).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=T(e),u=(e=>n=>{var s=Ue(n);if(!ke(s,o,a,!0)){var u=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=Le.Mouse;break;case"touch":u=Le.Touch;break;case"pen":u=Le.Pen}u===Le.Touch?Be[e]===Be.MouseDown?l="TouchStart":Be[e]===Be.MouseUp&&(l="TouchEnd"):Le.Pen}else Ae(n)&&(u=Le.Touch);null!==u?(c=u,(l.startsWith("Touch")&&u===Le.Touch||l.startsWith("Mouse")&&u===Le.Mouse)&&(u=null)):Be[e]===Be.Click&&(u=c,c=null);var d=Ae(n)?n.changedTouches[0]:n;if(d){var f=i.getId(s),{clientX:h,clientY:v}=d;Ke(t)(r({type:Be[l],id:f,x:h,y:v},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(Be[e]){case Be.MouseDown:case Be.MouseUp:s=s.replace("mouse","pointer");break;case Be.TouchStart:case Be.TouchEnd:return}l.push(fe(s,u,n))})),Ke((()=>{l.forEach((e=>e()))}))}function et(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:a}=e;return fe("scroll",Ke(pe(Ke((e=>{var a=Ue(e);if(a&&!ke(a,i,o,!0)){var s=n.getId(a);if(a===r&&r.defaultView){var u=be(r.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var tt=["INPUT","TEXTAREA","SELECT"],rt=new WeakMap;function nt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function it(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function ot(e,t){var r,n,i,{mirror:o,stylesheetManager:a}=e,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(de.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function at(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:f,selectionCb:h,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),a(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),f(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(n=Qe(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=pe(Ke((e=>{var r=Date.now()-o;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],o=null})),s),c=Ke(pe(Ke((e=>{var t=Ue(e),{clientX:r,clientY:n}=Ae(e)?e.changedTouches[0]:e;o||(o=ye()),u.push({x:r,y:n,id:i.getId(t),timeOffset:ye()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Oe.Drag:e instanceof MouseEvent?Oe.MouseMove:Oe.TouchMove)})),a,{trailing:!1})),d=[fe("mousemove",c,n),fe("touchmove",c,n),fe("drag",c,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),a=$e(e),s=et(e),u=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return fe("resize",Ke(pe(Ke((()=>{var e=we(),t=Ce();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),l=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:o,blockSelector:a,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:f}=e;function h(e){var t=Ue(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=de.parentElement(t)),t&&i&&!(tt.indexOf(i)<0)&&!ke(t,o,a,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,h=!1,p=M(t)||"";"radio"===p||"checkbox"===p?h=t.checked:(l[i.toLowerCase()]||l[p])&&(d=A({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),v(t,f?{text:d,isChecked:h,userTriggered:r}:{text:d,isChecked:h});var m=t.name;"radio"===p&&m&&h&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,f?{text:r,isChecked:!h,userTriggered:!1}:{text:r,isChecked:!h})}}))}}function v(e,n){var o=rt.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){rt.set(e,n);var a=i.getId(e);Ke(t)(r({},n,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>fe(e,Ke(h),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...y.map((e=>me(e[0],e[1],{set(){Ke(h)({target:this,isTrusted:!1})}},!1,m)))),Ke((()=>{p.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:a}=e,s=Ke((e=>pe(Ke((o=>{var a=Ue(o);if(a&&!ke(a,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=a;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),o.media||500))),u=[fe("play",s(qe.Play),a),fe("pause",s(qe.Pause),a),fe("seeked",s(qe.Seeked),a),fe("volumechange",s(qe.VolumeChange),a),fe("ratechange",s(qe.RateChange),a)];return Ke((()=>{u.forEach((e=>e()))}))}(e),d=()=>{},f=()=>{},h=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=it(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var n=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var s,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:a}),e.apply(t,o)}))}));var c={};ut("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ut("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ut("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ut("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[a,s]=o,{id:u,styleId:l}=it(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...nt(t),s||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[a]=o,{id:s,styleId:u}=it(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...nt(t),a]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=l,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),f=ot(e,e.doc),h=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:a}=t,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ke(((e,t,a)=>{var u,[l,c,d]=a;if(i.has(l))return s.apply(t,[l,c,d]);var{id:f,styleId:h}=it(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(f&&-1!==f||h&&-1!==h)&&r({id:f,styleId:h,set:{property:l,value:c,priority:d},index:nt(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ke(((e,t,a)=>{var s,[l]=a;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=it(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,o.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:nt(t.parentRule)}),e.apply(t,a)}))}),Ke((()=>{a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,r){var n=new a(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ge(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=a})),i.push(s),Ke((()=>{i.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,a=!0,s=Ke((()=>{var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;l<u;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:f,endContainer:h,endOffset:v}=c;ke(d,n,i,!0)||ke(h,n,i,!0)||s.push({start:r.getId(d),startOffset:f,end:r.getId(h),endOffset:v})}o({ranges:s})}}));return s(),fe("selectionchange",s)}(e),m=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?ge(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),g=[];for(var y of e.plugins)g.push(y.observer(y.callback,i,y.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==n||n.disconnect(),o(),a(),s(),u(),l(),c(),d(),f(),h(),v(),p(),m(),g.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ut(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class lt{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ct{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new lt(Y)),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=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Ee.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Ee.IncrementalSnapshot,data:{source:Oe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ee.Meta:case Ee.Load:case Ee.DomContentLoaded:return!1;case Ee.Plugin:return t;case Ee.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ee.IncrementalSnapshot:switch(t.data.source){case Oe.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.Drag:case Oe.TouchMove:case Oe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.ViewportResize:return!1;case Oe.MediaInteraction:case Oe.MouseInteraction:case Oe.Scroll:case Oe.CanvasMutation:case Oe.Input:return this.replaceIds(t.data,e,["id"]),t;case Oe.StyleSheetRule:case Oe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Oe.Font:return t;case Oe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Oe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===l.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class dt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(C(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=Qe(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(et(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(de.host(e))),this.restoreHandlers.push(ot({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ge(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=de.shadowRoot(this);return o&&Ze(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ht="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vt=0;vt<64;vt++)ht[ft.charCodeAt(vt)]=vt;var pt=new Map;var mt=(e,t,r)=>{if(e&&(bt(e,t)||"object"==typeof e)){var n=function(e,t){var r=pt.get(e);return r||(r=new Map,pt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function gt(e,t,r){if(e instanceof Array)return e.map((e=>gt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=ft[r[t]>>2],i+=ft[(3&r[t])<<4|r[t+1]>>4],i+=ft[(15&r[t+1])<<2|r[t+2]>>6],i+=ft[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[gt(e.data,t,r),e.width,e.height]}:bt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var yt=(e,t,r)=>e.map((e=>gt(e,t,r))),bt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function wt(e,t,r,n){var i=[];try{var o=ge(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];if(!ke(this,t,r,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function Ct(e,t,r,n,i,o){var a=[],s=Object.getOwnPropertyNames(e),u=function(s){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return"continue";try{if("function"!=typeof e[s])return"continue";var u=ge(e,s,(function(e){return function(){for(var a=arguments.length,u=new Array(a),l=0;l<a;l++)u[l]=arguments[l];var c=e.apply(this,u);if(mt(c,o,this),"tagName"in this.canvas&&!ke(this.canvas,n,i,!0)){var d=yt(u,o,this),f={type:t,property:s,args:d};r(this.canvas,f)}return c}}));a.push(u)}catch(n){var l=me(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(l)}};for(var l of s)u(l);return a}var It,kt,St,xt,At="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Tt="undefined"!=typeof window&&window.Blob&&new Blob([(It=At,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Nt(e){var t;try{if(!(t=Tt&&(window.URL||window.webkitURL).createObjectURL(Tt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+At,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Mt{constructor(e){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",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}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(e,r,n,i,o){var a=this,s=wt(r,n,i,!0),u=new Map,l=new Nt;l.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var c,d=1e3/e,f=0,h=e=>{var s,v;f&&e-f<d?c=requestAnimationFrame(h):(f=e,(s=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,n,i,!0)||s.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),s).forEach(function(){var e=t((function*(e){var t,r=a.mirror.getId(e);if(!u.get(r)&&0!==e.width&&0!==e.height){if(u.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,s=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:s});l.postMessage({id:r,bitmap:c,width:i,height:s,dataURLOptions:o.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(h))};c=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=wt(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=ge(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return ke(this.canvas,r,n,!0)||setTimeout((()=>{var r=yt(s,t,this);e(this.canvas,{type:De["2D"],property:o,args:r})}),0),i.apply(this,s)}}));i.push(a)}catch(r){var s=me(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:De["2D"],property:o,args:[t],setter:!0})}});i.push(s)}};for(var s of o)a(s);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...Ct(t.WebGLRenderingContext.prototype,De.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...Ct(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,i);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class _t{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new _e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:k(t,e.href),index:r})))})),n.styleIds.push(t)};for(var a of e)o(a);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Ft=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Zt=document.createElement("iframe");document.body.appendChild(Zt),Array.from=(null==(n=Zt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Zt)}}catch(e){console.debug("Unable to override Array.from",e)}var Et,Ot,Bt=new x;function Lt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:f,maskInputOptions:h,slimDOMOptions:v,maskInputFn:p,maskTextFn:m,hooks:g,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:C,recordDOM:I=!0,recordCanvas:k=!1,recordCrossOriginIframes:S=!1,recordAfter:A=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:N=!1,inlineImages:M=!1,plugins:_,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:Z}=e;He=Z;var E=!S||window.parent===window,O=!1;if(!E)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(E&&!t)throw new Error("emit function is required");if(!E&&!O)return()=>{};void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),Bt.reset();var B,L=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},D=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var q=0,V=e=>{for(var t of _||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!O&&(e=y(e)),e};kt=(e,r)=>{var o,a=e;if(a.timestamp=ye(),!(null==(o=Je[0])?void 0:o.isFrozen())||a.type===Ee.FullSnapshot||a.type===Ee.IncrementalSnapshot&&a.data.source===Oe.Mutation||Je.forEach((e=>e.unfreeze())),E)null==t||t(V(a),r);else if(O){var s={type:"rrweb",event:V(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(s,"*")}if(a.type===Ee.FullSnapshot)B=a,q=0;else if(a.type===Ee.IncrementalSnapshot){if(a.data.source===Oe.Mutation&&a.data.isAttachIframe)return;q++;var u=i&&q>=i,l=n&&a.timestamp-B.timestamp>n;(u||l)&&St(!0)}};var Y=e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Mutation},e)})},H=e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Scroll},e)}),G=e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.CanvasMutation},e)}),P=new _t({mutationCb:Y,adoptedStyleSheetCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.AdoptedStyleSheet},e)})}),W=new ct({mirror:Bt,mutationCb:Y,stylesheetManager:P,recordCrossOriginIframes:S,wrappedEmit:kt});for(var j of _||[])j.getMirror&&j.getMirror({nodeMirror:Bt,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});var z=new Rt;xt=new Mt({recordCanvas:k,mutationCb:G,win:window,blockClass:o,blockSelector:a,mirror:Bt,sampling:b.canvas,dataURLOptions:w});var X=new dt({mutationCb:Y,scrollCb:H,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:L,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:k,inlineImages:M,sampling:b,slimDOMOptions:D,iframeManager:W,stylesheetManager:P,canvasManager:xt,keepIframeSrcFn:R,processedNodeManager:z},mirror:Bt});St=function(e){if(void 0===e&&(e=!1),I){kt({type:Ee.Meta,data:{href:window.location.href,width:Ce(),height:we()}},e),P.reset(),X.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new x,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:f,slimDOM:h=!1,dataURLOptions:v,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C=(()=>!1)}=t||{};return ee(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:f,slimDOMOptions:!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===h,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===h?{}:h,dataURLOptions:v,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:Bt,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:L,maskTextFn:m,maskInputFn:p,slimDOM:D,dataURLOptions:w,recordCanvas:k,inlineImages:M,onSerialize:e=>{Te(e,Bt)&&W.addIframe(e),Ne(e,Bt)&&P.trackLinkElement(e),Me(e)&&X.addShadowRoot(de.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{P.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kt({type:Ee.FullSnapshot,data:{node:t,initialOffset:be(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,Bt.getId(document))}};try{var K=[],J=e=>{var t;return Ke(at)({mutationCb:Y,mousemoveCb:(e,t)=>kt({type:Ee.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.MouseInteraction},e)}),scrollCb:H,viewportResizeCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.ViewportResize},e)}),inputCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Input},e)}),mediaInteractionCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.StyleDeclaration},e)}),canvasMutationCb:G,fontCb:e=>kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Font},e)}),selectionCb:e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.Selection},e)})},customElementCb:e=>{kt({type:Ee.IncrementalSnapshot,data:r({source:Oe.CustomElement},e)})},blockClass:o,ignoreClass:s,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:d,sampling:b,recordDOM:I,recordCanvas:k,inlineImages:M,userTriggeredOnInput:T,collectFonts:N,doc:e,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:R,blockSelector:a,slimDOMOptions:D,dataURLOptions:w,mirror:Bt,iframeManager:W,stylesheetManager:P,shadowDomManager:X,processedNodeManager:z,canvasManager:xt,ignoreCSSAttributes:F,plugins:(null==(t=null==_?void 0:_.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Ee.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},g)};W.addLoadListener((e=>{try{K.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var U=()=>{St(),K.push(J(document)),Ft=!0};return"interactive"===document.readyState||"complete"===document.readyState?U():(K.push(fe("DOMContentLoaded",(()=>{kt({type:Ee.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&U()}))),K.push(fe("load",(()=>{kt({type:Ee.Load,data:{}}),"load"===A&&U()}),window))),()=>{K.forEach((e=>e())),z.destroy(),Ft=!1,He=void 0}}catch(e){console.warn(e)}}Lt.addCustomEvent=(e,t)=>{if(!Ft)throw new Error("please add custom event after start recording");kt({type:Ee.Custom,data:{tag:e,payload:t}})},Lt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Lt.takeFullSnapshot=e=>{if(!Ft)throw new Error("please take full snapshot after start recording");St(e)},Lt.mirror=Bt,(Ot=Et||(Et={}))[Ot.NotStarted=0]="NotStarted",Ot[Ot.Running=1]="Running",Ot[Ot.Stopped=2]="Stopped";var Dt,qt=Object.defineProperty,Vt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yt=Object.defineProperty,Ht=(e,t,r)=>((e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Gt=Object.defineProperty,Pt=(e,t,r)=>((e,t,r)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={};function Xt(e){if(zt[e])return zt[e];var t=globalThis[e],r=t.prototype,n=e in Wt?Wt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in jt?jt[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return zt[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?zt[e]=l:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var n,i=e+"."+String(r);if(Kt[i])return Kt[i].call(t);var o=Xt(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(Kt[i]=a,a.call(t)):t[r]}var Ut={};function Qt(e,t,r){var n=e+"."+String(r);if(Ut[n])return Ut[n].bind(t);var i=Xt(e)[r];return"function"!=typeof i?t[r]:(Ut[n]=i,i.bind(t))}var $t={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return Qt("Node",e,"contains")(t)},getRootNode:function(e){return Qt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class er{constructor(){Pt(this,"idNodeMap",new Map),Pt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function tr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&tr($t.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&tr($t.parentNode(e),t,r)}class rr{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 e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof rr))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var nr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ir={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},or={};function ar(e){if(or[e])return or[e];var t=globalThis[e],r=t.prototype,n=e in nr?nr[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ir?ir[e]:void 0,a=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&a)return or[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return document.body.removeChild(s),l?or[e]=l:r}catch(e){return r}}var sr={};function ur(e,t,r){var n,i=e+"."+String(r);if(sr[i])return sr[i].call(t);var o=ar(e),a=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return a?(sr[i]=a,a.call(t)):t[r]}var lr={};function cr(e,t,r){var n=e+"."+String(r);if(lr[n])return lr[n].bind(t);var i=ar(e)[r];return"function"!=typeof i?t[r]:(lr[n]=i,i.bind(t))}var dr={childNodes:function(e){return ur("Node",e,"childNodes")},parentNode:function(e){return ur("Node",e,"parentNode")},parentElement:function(e){return ur("Node",e,"parentElement")},textContent:function(e){return ur("Node",e,"textContent")},contains:function(e,t){return cr("Node",e,"contains")(t)},getRootNode:function(e){return cr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ur("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ur("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ur("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ur("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ar("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.",hr={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&&(hr=new Proxy(hr,{get:(e,t,r)=>("map"===t&&console.error(fr),Reflect.get(e,t,r))}));var vr=Date.now;function pr(e){return e?e.nodeType===e.ELEMENT_NODE?e:dr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(vr=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=dr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&dr.host(dr.getRootNode(e))&&(r=dr.host(dr.getRootNode(e))),r}function gr(e){for(var t,r=e;t=mr(r);)r=t;return r}function yr(e){var t=e.ownerDocument;if(!t)return!1;var r=gr(e);return dr.contains(t,r)}for(var br=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ht(this,"id",1),Ht(this,"styleIDMap",new WeakMap),Ht(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return hr},closestElementOfNode:pr,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=o.getBoundingClientRect(),s=e(o,r),u=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:u,absoluteScale:s.absoluteScale*u}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:gr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=dr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=dr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof rr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(dr.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>e(t,r,a||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(dr.contains(t,e)||yr(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&$t.host(n)||null,Boolean(i&&"shadowRoot"in i&&$t.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var a=dr.parentNode(t);return(!a||a.nodeType!==t.DOCUMENT_NODE)&&(!a||e(a,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=pr(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(tr(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return vr},on:function(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:a}=i;if(o&&o in t){var s=t[o];if(s.parent){var u=s.parent.children.indexOf(s);s.parent.children.splice(u,0,r(i,s.parent))}else{var l=n.indexOf(s);n.splice(l,0,r(i,null))}}else if(a in t){var c=t[a];c.children.push(r(i,c))}else n.push(r(i,null))}return n},shadowHostInDom:yr,throttle:function(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,a)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,a)}),l))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)Cr[wr.charCodeAt(Ir)]=Ir;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Sr=document.createElement("iframe");document.body.appendChild(Sr),Array.from=(null==(Dt=Sr.contentWindow)?void 0:Dt.Array.from)||Array.from,document.body.removeChild(Sr)}}catch(e){console.debug("Unable to override Array.from",e)}new er,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class xr{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Ar=/(^|@)\S+:\d+/,Tr=/^\s*at .*(\S+:\d+|\(native\))/m,Nr=/^(eval@)?(\[native code])?$/,Mr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new xr({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Nr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new xr({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new xr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var a=t.exec(r[i]);a&&n.push(new xr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ar)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new xr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var a=n.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&i.push(a)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Rr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Rr(e[n])&&Fr(e[n],t-1))return!0;return!1}function Zr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rr(e)&&Fr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=_r(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Er={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 Or(e,t,r){var n,i=r?Object.assign({},Er,r):Er,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=t.error,o=Mr.parse(n).map((e=>e.toString())),a=[Zr(r,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Zr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Zr("Uncaught (in promise)",i.stringifyOptions),Zr(t.reason,i.stringifyOptions)]);var o=Mr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(f(n,d));return()=>{u.forEach((e=>e()))};function f(t,r){var n=this;return t[r]?br.patch(t,r,(t=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Mr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Zr(e,i.stringifyOptions)));++a<i.lengthThreshold?e({level:r,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Zr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})):()=>{}}}var Br=e=>({name:"rrweb/console@1",observer:Or,options:e}),Lr="undefined"!=typeof window?window:void 0,Dr="undefined"!=typeof globalThis?globalThis:Lr,qr=Array.prototype.forEach,Vr=null==Dr?void 0:Dr.navigator,Yr=null==Dr?void 0:Dr.document;null==Dr||Dr.location,null==Dr||Dr.fetch,null!=Dr&&Dr.XMLHttpRequest&&"withCredentials"in new Dr.XMLHttpRequest&&Dr.XMLHttpRequest,null==Dr||Dr.AbortController;var Hr,Gr=null==Vr?void 0:Vr.userAgent,Pr=null!=Lr?Lr:{};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Hr||(Hr={}));var Wr=["fatal","error","warning","log","info","debug"];function jr(e,t){return-1!==e.indexOf(t)}var zr=function(e){return e.trim()},Xr=Array.isArray,Kr=Object.prototype,Jr=Kr.hasOwnProperty,Ur=Kr.toString,Qr=Xr||function(e){return"[object Array]"===Ur.call(e)},$r=e=>"function"==typeof e,en=e=>$r(e)&&-1!==e.toString().indexOf("[native code]"),tn=()=>!!Lr.Zone,rn=e=>e===Object(e)&&!Qr(e),nn=e=>void 0===e,on=e=>"[object String]"==Ur.call(e),an=e=>on(e)&&0===e.trim().length,sn=e=>null===e,un=e=>nn(e)||sn(e),ln=e=>"[object Number]"==Ur.call(e),cn=e=>"[object Boolean]"===Ur.call(e),dn=e=>e instanceof Document,fn=e=>e instanceof FormData,hn=e=>{var t={o:function(t){if(Lr&&Pr.POSTHOG_DEBUG&&!nn(Lr.console)&&Lr.console){for(var r=("__rrweb_original__"in Lr.console[t]?Lr.console[t].__rrweb_original__:Lr.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r(e,...i)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.o("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>hn(e+" "+t)};return t},vn=hn("[PostHog.js]"),pn=vn.createLogger,mn={};function gn(e,t,r){if(Qr(e))if(qr&&e.forEach===qr)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===mn)return}function yn(e,t,r){if(!un(e)){if(Qr(e))return gn(e,t,r);if(fn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===mn)return}else for(var i in e)if(Jr.call(e,i)&&t.call(r,e[i],i)===mn)return}}var bn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e};function wn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function Cn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var In=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return yn(e,(function(e,t){nn(e)||nn(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function kn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return $r(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Sn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}function xn(e){return!!e&&1===e.nodeType}function An(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Tn(e){return e?zr(e).split(/\s+/):[]}function Nn(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Tn(t)}function Mn(e){var t="";return Rn(e)&&!Fn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var r;(function(e){return!!e&&3===e.nodeType})(e)&&e.textContent&&(t+=null!==(r=function(e){return un(e)?null:zr(e).split(/(\s+)/).filter((e=>qn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),zr(t)}var _n=["a","button","form","input","select","textarea","label"];function Rn(e){for(var t=e;t.parentNode&&!An(t,"body");t=t.parentNode){var r=Nn(t);if(jr(r,"ph-sensitive")||jr(r,"ph-no-capture"))return!1}if(jr(Nn(e),"ph-include"))return!0;var n=e.type||"";if(on(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(on(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fn(e){return!!(An(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||An(e,"select")||An(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Zn="(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})",En=new RegExp("^(?:"+Zn+")$"),On=new RegExp(Zn),Bn="\\d{3}-?\\d{2}-?\\d{4}",Ln=new RegExp("^("+Bn+")$"),Dn=new RegExp("("+Bn+")");function qn(e,t){if(void 0===t&&(t=!0),un(e))return!1;if(on(e)){if(e=zr(e),(t?En:On).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Ln:Dn).test(e))return!1}return!0}function Vn(e){var t=Mn(e);return qn(t=(t+" "+Yn(e)).trim())?t:""}function Yn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Mn(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Yn(e)).trim())}catch(e){vn.error("[AutoCapture]",e)}})),t}function Hn(e){return function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+="."+o.replace(/"/g,"");var a=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return wn(a).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[Gn(t.toString())]=Gn(r.toString())})),i+=":",i+=wn(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Pn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function Gn(e){return e.replace(/"|\\"/g,'\\"')}function Pn(e){var t=e.attr__class;return t?Qr(t)?t:Tn(t):void 0}var Wn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},jn=pn("[Recorder]"),zn=e=>"navigation"===e.entryType,Xn=e=>"resource"===e.entryType;function Kn(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>zn(e)||Xn(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>zn(e)||Xn(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Jn(e,t){return!!t&&(cn(t)||t[e])}function Un(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if(cn(r))return!0;if(Qr(r))return o(r);var a=r[t];return cn(a)?a:o(a)}function Qn(e,t,r,n,i,o){return $n.apply(this,arguments)}function $n(){return $n=t((function*(e,t,r,n,i,o){if(void 0===o&&(o=0),o>10)return jn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var a=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Xn(e)&&e.initiatorType===t&&(nn(n)||e.startTime>=n)&&(nn(i)||e.startTime<=i)));return a||(yield new Promise((e=>setTimeout(e,50*o))),Qn(e,t,r,n,i,o+1))})),$n.apply(this,arguments)}function ei(e){var{body:t,options:r,url:n}=e;if(un(t))return null;var{hostname:i,isHostDenied:o}=Sn(n,r);if(o)return i+" is in deny list";if(on(t))return t;if(dn(t))return t.textContent;if(fn(t))return In(t);if(rn(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ti=e=>!sn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ri(e){var{entry:t,method:n,status:i,networkRequest:o,isInitial:a,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),f=Math.floor(d+(s||0)),h=[r({},t?t.toJSON():{name:l},{startTime:nn(s)?void 0:Math.round(s),endTime:nn(u)?void 0:Math.round(u),timeOrigin:d,timestamp:f,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(ti(t))for(var v of t.serverTiming||[])h.push({timeOrigin:d,timestamp:f,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return h}var ni=["video/","audio/"];function ii(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function oi(){return oi=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Sn(n,r);return o?Promise.resolve(i+" is in deny list"):ii(t)})),oi.apply(this,arguments)}function ai(){return ai=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),a=ni.some((e=>null==o?void 0:o.startsWith(e)));if(o&&a)return"Content-Type "+o+" is not supported";var{hostname:s,isHostDenied:u}=Sn(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return sn(i)?ii(t):Promise.resolve(i)})),ai.apply(this,arguments)}function si(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Jn("request",n.recordHeaders),o=Jn("response",n.recordHeaders),a=kn(r,"fetch",(a=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),f={};try{var h={};d.headers.forEach(((e,t)=>{h[t]=e})),i&&(f.requestHeaders=h),Un({type:"request",headers:h,url:t,recordBody:n.recordBody})&&(f.requestBody=yield function(e){return oi.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=yield a(d),c=r.performance.now();var v={};return u.headers.forEach(((e,t)=>{v[t]=e})),o&&(f.responseHeaders=v),Un({type:"response",headers:v,url:t,recordBody:n.recordBody})&&(f.responseBody=yield function(e){return ai.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Qn(r,"fetch",d.url,l,c).then((t=>{var r,n=ri({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:f,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{a()}}var ui=null;function li(e,t,n){if(!("performance"in t))return()=>{};if(ui)return jn.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},Wn,n):Wn,o=t=>{var n=[];t.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},a=Kn(o,t,i),s=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Jn("request",r.recordHeaders),i=Jn("response",r.recordHeaders),o=kn(t.XMLHttpRequest.prototype,"open",(o=>function(a,s,u,l,c){void 0===u&&(u=!0);var d,f,h=this,v=new Request(s),p={},m={},g=h.setRequestHeader.bind(h);h.setRequestHeader=(e,t)=>(m[e]=t,g(e,t)),n&&(p.requestHeaders=m);var y=h.send.bind(h);h.send=e=>(Un({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=ei({body:e,options:r,url:s})),d=t.performance.now(),y(e)),h.addEventListener("readystatechange",(()=>{if(h.readyState===h.DONE){f=t.performance.now();var n={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Un({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=ei({body:h.response,options:r,url:s})),Qn(t,"xmlhttprequest",v.url,d,f).then((t=>{var r=ri({entry:t,method:a,status:null==h?void 0:h.status,networkRequest:p,start:d,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}})),o.call(h,a,s,u,l,c)}));return()=>{o()}}(o,t,i),u=si(o,t,i)),ui=()=>{a(),s(),u()}}var ci=e=>({name:"rrweb/network@1",observer:li,options:e});Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:ci},Pr.__PosthogExtensions__.rrweb={record:Lt,version:"v2"},Pr.rrweb={record:Lt,version:"v2"},Pr.rrwebConsoleRecord={getRecordConsolePlugin:Br},Pr.getRecordNetworkPlugin=ci;var di,fi,hi,vi,pi,mi,gi,yi,bi={},wi=[],Ci=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ii=Array.isArray;function ki(e,t){for(var r in t)e[r]=t[r];return e}function Si(e){var t=e.parentNode;t&&t.removeChild(e)}function xi(e,t,r){var n,i,o,a={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?di.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Ai(e,a,n,i,null)}function Ai(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++hi:i,__i:-1,__u:0};return null==i&&null!=fi.vnode&&fi.vnode(o),o}function Ti(e){return e.children}function Ni(e,t){this.props=e,this.context=t}function Mi(e,t){if(null==t)return e.__?Mi(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Mi(e):null}function _i(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return _i(e)}}function Ri(e){(!e.__d&&(e.__d=!0)&&vi.push(e)&&!Fi.__r++||pi!==fi.debounceRendering)&&((pi=fi.debounceRendering)||mi)(Fi)}function Fi(){var e,t,r,n,i,o,a,s,u;for(vi.sort(gi);e=vi.shift();)e.__d&&(t=vi.length,n=void 0,o=(i=(r=e).__v).__e,s=[],u=[],(a=r.__P)&&((n=ki({},i)).__v=i.__v+1,fi.vnode&&fi.vnode(n),Vi(a,n,i,r.__n,void 0!==a.ownerSVGElement,32&i.__u?[o]:null,s,null==o?Mi(i):o,!!(32&i.__u),u),n.__.__k[n.__i]=n,Yi(s,n,u),n.__e!=o&&_i(n)),vi.length>t&&vi.sort(gi));Fi.__r=0}function Zi(e,t,r,n,i,o,a,s,u,l,c){var d,f,h,v,p,m=n&&n.__k||wi,g=t.length;for(r.__d=u,function(e,t,r){var n,i,o,a,s,u=t.length,l=r.length,c=l,d=0;for(e.__k=[],n=0;n<u;n++)null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?Ai(null,i,null,null,i):Ii(i)?Ai(Ti,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?Ai(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=Oi(i,r,a=n+d,c),i.__i=s,o=null,-1!==s&&(c--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?c>u-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==n+d&&(i.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Mi(o)),Gi(o,o,!1),r[n]=null,c--);if(c)for(n=0;n<l;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Mi(o)),Gi(o,o))}(r,t,m),u=r.__d,d=0;d<g;d++)null!=(h=r.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(f=-1===h.__i?bi:m[h.__i]||bi,h.__i=d,Vi(e,h,f,i,o,a,s,u,l,c),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Hi(f.ref,null,h),c.push(h.ref,h.__c||v,h)),null==p&&null!=v&&(p=v),65536&h.__u||f.__k===h.__k?u=Ei(h,u,e):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:v&&(u=v.nextSibling),h.__d=void 0,h.__u&=-196609);r.__d=u,r.__e=p}function Ei(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ei(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Oi(e,t,r,n){var i=e.key,o=e.type,a=r-1,s=r+1,u=t[r];if(null===u||u&&i==u.key&&o===u.type)return r;if(n>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a--}if(s<t.length){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s++}}return-1}function Bi(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ci.test(t)?r:r+"px"}function Li(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Bi(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Bi(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?qi:Di,o)):e.removeEventListener(t,o?qi:Di,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function Di(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(fi.event?fi.event(e):e)}function qi(e){return this.l[e.type+!0](fi.event?fi.event(e):e)}function Vi(e,t,r,n,i,o,a,s,u,l){var c,d,f,h,v,p,m,g,y,b,w,C,I,k,S,x=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(c=fi.__b)&&c(t);e:if("function"==typeof x)try{if(g=t.props,y=(c=x.contextType)&&n[c.__c],b=c?y?y.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:("prototype"in x&&x.prototype.render?t.__c=d=new x(g,b):(t.__c=d=new Ni(g,b),d.constructor=x,d.render=Pi),y&&y.sub(d),d.props=g,d.state||(d.state={}),d.context=b,d.__n=n,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ki({},d.__s)),ki(d.__s,x.getDerivedStateFromProps(g,d.__s))),h=d.props,v=d.state,d.__v=t,f)null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==x.getDerivedStateFromProps&&g!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,b)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,v,p)}))}if(d.context=b,d.props=g,d.__P=e,d.__e=!1,C=fi.__r,I=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(n=ki(ki({},n),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(p=d.getSnapshotBeforeUpdate(h,v)),Zi(e,Ii(S=null!=c&&c.type===Ti&&null==c.key?c.props.children:c)?S:[S],t,r,n,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=s,t.__u|=u?160:32,o[o.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),fi.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,o,a,s,u){var l,c,d,f,h,v,p,m=r.props,g=t.props,y=t.type;if("svg"===y&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((h=o[l])&&"setAttribute"in h==!!y&&(y?h.localName===y:3===h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null===y)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,g.is&&g),o=null,s=!1}if(null===y)m===g||s&&e.data===g||(e.data=g);else{if(o=o&&di.call(e.childNodes),m=r.props||bi,!s&&null!=o)for(m={},l=0;l<e.attributes.length;l++)m[(h=e.attributes[l]).name]=h.value;for(l in m)h=m[l],"children"==l||("dangerouslySetInnerHTML"==l?d=h:"key"===l||l in g||Li(e,l,null,h,i));for(l in g)h=g[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?v=h:"checked"==l?p=h:"key"===l||s&&"function"!=typeof h||m[l]===h||Li(e,l,h,m[l],i);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Zi(e,Ii(f)?f:[f],t,r,n,i&&"foreignObject"!==y,o,a,o?o[0]:r.__k&&Mi(r,0),s,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Si(o[l]);s||(l="value",void 0!==v&&(v!==e[l]||"progress"===y&&!v||"option"===y&&v!==m[l])&&Li(e,l,v,m[l],!1),l="checked",void 0!==p&&p!==e[l]&&Li(e,l,p,m[l],!1))}return e}(r.__e,t,r,n,i,o,a,u,l);(c=fi.diffed)&&c(t)}function Yi(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Hi(r[n],r[++n],r[++n]);fi.__c&&fi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){fi.__e(e,t.__v)}}))}function Hi(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){fi.__e(e,r)}}function Gi(e,t,r){var n,i;if(fi.unmount&&fi.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Hi(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){fi.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Gi(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||Si(e.__e),e.__=e.__e=e.__d=void 0}function Pi(e,t,r){return this.constructor(e,r)}function Wi(e,t,r){var n,i,o,a;fi.__&&fi.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],a=[],Vi(t,e=(!n&&r||t).__k=xi(Ti,null,[e]),i||bi,bi,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?di.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Yi(o,e,a)}function ji(e,t,r){var n,i,o,a,s=ki({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&void 0!==a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?di.call(arguments,2):r),Ai(e.type,s,n||e.key,i||e.ref,null)}di=wi.slice,fi={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},hi=0,Ni.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ki({},this.state),"function"==typeof e&&(e=e(ki({},r),this.props)),e&&ki(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ri(this))},Ni.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ri(this))},Ni.prototype.render=Ti,vi=[],mi="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gi=function(e,t){return e.__v.__b-t.__v.__b},Fi.__r=0,yi=0;var zi,Xi,Ki,Ji,Ui=0,Qi=[],$i=[],eo=fi.__b,to=fi.__r,ro=fi.diffed,no=fi.__c,io=fi.unmount;function oo(e,t){fi.__h&&fi.__h(Xi,e,Ui||t),Ui=0;var r=Xi.__H||(Xi.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:$i}),r.__[e]}function ao(e){return Ui=1,function(e,t,r){var n=oo(zi++,2);if(n.t=e,!n.__c&&(n.__=[So(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Xi,!Xi.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};Xi.u=!0;var o=Xi.shouldComponentUpdate,a=Xi.componentWillUpdate;Xi.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}a&&a.call(this,e,t,r)},Xi.shouldComponentUpdate=i}return n.__N||n.__}(So,e)}function so(e,t){var r=oo(zi++,3);!fi.__s&&ko(r.__H,t)&&(r.__=e,r.i=t,Xi.__H.__h.push(r))}function uo(e){return Ui=5,lo((function(){return{current:e}}),[])}function lo(e,t){var r=oo(zi++,7);return ko(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function co(e){var t=Xi.context[e.__c],r=oo(zi++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Xi)),t.props.value):e.__}function fo(){for(var e;e=Qi.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Co),e.__H.__h.forEach(Io),e.__H.__h=[]}catch(t){e.__H.__h=[],fi.__e(t,e.__v)}}fi.__b=function(e){Xi=null,eo&&eo(e)},fi.__r=function(e){to&&to(e),zi=0;var t=(Xi=e.__c).__H;t&&(Ki===Xi?(t.__h=[],Xi.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=$i,e.__N=e.i=void 0}))):(t.__h.forEach(Co),t.__h.forEach(Io),t.__h=[],zi=0)),Ki=Xi},fi.diffed=function(e){ro&&ro(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Qi.push(t)&&Ji===fi.requestAnimationFrame||((Ji=fi.requestAnimationFrame)||wo)(fo)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==$i&&(e.__=e.__V),e.i=void 0,e.__V=$i}))),Ki=Xi=null},fi.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Co),e.__h=e.__h.filter((function(e){return!e.__||Io(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],fi.__e(r,e.__v)}})),no&&no(e,t)},fi.unmount=function(e){io&&io(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Co(e)}catch(e){t=e}})),r.__H=void 0,t&&fi.__e(t,r.__v))};var ho,vo,po,mo,go,yo,bo="function"==typeof requestAnimationFrame;function wo(e){var t,r=function(){clearTimeout(n),bo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);bo&&(t=requestAnimationFrame(r))}function Co(e){var t=Xi,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Xi=t}function Io(e){var t=Xi;e.__c=e.__(),Xi=t}function ko(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function So(e,t){return"function"==typeof t?t(e):t}!function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(ho||(ho={})),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}(vo||(vo={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(po||(po={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(mo||(mo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(go||(go={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(yo||(yo={}));var xo=pn("[Surveys]");var Ao="seenSurvey_",To="inProgressSurvey_";Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return ln(e)&&isFinite(e)&&Math.floor(e)===e});var No="0123456789abcdef";class Mo{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Mo(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+No.charAt(this.bytes[t]>>>4)+No.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Mo(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class _o{constructor(){this.h=0,this.p=0,this.m=new Zo}generate(){var e=this.generateOrAbort();if(nn(e)){this.h=0;var t=this.generateOrAbort();if(nn(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.h)this.h=e,this.C();else{if(!(e+1e4>this.h))return;this.p++,this.p>4398046511103&&(this.h++,this.C())}return Mo.fromFieldsV7(this.h,Math.trunc(this.p/Math.pow(2,30)),this.p&Math.pow(2,30)-1,this.m.nextUint32())}C(){this.p=1024*this.m.nextUint32()+(1023&this.m.nextUint32())}}var Ro,Fo=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Lr&&!nn(Lr.crypto)&&crypto.getRandomValues&&(Fo=e=>crypto.getRandomValues(e));class Zo{constructor(){this.I=new Uint32Array(8),this.k=1/0}nextUint32(){return this.k>=this.I.length&&(Fo(this.I),this.k=0),this.I[this.k++]}}var Eo=()=>Oo().toString(),Oo=()=>(Ro||(Ro=new _o)).generate(),Bo="Mobile",Lo="Android",Do="Tablet",qo=Lo+" "+Do,Vo="iPad",Yo="Apple Watch",Ho="BlackBerry",Go="Nintendo",Po="PlayStation",Wo="Xbox",jo="Windows Phone",zo="Nokia",Xo="Ouya",Ko="Generic",Jo=Ko+" "+Bo.toLowerCase(),Uo=Ko+" "+Do.toLowerCase(),Qo=new RegExp(Wo,"i"),$o=new RegExp(Po+" \\w+","i"),ea=new RegExp(Go+" \\w+","i"),ta=new RegExp(Ho+"|PlayBook|BB10","i"),ra=function(e){var t=function(e){return ea.test(e)?Go:$o.test(e)?Po:Qo.test(e)?Wo:new RegExp(Xo,"i").test(e)?Xo:new RegExp("("+jo+"|WPDesktop)","i").test(e)?jo:/iPad/.test(e)?Vo:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Yo:ta.test(e)?Ho:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(zo,"i").test(e)?zo:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Bo).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Lo:qo:Lo:new RegExp("(pda|"+Bo+")","i").test(e)?Jo:new RegExp(Do,"i").test(e)&&!new RegExp(Do+" pc","i").test(e)?Uo:""}(e);return t===Vo||t===qo||"Kobo"===t||"Kindle Fire"===t||t===Uo?Do:t===Go||t===Wo||t===Po||t===Xo?"Console":t===Yo?"Wearable":t?Bo:"Desktop"};null!=Vr&&Vr.sendBeacon;var na=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},ia={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>na(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!na(t,e))))),icontains:(e,t)=>t.map(oa).some((t=>e.map(oa).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(oa).every((t=>e.map(oa).every((e=>!t.includes(e)))))},oa=e=>e.toLowerCase(),aa=pn("[Stylesheet Loader]"),sa=Lr,ua=Yr;function la(e){return"$survey_response_"+e}var ca="#020617",da={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:vo.Right,widgetColor:"#e0a045",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",inputBackground:"white",boxPadding:"20px 24px",borderRadius:"10px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"};function fa(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ha(e){var t;void 0===e&&(e=da.backgroundColor),"#"===e[0]&&(t=fa(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=fa(r)),!t)return ca;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),a=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?ca:"white"}return ca}function va(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(aa.error("prepare_external_dependency_stylesheet returned null"),null)})(ua,':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:2147483647;--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-disabled-button-opacity:0.6;--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-survey-input-background:#fff;--ph-survey-input-focus-shadow:rgba(0,0,0,.15);--ph-survey-choice-border-hover:rgba(0,0,0,.4);--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-input-text-color:#020617;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff}.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;font-family:inherit;font-size:1rem;font-weight:500;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .1s ease-in-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom:16px}@keyframes ph-survey-fade-in-up{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes ph-survey-fade-out-down{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}@keyframes ph-survey-question-slide-in{0%{opacity:.5;transform:translateX(15px)}to{opacity:1;transform:translateX(0)}}.survey-container{bottom:0;height:fit-content;margin:0;max-width:85%;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.survey-box,.thank-you-message-container{display:flex;flex-direction:column;gap:16px}.bottom-section{display:flex;flex-direction:column;gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message-container{animation:ph-survey-question-slide-in .25s ease-out forwards;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}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form,.thank-you-message{animation:ph-survey-fade-in-up .3s ease-out forwards;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);box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family);font-weight:400;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{background:var(--ph-survey-input-background);color:var(--ph-survey-input-text-color)}@media (max-width:768px){.survey-form input[type=text],.survey-form textarea{font-size:1rem}}.survey-form input[type=text],.survey-form textarea{font-family:inherit}.survey-form textarea{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;box-sizing:border-box;outline:none;padding:10px;width:100%}.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{display:flex;flex-direction:column;font-size:14px;gap:8px}.multiple-choice-options .choice-option{cursor:pointer;display:flex;font-size:13px;position:relative}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) label{border-color:var(--ph-survey-text-subtle-color)}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) .choice-check{opacity:.5}.multiple-choice-options input{cursor:pointer;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;z-index:1}:is(.multiple-choice-options input):checked+label{border:1.5px solid var(--ph-survey-text-subtle-color);font-weight:700}:is(:is(.multiple-choice-options input):checked+label)+.choice-check{opacity:1}:is(:is(.multiple-choice-options input):checked+label) input{font-weight:700}.multiple-choice-options label{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;box-sizing:border-box;color:var(--ph-survey-input-text-color);cursor:pointer;display:block;padding:10px 35px 10px 10px;position:relative;transition:border-color .15s ease,background-color .15s ease;width:100%}:is(.multiple-choice-options .choice-option-open) label{display:flex;flex-wrap:wrap;gap:4px;padding-right:10px}:is(.multiple-choice-options .choice-option-open) label span{width:100%}:is(.multiple-choice-options .choice-option-open) label input{border:0;flex-grow:1;opacity:1;outline:0;position:relative;z-index:2}:is(:is(.multiple-choice-options .choice-option-open) label input)::placeholder{color:var(--ph-survey-text-subtle-color)}.choice-check{background:transparent;color:var(--ph-survey-input-text-color);opacity:0;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:opacity .15s ease;z-index:2}.choice-check svg{fill:var(--ph-survey-rating-bg-color);display:block;height:16px;width:16px}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0;transition:transform .15s ease,opacity .15s ease}.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)}.rating-options-number{border:1.5px solid var(--ph-survey-border-color);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;text-align:center;transition:background-color .15s ease,color .15s ease}: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;font-size:16px;font-weight:600;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:1.5px solid transparent;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);box-sizing:border-box;color:var(--ph-survey-submit-button-text-color);cursor:pointer;display:inline-block;font-family:inherit;font-size:14px;font-weight:700;margin:0;outline:0;overflow:visible;padding:12px;position:relative;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.12);text-transform:none;touch-action:manipulation;transition:transform .15s ease,box-shadow .15s ease;user-select:none;white-space:nowrap;width:100%}.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;filter:grayscale(50%);opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border:1.5px solid var(--ph-survey-border-color);border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%);transition:opacity .15s ease,transform .15s ease}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;color:var(--ph-survey-text-primary-color);display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-align:center;text-decoration:none;transition:opacity .15s ease}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{color:var(--ph-survey-text-primary-color);font-size:16px;font-weight:600;margin:10px 0 0}.thank-you-message-body{color:var(--ph-survey-text-primary-color);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)}.bolded{font-weight:600}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var pa=(e,t,n)=>{var i=Oa(e),o=ua.querySelector("."+i);if(o&&o.shadowRoot)return o.shadowRoot;var a=ua.createElement("div");((e,t,n)=>{var i=r({},da,n),o=e.style,a=[vo.Center,vo.Left,vo.Right].includes(i.position);o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),o.setProperty("--ph-survey-box-padding",i.boxPadding),o.setProperty("--ph-survey-max-width",i.maxWidth),o.setProperty("--ph-survey-z-index",i.zIndex),o.setProperty("--ph-survey-border-color",i.borderColor),!a||t===po.Widget&&(null==n?void 0:n.widgetType)!==ho.Tab?(o.setProperty("--ph-survey-border-radius",i.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",i.backgroundColor),o.setProperty("--ph-survey-box-shadow",i.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||ha(i.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),o.setProperty("--ph-survey-rating-text-color",ha(i.ratingButtonColor)),o.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",ha(i.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",ha(i.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),o.setProperty("--ph-survey-input-background",i.inputBackground),o.setProperty("--ph-survey-input-text-color",ha(i.inputBackground)),o.setProperty("--ph-widget-color",i.widgetColor),o.setProperty("--ph-widget-text-color",ha(i.widgetColor)),o.setProperty("--ph-widget-z-index",i.zIndex),"white"===i.backgroundColor&&o.setProperty("--ph-survey-input-background","#f8f8f8")})(a,e.type,e.appearance),a.className=i;var s=a.attachShadow({mode:"open"}),u=va(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return ua.body.appendChild(a),s},ma=(e,t)=>{if(!t)return null;var r=e[la(t)];return Qr(r)?[...r]:r},ga=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:o,isSurveyCompleted:a}=e;o?(localStorage.setItem(ka(n),"true"),o.capture("survey sent",r({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>({id:e.id,question:e.question,response:ma(t,e.id)}))),$survey_submission_id:i,$survey_completed:a,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},t,{$set:{[Sa(n,"responded")]:!0}})),a&&(sa.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),Ea(n))):xo.error("[survey sent] event not captured, PostHog instance not found.")},ya=(e,t,n)=>{if(t){if(!n){var i=Fa(e);t.capture("survey dismissed",r({$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,$survey_partially_completed:Object.values((null==i?void 0:i.responses)||{}).filter((e=>!un(e))).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==i?void 0:i.responses,{$survey_submission_id:null==i?void 0:i.surveySubmissionId,$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:ma((null==i?void 0:i.responses)||{},e.id)}))),$set:{[Sa(e,"dismissed")]:!0}})),Ea(e),localStorage.setItem(ka(e),"true"),sa.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else xo.error("[survey dismissed] event not captured, PostHog instance not found.")},ba=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),wa=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Ca=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?wa(e.questions,ba(e.questions)):e.questions,Ia=e=>{var t,r;return!(null==(t=e.conditions)||null==(r=t.events)||!r.repeatedActivation||!(e=>{var t,r,n,i,o,a;return null!=(null==(t=e.conditions)||null==(r=t.events)||null==(n=r.values)?void 0:n.length)&&(null==(i=e.conditions)||null==(o=i.events)||null==(a=o.values)?void 0:a.length)>0})(e))||e.schedule===yo.Always||Za(e)},ka=e=>{var t=""+Ao+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ao+e.id+"_"+e.current_iteration),t},Sa=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},xa=function(e,t){var r={__c:t="__cC"+yi++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Ri(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),Aa=()=>co(xa),Ta=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return ji(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function Na(e){return null!=e?e:"icontains"}function Ma(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==sa||null==(r=sa.location)?void 0:r.href;if(!i)return!1;var o=[e.conditions.url],a=Na(null==(n=e.conditions)?void 0:n.urlMatchType);return ia[a](o,[i])}var _a=e=>{var t=""+To+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+To+e.id+"_"+e.current_iteration),t},Ra=(e,t)=>{try{localStorage.setItem(_a(e),JSON.stringify(t))}catch(e){xo.error("Error setting in-progress survey state in localStorage",e)}},Fa=e=>{try{var t=localStorage.getItem(_a(e));if(t)return JSON.parse(t)}catch(e){xo.error("Error getting in-progress survey state from localStorage",e)}return null},Za=e=>{var t=Fa(e);return!un(null==t?void 0:t.surveySubmissionId)},Ea=e=>{try{localStorage.removeItem(_a(e))}catch(e){xo.error("Error clearing in-progress survey state from localStorage",e)}};function Oa(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}var Ba=0;function La(e,t,r,n,i,o){var a,s,u={};for(s in t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ba,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return fi.vnode&&fi.vnode(l),l}var Da=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),qa=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Va=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ya=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ha=La("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:La("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"})}),Ga=La("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:La("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:"black"})}),Pa=La("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[La("g",{"clip-path":"url(#clip0_2415_6911)",children:[La("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:La("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),La("g",{mask:"url(#mask0_2415_6911)",children:[La("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"}),La("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"}),La("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"}),La("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"}),La("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"}),La("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"})]})]}),La("defs",{children:La("clipPath",{id:"clip0_2415_6911",children:La("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Wa=La("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:La("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"})});function ja(){return La("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Pa]})}function za(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:a,skipSubmitButton:s}=e,{isPreviewMode:u}=co(xa);return La("div",{className:"bottom-section",children:[!s&&La("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{o&&(null==Lr||Lr.open(o)),u?null==a||a():i()},children:t}),!n.whiteLabel&&La(ja,{})]})}function Xa(e){var{question:t,description:r,descriptionContentType:n,forceDisableHtml:i}=e;return La("div",{className:"question-header",children:[La("div",{className:"survey-question",children:t}),r&&Ta({component:xi("div",{className:"survey-question-description"}),children:r,renderAsHtml:!i&&"text"!==n})]})}function Ka(e){var{onClick:t}=e,{isPreviewMode:r}=co(xa);return La("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ga})}function Ja(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:o,onClose:a}=e,{isPopup:s}=co(xa);return La("div",{className:"thank-you-message",children:[s&&La(Ka,{onClick:()=>a()}),La("div",{className:"thank-you-message-container",children:[La("h3",{className:"thank-you-message-header",children:t}),r&&Ta({component:xi("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&La(za,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})]})}function Ua(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o,initialValue:a}=e,[s,u]=ao((()=>on(a)?a:""));return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>{u(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:s})]}),La(za,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:n,onSubmit:()=>i(s),onPreviewSubmit:()=>o(s)})]})}function Qa(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return La(Ti,{children:[La("div",{className:"question-container",children:La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r})}),La(za,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function $a(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:a,initialValue:s}=e,u=t.scale,l=10===t.scale?0:1,[c,d]=ao((()=>ln(s)?s:Qr(s)&&s.length>0&&ln(parseInt(s[0]))?parseInt(s[0]):on(s)&&ln(parseInt(s))?parseInt(s):null)),{isPreviewMode:f}=Aa(),h=e=>f?a(e):o(e);return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("div",{className:"rating-section",children:[La("div",{className:"rating-options",children:["emoji"===t.display&&La("div",{className:"rating-options-emoji",children:(3===t.scale?ns:is).map(((e,r)=>La("button",{"aria-label":"Rate "+(r+1),className:"ratings-emoji question-"+n+"-rating-"+r+" "+(r+1===c?"rating-active":""),value:r+1,type:"button",onClick:()=>{var e=r+1;d(e),t.skipSubmitButton&&h(e)},children:e},r)))}),"number"===t.display&&La("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-l+1)+", minmax(0, 1fr))"},children:us(t.scale).map(((e,r)=>La(es,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{d(e),t.skipSubmitButton&&h(e)}},r)))})]}),La("div",{className:"rating-text",children:[La("div",{children:t.lowerBoundLabel}),La("div",{children:t.upperBoundLabel})]})]})]}),La(za,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:sn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:t.skipSubmitButton})]})}function es(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return La("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{i(t)},children:t})}function ts(e,t,r,n){if(n)return!1;if(sn(e))return!0;if(Qr(e)){if(!t&&0===e.length)return!0;if(t&&!r&&0===e.length)return!0}return!1}function rs(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:a,initialValue:s}=e,u=uo(null),l=lo((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=wa(t,ba(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,d]=ao((()=>on(s)||Qr(s)?s:t.type===mo.SingleChoice?null:[])),[f,h]=ao((()=>on(s)?!l.includes(s):!!Qr(s)&&!l.some((e=>s.includes(e))))),[v,p]=ao((()=>on(s)&&!l.includes(s)?s:Qr(s)&&s.find((e=>!l.includes(e)))||"")),{isPreviewMode:m}=Aa(),g=t.type===mo.SingleChoice?"radio":"checkbox",y=t.skipSubmitButton&&t.type===mo.SingleChoice&&!t.hasOpenChoice,b=(e,r)=>r?(h(!f),void(f||setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),0))):t.type===mo.SingleChoice?(d(e),h(!1),void(y&&(o(e),m&&a(e)))):void(t.type===mo.MultipleChoice&&Qr(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e])));return La(Ti,{children:[La("div",{className:"question-container",children:[La(Xa,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),La("div",{className:"multiple-choice-options limit-height",children:l.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,o="choice-option"+(i?" choice-option-open":""),a=i?f:t.type===mo.SingleChoice?c===e:Qr(c)&&c.includes(e);return La("div",{className:o,children:[La("input",{type:g,id:"surveyQuestion"+n+"Choice"+r,name:"question"+n,checked:a,onClick:()=>b(e,i)}),La("label",{htmlFor:"surveyQuestion"+n+"Choice"+r,children:i?La(Ti,{children:[La("span",{children:[e,":"]}),La("input",{type:"text",ref:u,id:"surveyQuestion"+n+"Choice"+r+"Open",name:"question"+n,value:v,onKeyDown:e=>{e.stopPropagation()},onInput:e=>(e=>{e.stopPropagation(),p(e.currentTarget.value),t.type===mo.SingleChoice&&d(e.currentTarget.value)})(e),onClick:t=>{f||b(e,!0),t.stopPropagation()}})]}):e}),La("span",{className:"choice-check",children:Wa})]},r)}))})]}),La(za,{text:t.buttonText||"Submit",submitDisabled:ts(c,f,v,!!t.optional),appearance:i,onSubmit:()=>{f&&t.type===mo.MultipleChoice?Qr(c)&&o([...c,v]):o(c)},onPreviewSubmit:()=>{f&&t.type===mo.MultipleChoice?Qr(c)&&a([...c,v]):a(c)},skipSubmitButton:y})]})}var ns=[Va,qa,Da],is=[Ya,Va,qa,Da,Ha],os=[1,2,3,4,5],as=[1,2,3,4,5,6,7],ss=[0,1,2,3,4,5,6,7,8,9,10];function us(e){switch(e){case 5:default:return os;case 7:return as;case 10:return ss}}var ls=Lr,cs=Yr,ds="ph:show_survey_widget";function fs(e,t,r){var n,i=e.questions[t],o=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?go.End:o;if(i.branching.type===go.End)return go.End;if(i.branching.type===go.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===go.ResponseBased){if(i.type===mo.SingleChoice){var a,s,u=i.choices.indexOf(""+r);if(-1===u&&i.hasOpenChoice&&(u=i.choices.length-1),null!=(a=i.branching)&&null!=(s=a.responseValues)&&s.hasOwnProperty(u)){var l=i.branching.responseValues[u];return Number.isInteger(l)?l:l===go.End?go.End:o}}else if(i.type===mo.Rating){var c,d;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,i.scale);if(null!=(c=i.branching)&&null!=(d=c.responseValues)&&d.hasOwnProperty(f)){var h=i.branching.responseValues[f];return Number.isInteger(h)?h:h===go.End?go.End:o}}return o}return xo.warn("Falling back to next question index due to unexpected branching type"),o}class hs{constructor(e){var t=this;this.S=new Map,this.A=new Map,this.T=e=>{var t,n,i=null==(t=e.conditions)?void 0:t.seenSurveyWaitPeriodInDays;if(((e,t)=>{if(!t||!e)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(n/864e5)>t})(localStorage.getItem("lastSeenSurveyDate"),i)){var o=(e=>!!localStorage.getItem(ka(e))&&!Ia(e))(e);if(!o){this.N(e.id),this.M(e);var a=(null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0,s=pa(e,this._posthog);if(a<=0)return Wi(La(gs,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.R}),s);var u=setTimeout((()=>{if(!Ma(e))return this.R(e);Wi(La(gs,{posthog:this._posthog,survey:r({},e,{appearance:r({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.R}),s)}),1e3*a);this.S.set(e.id,u)}}},this.F=e=>{var t=pa(e,this._posthog);Wi(La(bs,{posthog:this._posthog,survey:e}),t)},this.Z=e=>{var t=this.A.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute("PHWidgetSurveyClickListener"),this.A.delete(e),xo.info("Removed click listener for survey "+e))},this.O=e=>{var t,r=null==(t=e.appearance)?void 0:t.widgetSelector;if(r){var n=cs.querySelector(r),i=this.A.get(e.id);if(n){if(this.F(e),i){if(n===i.element)return;xo.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.Z(e.id)}if(!n.hasAttribute("PHWidgetSurveyClickListener")){var o=t=>{var r,n;if(t.stopPropagation(),(null==(r=e.appearance)?void 0:r.position)===vo.NextToTrigger){var i=t.currentTarget.getBoundingClientRect(),o=ls.innerHeight,a=ls.innerWidth,s=parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||"300"),u=i.left+i.width/2-s/2;u+s>a-20&&(u=a-s-20),u<20&&(u=20);var l=o-i.bottom,c=i.top,d=l<250&&c>l,f={position:"fixed",top:d?"auto":i.bottom+12+"px",left:u+"px",right:"auto",bottom:d?o-i.top+12+"px":"auto",zIndex:da.zIndex};ls.dispatchEvent(new CustomEvent(ds,{detail:{surveyId:e.id,position:f}}))}else ls.dispatchEvent(new CustomEvent(ds,{detail:{surveyId:e.id,position:{}}}))};Cn(n,"click",o),n.setAttribute("PHWidgetSurveyClickListener","true"),this.A.set(e.id,{element:n,listener:o}),xo.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.Z(e.id)}},this.renderSurvey=(e,t)=>{Wi(La(gs,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.R,isPopup:!1}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||n.surveys.getSurveys((r=>{var n=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.B(e)&&t.L(e)&&t.D(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type!==po.API)),n=t.q(r),i=new Set;n.forEach((e=>{var r,n,o;e.type===po.Widget&&((null==(r=e.appearance)?void 0:r.widgetType)===ho.Tab?t.F(e):(null==(n=e.appearance)?void 0:n.widgetType)===ho.Selector&&null!=(o=e.appearance)&&o.widgetSelector&&(i.add(e.id),t.O(e)));sn(t.V)&&e.type===po.Popover&&t.T(e)})),t.A.forEach(((e,r)=>{i.has(r)||t.Z(r)}))}),e)},this.M=e=>{sn(this.V)||xo.error("Survey "+[...this.V]+" already in focus. Cannot add survey "+e.id+"."),this.V=e.id},this.R=e=>{this.V!==e.id&&xo.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.N(e.id),this.V=null,Wi(null,pa(e,this._posthog));var t=cs.querySelector(Oa(e,!0));null==t||t.remove()},this._posthog=e,this.V=null}N(e){var t=this.S.get(e);t&&(clearTimeout(t),this.S.delete(e))}q(e){return e.sort(((e,t)=>{var r,n,i=Za(e),o=Za(t);if(i&&!o)return-1;if(!i&&o)return 1;var a=e.schedule===yo.Always,s=t.schedule===yo.Always;return a&&!s?1:!a&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}Y(e){return!e||!!this._posthog.featureFlags.isFeatureEnabled(e)}B(e){return!e.conditions||Ma(e)&&function(e){var t,r,n;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!Gr)return!1;var i=ra(Gr);return ia[Na(null==(n=e.conditions)?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ua||!ua.querySelector(e.conditions.selector))}(e)}H(e){return Ia(e)||this.Y(e.internal_targeting_flag_key)||Za(e)}checkSurveyEligibility(e){var t={eligible:!0,reason:void 0};return function(e){return!(!e.start_date||e.end_date)}(e)?this.Y(e.linked_flag_key)?this.Y(e.targeting_flag_key)?(this.H(e)||(t.eligible=!1,t.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress"),t):(t.eligible=!1,t.reason="Survey targeting feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey linked feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey is not running. It was completed on "+e.end_date,t)}L(e){var t;if(!function(e){var t,r,n;return!(null==(t=e.conditions)||null==(r=t.events)||null==(n=r.values)||!n.length)}(e)&&!function(e){var t,r,n;return!(null==(t=e.conditions)||null==(r=t.actions)||null==(n=r.values)||!n.length)}(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}D(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this._posthog.featureFlags.isFeatureEnabled(r)}))}getTestAPI(){return{addSurveyToFocus:this.M,removeSurveyFromFocus:this.R,surveyInFocus:this.V,surveyTimeouts:this.S,handleWidget:this.F,handlePopoverSurvey:this.T,manageWidgetSelectorListener:this.O,sortSurveysByAppearanceDelay:this.q,checkFlags:this.D.bind(this)}}}function vs(e){if(cs&&ls){var t=new hs(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function ps(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;so((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,i=t.type===po.Widget,o=Ma(t),a=(null==(e=t.appearance)?void 0:e.widgetType)===ho.Tab&&i;if(!o)return xo.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);a&&(xo.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};Cn(ls,"popstate",o),Cn(ls,"hashchange",o);var a=ls.history.pushState,s=ls.history.replaceState;return ls.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},ls.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},()=>{ls.removeEventListener("popstate",o),ls.removeEventListener("hashchange",o),ls.history.pushState=a,ls.history.replaceState=s}}}),[i,t,r,n])}function ms(e,t,r){switch(void 0===t&&(t=vo.Right),t){case vo.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case vo.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case vo.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case vo.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case vo.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case vo.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case vo.Left:return{left:"30px"};case vo.Center:return{left:"50%",transform:"translateX(-50%)"};default:case vo.Right:return{right:e===po.Widget&&r===ho.Tab?"60px":"30px"}}}function gs(e){var t,n,i,o,a,s,{survey:u,forceDisableHtml:l,posthog:c,style:d={},previewPageIndex:f,removeSurveyFromFocus:h=(()=>{}),isPopup:v=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:g=(()=>{})}=e,y=uo(null),b=Number.isInteger(f),w=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:C,isSurveySent:I,hidePopupWithViewTransition:k}=function(e,t,r,n,i,o){var[a,s]=ao(n||0===r),[u,l]=ao(!1),c=()=>{var t=()=>{e.type===po.Popover&&i(e),s(!1)};cs.startViewTransition?cs.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{t()})):t()},d=t=>{t.detail.surveyId===e.id&&c()};return so((()=>{if(t){if(!n){var i=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return c();l(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{c()}),5e3)}},o=()=>{Ma(e)&&(s(!0),ls.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((()=>{var t,r,n=null==(t=cs.querySelector(Oa(e,!0)))||null==(r=t.shadowRoot)?void 0:r.querySelector("textarea");n&&n.focus()}),100))};if(Cn(ls,"PHSurveyClosed",d),Cn(ls,"PHSurveySent",i),r>0){var a=setTimeout(o,r);return()=>{clearTimeout(a),ls.removeEventListener("PHSurveyClosed",d),ls.removeEventListener("PHSurveySent",i)}}return o(),()=>{ls.removeEventListener("PHSurveyClosed",d),ls.removeEventListener("PHSurveySent",i)}}}else xo.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ps({survey:e,removeSurveyFromFocus:i,setSurveyVisible:s,isPreviewMode:n}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:s,hidePopupWithViewTransition:c}}(u,c,w,b,h,y),S=I||f===u.questions.length,x=lo((()=>{var e=Fa(u);return{isPreviewMode:b,previewPageIndex:f,onPopupSurveyDismissed:()=>{ya(u,c,b),m()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||Eo(),onPreviewSubmit:p,posthog:c}}),[b,f,v,c,u,m,p]);return C?La(xa.Provider,{value:x,children:La("div",{className:"survey-container",style:r({},ms(u.type,null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:y,children:S?La(Ja,{header:(null==(o=u.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(a=u.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||da,onClose:()=>{k(),g()}}):La(ys,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function ys(e){var{survey:t,forceDisableHtml:n,posthog:i}=e,[o,a]=ao((()=>{var e=Fa(t);return null!=e&&e.responses&&xo.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:s,onPopupSurveyDismissed:u,isPopup:l,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:f}=co(xa),[h,v]=ao((()=>{var e=Fa(t);return s||(null==e?void 0:e.lastQuestionIndex)||0})),p=lo((()=>Ca(t)),[t]);so((()=>{f&&!nn(s)&&v(s)}),[s,f]);var m=p.at(h);return m?La("form",{className:"survey-form",name:"surveyForm",children:[l&&La(Ka,{onClick:()=>{u()}}),La("div",{className:"survey-box",children:ws({question:m,forceDisableHtml:n,displayQuestionIndex:h,appearance:t.appearance||da,onSubmit:e=>(e=>{var{res:n,displayQuestionIndex:s,questionId:u}=e;if(i)if(u){var l=la(u),c=r({},o,{[l]:n});a(c);var f=fs(t,s,n),h=f===go.End;h||(v(f),Ra(t,{surveySubmissionId:d,responses:c,lastQuestionIndex:f})),(t.enable_partial_responses||h)&&ga({responses:c,survey:t,surveySubmissionId:d,isSurveyCompleted:h,posthog:i})}else xo.error("onNextButtonClick called without a questionId.");else xo.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:h,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?o[la(m.id)]:void 0})})]}):null}function bs(e){var t,r,n,i,o,{survey:a,forceDisableHtml:s,posthog:u,readOnly:l}=e,[c,d]=ao(!0),[f,h]=ao(!1),[v,p]=ao({});if(so((()=>{var e;if(u){if(!l){"tab"===(null==(e=a.appearance)?void 0:e.widgetType)&&p({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===a.id&&(xo.info("Received show event for feedback button survey "+a.id),p(r.detail.position||{}),h(!0))};return Cn(ls,ds,t),()=>{ls.removeEventListener(ds,t)}}}else xo.error("FeedbackWidget called without a PostHog instance.")}),[u,l,a.id,null==(t=a.appearance)?void 0:t.widgetType,null==(r=a.appearance)?void 0:r.widgetSelector,null==(n=a.appearance)?void 0:n.borderColor]),ps({survey:a,setSurveyVisible:d}),!c)return null;var m=()=>{setTimeout((()=>{h(!1)}),200)};return La(Ti,{children:["tab"===(null==(i=a.appearance)?void 0:i.widgetType)&&La("button",{className:"ph-survey-widget-tab",onClick:()=>h(!f),disabled:l,children:(null==(o=a.appearance)?void 0:o.widgetLabel)||""}),f&&La(gs,{posthog:u,survey:a,forceDisableHtml:s,style:v,onPopupSurveyDismissed:m,onCloseConfirmationMessage:m})]})}var ws=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:a,onPreviewSubmit:s,initialValue:u}=e,l={[mo.Open]:Ua,[mo.Link]:Qa,[mo.Rating]:$a,[mo.SingleChoice]:rs,[mo.MultipleChoice]:rs},c={question:t,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{s(e)},onSubmit:e=>{a(e)},initialValue:u},d={[mo.Open]:{},[mo.Link]:{},[mo.Rating]:{displayQuestionIndex:i},[mo.SingleChoice]:{displayQuestionIndex:i},[mo.MultipleChoice]:{displayQuestionIndex:i}},f=l[t.type],h=r({},c,d[t.type]);return xi(f,r({},h,{key:t.id}))};function Cs(e){return!nn(Event)&&Is(e,Event)}function Is(e,t){try{return e instanceof t}catch(e){return!1}}function ks(e){return sn(e)||!rn(e)&&!$r(e)}function Ss(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Is(e,Error)}}function xs(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function As(e){return xs(e,"DOMError")}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.generateSurveys=vs,Pr.extendPostHogWithSurveys=vs;var Ts=/\(error: (.*)\)/,Ns=50,Ms="?";function _s(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?Ms:t,in_app:!0};return nn(r)||(i.lineno=r),nn(n)||(i.colno=n),i}var Rs=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Fs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Zs=/\((\S*)(?::(\d+))(?::(\d+))\)/,Es=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Os=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bs=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e,t){void 0===t&&(t=0);for(var n=[],o=e.split("\n"),a=t;a<o.length;a++){var s=o[a];if(!(s.length>1024)){var u=Ts.test(s)?s.replace(Ts,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of i){var c=l(u);if(c){n.push(c);break}}if(n.length>=Ns)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Ns).map((e=>r({},e,{filename:e.filename||Ls(t).filename,function:e.function||Ms})))}(n)}}(...[[30,e=>{var t=Rs.exec(e);if(t){var[,r,n,i]=t;return _s(r,Ms,+n,+i)}var o=Fs.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Zs.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[s,u]=Ys(o[1]||Ms,o[2]);return _s(u,s,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=Es.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=Os.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var n=t[3],i=t[1]||Ms;return[i,n]=Ys(i,n),_s(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Ls(e){return e[e.length-1]||{}}var Ds,qs,Vs,Ys=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:Ms,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};var Hs=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Gs(e,t){void 0===t&&(t=0);var r=e.stacktrace||e.stack||"",n=function(e){if(e&&Ps.test(e.message))return 1;return 0}(e);try{var i=Bs,o=function(e,t){var r=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var r=Object.keys(t);return Vs&&r.length===qs||(qs=r.length,Vs=r.reduce(((r,n)=>{Ds||(Ds={});var i=Ds[n];if(i)r[i[0]]=i[1];else for(var o=e(n),a=o.length-1;a>=0;a--){var s=o[a],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,Ds[n]=[u,l];break}}return r}),{})),Vs}(t);return e.forEach((e=>{e.filename&&(e.chunk_id=r[e.filename])})),e}(i(r,n),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Ps=/Minified React error #\d+;/i;function Ws(e,t){var r,n,i=Gs(e),o=null===(r=null==t?void 0:t.handled)||void 0===r||r,a=null!==(n=null==t?void 0:t.synthetic)&&void 0!==n&&n;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:a}}}function js(e,t){var r=Ws(e,t);return e.cause&&Ss(e.cause)&&e.cause!==e?[r,...js(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})]:[r]}function zs(e,t){return{$exception_list:js(e,t),$exception_level:"error"}}function Xs(e,t){var r,n,i,o=null===(r=null==t?void 0:t.handled)||void 0===r||r,a=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,s={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(null!=t&&t.syntheticException){var u=Gs(t.syntheticException,1);u.length&&(s.stacktrace={frames:u,type:"raw"})}return{$exception_list:[s],$exception_level:"error"}}function Ks(e){return on(e)&&!an(e)&&Wr.indexOf(e)>=0}function Js(e,t){var r,n,i=null===(r=null==t?void 0:t.handled)||void 0===r||r,o=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,a=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Cs(e)?e.constructor.name:"Error",s="Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:i.slice(0,t)+"..."}return""}(e),u={type:a,value:s,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var l=Gs(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Ks(e.level)?e.level:"error"}}function Us(e,t){var{error:n,event:i}=e,o={$exception_list:[]},a=n||i;if(As(a)||function(e){return xs(e,"DOMException")}(a)){var s=a;if(function(e){return"stack"in e}(a))o=zs(a,t);else{var u=s.name||(As(s)?"DOMError":"DOMException"),l=s.message?u+": "+s.message:u;o=Xs(l,r({},t,{overrideExceptionType:As(s)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in s&&(o.$exception_DOMException_code=""+s.code),o}if(function(e){return xs(e,"ErrorEvent")}(a)&&a.error)return zs(a.error,t);if(Ss(a))return zs(a,t);if(function(e){return xs(e,"Object")}(a)||Cs(a))return Js(a,t);if(nn(n)&&on(i)){var c="Error",d=i,f=i.match(Hs);return f&&(c=f[1],d=f[2]),Xs(d,r({},t,{overrideExceptionType:c,defaultExceptionMessage:d}))}return Xs(a,t)}function Qs(e){var[t]=e,r=function(e){if(ks(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return ks(r)?Xs("Non-Error promise rejection captured with value: "+String(r),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Us({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var $s=pn("[ExceptionAutocapture]"),eu={wrapOnError:e=>{var t=Lr;t||$s.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=Us({event:i[0],error:i[4]});return e(a),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=Lr;t||$s.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=Qs(o);return e(s),null!==(n=null==r?void 0:r.apply(t,o))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||$s.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=n.join(" "),a=n.find((e=>e instanceof Error)),s=a?Us({event:o,error:a}):Us({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(s),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.errorWrappingFunctions=eu,Pr.posthogErrorWrappingFunctions=eu;var tu=(e,t)=>{if(e){var{sessionId:r,windowId:n}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",n)}};Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{};var ru={_patchFetch:e=>kn(Lr,"fetch",(r=>function(){var n=t((function*(t,n){var i=new Request(t,n);return tu(e,i),r(i)}));return function(e,t){return n.apply(this,arguments)}}())),_patchXHR:e=>kn(Lr.XMLHttpRequest.prototype,"open",(t=>function(r,n,i,o,a){void 0===i&&(i=!0);var s=new Request(n);return tu(e,s),t.call(this,r,s.url,i,o,a)}))};Pr.__PosthogExtensions__.tracingHeadersPatchFns=ru,Pr.postHogTracingHeadersPatchFns=ru;var nu,iu,ou=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},au=function(e){if("loading"===document.readyState)return"loading";var t=ou();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},su=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},uu=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:su(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>(t||100)-1)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(e){}return r},lu=-1,cu=function(){return lu},du=function(e){addEventListener("pageshow",(function(t){t.persisted&&(lu=t.timeStamp,e(t))}),!0)},fu=function(){var e=ou();return e&&e.activationStart||0},hu=function(e,t){var r=ou(),n="navigate";return cu()>=0?n="back-forward-cache":r&&(document.prerendering||fu()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},vu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},pu=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},mu=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},gu=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},yu=function(e){var t=!1;return function(){t||(e(),t=!0)}},bu=-1,wu=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Cu=function(e){"hidden"===document.visibilityState&&bu>-1&&(bu="visibilitychange"===e.type?e.timeStamp:0,ku())},Iu=function(){addEventListener("visibilitychange",Cu,!0),addEventListener("prerenderingchange",Cu,!0)},ku=function(){removeEventListener("visibilitychange",Cu,!0),removeEventListener("prerenderingchange",Cu,!0)},Su=function(){return bu<0&&(bu=wu(),Iu(),du((function(){setTimeout((function(){bu=wu(),Iu()}),0)}))),{get firstHiddenTime(){return bu}}},xu=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Au=[1800,3e3],Tu=function(e,t){t=t||{},xu((function(){var r,n=Su(),i=hu("FCP"),o=vu("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-fu(),0),i.entries.push(e),r(!0)))}))}));o&&(r=pu(e,i,Au,t.reportAllChanges),du((function(n){i=hu("FCP"),r=pu(e,i,Au,t.reportAllChanges),mu((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Nu=[.1,.25],Mu=0,_u=1/0,Ru=0,Fu=function(e){e.forEach((function(e){e.interactionId&&(_u=Math.min(_u,e.interactionId),Ru=Math.max(Ru,e.interactionId),Mu=Ru?(Ru-_u)/7+1:0)}))},Zu=function(){return nu?Mu:performance.interactionCount||0},Eu=function(){"interactionCount"in performance||nu||(nu=vu("event",Fu,{type:"event",buffered:!0,durationThreshold:0}))},Ou=[],Bu=new Map,Lu=0,Du=[],qu=function(e){if(Du.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ou[Ou.length-1],r=Bu.get(e.interactionId);if(r||Ou.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Bu.set(n.id,n),Ou.push(n)}Ou.sort((function(e,t){return t.latency-e.latency})),Ou.length>10&&Ou.splice(10).forEach((function(e){return Bu.delete(e.id)}))}}},Vu=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=yu(e),"hidden"===document.visibilityState?e():(r=t(e),gu(e)),r},Yu=[200,500],Hu=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},xu((function(){var r;Eu();var n,i=hu("INP"),o=function(e){Vu((function(){e.forEach(qu);var t=function(){var e=Math.min(Ou.length-1,Math.floor((Zu()-Lu)/50));return Ou[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,n())}))},a=vu("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=pu(e,i,Yu,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),gu((function(){o(a.takeRecords()),n(!0)})),du((function(){Lu=Zu(),Ou.length=0,Bu.clear(),i=hu("INP"),n=pu(e,i,Yu,t.reportAllChanges)})))})))},Gu=[],Pu=[],Wu=0,ju=new WeakMap,zu=new Map,Xu=-1,Ku=function(e){Gu=Gu.concat(e),Ju()},Ju=function(){Xu<0&&(Xu=Vu(Uu))},Uu=function(){zu.size>10&&zu.forEach((function(e,t){Bu.has(t)||zu.delete(t)}));var e=Ou.map((function(e){return ju.get(e.entries[0])})),t=Pu.length-50;Pu=Pu.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<Pu.length;n++){var i=Pu[n];Qu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}var o=Gu.length-1-50;Gu=Gu.filter((function(e,t){return e.startTime>Wu&&t>o||r.has(e)})),Xu=-1};Du.push((function(e){e.interactionId&&e.target&&!zu.has(e.interactionId)&&zu.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;Wu=Math.max(Wu,e.processingEnd);for(var n=Pu.length-1;n>=0;n--){var i=Pu[n];if(Math.abs(r-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},Pu.push(t)),(e.interactionId||"first-input"===e.entryType)&&ju.set(e,t),Ju()}));var Qu=function(e,t){for(var r,n=[],i=0;r=Gu[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},$u=[2500,4e3],el={},tl={onLCP:function(e,t){!function(e,t){t=t||{},xu((function(){var r,n=Su(),i=hu("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-fu(),0),i.entries=[e],r())}))},a=vu("largest-contentful-paint",o);if(a){r=pu(e,i,$u,t.reportAllChanges);var s=yu((function(){el[i.id]||(o(a.takeRecords()),a.disconnect(),el[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Vu(s)}),{once:!0,capture:!0})})),gu(s),du((function(n){i=hu("LCP"),r=pu(e,i,$u,t.reportAllChanges),mu((function(){i.value=performance.now()-n.timeStamp,el[i.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=ou();if(r){var n=r.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],a=Math.max(0,r.responseStart-n),s=Math.max(a,o?(o.requestStart||o.startTime)-n:0),u=Math.max(s,o?o.responseEnd-n:0),l=Math.max(u,i.startTime-n);t={element:uu(i.element),timeToFirstByte:a,resourceLoadDelay:s-a,resourceLoadDuration:u-s,elementRenderDelay:l-u,navigationEntry:r,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},Tu(yu((function(){var r,n=hu("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>n.value&&(n.value=i,n.entries=o,r())},s=vu("layout-shift",a);s&&(r=pu(e,n,Nu,t.reportAllChanges),gu((function(){a(s.takeRecords()),r(!0)})),du((function(){i=0,n=hu("CLS",0),r=pu(e,n,Nu,t.reportAllChanges),mu((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var n=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(n&&n.sources&&n.sources.length){var i=(t=n.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(r={largestShiftTarget:uu(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:au(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){Tu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:au(cu())};if(e.entries.length){var r=ou(),n=e.entries[e.entries.length-1];if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:au(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){iu||(iu=vu("long-animation-frame",Ku)),Hu((function(t){var r=function(e){var t=e.entries[0],r=ju.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=Qu(t.startTime,i),s=e.entries.find((function(e){return e.target})),u=s&&s.target||zu.get(t.interactionId),l=[t.startTime+t.duration,i].concat(a.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,l),d={interactionTarget:uu(u),interactionTargetElement:u,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:o,longAnimationFrameEntries:a,inputDelay:n-t.startTime,processingDuration:i-n,presentationDelay:Math.max(c-i,0),loadState:au(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};function rl(e,t){return t.length>e?t.slice(0,e)+"...":t}function nl(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!xn(t));return t}function il(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};_n.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=rl(1024,Vn(e)):o.$el_text=rl(1024,Mn(e)));var a=Nn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),yn(e.attributes,(function(r){var i;if((!Fn(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&qn(r.value)&&(i=r.name,!on(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var a=r.value;"class"===r.name&&(a=Tn(a).join(" ")),o["attr__"+r.name]=rl(1024,a)}}));for(var s=1,u=1,l=e;l=nl(l);)s++,l.tagName===e.tagName&&u++;return o.nth_child=s,o.nth_of_type=u,o}function ol(e,t){for(var r,n,i,{e:o,maskAllElementAttributes:a,maskAllText:s,elementAttributeIgnoreList:u,elementsChainAsString:l}=t,c=[e],d=e;d.parentNode&&!An(d,"body");)(i=d.parentNode)&&11===i.nodeType?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var f,h,v,p=[],m={},g=!1,y=!1;if(yn(c,(e=>{var t=Rn(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&qn(g)&&g),jr(Nn(e),"ph-no-capture")&&(y=!0),p.push(il(e,a,s,u));var r=function(e){if(!Rn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&qn(n)&&(t[r]=n)}})),t}(e);bn(m,r)})),y)return{props:{},explicitNoCapture:y};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=Vn(e):p[0].$el_text=Mn(e)),g){var b,w;p[0].attr__href=g;var C=null==(h=g,v=null==Yr?void 0:Yr.createElement("a"),b=nn(v)?null:(v.href=h,v))?void 0:b.host,I=null==Lr||null==(w=Lr.location)?void 0:w.host;C&&I&&C!==I&&(f=g)}return{props:bn({$event_type:o.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:Hn(p)},null!=(r=p[0])&&r.$el_text?{$el_text:null==(n=p[0])?void 0:n.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},m)}}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.postHogWebVitalsCallbacks=tl,Pr.postHogWebVitalsCallbacks=tl;var al={};function sl(e){return function(e,t){var r=al[e];if(r)return r;var n=t[e];if(en(n)&&!tn())return al[e]=n.bind(t);var i=t.document;if(i&&$r(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),i.head.removeChild(o)}catch(t){vn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&$r(n)?al[e]=n.bind(t):n}("MutationObserver",e)}function ul(e){var t=function(e){return nn(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}function ll(e,t){return ln(e)&&e>=t}class cl{G(e){var t,r,n,i,o=this.P((null==e?void 0:e.__onCapture)||this.W.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){this.j=[],this.P=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}),this.X=e=>{var t=ul(e);sn(t)||this.K(t)||this.j.push(t),this.j.length&&nn(this.J)&&(this.J=Pr.setTimeout((()=>{this.U()}),1e3))},this.$=()=>{var e=Date.now();e%50==0&&this.j.forEach((t=>{nn(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.ee=()=>{this.te=Date.now()},this.instance=e,this.re=this.G(t),this._onCapture=this.re.__onCapture}start(e){this.ne(),this.ie(),this.oe(),this.ae(e)}ae(e){if(!this.se){var t=sl(Pr);this.se=new t((e=>{this.ue(e)})),this.se.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.se)||e.disconnect(),this.se=void 0,Pr.removeEventListener("click",this.X),Pr.removeEventListener("scroll",this.$,{capture:!0}),Pr.removeEventListener("selectionchange",this.ee)}ue(e){this.le=Date.now()}ne(){Cn(Pr,"click",this.X)}ie(){Cn(Pr,"scroll",this.$,{capture:!0})}oe(){Cn(Pr,"selectionchange",this.ee)}K(e){if(!e)return!0;if((t=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||null!=t.closest&&t.closest(".toolbar-global-fade-container")))return!0;var t,r=this.j.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!An(e.node,"html")&&xn(e.node)&&!_n.includes(e.node.tagName.toLowerCase()))}U(){if(this.j.length){clearTimeout(this.J),this.J=void 0;var e=this.j;for(var t of(this.j=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.le&&t.timestamp<=this.le?this.le-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.te&&t.timestamp<=this.te?this.te-t.timestamp:void 0;var n=ll(t.scrollDelayMs,this.re.scroll_threshold_ms),i=ll(t.selectionChangedDelayMs,this.re.selection_change_threshold_ms),o=ll(t.mutationDelayMs,this.re.mutation_threshold_ms),a=ll(t.absoluteDelayMs,1.1*this.re.mutation_threshold_ms),s=ln(t.scrollDelayMs)&&t.scrollDelayMs<this.re.scroll_threshold_ms,u=ln(t.mutationDelayMs)&&t.mutationDelayMs<this.re.mutation_threshold_ms,l=ln(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this.re.selection_change_threshold_ms;s||u||l||(n||o||a||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.le,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:a,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this.re.mutation_threshold_ms&&this.j.push(t))}this.j.length&&nn(this.J)&&(this.J=Pr.setTimeout((()=>{this.U()}),1e3))}}W(e,t){this.instance.capture("$dead_click",r({},t,ol(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.re.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Pr.__PosthogExtensions__=Pr.__PosthogExtensions__||{},Pr.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new cl(e,t)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map