posthog-js 1.178.0 → 1.181.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 (87) 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 +2 -2
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +2 -2
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +2 -2
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +2 -2
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/dead-clicks-autocapture.js +2 -0
  14. package/dist/dead-clicks-autocapture.js.map +1 -0
  15. package/dist/exception-autocapture.js +1 -1
  16. package/dist/exception-autocapture.js.map +1 -1
  17. package/dist/external-scripts-loader.js.map +1 -1
  18. package/dist/main.js +2 -2
  19. package/dist/main.js.map +1 -1
  20. package/dist/module.d.ts +30 -5
  21. package/dist/module.full.d.ts +30 -5
  22. package/dist/module.full.js +2 -2
  23. package/dist/module.full.js.map +1 -1
  24. package/dist/module.full.no-external.d.ts +30 -5
  25. package/dist/module.full.no-external.js +2 -2
  26. package/dist/module.full.no-external.js.map +1 -1
  27. package/dist/module.js +2 -2
  28. package/dist/module.js.map +1 -1
  29. package/dist/module.no-external.d.ts +30 -5
  30. package/dist/module.no-external.js +2 -2
  31. package/dist/module.no-external.js.map +1 -1
  32. package/dist/recorder-v2.js.map +1 -1
  33. package/dist/recorder.js.map +1 -1
  34. package/dist/src/autocapture-utils.d.ts +0 -4
  35. package/dist/src/autocapture.d.ts +15 -5
  36. package/dist/src/constants.d.ts +1 -0
  37. package/dist/src/entrypoints/all-external-dependencies.d.ts +1 -0
  38. package/dist/src/entrypoints/dead-clicks-autocapture.d.ts +28 -0
  39. package/dist/src/extensions/dead-clicks-autocapture.d.ts +16 -0
  40. package/dist/src/extensions/exception-autocapture/error-conversion.d.ts +1 -0
  41. package/dist/src/posthog-core.d.ts +2 -0
  42. package/dist/src/types.d.ts +9 -0
  43. package/dist/src/utils/element-utils.d.ts +5 -0
  44. package/dist/src/utils/globals.d.ts +7 -2
  45. package/dist/surveys-preview.js.map +1 -1
  46. package/dist/surveys.js.map +1 -1
  47. package/dist/tracing-headers.js.map +1 -1
  48. package/dist/web-vitals.js.map +1 -1
  49. package/lib/package.json +1 -1
  50. package/lib/src/autocapture-utils.d.ts +0 -4
  51. package/lib/src/autocapture-utils.js +1 -37
  52. package/lib/src/autocapture-utils.js.map +1 -1
  53. package/lib/src/autocapture.d.ts +15 -5
  54. package/lib/src/autocapture.js +161 -147
  55. package/lib/src/autocapture.js.map +1 -1
  56. package/lib/src/constants.d.ts +1 -0
  57. package/lib/src/constants.js +1 -0
  58. package/lib/src/constants.js.map +1 -1
  59. package/lib/src/entrypoints/all-external-dependencies.d.ts +1 -0
  60. package/lib/src/entrypoints/all-external-dependencies.js +1 -0
  61. package/lib/src/entrypoints/all-external-dependencies.js.map +1 -1
  62. package/lib/src/entrypoints/dead-clicks-autocapture.d.ts +28 -0
  63. package/lib/src/entrypoints/dead-clicks-autocapture.js +242 -0
  64. package/lib/src/entrypoints/dead-clicks-autocapture.js.map +1 -0
  65. package/lib/src/extensions/dead-clicks-autocapture.d.ts +16 -0
  66. package/lib/src/extensions/dead-clicks-autocapture.js +87 -0
  67. package/lib/src/extensions/dead-clicks-autocapture.js.map +1 -0
  68. package/lib/src/extensions/exception-autocapture/error-conversion.d.ts +1 -0
  69. package/lib/src/extensions/exception-autocapture/error-conversion.js +3 -2
  70. package/lib/src/extensions/exception-autocapture/error-conversion.js.map +1 -1
  71. package/lib/src/extensions/replay/mutation-rate-limiter.js +3 -2
  72. package/lib/src/extensions/replay/mutation-rate-limiter.js.map +1 -1
  73. package/lib/src/extensions/replay/sessionrecording.js +2 -0
  74. package/lib/src/extensions/replay/sessionrecording.js.map +1 -1
  75. package/lib/src/heatmaps.js +5 -10
  76. package/lib/src/heatmaps.js.map +1 -1
  77. package/lib/src/posthog-core.d.ts +2 -0
  78. package/lib/src/posthog-core.js +7 -4
  79. package/lib/src/posthog-core.js.map +1 -1
  80. package/lib/src/types.d.ts +9 -0
  81. package/lib/src/types.js.map +1 -1
  82. package/lib/src/utils/element-utils.d.ts +5 -0
  83. package/lib/src/utils/element-utils.js +44 -0
  84. package/lib/src/utils/element-utils.js.map +1 -0
  85. package/lib/src/utils/globals.d.ts +7 -2
  86. package/lib/src/utils/globals.js.map +1 -1
  87. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r),r=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),i=(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))(i||{});function s(e){return e.nodeType===e.ELEMENT_NODE}function a(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function l(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function c(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,u).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function u(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=c(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}function d(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let p=class{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function h(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:i,maskInputFn:s}=e,a=i||"";const l=o&&f(o);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function f(e){return e.toLowerCase()}const m="__rrweb_original__";function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function y(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let v=1;const b=new RegExp("[^a-z0-9-_:]"),C=-2;function _(){return v++}let I,S;const w=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?:[a-z+]+:)?\/\//i,T=/^www\..*/i,M=/^(data:)([^,]*),(.*)/i;function x(e,t){return(e||"").replace(w,((e,n,r,o,i,s)=>{const a=r||i||s,l=n||o||"";if(!a)return e;if(k.test(a)||T.test(a))return`url(${l}${a}${l})`;if(M.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const A=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;const N=new WeakMap;function L(e,t){return t&&""!==t.trim()?R(e,t):t}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function R(e,t){let n=N.get(e);if(n||(n=e.createElement("a"),N.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function D(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?L(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(E),!(n>=t.length);){let i=r(A);if(","===i.slice(-1))i=L(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=L(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?x(r,R(e)):"object"===t&&"data"===n?L(e,r):r:L(e,r):r}function F(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function H(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&H(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&H(e.parentNode,t,n)}function Z(e,t,n,r){let o;if(s(e)){if(o=e,!o.childNodes.length)return!1}else{if(null===e.parentElement)return!1;o=e.parentElement}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(H(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function P(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:p,maskInputFn:y,dataURLOptions:v={},inlineImages:C,recordCanvas:_,keepIframeSrcFn:w,newlyAddedElement:k=!1}=t,T=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:i.Document,childNodes:[],compatMode:e.compatMode}:{type:i.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:T};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:p,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:C=!1,rootId:_}=t,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return b.test(t)?"div":t}(e);let T={};const M=e.attributes.length;for(let t=0;t<M;t++){const r=e.attributes[t];F(k,r.name,r.value)||(T[r.name]=D(n,k,f(r.name),r.value))}if("link"===k&&s){const t=e.href;let r=d(n,t);if(!r&&t.includes(".css")){r=d(n,window.location.origin+"/"+t.replace(window.location.href,""))}let o=null;r&&(o=c(r)),o&&(delete T.rel,delete T.href,T._cssText=x(o,r.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=c(e.sheet);t&&(T._cssText=x(t,R(n)))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==T.type&&"checkbox"!==T.type&&"submit"!==T.type&&"button"!==T.type&&t?T.value=h({element:e,type:g(e),tagName:k,value:t,maskInputOptions:a,maskInputFn:l}):n&&(T.checked=n)}"option"===k&&(e.selected&&!a.select?T.selected=!0:delete T.selected);if("canvas"===k&&y)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=m in o?o[m]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(T.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(T.rr_dataURL=t)}if("img"===k&&p){I||(I=n.createElement("canvas"),S=I.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{I.width=t.naturalWidth,I.height=t.naturalHeight,S.drawImage(t,0,0),T.rr_dataURL=I.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?T.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===k||"video"===k){const t=T;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}C||(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop));if(w){const{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||v(T.src)||(e.contentDocument||(T.rr_src=T.src),delete T.src);let A;try{customElements.get(k)&&(A=!0)}catch(e){}return{type:i.Element,tagName:k,attributes:T,childNodes:[],isSVG:O(e)||void 0,needBlock:w,rootId:_,isCustom:A}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,keepIframeSrcFn:w,newlyAddedElement:k,rootId:T});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:r,maskTextFn:o,rootId:s}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(n=e.parentNode.sheet)?void 0:n.cssRules)&&(l=c(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}l=x(l,R(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&r&&(l=o?o(l,e.parentElement):l.replace(/[\S]/g,"*"));return{type:i.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:p,rootId:T});case e.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:T};case e.COMMENT_NODE:return{type:i.Comment,textContent:e.textContent||"",rootId:T};default:return!1}}function B(e){return null==e?"":e.toLowerCase()}function W(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b={},inlineImages:I=!1,recordCanvas:S=!1,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:E=!1}=t;let{needsMask:N}=t,{preserveWhiteSpace:L=!0}=t;if(!N){N=Z(e,u,d,void 0===N)}const O=P(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:b,inlineImages:I,recordCanvas:S,keepIframeSrcFn:A,newlyAddedElement:E});if(!O)return console.warn(e,"not serialized"),null;let R;R=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===i.Comment)return!0;if(e.type===i.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"===y(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(e.attributes.name)||"icon"===B(e.attributes.rel)||"apple-touch-icon"===B(e.attributes.rel)||"shortcut icon"===B(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===B(e.attributes.name)||"googlebot"===B(e.attributes.name)||"bingbot"===B(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===B(e.attributes.name)||"generator"===B(e.attributes.name)||"framework"===B(e.attributes.name)||"publisher"===B(e.attributes.name)||"progid"===B(e.attributes.name)||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===B(e.attributes.name)||"yandex-verification"===B(e.attributes.name)||"csrf-token"===B(e.attributes.name)||"p:domain_verify"===B(e.attributes.name)||"verify-v1"===B(e.attributes.name)||"verification"===B(e.attributes.name)||"shopify-checkout-api-token"===B(e.attributes.name)))return!0}}return!1}(O,v)&&(L||O.type!==i.Text||O.isStyle||O.textContent.replace(/^\s+|\s+$/gm,"").length)?_():C;const D=Object.assign(O,{id:R});if(r.add(e,D),R===C)return null;w&&w(e);let F=!p;if(D.type===i.Element){F=F&&!D.needBlock,delete D.needBlock;const t=e.shadowRoot;t&&l(t)&&(D.isShadowHost=!0)}if((D.type===i.Document||D.type===i.Element)&&F){v.headWhitespace&&D.type===i.Element&&"head"===D.tagName&&(L=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(D.type===i.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(e.childNodes)){const e=W(n,t);e&&D.childNodes.push(e)}if(s(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=W(n,t);r&&(l(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}return e.parentNode&&a(e.parentNode)&&l(e.parentNode)&&(D.isShadow=!0),D.type===i.Element&&"iframe"===D.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=W(t,{doc:t,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A});n&&k(e,n)}}),T),D.type===i.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===y(D.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(M){const t=W(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:M,stylesheetLoadTimeout:x,keepIframeSrcFn:A});t&&M(e,t)}}),x),D}function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const q="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.";let V={map:{},getId:()=>(console.error(q),-1),getNode:()=>(console.error(q),null),removeNodeFromMap(){console.error(q)},has:()=>(console.error(q),!1),reset(){console.error(q)}};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function j(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>j(e,t,i||{},!0)}function U(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(V=new Proxy(V,{get:(e,t,n)=>("map"===t&&console.error(q),Reflect.get(e,t,n))}));let z=Date.now;function X(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}}function $(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function J(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function K(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function Q(e,t,n,r){if(!e)return!1;const o=K(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(H(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ee(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===C}function te(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||te(e.parentNode,t))}function ne(e){return Boolean(e.changedTouches)}function re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function oe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ie(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(z=()=>(new Date).getTime());let se=class{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 ae(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function le(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ae(n);)n=t;return n}(e);return t.contains(n)}function ce(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||le(e))}var ue=(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))(ue||{}),de=(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))(de||{}),pe=(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))(pe||{}),he=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(he||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),me=(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))(me||{});function ge(e){return"__ln"in e}class ye{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ge(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ge(e.nextSibling)&&e.nextSibling.__ln.previous){const 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){const 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--)}}const ve=(e,t)=>`${e}@${t}`;class be{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),n(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new ye,r=e=>{let t=e,n=C;for(;n===C;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!ce(o)||"TEXTAREA"===o.parentNode.tagName)return;const i=a(o.parentNode)?this.mirror.getId(ae(o)):this.mirror.getId(o.parentNode),s=r(o);if(-1===i||-1===s)return n.addNode(o);const l=W(o,{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=>{re(e,this.mirror)&&this.iframeManager.addIframe(e),oe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ie(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:i,nextId:s,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)_e(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)Ie(this.droppedSet,e)||_e(this.removes,e,this.mirror)?Ie(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{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=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).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};(s.texts.length||s.attributes.length||s.removes.length||s.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(s))})),n(this,"genTextAreaValueMutation",(e=>{let 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(e.childNodes,(e=>e.textContent||"")).join("")})),n(this,"processMutation",(e=>{if(!ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=e.target.textContent;Q(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Z(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,K(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=g(t);r=h({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!F(t.tagName,n)&&(o.attributes[n]=D(this.doc,f(t.tagName),f(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(Q(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=>{const n=this.mirror.getId(t),r=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ce(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ve(n,r)]?Ce(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!a(e.target)||!l(e.target))||void 0})),this.mapRemoves.push(t))}))}})),n(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ve(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),ie(e)&&e.shadowRoot.childNodes.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 Ce(e,t){e.delete(t),t.childNodes.forEach((t=>Ce(e,t)))}function _e(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some((e=>e.id===t)))return!0;r=r.parentNode}return!1}(e,t,n)}function Ie(e,t){return 0!==e.size&&Se(e,t)}function Se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Se(e,n))}let we;const ke=e=>{if(!we)return e;return function(){try{return e(...arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},Te=[];function Me(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function xe(e,t){var n,r;const o=new be;Te.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null==(r=null==(n=null==window?void 0:window.Zone)?void 0:n.__symbol__)?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(ke(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Ae(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let c=null;return Object.keys(pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=f(e);const a=(e=>n=>{const s=Me(n);if(Q(s,o,i,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=he.Mouse;break;case"touch":a=he.Touch;break;case"pen":a=he.Pen}a===he.Touch?pe[e]===pe.MouseDown?l="TouchStart":pe[e]===pe.MouseUp&&(l="TouchEnd"):he.Pen}else ne(n)&&(a=he.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===he.Touch||l.startsWith("Mouse")&&a===he.Mouse)&&(a=null)):pe[e]===pe.Click&&(a=c,c=null);const u=ne(n)?n.changedTouches[0]:n;if(!u)return;const d=r.getId(s),{clientX:p,clientY:h}=u;ke(t)({type:pe[l],id:d,x:p,y:h,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(pe[e]){case pe.MouseDown:case pe.MouseUp:s=s.replace("mouse","pointer");break;case pe.TouchStart:case pe.TouchEnd:return}l.push(G(s,a,n))})),ke((()=>{l.forEach((e=>e()))}))}function Ee(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;return G("scroll",ke(Y(ke((e=>{const s=Me(e);if(!s||Q(s,o,i,!0))return;const a=r.getId(s);if(s===n&&n.defaultView){const e=X(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})})),s.scroll||100)),n)}const Ne=["INPUT","TEXTAREA","SELECT"],Le=new WeakMap;function Oe(e){return function(e,t){if(He("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Re(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function De(e,t){let{mirror:n,stylesheetManager:r}=e;var o,i,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null==(o=t.defaultView)?void 0:o.Document:null==(s=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:s.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),i(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),p(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(r=xe(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=Y(ke((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=ke(Y(ke((e=>{const t=Me(e),{clientX:n,clientY:r}=ne(e)?e.changedTouches[0]:e;a||(a=z()),l.push({x:n,y:r,id:o.getId(t),timeOffset:z()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?de.Drag:e instanceof MouseEvent?de.MouseMove:de.TouchMove)})),i,{trailing:!1})),d=[G("mousemove",u,r),G("touchmove",u,r),G("drag",u,r)];return ke((()=>{d.forEach((e=>e()))}))}(e),i=Ae(e),s=Ee(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,i=-1;return G("resize",ke(Y(ke((()=>{const e=$(),t=J();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function p(e){let t=Me(e);const r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=t.parentElement),!t||!u||Ne.indexOf(u)<0||Q(t,o,i,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let p=t.value,m=!1;const y=g(t)||"";"radio"===y||"checkbox"===y?m=t.checked:(l[u.toLowerCase()]||l[y])&&(p=h({element:t,maskInputOptions:l,tagName:u,type:y,value:p,maskInputFn:c})),f(t,d?{text:p,isChecked:m,userTriggered:r}:{text:p,isChecked:m});const v=t.name;"radio"===y&&v&&m&&n.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach((e=>{if(e!==t){const t=e.value;f(e,d?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function f(e,n){const o=Le.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Le.set(e,n);const o=r.getId(e);ke(t)({...n,id:o})}}const m=("last"===u.input?["change"]:["input","change"]).map((e=>G(e,ke(p),n))),y=n.defaultView;if(!y)return()=>{m.forEach((e=>e()))};const v=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,"value"),b=[[y.HTMLInputElement.prototype,"value"],[y.HTMLInputElement.prototype,"checked"],[y.HTMLSelectElement.prototype,"value"],[y.HTMLTextAreaElement.prototype,"value"],[y.HTMLSelectElement.prototype,"selectedIndex"],[y.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&m.push(...b.map((e=>j(e[0],e[1],{set(){ke(p)({target:this,isTrusted:!1})}},!1,y)))),ke((()=>{m.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:i,doc:s}=e;const a=ke((e=>Y(ke((i=>{const s=Me(i);if(!s||Q(s,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:o.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),i.media||500))),l=[G("play",a(me.Play),s),G("pause",a(me.Pause),s),G("seeked",a(me.Seeked),s),G("volumechange",a(me.VolumeChange),s),G("ratechange",a(me.RateChange),s)];return ke((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},p=()=>{},f=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:i}=t;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,i)}))});const a=i.CSSStyleSheet.prototype.deleteRule;let l,c;i.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(l=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,i)}))}));const u={};Ze("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Ze("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Ze("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Ze("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,i]=e;d[t]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(d[t].insertRule,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Oe(t),a||0]}]}),e.apply(t,i)}))}),i.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Oe(t),s]}]}),e.apply(t,i)}))})})),ke((()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=a,l&&(i.CSSStyleSheet.prototype.replace=l),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),d=De(e,e.doc),p=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:i}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:ke(((e,t,s)=>{var l;const[c,u,d]=s;if(o.has(c))return a.apply(t,[c,u,d]);const{id:p,styleId:h}=Re(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,i.styleMirror);return(p&&-1!==p||h&&-1!==h)&&n({id:p,styleId:h,set:{property:c,value:u,priority:d},index:Oe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ke(((e,t,s)=>{var a;const[c]=s;if(o.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Re(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,i.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Oe(t.parentRule)}),e.apply(t,s)}))}),ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],i=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){const r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=U(n.fonts,"add",(function(e){return function(n){return setTimeout(ke((()=>{const e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=s})),o.push(a),ke((()=>{o.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=ke((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=i;Q(s,r,o,!0)||Q(c,r,o,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}i({ranges:a})}));return a(),G("selectionchange",a)}(e),y=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?U(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,n,t.options));return ke((()=>{Te.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),f(),m(),y(),v.forEach((e=>e()))}))}function He(e){return void 0!==window[e]}function Ze(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pe{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Be{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new Pe(_)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pe(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ue.IncrementalSnapshot,data:{source:de.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return t;case ue.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ue.IncrementalSnapshot:switch(t.data.source){case de.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 de.Drag:case de.TouchMove:case de.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.ViewportResize:return!1;case de.MediaInteraction:case de.MouseInteraction:case de.Scroll:case de.CanvasMutation:case de.Input:return this.replaceIds(t.data,e,["id"]),t;case de.StyleSheetRule:case de.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case de.Font:return t;case de.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case de.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===i.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class We{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(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(!l(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=xe({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ee({...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(e.host)),this.restoreHandlers.push(De({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){const n=this;this.restoreHandlers.push(U(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&ce(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;Ve<64;Ve++)qe[Ge.charCodeAt(Ve)]=Ve;const Ye=new Map;const je=(e,t,n)=>{if(!e||!Xe(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ye.get(e);return n||(n=new Map,Ye.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ue(e,t,n){if(e instanceof Array)return e.map((e=>Ue(e,t,n)));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,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Ge[n[t]>>2],o+=Ge[(3&n[t])<<4|n[t+1]>>4],o+=Ge[(15&n[t+1])<<2|n[t+2]>>6],o+=Ge[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}}if(Xe(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:je(e,t,n)}}return e}const ze=(e,t,n)=>e.map((e=>Ue(e,t,n))),Xe=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function $e(e,t,n,r){const o=[];try{const i=U(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(!Q(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...s])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Je(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=U(e,l,(function(e){return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];const u=e.apply(this,a);if(je(u,i,this),"tagName"in this.canvas&&!Q(this.canvas,r,o,!0)){const e=ze(a,i,this),r={type:t,property:l,args:e};n(this.canvas,r)}return u}}));s.push(a)}catch{const r=j(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}const Ke="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Qe="undefined"!=typeof window&&window.Blob&&new Blob([(et=Ke,Uint8Array.from(atob(et),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var et;function tt(e){let t;try{if(t=Qe&&(window.URL||window.webkitURL).createObjectURL(Qe),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Ke,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class nt{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(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)}));const{sampling:t="all",win:r,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,o,i),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,o,i,{dataURLOptions:a})}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,t,n,r,o){const i=$e(t,n,r,!0),s=new Map,a=new tt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{Q(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,i=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:r,resizeHeight:i});a.postMessage({id:n,bitmap:l,width:r,height:i,dataURLOptions:o.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=$e(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=U(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return Q(this.canvas,n,r,!0)||setTimeout((()=>{const n=ze(a,t,this);e(this.canvas,{type:fe["2D"],property:s,args:n})}),0),o.apply(this,a)}}));o.push(i)}catch{const n=j(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:fe["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return o.push(...Je(t.WebGLRenderingContext.prototype,fe.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Je(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class rt{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new se),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){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:u(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ot{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).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(){}}let it,st,at,lt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}const ct=new p;function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:g,hooks:y,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:w=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:M=!1,inlineImages:x=!1,plugins:A,keepIframeSrcFn:E=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:L}=e;we=L;const O=!w||window.parent===window;let R=!1;if(!O)try{window.parent.document&&(R=!1)}catch(e){R=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!R)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),ct.reset();const D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},F=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};let H;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let Z=0;const P=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};it=(e,o)=>{var i;const s=e;if(s.timestamp=z(),!(null==(i=Te[0])?void 0:i.isFrozen())||s.type===ue.FullSnapshot||s.type===ue.IncrementalSnapshot&&s.data.source===de.Mutation||Te.forEach((e=>e.unfreeze())),O)null==t||t(P(s),o);else if(R){const e={type:"rrweb",event:P(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===ue.FullSnapshot)H=s,Z=0;else if(s.type===ue.IncrementalSnapshot){if(s.data.source===de.Mutation&&s.data.isAttachIframe)return;Z++;const e=r&&Z>=r,t=n&&s.timestamp-H.timestamp>n;(e||t)&&st(!0)}};const B=e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Mutation,...e}})},q=e=>it({type:ue.IncrementalSnapshot,data:{source:de.Scroll,...e}}),V=e=>it({type:ue.IncrementalSnapshot,data:{source:de.CanvasMutation,...e}}),Y=new rt({mutationCb:B,adoptedStyleSheetCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.AdoptedStyleSheet,...e}})}),j=new Be({mirror:ct,mutationCb:B,stylesheetManager:Y,recordCrossOriginIframes:w,wrappedEmit:it});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:ct,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});const U=new ot;at=new nt({recordCanvas:S,mutationCb:V,win:window,blockClass:o,blockSelector:i,mirror:ct,sampling:b.canvas,dataURLOptions:C});const K=new We({mutationCb:B,scrollCb:q,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:C,maskTextFn:g,maskInputFn:m,recordCanvas:S,inlineImages:x,sampling:b,slimDOMOptions:F,iframeManager:j,stylesheetManager:Y,canvasManager:at,keepIframeSrcFn:E,processedNodeManager:U},mirror:ct});st=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I)return;it({type:ue.Meta,data:{href:window.location.href,width:J(),height:$()}},e),Y.reset(),K.init(),Te.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new p,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:_,keepIframeSrcFn:I=(()=>!1)}=t||{};return W(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:_,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ct,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:m,slimDOM:F,dataURLOptions:C,recordCanvas:S,inlineImages:x,onSerialize:e=>{re(e,ct)&&j.addIframe(e),oe(e,ct)&&Y.trackLinkElement(e),ie(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!t)return console.warn("Failed to snapshot the document");it({type:ue.FullSnapshot,data:{node:t,initialOffset:X(window)}},e),Te.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,ct.getId(document))};try{const e=[],t=e=>{var t;return ke(Fe)({mutationCb:B,mousemoveCb:(e,t)=>it({type:ue.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.ViewportResize,...e}}),inputCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Input,...e}}),mediaInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MediaInteraction,...e}}),styleSheetRuleCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleSheetRule,...e}}),styleDeclarationCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Font,...e}}),selectionCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Selection,...e}})},customElementCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:b,recordDOM:I,recordCanvas:S,inlineImages:x,userTriggeredOnInput:T,collectFonts:M,doc:e,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:F,dataURLOptions:C,mirror:ct,iframeManager:j,stylesheetManager:Y,shadowDomManager:K,processedNodeManager:U,canvasManager:at,ignoreCSSAttributes:N,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>it({type:ue.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};j.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{st(),e.push(t(document)),lt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(G("DOMContentLoaded",(()=>{it({type:ue.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(G("load",(()=>{it({type:ue.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),U.destroy(),lt=!1,we=void 0}}catch(e){console.warn(e)}}var dt,pt;ut.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");it({type:ue.Custom,data:{tag:e,payload:t}})},ut.freezePage=()=>{Te.forEach((e=>e.freeze()))},ut.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");st(e)},ut.mirror=ct,(pt=dt||(dt={}))[pt.NotStarted=0]="NotStarted",pt[pt.Running=1]="Running",pt[pt.Stopped=2]="Stopped";const ht="2.0.0-alpha.16";var ft,mt=Object.defineProperty,gt=(e,t,n)=>(((e,t,n)=>{t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),yt=Object.defineProperty,vt=(e,t,n)=>(((e,t,n)=>{t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bt=Object.defineProperty,Ct=(e,t,n)=>(((e,t,n)=>{t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class _t{constructor(){Ct(this,"idNodeMap",new Map),Ct(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function It(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&It(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&It(e.parentNode,t,n)}const St="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.";let wt={map:{},getId:()=>(console.error(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get:(e,t,n)=>("map"===t&&console.error(St),Reflect.get(e,t,n))}));let kt=Date.now;function Tt(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}/[1-9][0-9]{12}/.test(Date.now().toString())||(kt=()=>(new Date).getTime());function Mt(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function xt(e){let t,n=e;for(;t=Mt(n);)n=t;return n}function At(e){const t=e.ownerDocument;if(!t)return!1;const n=xt(e);return t.contains(n)}const Et=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){vt(this,"id",1),vt(this,"styleIDMap",new WeakMap),vt(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 wt},closestElementOfNode:Tt,getBaseDimension:function e(t,n){var r,o;const i=null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.frameElement;if(!i||i===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=e(i,n),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:xt,getShadowHost:Mt,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return Boolean(null==e?void 0:e.shadowRoot)},hookSetter:function e(t,n,r,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=i.Object.getOwnPropertyDescriptor(t,n);return i.Object.defineProperty(t,n,o?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||At(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const o=Tt(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(It(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.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,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return kt},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const o of e){const{nextId:e,parentId:i}=o;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,n(o,i.parent))}else{const e=r.indexOf(i);r.splice(e,0,n(o,null))}}else if(i in t){const e=t[i];e.children.push(n(o,e))}else r.push(n(o,null))}return r},shadowHostInDom:At,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ot=0;Ot<64;Ot++)Lt[Nt.charCodeAt(Ot)]=Ot;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ft=e.contentWindow)?void 0:ft.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt;new _t,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Rt||(Rt={}));class Dt{constructor(e){gt(this,"fileName"),gt(this,"functionName"),gt(this,"lineNumber"),gt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ft=/(^|@)\S+:\d+/,Ht=/^\s*at .*(\S+:\d+|\(native\))/m,Zt=/^(eval@)?(\[native code])?$/,Pt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ht)?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];const 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(Ht)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Dt({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Zt)}),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 Dt({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Dt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ft)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Dt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Wt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Gt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Wt(e[r])&&Gt(e[r],t-1))return!0;return!1}function qt(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Wt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Wt(e)&&Gt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Bt(r.length?r[0]:null):e[n]=r}return e}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}))}const Vt={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 Yt(e,t,n){const r=n?Object.assign({},Vt,n):Vt,o=r.logger;if(!o)return()=>{};let i;i="string"==typeof o?t[o]:o;let s=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,i=Pt.parse(o).map((e=>e.toString())),s=[qt(n,r.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[qt(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[qt("Uncaught (in promise)",r.stringifyOptions),qt(t.reason,r.stringifyOptions)]);const i=Pt.parse(n).map((e=>e.toString()));e({level:"error",trace:i,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(i,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?Et.patch(t,n,(t=>function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=Pt.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>qt(e,r.stringifyOptions)));s++,s<r.lengthThreshold?e({level:n,trace:t,payload:o}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[qt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const jt=e=>({name:"rrweb/console@1",observer:Yt,options:e}),Ut=Array.isArray,zt=Object.prototype,Xt=zt.hasOwnProperty,$t=zt.toString,Jt=Ut||function(e){return"[object Array]"===$t.call(e)},Kt=function(e){return"function"==typeof e},Qt=function(e){return e===Object(e)&&!Jt(e)},en=function(e){return void 0===e},tn=function(e){return"[object String]"==$t.call(e)},nn=function(e){return tn(e)&&0===e.trim().length},rn=function(e){return null===e},on=function(e){return en(e)||rn(e)},sn=function(e){return"[object Number]"==$t.call(e)},an=function(e){return"[object Boolean]"===$t.call(e)},ln=e=>e instanceof Document,cn=e=>e instanceof FormData,un="undefined"!=typeof window?window:void 0,dn="undefined"!=typeof globalThis?globalThis:un,pn=Array.prototype.forEach,hn=null==dn?void 0:dn.navigator,fn=null==dn?void 0:dn.document;null==dn||dn.location,null==dn||dn.fetch,null!=dn&&dn.XMLHttpRequest&&"withCredentials"in new dn.XMLHttpRequest&&dn.XMLHttpRequest,null==dn||dn.AbortController,null==hn||hn.userAgent;const mn=null!=un?un:{},gn="[PostHog.js]",yn={_log:function(e){if(un&&mn.POSTHOG_DEBUG&&!en(un.console)&&un.console){const o="__rrweb_original__"in un.console[e]?un.console[e].__rrweb_original__:un.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(gn,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(gn,...t)},uninitializedWarning:e=>{yn.error(`You must initialize PostHog before calling ${e}`)}},vn={};function bn(e,t,n){if(!on(e)){if(Jt(e))return function(e,t,n){if(Jt(e))if(pn&&e.forEach===pn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===vn)return}(e,t,n);if(cn(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===vn)return}else for(const r in e)if(Xt.call(e,r)&&t.call(n,e[r],r)===vn)return}}const Cn=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return bn(e,(function(e,r){en(e)||en(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},_n={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"]};function In(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return Kt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Sn(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const wn=e=>"navigation"===e.entryType,kn=e=>"resource"===e.entryType;function Tn(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>wn(e)||kn(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>Ln({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>wn(e)||kn(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>Ln({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function Mn(e,t){return!!t&&(an(t)||t[e])}function xn(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(an(n))return!0;if(Jt(n))return o(n);const i=n[t];return an(i)?i:o(i)}async function An(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i>10)return yn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const s=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>kn(e)&&e.initiatorType===t&&(en(r)||e.startTime>=r)&&(en(o)||e.startTime<=o)));return s||(await new Promise((e=>setTimeout(e,50*i))),An(e,t,n,r,o,i+1))}function En(e){let{body:t,options:n,url:r}=e;if(on(t))return null;const{hostname:o,isHostDenied:i}=Sn(r,n);if(i)return o+" is in deny list";if(tn(t))return t;if(ln(t))return t.textContent;if(cn(t))return Cn(t);if(Qt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Nn=e=>!rn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Ln(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:i,start:s,end:a,url:l,initiatorType:c}=e;s=t?t.startTime:s,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(s||0)),p=[{...t?t.toJSON():{name:l},startTime:en(s)?void 0:Math.round(s),endTime:en(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:i}];if(Nn(t))for(const e of t.serverTiming||[])p.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return p}const On=["video/","audio/"];function Rn(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function Dn(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=On.some((e=>null==i?void 0:i.startsWith(e)));if(i&&s)return`Content-Type ${i} is not supported`;const{hostname:a,isHostDenied:l}=Sn(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return rn(o)?Rn(t):Promise.resolve(o)}function Fn(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=Mn("request",n.recordHeaders),o=Mn("response",n.recordHeaders),i=In(t,"fetch",(i=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,p;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(u.requestHeaders=e),xn({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:i}=Sn(r,n);return i?Promise.resolve(o+" is in deny list"):Rn(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await i(l),p=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(u.responseHeaders=a),xn({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await Dn({r:c,options:n,url:s})),c}finally{An(t,"fetch",l.url,d,p).then((t=>{var n;const r=Ln({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:p,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{i()}}let Hn=null;function Zn(e,t,n){if(!("performance"in t))return()=>{};if(Hn)return yn.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},_n,n):_n,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},i=Tn(o,t,r);let s=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=Mn("request",n.recordHeaders),o=Mn("response",n.recordHeaders),i=In(t.XMLHttpRequest.prototype,"open",(i=>function(s,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,p=new Request(a),h={};let f,m;const g={},y=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(g[e]=t,y(e,t)),r&&(h.requestHeaders=g);const v=d.send.bind(d);d.send=e=>(xn({type:"request",headers:g,url:a,recordBody:n.recordBody})&&(h.requestBody=En({body:e,options:n,url:a})),f=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;m=t.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(h.responseHeaders=r),xn({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(h.responseBody=En({body:d.response,options:n,url:a})),An(t,"xmlhttprequest",p.url,f,m).then((t=>{const n=Ln({entry:t,method:p.method,status:null==d?void 0:d.status,networkRequest:h,start:f,end:m,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),i.call(d,s,a,l,c,u)}));return()=>{i()}}(o,t,r),a=Fn(o,t,r)),Hn=()=>{i(),s(),a()},Hn}const Pn=e=>({name:"rrweb/network@1",observer:Zn,options:e});let Bn,Wn,Gn;mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:jt,getRecordNetworkPlugin:Pn},mn.__PosthogExtensions__.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrwebConsoleRecord={getRecordConsolePlugin:jt},mn.getRecordNetworkPlugin=Pn,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Bn||(Bn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Wn||(Wn={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Gn||(Gn={}));var qn,Vn,Yn,jn,Un,zn,Xn,$n,Jn={},Kn=[],Qn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,er=Array.isArray;function tr(e,t){for(var n in t)e[n]=t[n];return e}function nr(e){var t=e.parentNode;t&&t.removeChild(e)}function rr(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?qn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return or(e,s,r,o,null)}function or(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++Yn:o,__i:-1,__u:0};return null==o&&null!=Vn.vnode&&Vn.vnode(i),i}function ir(e){return e.children}function sr(e,t){this.props=e,this.context=t}function ar(e,t){if(null==t)return e.__?ar(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ar(e):null}function lr(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return lr(e)}}function cr(e){(!e.__d&&(e.__d=!0)&&jn.push(e)&&!ur.__r++||Un!==Vn.debounceRendering)&&((Un=Vn.debounceRendering)||zn)(ur)}function ur(){var e,t,n,r,o,i,s,a,l;for(jn.sort(Xn);e=jn.shift();)e.__d&&(t=jn.length,r=void 0,i=(o=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=tr({},o)).__v=o.__v+1,Vn.vnode&&Vn.vnode(r),vr(s,r,o,n.__n,void 0!==s.ownerSVGElement,32&o.__u?[i]:null,a,null==i?ar(o):i,!!(32&o.__u),l),r.__.__k[r.__i]=r,br(a,r,l),r.__e!=i&&lr(r)),jn.length>t&&jn.sort(Xn));ur.__r=0}function dr(e,t,n,r,o,i,s,a,l,c,u){var d,p,h,f,m,g=r&&r.__k||Kn,y=t.length;for(n.__d=l,function(e,t,n){var r,o,i,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?or(null,o,null,null,o):er(o)?or(ir,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?or(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=hr(o,n,s=r+d,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=ar(i)),_r(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=ar(i)),_r(i,i))}(n,t,g),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?Jn:g[h.__i]||Jn,h.__i=d,vr(e,h,p,o,i,s,a,l,c,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Cr(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),65536&h.__u||p.__k===h.__k?l=pr(h,l,e):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=m}function pr(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=pr(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function hr(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&i===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return a;a++}}return-1}function fr(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Qn.test(t)?n:n+"px"}function mr(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||fr(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||fr(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=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+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?yr:gr,i)):e.removeEventListener(t,i?yr:gr,i);else{if(o)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==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function gr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Vn.event?Vn.event(e):e)}function yr(e){return this.l[e.type+!0](Vn.event?Vn.event(e):e)}function vr(e,t,n,r,o,i,s,a,l,c){var u,d,p,h,f,m,g,y,v,b,C,_,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=Vn.__b)&&u(t);e:if("function"==typeof k)try{if(y=t.props,v=(u=k.contextType)&&r[u.__c],b=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(y,b):(t.__c=d=new sr(y,b),d.constructor=k,d.render=Ir),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=tr({},d.__s)),tr(d.__s,k.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__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&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,m)}))}if(d.context=b,d.props=y,d.__P=e,d.__e=!1,_=Vn.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=tr(tr({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(h,f)),dr(e,er(w=null!=u&&u.type===ir&&null==u.key?u.props.children:u)?w:[w],t,n,r,o,i,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=i?(t.__e=a,t.__u|=l?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Vn.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,s,a,l){var c,u,d,p,h,f,m,g=n.props,y=t.props,v=t.type;if("svg"===v&&(o=!0),null!=i)for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!v&&(v?h.localName===v:3===h.nodeType)){e=h,i[c]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),i=null,a=!1}if(null===v)g===y||a&&e.data===y||(e.data=y);else{if(i=i&&qn.call(e.childNodes),g=n.props||Jn,!a&&null!=i)for(g={},c=0;c<e.attributes.length;c++)g[(h=e.attributes[c]).name]=h.value;for(c in g)h=g[c],"children"==c||("dangerouslySetInnerHTML"==c?d=h:"key"===c||c in y||mr(e,c,null,h,o));for(c in y)h=y[c],"children"==c?p=h:"dangerouslySetInnerHTML"==c?u=h:"value"==c?f=h:"checked"==c?m=h:"key"===c||a&&"function"!=typeof h||g[c]===h||mr(e,c,h,g[c],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),dr(e,er(p)?p:[p],t,n,r,o&&"foreignObject"!==v,i,s,i?i[0]:n.__k&&ar(n,0),a,l),null!=i)for(c=i.length;c--;)null!=i[c]&&nr(i[c]);a||(c="value",void 0!==f&&(f!==e[c]||"progress"===v&&!f||"option"===v&&f!==g[c])&&mr(e,c,f,g[c],!1),c="checked",void 0!==m&&m!==e[c]&&mr(e,c,m,g[c],!1))}return e}(n.__e,t,n,r,o,i,s,l,c);(u=Vn.diffed)&&u(t)}function br(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Cr(n[r],n[++r],n[++r]);Vn.__c&&Vn.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Vn.__e(e,t.__v)}}))}function Cr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Vn.__e(e,n)}}function _r(e,t,n){var r,o;if(Vn.unmount&&Vn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Cr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Vn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&_r(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||nr(e.__e),e.__=e.__e=e.__d=void 0}function Ir(e,t,n){return this.constructor(e,n)}function Sr(e,t,n){var r,o,i,s;Vn.__&&Vn.__(e,t),o=(r="function"==typeof n)?null:t.__k,i=[],s=[],vr(t,e=(!r&&n||t).__k=rr(ir,null,[e]),o||Jn,Jn,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?qn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),br(i,e,s)}function wr(e,t,n){var r,o,i,s,a=tr({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=void 0===t[i]&&void 0!==s?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?qn.call(arguments,2):n),or(e.type,a,r||e.key,o||e.ref,null)}qn=Kn.slice,Vn={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},Yn=0,sr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=tr({},this.state),"function"==typeof e&&(e=e(tr({},n),this.props)),e&&tr(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),cr(this))},sr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),cr(this))},sr.prototype.render=ir,jn=[],zn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xn=function(e,t){return e.__v.__b-t.__v.__b},ur.__r=0,$n=0;const kr=un,Tr=fn,Mr="seenSurvey_",xr=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n 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%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${Er((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function Ar(e){if("#"===e[0]){const 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 Er(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lr;"#"===t[0]&&(e=Ar(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=Ar(n)),!e)return"black";const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const Nr={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:"right"},Lr="#eeeded",Or=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;r&&(localStorage.setItem(Pr(n),"true"),r.capture("survey sent",{$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=>e.question)),sessionRecordingUrl:null===(e=r.get_session_replay_url)||void 0===e?void 0:e.call(r),...t,$set:{[Br(n,"responded")]:!0}}),kr.dispatchEvent(new Event("PHSurveySent")))},Rr=(e,t,n)=>{var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[Br(e,"dismissed")]:!0}}),localStorage.setItem(Pr(e),"true"),kr.dispatchEvent(new Event("PHSurveyClosed")))},Dr=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Fr=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,Hr=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Fr(e.questions,Dr(e.questions)):e.questions),Zr=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,o,i,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(s=i.values)||void 0===s?void 0:s.length)>0})(e))},Pr=e=>{let t=`${Mr}${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`${Mr}${e.id}_${e.current_iteration}`),t},Br=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},Wr=function(e,t){var n={__c:t="__cC"+$n++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,cr(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),Gr=e=>{let{component:t,children:n,renderAsHtml:r,style:o}=e;return wr(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},qr=fn;var Vr,Yr,jr,Ur,zr=0,Xr=[],$r=[],Jr=Vn.__b,Kr=Vn.__r,Qr=Vn.diffed,eo=Vn.__c,to=Vn.unmount;function no(e,t){Vn.__h&&Vn.__h(Yr,e,zr||t),zr=0;var n=Yr.__H||(Yr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:$r}),n.__[e]}function ro(e){return zr=1,function(e,t,n){var r=no(Vr++,2);if(r.t=e,!r.__c&&(r.__=[mo(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Yr,!Yr.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};Yr.u=!0;var i=Yr.shouldComponentUpdate,s=Yr.componentWillUpdate;Yr.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},Yr.shouldComponentUpdate=o}return r.__N||r.__}(mo,e)}function oo(e,t){var n=no(Vr++,3);!Vn.__s&&fo(n.__H,t)&&(n.__=e,n.i=t,Yr.__H.__h.push(n))}function io(e){return zr=5,so((function(){return{current:e}}),[])}function so(e,t){var n=no(Vr++,7);return fo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ao(e){var t=Yr.context[e.__c],n=no(Vr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Yr)),t.props.value):e.__}function lo(){for(var e;e=Xr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(po),e.__H.__h.forEach(ho),e.__H.__h=[]}catch(t){e.__H.__h=[],Vn.__e(t,e.__v)}}Vn.__b=function(e){Yr=null,Jr&&Jr(e)},Vn.__r=function(e){Kr&&Kr(e),Vr=0;var t=(Yr=e.__c).__H;t&&(jr===Yr?(t.__h=[],Yr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=$r,e.__N=e.i=void 0}))):(t.__h.forEach(po),t.__h.forEach(ho),t.__h=[],Vr=0)),jr=Yr},Vn.diffed=function(e){Qr&&Qr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Xr.push(t)&&Ur===Vn.requestAnimationFrame||((Ur=Vn.requestAnimationFrame)||uo)(lo)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==$r&&(e.__=e.__V),e.i=void 0,e.__V=$r}))),jr=Yr=null},Vn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(po),e.__h=e.__h.filter((function(e){return!e.__||ho(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Vn.__e(n,e.__v)}})),eo&&eo(e,t)},Vn.unmount=function(e){to&&to(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{po(e)}catch(e){t=e}})),n.__H=void 0,t&&Vn.__e(t,n.__v))};var co="function"==typeof requestAnimationFrame;function uo(e){var t,n=function(){clearTimeout(r),co&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);co&&(t=requestAnimationFrame(n))}function po(e){var t=Yr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Yr=t}function ho(e){var t=Yr;e.__c=e.__(),Yr=t}function fo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function mo(e,t){return"function"==typeof t?t(e):t}var go=0;function yo(e,t,n,r,o,i){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--go,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Vn.vnode&&Vn.vnode(c),c}const vo=yo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:yo("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"})}),bo=yo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:yo("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"})}),Co=yo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:yo("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"})}),_o=yo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:yo("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"})}),Io=yo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:yo("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"})}),So=yo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yo("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"})}),wo=yo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[yo("g",{"clip-path":"url(#clip0_2415_6911)",children:[yo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:yo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),yo("g",{mask:"url(#mask0_2415_6911)",children:[yo("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"}),yo("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"}),yo("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"}),yo("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"}),yo("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"}),yo("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"})]})]}),yo("defs",{children:yo("clipPath",{id:"clip0_2415_6911",children:yo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),ko=yo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yo("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 To(){return yo("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",wo]})}function Mo(e){let{text:t,submitDisabled:n,appearance:r,onSubmit:o,link:i}=e;const{isPreviewMode:s,isPopup:a}=ao(Wr),l=r.submitButtonTextColor||Er(r.submitButtonColor||Nr.submitButtonColor);return yo("div",{className:"bottom-section",children:[yo("div",{className:"buttons",children:yo("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(i&&(null==un||un.open(i)),o())},children:t})}),!r.whiteLabel&&yo(To,{})]})}function xo(e){let{question:t,description:n,descriptionContentType:r,backgroundColor:o,forceDisableHtml:i}=e;const{isPopup:s}=ao(Wr);return yo("div",{style:s?{backgroundColor:o||Nr.backgroundColor}:{},children:[yo("div",{className:"survey-question",children:t}),n&&Gr({component:rr("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function Ao(e){let{onClick:t}=e;const{isPreviewMode:n}=ao(Wr);return yo("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:yo("button",{className:"form-cancel",onClick:t,disabled:n,children:So})})}function Eo(e){let{header:t,description:n,contentType:r,forceDisableHtml:o,appearance:i,onClose:s,styleOverrides:a}=e;const l=Er(i.backgroundColor||Nr.backgroundColor),{isPopup:c}=ao(Wr);return yo(ir,{children:yo("div",{className:"thank-you-message",style:{...a},children:yo("div",{className:"thank-you-message-container",children:[c&&yo(Ao,{onClick:()=>s()}),yo("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&Gr({component:rr("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==r,style:{color:l}}),c&&yo(Mo,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>s()})]})})})}function No(e){var t;const n=io(null),[r,o]=ro(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return oo((()=>{if(n.current){const e=function(e){const t=kr.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const r=parseInt(n[1]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function Lo(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;const i=io(null),[s,a]=ro("");return yo("div",{ref:i,children:[yo(xo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),yo("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>a(e.currentTarget.value)}),yo(Mo,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:()=>o(s)})]})}function Oo(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;return yo(ir,{children:[yo(xo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),yo(Mo,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>o("link clicked")})]})}function Ro(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=ro(null);return yo(ir,{children:[yo(xo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),yo("div",{className:"rating-section",children:[yo("div",{className:"rating-options",children:["emoji"===t.display&&yo("div",{className:"rating-options-emoji",children:(3===t.scale?Ho:Zo).map(((e,t)=>{const n=t+1===l;return yo("button",{className:`ratings-emoji question-${r}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&yo("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:Go(t.scale).map(((e,t)=>yo(Do,{displayQuestionIndex:r,active:l===e,appearance:o,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),yo("div",{className:"rating-text",children:[yo("div",{children:t.lowerBoundLabel}),yo("div",{children:t.upperBoundLabel})]})]}),yo(Mo,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:rn(l)&&!t.optional,appearance:o,onSubmit:()=>i(l)})]})}function Do(e){let{num:t,active:n,displayQuestionIndex:r,appearance:o,setActiveNumber:i}=e;const{textColor:s,ref:a}=No({appearance:o,defaultTextColor:"black",forceUpdate:n});return yo("button",{ref:a,className:`ratings-number question-${r}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function Fo(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=io(null),a=so((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const r=Fr(t,Dr(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[l,c]=ro(t.type===Wn.MultipleChoice?[]:null),[u,d]=ro(!1),[p,h]=ro(""),f=t.type===Wn.SingleChoice?"radio":"checkbox";return yo("div",{ref:s,children:[yo(xo,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),yo("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let o="choice-option";const i=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),yo("div",{className:o,children:[yo("input",{type:f,id:`surveyQuestion${r}Choice${n}`,name:`question${r}`,value:i,disabled:!i,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===Wn.SingleChoice?c(i):t.type===Wn.MultipleChoice&&Jt(l)?l.includes(i)?c(l.filter((e=>e!==i))):c([...l,i]):void 0}),yo("label",{htmlFor:`surveyQuestion${r}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?yo(ir,{children:[yo("span",{children:[s,":"]}),yo("input",{type:"text",id:`surveyQuestion${r}Choice${n}Open`,name:`question${r}`,onInput:e=>{const n=e.currentTarget.value;return t.type===Wn.SingleChoice?c(n):t.type===Wn.MultipleChoice&&Jt(l)?h(n):void 0}})]}):s}),yo("span",{className:"choice-check",style:{color:"black"},children:ko})]})}))}),yo(Mo,{text:t.buttonText||"Submit",submitDisabled:(rn(l)||Jt(l)&&!u&&0===l.length||Jt(l)&&u&&!p&&0===l.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:()=>{u&&t.type===Wn.MultipleChoice?Jt(l)&&i([...l,p]):i(l)}})]})}const Ho=[Co,bo,vo],Zo=[_o,Co,bo,vo,Io],Po=[1,2,3,4,5],Bo=[1,2,3,4,5,6,7],Wo=[0,1,2,3,4,5,6,7,8,9,10];function Go(e){switch(e){case 5:default:return Po;case 7:return Bo;case 10:return Wo}}const qo=un,Vo=fn;class Yo{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=Vo.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){const e=new Date,t=Math.abs(e.getTime()-new Date(r).getTime());if(Math.ceil(t/864e5)<n)return}const o=(e=>!!localStorage.getItem(Pr(e))&&!Zr(e))(e);if(!o){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const r=Tr.createElement("div");r.className=`PostHogSurvey${t}`;const o=r.attachShadow({mode:"open"});if(e){const t=Object.assign(Tr.createElement("style"),{innerText:e});o.appendChild(t)}return Tr.body.appendChild(r),o})(xr(null==e?void 0:e.appearance),e.id);Sr(yo(zo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=qr.createElement("div");n.className=`PostHogWidget${e.id}`;const r=n.attachShadow({mode:"open"}),o=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return r.append(Object.assign(qr.createElement("style"),{innerText:o})),qr.body.appendChild(n),r}(e),n=xr(e.appearance);t.appendChild(Object.assign(Vo.createElement("style"),{innerText:n})),Sr(yo($o,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Vo.querySelector(e.appearance.widgetSelector);if(n)if(0===Vo.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===Vo.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,o;const t=null===(r=Vo.querySelector(`.PostHogWidget${e.id}`))||void 0===r||null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=Bn.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{Sr(yo(zo,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(rn(e.surveyInFocus)){var n,r,o;if(t.type===Bn.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===Vo.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(r=t.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=t.appearance)&&void 0!==o&&o.widgetSelector&&e.handleWidgetSelector(t);t.type===Bn.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{rn(this.surveyInFocus)||yn.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&yn.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function jo(e){if(!Vo||!qo)return;const t=new Yo(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function Uo(e,t,n,r,o){const[i,s]=ro(r||0===n),[a,l]=ro(!1);return oo((()=>{if(r||!t)return;const i=()=>{o(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(o(e.id),s(!1))},c=()=>{var n;s(!0),qo.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===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return qo.addEventListener("PHSurveyClosed",i),qo.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),qo.removeEventListener("PHSurveyClosed",i),qo.removeEventListener("PHSurveySent",a)}})():(c(),()=>{qo.removeEventListener("PHSurveyClosed",i),qo.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:i,isSurveySent:a,setIsPopupVisible:s}}function zo(e){var t,n,r,o,i,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:p,isPopup:h}=e;const f=Number.isInteger(d),m=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:g,isSurveySent:y,setIsPopupVisible:v}=Uo(a,c,m,f,p),b=y||d===a.questions.length,C=null!==(n=u)&&void 0!==n&&n.left&&sn(null===(r=u)||void 0===r?void 0:r.left)?{left:u.left-40}:{};return f&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),g?yo(Wr.Provider,{value:{isPreviewMode:f,previewPageIndex:d,handleCloseSurveyPopup:()=>Rr(a,c,f),isPopup:h||!1},children:b?yo(Eo,{header:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(i=a.appearance)||void 0===i?void 0:i.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||Nr,styleOverrides:{...u,...C},onClose:()=>v(!1)}):yo(Xo,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):yo(ir,{})}function Xo(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,styleOverrides:s}=e;const a=Er((null===(t=r.appearance)||void 0===t?void 0:t.backgroundColor)||Nr.backgroundColor),[l,c]=ro({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:p,isPopup:h}=ao(Wr),[f,m]=ro(d||0),g=so((()=>Hr(r)),[r]);oo((()=>{m(null!=d?d:0)}),[d]);return yo("form",{className:"survey-form",style:h?{color:a,borderColor:null===(n=r.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:g.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?f===s:f===t)&&yo("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=r.appearance)||void 0===n?void 0:n.backgroundColor)||Nr.backgroundColor}:{},children:[h&&yo(Ao,{onClick:()=>p()}),Jo({question:e,forceDisableHtml:o,displayQuestionIndex:t,appearance:r.appearance||Nr,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(!i)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!i.getNextSurveyStep)return void(o===r.questions.length-1?Or({...l,[s]:t},r,i):m(o+1));const a=i.getNextSurveyStep(r,o,t);a===Gn.End?Or({...l,[s]:t},r,i):m(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function $o(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=ro(!1),[u,d]=ro({}),p=io(null);return oo((()=>{var e,t;if(!s&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&p.current){var n;const e=p.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){const e=Vo.querySelector(r.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),yo(ir,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&yo("div",{className:"ph-survey-widget-tab",ref:p,onClick:()=>!s&&c(!l),style:{color:Er(r.appearance.widgetColor)},children:[yo("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&yo(zo,{posthog:i,survey:r,forceDisableHtml:o,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const Jo=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s={[Wn.Open]:Lo,[Wn.Link]:Oo,[Wn.Rating]:Ro,[Wn.SingleChoice]:Fo,[Wn.MultipleChoice]:Fo},a={question:t,forceDisableHtml:n,appearance:o,onSubmit:i},l={[Wn.Open]:{},[Wn.Link]:{},[Wn.Rating]:{displayQuestionIndex:r},[Wn.SingleChoice]:{displayQuestionIndex:r},[Wn.MultipleChoice]:{displayQuestionIndex:r}};return yo(s[t.type],{...{...a,...l[t.type]}})};function Ko(e){return!en(Event)&&Qo(e,Event)}function Qo(e,t){try{return e instanceof t}catch{return!1}}function ei(e){return rn(e)||!Qt(e)&&!Kt(e)}function ti(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function ni(e){return ti(e,"DOMError")}mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.canActivateRepeatedly=Zr,mn.__PosthogExtensions__.generateSurveys=jo,mn.extendPostHogWithSurveys=jo;const ri=/\(error: (.*)\)/,oi=50,ii="?";function si(e,t,n,r){const o={platform:"javascript",filename:e,function:"<anonymous>"===t?ii:t,in_app:!0};return en(n)||(o.lineno=n),en(r)||(o.colno=r),o}const ai=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,li=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ci=/\((\S*)(?::(\d+))(?::(\d+))\)/,ui=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,di=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,pi=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],o=e.split("\n");for(let e=t;e<o.length;e++){const t=o[e];if(t.length>1024)continue;const i=ri.test(t)?t.replace(ri,"$1"):t;if(!i.match(/\S*Error: /)){for(const e of r){const t=e(i);if(t){n.push(t);break}}if(n.length>=oi)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,oi).map((e=>({...e,filename:e.filename||hi(t).filename,function:e.function||ii})))}(n)}}(...[[30,e=>{const t=ai.exec(e);if(t){const[,e,n,r]=t;return si(e,ii,+n,+r)}const n=li.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=ci.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=fi(n[1]||ii,n[2]);return si(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=ui.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=di.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||ii;return[n,e]=fi(n,e),si(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function hi(e){return e[e.length-1]||{}}const fi=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:ii,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let mi;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(mi||(mi={}));const gi=["fatal","error","warning","log","info","debug"],yi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function vi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",r=function(e){if(e&&bi.test(e.message))return 1;return 0}(e);try{const e=pi(n,r);return e.slice(0,e.length-t)}catch{}return[]}const bi=/Minified React error #\d+;/i;function Ci(e,t){var n,r;const o=vi(e),i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:o},mechanism:{handled:i,synthetic:s}}],$exception_level:"error"}}function _i(e,t){var n,r,o;const i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(o=null==t?void 0:t.defaultExceptionType)&&void 0!==o?o:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:i,synthetic:s}};if(null!=t&&t.syntheticException){const e=vi(t.syntheticException,1);e.length&&(a.stacktrace={frames:e})}return{$exception_list:[a],$exception_level:"error"}}function Ii(e){return tn(e)&&!nn(e)&&gi.indexOf(e)>=0}function Si(e,t){var n,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Ko(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length||r.length<=t?r:`${r.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:o,synthetic:i}};if(null!=t&&t.syntheticException){const e=vi(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e})}return{$exception_list:[l],$exception_level:Ii(e.level)?e.level:"error"}}function wi(e,t){let[n,r,o,i,s]=e,a={$exception_list:[]};const l=s||n;if(ni(l)||function(e){return ti(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=Ci(l,t);else{const n=e.name||(ni(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n,o=ni(e)?"DOMError":"DOMException";a=_i(r,{...t,overrideExceptionType:o,defaultExceptionMessage:r})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return ti(e,"ErrorEvent")}(l)&&l.error)return Ci(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Qo(e,Error)}}(l))return Ci(l,t);if(function(e){return ti(e,"Object")}(l)||Ko(l)){return Si(l,t)}if(en(s)&&tn(n)){let e="Error",r=n;const o=n.match(yi);return o&&(e=o[1],r=o[2]),_i(r,{...t,overrideExceptionType:e,defaultExceptionMessage:r})}return _i(l,t)}function ki(e){let[t]=e;const n=function(e){if(ei(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return ei(n)?_i(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):wi([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const Ti={wrapOnError:e=>{const t=un;t||yn.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const s=wi(o);return e(s),null!==(t=null==n?void 0:n(...o))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=un;t||yn.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];const a=ki(i);return e(a),null!==(r=null==n?void 0:n.apply(t,i))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.errorWrappingFunctions=Ti,mn.__PosthogExtensions__.parseErrorAsProperties=wi,mn.posthogErrorWrappingFunctions=Ti,mn.parseErrorAsProperties=wi;const Mi=(e,t)=>{const{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{};const xi={_patchFetch:e=>In(un,"fetch",(t=>async function(n,r){const o=new Request(n,r);return Mi(e,o),t(o)})),_patchXHR:e=>In(un.XMLHttpRequest.prototype,"open",(t=>function(n,r){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(r);return Mi(e,a),t.call(this,n,a.url,o,i,s)}))};mn.__PosthogExtensions__.tracingHeadersPatchFns=xi,mn.postHogTracingHeadersPatchFns=xi;var Ai,Ei,Ni,Li=-1,Oi=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Li=t.timeStamp,e(t))}),!0)},Ri=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Di=function(){var e=Ri();return e&&e.activationStart||0},Fi=function(e,t){var n=Ri(),r="navigate";return Li>=0?r="back-forward-cache":n&&(document.prerendering||Di()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.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:r}},Hi=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Zi=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Pi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Bi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Wi=function(e){var t=!1;return function(){t||(e(),t=!0)}},Gi=-1,qi=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Vi=function(e){"hidden"===document.visibilityState&&Gi>-1&&(Gi="visibilitychange"===e.type?e.timeStamp:0,ji())},Yi=function(){addEventListener("visibilitychange",Vi,!0),addEventListener("prerenderingchange",Vi,!0)},ji=function(){removeEventListener("visibilitychange",Vi,!0),removeEventListener("prerenderingchange",Vi,!0)},Ui=function(){return Gi<0&&(Gi=qi(),Yi(),Oi((function(){setTimeout((function(){Gi=qi(),Yi()}),0)}))),{get firstHiddenTime(){return Gi}}},zi=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Xi=[1800,3e3],$i=function(e,t){t=t||{},zi((function(){var n,r=Ui(),o=Fi("FCP"),i=Hi("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-Di(),0),o.entries.push(e),n(!0)))}))}));i&&(n=Zi(e,o,Xi,t.reportAllChanges),Oi((function(r){o=Fi("FCP"),n=Zi(e,o,Xi,t.reportAllChanges),Pi((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Ji=[.1,.25],Ki=[2500,4e3],Qi={},es=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ts=function(e){if("loading"===document.readyState)return"loading";var t=es();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"},ns=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},rs=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:ns(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},os=-1,is=function(e,t){var n=es(),r="navigate";return os>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=es();return e&&e.activationStart||0}()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ss=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},as=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ls=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},cs=0,us=1/0,ds=0,ps=function(e){e.forEach((function(e){e.interactionId&&(us=Math.min(us,e.interactionId),ds=Math.max(ds,e.interactionId),cs=ds?(ds-us)/7+1:0)}))},hs=function(){"interactionCount"in performance||Ai||(Ai=ss("event",ps,{type:"event",buffered:!0,durationThreshold:0}))},fs=[],ms=new Map,gs=0,ys=function(){return(Ai?cs:performance.interactionCount||0)-gs},vs=[],bs=function(e){if(vs.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=fs[fs.length-1],n=ms.get(e.interactionId);if(n||fs.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ms.set(r.id,r),fs.push(r)}fs.sort((function(e,t){return t.latency-e.latency})),fs.length>10&&fs.splice(10).forEach((function(e){return ms.delete(e.id)}))}}},Cs=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),ls(e)),n},_s=[200,500],Is=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;hs();var r,o=is("INP"),i=function(e){Cs((function(){e.forEach(bs);var t,n=(t=Math.min(fs.length-1,Math.floor(ys()/50)),fs[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},s=ss("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=as(e,o,_s,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ls((function(){i(s.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(os=t.timeStamp,e(t))}),!0)}((function(){gs=0,fs.length=0,ms.clear(),o=is("INP"),r=as(e,o,_s,t.reportAllChanges)})))})))},Ss=[],ws=[],ks=new WeakMap,Ts=new Map,Ms=-1,xs=function(e){Ss=Ss.concat(e),As()},As=function(){Ms<0&&(Ms=Cs(Es))},Es=function(){Ts.size>10&&Ts.forEach((function(e,t){ms.has(t)||Ts.delete(t)}));var e=fs.map((function(e){return ks.get(e.entries[0])})),t=ws.length-50;ws=ws.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<ws.length;r++){var o=ws[r];Ns(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var s=Ss[Ss.length-1-i];if(!s||s.startTime<Ni)break;n.add(s)}Ss=Array.from(n),Ms=-1};vs.push((function(e){e.interactionId&&e.target&&!Ts.has(e.interactionId)&&Ts.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Ni=Math.max(Ni,e.processingEnd);for(var r=ws.length-1;r>=0;r--){var o=ws[r];if(Math.abs(n-o.renderTime)<=8){(t=o).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:n,entries:[e]},ws.push(t)),(e.interactionId||"first-input"===e.entryType)&&ks.set(e,t),As()}));var Ns=function(e,t){for(var n,r=[],o=0;n=Ss[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r};const Ls={onLCP:function(e,t){t=t||{},zi((function(){var n,r=Ui(),o=Fi("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-Di(),0),o.entries=[e],n())}))},s=Hi("largest-contentful-paint",i);if(s){n=Zi(e,o,Ki,t.reportAllChanges);var a=Wi((function(){Qi[o.id]||(i(s.takeRecords()),s.disconnect(),Qi[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Wi(e),"hidden"===document.visibilityState?e():(n=t(e),Bi(e)),n}(a)}),!0)})),Bi(a),Oi((function(r){o=Fi("LCP"),n=Zi(e,o,Ki,t.reportAllChanges),Pi((function(){o.value=performance.now()-r.timeStamp,Qi[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},$i(Wi((function(){var n,r=Fi("CLS",0),o=0,i=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},a=Hi("layout-shift",s);a&&(n=Zi(e,r,Ji,t.reportAllChanges),Bi((function(){s(a.takeRecords()),n(!0)})),Oi((function(){o=0,r=Fi("CLS",0),n=Zi(e,r,Ji,t.reportAllChanges),Pi((function(){return n()}))})),setTimeout(n,0))})))},onFCP:$i,onINP:function(e,t){Ei||(Ei=ss("long-animation-frame",xs)),Is((function(t){var n=function(e){var t=e.entries[0],n=ks.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Ns(t.startTime,o),a=e.entries.find((function(e){return e.target})),l=a&&a.target||Ts.get(t.interactionId),c=[t.startTime+t.duration,o].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:rs(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:i,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(u-o,0),loadState:ts(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.postHogWebVitalsCallbacks=Ls,mn.postHogWebVitalsCallbacks=Ls}();
1
+ !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r),r=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),i=(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))(i||{});function s(e){return e.nodeType===e.ELEMENT_NODE}function a(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function l(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function c(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,u).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function u(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=c(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}function d(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let p=class{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function h(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:i,maskInputFn:s}=e,a=i||"";const l=o&&f(o);return(n[r.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function f(e){return e.toLowerCase()}const m="__rrweb_original__";function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function y(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let v=1;const b=new RegExp("[^a-z0-9-_:]"),_=-2;function C(){return v++}let I,S;const w=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?:[a-z+]+:)?\/\//i,M=/^www\..*/i,T=/^(data:)([^,]*),(.*)/i;function x(e,t){return(e||"").replace(w,((e,n,r,o,i,s)=>{const a=r||i||s,l=n||o||"";if(!a)return e;if(k.test(a)||M.test(a))return`url(${l}${a}${l})`;if(T.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const A=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;const N=new WeakMap;function O(e,t){return t&&""!==t.trim()?R(e,t):t}function L(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function R(e,t){let n=N.get(e);if(n||(n=e.createElement("a"),N.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function D(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?O(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(E),!(n>=t.length);){let i=r(A);if(","===i.slice(-1))i=O(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=O(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?x(r,R(e)):"object"===t&&"data"===n?O(e,r):r:O(e,r):r}function F(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function H(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&H(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&H(e.parentNode,t,n)}function P(e,t,n,r){let o;if(s(e)){if(o=e,!o.childNodes.length)return!1}else{if(null===e.parentElement)return!1;o=e.parentElement}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(H(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function Z(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:p,maskInputFn:y,dataURLOptions:v={},inlineImages:_,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:k=!1}=t,M=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:i.Document,childNodes:[],compatMode:e.compatMode}:{type:i.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:p,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:_=!1,rootId:C}=t,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return b.test(t)?"div":t}(e);let M={};const T=e.attributes.length;for(let t=0;t<T;t++){const r=e.attributes[t];F(k,r.name,r.value)||(M[r.name]=D(n,k,f(r.name),r.value))}if("link"===k&&s){const t=e.href;let r=d(n,t);if(!r&&t.includes(".css")){r=d(n,window.location.origin+"/"+t.replace(window.location.href,""))}let o=null;r&&(o=c(r)),o&&(delete M.rel,delete M.href,M._cssText=x(o,r.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=c(e.sheet);t&&(M._cssText=x(t,R(n)))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&t?M.value=h({element:e,type:g(e),tagName:k,value:t,maskInputOptions:a,maskInputFn:l}):n&&(M.checked=n)}"option"===k&&(e.selected&&!a.select?M.selected=!0:delete M.selected);if("canvas"===k&&y)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=m in o?o[m]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(M.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(M.rr_dataURL=t)}if("img"===k&&p){I||(I=n.createElement("canvas"),S=I.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{I.width=t.naturalWidth,I.height=t.naturalHeight,S.drawImage(t,0,0),M.rr_dataURL=I.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?M.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===k||"video"===k){const t=M;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}_||(e.scrollLeft&&(M.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(M.rr_scrollTop=e.scrollTop));if(w){const{width:t,height:n}=e.getBoundingClientRect();M={class:M.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||v(M.src)||(e.contentDocument||(M.rr_src=M.src),delete M.src);let A;try{customElements.get(k)&&(A=!0)}catch(e){}return{type:i.Element,tagName:k,attributes:M,childNodes:[],isSVG:L(e)||void 0,needBlock:w,rootId:C,isCustom:A}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:y,dataURLOptions:v,inlineImages:_,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:k,rootId:M});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:r,maskTextFn:o,rootId:s}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(n=e.parentNode.sheet)?void 0:n.cssRules)&&(l=c(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}l=x(l,R(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&r&&(l=o?o(l,e.parentElement):l.replace(/[\S]/g,"*"));return{type:i.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:p,rootId:M});case e.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:i.Comment,textContent:e.textContent||"",rootId:M};default:return!1}}function B(e){return null==e?"":e.toLowerCase()}function W(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b={},inlineImages:I=!1,recordCanvas:S=!1,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:M=5e3,onStylesheetLoad:T,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:E=!1}=t;let{needsMask:N}=t,{preserveWhiteSpace:O=!0}=t;if(!N){N=P(e,u,d,void 0===N)}const L=Z(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:b,inlineImages:I,recordCanvas:S,keepIframeSrcFn:A,newlyAddedElement:E});if(!L)return console.warn(e,"not serialized"),null;let R;R=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===i.Comment)return!0;if(e.type===i.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"===y(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(e.attributes.name)||"icon"===B(e.attributes.rel)||"apple-touch-icon"===B(e.attributes.rel)||"shortcut icon"===B(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===B(e.attributes.name)||"googlebot"===B(e.attributes.name)||"bingbot"===B(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===B(e.attributes.name)||"generator"===B(e.attributes.name)||"framework"===B(e.attributes.name)||"publisher"===B(e.attributes.name)||"progid"===B(e.attributes.name)||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===B(e.attributes.name)||"yandex-verification"===B(e.attributes.name)||"csrf-token"===B(e.attributes.name)||"p:domain_verify"===B(e.attributes.name)||"verify-v1"===B(e.attributes.name)||"verification"===B(e.attributes.name)||"shopify-checkout-api-token"===B(e.attributes.name)))return!0}}return!1}(L,v)&&(O||L.type!==i.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?C():_;const D=Object.assign(L,{id:R});if(r.add(e,D),R===_)return null;w&&w(e);let F=!p;if(D.type===i.Element){F=F&&!D.needBlock,delete D.needBlock;const t=e.shadowRoot;t&&l(t)&&(D.isShadowHost=!0)}if((D.type===i.Document||D.type===i.Element)&&F){v.headWhitespace&&D.type===i.Element&&"head"===D.tagName&&(O=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(D.type===i.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(e.childNodes)){const e=W(n,t);e&&D.childNodes.push(e)}if(s(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=W(n,t);r&&(l(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}return e.parentNode&&a(e.parentNode)&&l(e.parentNode)&&(D.isShadow=!0),D.type===i.Element&&"iframe"===D.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=W(t,{doc:t,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:x,keepIframeSrcFn:A});n&&k(e,n)}}),M),D.type===i.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===y(D.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(T){const t=W(e,{doc:n,mirror:r,blockClass:o,blockSelector:c,needsMask:N,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:I,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:x,keepIframeSrcFn:A});t&&T(e,t)}}),x),D}function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const q="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.";let V={map:{},getId:()=>(console.error(q),-1),getNode:()=>(console.error(q),null),removeNodeFromMap(){console.error(q)},has:()=>(console.error(q),!1),reset(){console.error(q)}};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}}function $(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>$(e,t,i||{},!0)}function j(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(V=new Proxy(V,{get:(e,t,n)=>("map"===t&&console.error(q),Reflect.get(e,t,n))}));let U=Date.now;function z(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}}function X(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function J(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function K(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function Q(e,t,n,r){if(!e)return!1;const o=K(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(H(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ee(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===_}function te(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||te(e.parentNode,t))}function ne(e){return Boolean(e.changedTouches)}function re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function oe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ie(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(U=()=>(new Date).getTime());let se=class{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 ae(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function le(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ae(n);)n=t;return n}(e);return t.contains(n)}function ce(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||le(e))}var ue=(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))(ue||{}),de=(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))(de||{}),pe=(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))(pe||{}),he=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(he||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),me=(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))(me||{});function ge(e){return"__ln"in e}class ye{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ge(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ge(e.nextSibling)&&e.nextSibling.__ln.previous){const 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){const 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--)}}const ve=(e,t)=>`${e}@${t}`;class be{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),n(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new ye,r=e=>{let t=e,n=_;for(;n===_;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!ce(o)||"TEXTAREA"===o.parentNode.tagName)return;const i=a(o.parentNode)?this.mirror.getId(ae(o)):this.mirror.getId(o.parentNode),s=r(o);if(-1===i||-1===s)return n.addNode(o);const l=W(o,{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=>{re(e,this.mirror)&&this.iframeManager.addIframe(e),oe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ie(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:i,nextId:s,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Ce(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)Ie(this.droppedSet,e)||Ce(this.removes,e,this.mirror)?Ie(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{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=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).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};(s.texts.length||s.attributes.length||s.removes.length||s.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(s))})),n(this,"genTextAreaValueMutation",(e=>{let 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(e.childNodes,(e=>e.textContent||"")).join("")})),n(this,"processMutation",(e=>{if(!ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=e.target.textContent;Q(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:P(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,K(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=g(t);r=h({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!F(t.tagName,n)&&(o.attributes[n]=D(this.doc,f(t.tagName),f(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(Q(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=>{const n=this.mirror.getId(t),r=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(_e(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ve(n,r)]?_e(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!a(e.target)||!l(e.target))||void 0})),this.mapRemoves.push(t))}))}})),n(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ve(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),ie(e)&&e.shadowRoot.childNodes.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 _e(e,t){e.delete(t),t.childNodes.forEach((t=>_e(e,t)))}function Ce(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some((e=>e.id===t)))return!0;r=r.parentNode}return!1}(e,t,n)}function Ie(e,t){return 0!==e.size&&Se(e,t)}function Se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Se(e,n))}let we;const ke=e=>{if(!we)return e;return function(){try{return e(...arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},Me=[];function Te(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function xe(e,t){var n,r;const o=new be;Me.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null==(r=null==(n=null==window?void 0:window.Zone)?void 0:n.__symbol__)?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(ke(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Ae(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let c=null;return Object.keys(pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=f(e);const a=(e=>n=>{const s=Te(n);if(Q(s,o,i,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=he.Mouse;break;case"touch":a=he.Touch;break;case"pen":a=he.Pen}a===he.Touch?pe[e]===pe.MouseDown?l="TouchStart":pe[e]===pe.MouseUp&&(l="TouchEnd"):he.Pen}else ne(n)&&(a=he.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===he.Touch||l.startsWith("Mouse")&&a===he.Mouse)&&(a=null)):pe[e]===pe.Click&&(a=c,c=null);const u=ne(n)?n.changedTouches[0]:n;if(!u)return;const d=r.getId(s),{clientX:p,clientY:h}=u;ke(t)({type:pe[l],id:d,x:p,y:h,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(pe[e]){case pe.MouseDown:case pe.MouseUp:s=s.replace("mouse","pointer");break;case pe.TouchStart:case pe.TouchEnd:return}l.push(G(s,a,n))})),ke((()=>{l.forEach((e=>e()))}))}function Ee(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,sampling:s}=e;return G("scroll",ke(Y(ke((e=>{const s=Te(e);if(!s||Q(s,o,i,!0))return;const a=r.getId(s);if(s===n&&n.defaultView){const e=z(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})})),s.scroll||100)),n)}const Ne=["INPUT","TEXTAREA","SELECT"],Oe=new WeakMap;function Le(e){return function(e,t){if(He("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Re(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function De(e,t){let{mirror:n,stylesheetManager:r}=e;var o,i,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null==(o=t.defaultView)?void 0:o.Document:null==(s=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:s.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),i(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),p(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),h(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(r=xe(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=Y(ke((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=ke(Y(ke((e=>{const t=Te(e),{clientX:n,clientY:r}=ne(e)?e.changedTouches[0]:e;a||(a=U()),l.push({x:n,y:r,id:o.getId(t),timeOffset:U()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?de.Drag:e instanceof MouseEvent?de.MouseMove:de.TouchMove)})),i,{trailing:!1})),d=[G("mousemove",u,r),G("touchmove",u,r),G("drag",u,r)];return ke((()=>{d.forEach((e=>e()))}))}(e),i=Ae(e),s=Ee(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,i=-1;return G("resize",ke(Y(ke((()=>{const e=X(),t=J();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function p(e){let t=Te(e);const r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=t.parentElement),!t||!u||Ne.indexOf(u)<0||Q(t,o,i,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let p=t.value,m=!1;const y=g(t)||"";"radio"===y||"checkbox"===y?m=t.checked:(l[u.toLowerCase()]||l[y])&&(p=h({element:t,maskInputOptions:l,tagName:u,type:y,value:p,maskInputFn:c})),f(t,d?{text:p,isChecked:m,userTriggered:r}:{text:p,isChecked:m});const v=t.name;"radio"===y&&v&&m&&n.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach((e=>{if(e!==t){const t=e.value;f(e,d?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function f(e,n){const o=Oe.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Oe.set(e,n);const o=r.getId(e);ke(t)({...n,id:o})}}const m=("last"===u.input?["change"]:["input","change"]).map((e=>G(e,ke(p),n))),y=n.defaultView;if(!y)return()=>{m.forEach((e=>e()))};const v=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,"value"),b=[[y.HTMLInputElement.prototype,"value"],[y.HTMLInputElement.prototype,"checked"],[y.HTMLSelectElement.prototype,"value"],[y.HTMLTextAreaElement.prototype,"value"],[y.HTMLSelectElement.prototype,"selectedIndex"],[y.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&m.push(...b.map((e=>$(e[0],e[1],{set(){ke(p)({target:this,isTrusted:!1})}},!1,y)))),ke((()=>{m.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:i,doc:s}=e;const a=ke((e=>Y(ke((i=>{const s=Te(i);if(!s||Q(s,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:o.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),i.media||500))),l=[G("play",a(me.Play),s),G("pause",a(me.Pause),s),G("seeked",a(me.Seeked),s),G("volumechange",a(me.VolumeChange),s),G("ratechange",a(me.RateChange),s)];return ke((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},p=()=>{},f=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:i}=t;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,i)}))});const a=i.CSSStyleSheet.prototype.deleteRule;let l,c;i.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(l=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,i)}))}));const u={};Pe("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Pe("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Pe("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Pe("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,i]=e;d[t]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(d[t].insertRule,{apply:ke(((e,t,i)=>{const[s,a]=i,{id:l,styleId:c}=Re(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Le(t),a||0]}]}),e.apply(t,i)}))}),i.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:ke(((e,t,i)=>{const[s]=i,{id:a,styleId:l}=Re(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Le(t),s]}]}),e.apply(t,i)}))})})),ke((()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=a,l&&(i.CSSStyleSheet.prototype.replace=l),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),d=De(e,e.doc),p=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:i}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:ke(((e,t,s)=>{var l;const[c,u,d]=s;if(o.has(c))return a.apply(t,[c,u,d]);const{id:p,styleId:h}=Re(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,i.styleMirror);return(p&&-1!==p||h&&-1!==h)&&n({id:p,styleId:h,set:{property:c,value:u,priority:d},index:Le(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ke(((e,t,s)=>{var a;const[c]=s;if(o.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Re(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,i.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Le(t.parentRule)}),e.apply(t,s)}))}),ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],i=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){const r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=j(n.fonts,"add",(function(e){return function(n){return setTimeout(ke((()=>{const e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=s})),o.push(a),ke((()=>{o.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=ke((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=i;Q(s,r,o,!0)||Q(c,r,o,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}i({ranges:a})}));return a(),G("selectionchange",a)}(e),y=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?j(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),v=[];for(const t of e.plugins)v.push(t.observer(t.callback,n,t.options));return ke((()=>{Me.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),f(),m(),y(),v.forEach((e=>e()))}))}function He(e){return void 0!==window[e]}function Pe(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ze{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Be{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new Ze(C)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ze(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ue.IncrementalSnapshot,data:{source:de.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return t;case ue.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ue.IncrementalSnapshot:switch(t.data.source){case de.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 de.Drag:case de.TouchMove:case de.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.ViewportResize:return!1;case de.MediaInteraction:case de.MouseInteraction:case de.Scroll:case de.CanvasMutation:case de.Input:return this.replaceIds(t.data,e,["id"]),t;case de.StyleSheetRule:case de.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case de.Font:return t;case de.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case de.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===i.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class We{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(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(!l(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=xe({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ee({...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(e.host)),this.restoreHandlers.push(De({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){const n=this;this.restoreHandlers.push(j(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&ce(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;Ve<64;Ve++)qe[Ge.charCodeAt(Ve)]=Ve;const Ye=new Map;const $e=(e,t,n)=>{if(!e||!ze(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ye.get(e);return n||(n=new Map,Ye.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function je(e,t,n){if(e instanceof Array)return e.map((e=>je(e,t,n)));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,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Ge[n[t]>>2],o+=Ge[(3&n[t])<<4|n[t+1]>>4],o+=Ge[(15&n[t+1])<<2|n[t+2]>>6],o+=Ge[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[je(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[je(e.data,t,n),e.width,e.height]}}if(ze(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:$e(e,t,n)}}return e}const Ue=(e,t,n)=>e.map((e=>je(e,t,n))),ze=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Xe(e,t,n,r){const o=[];try{const i=j(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(!Q(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...s])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Je(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=j(e,l,(function(e){return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];const u=e.apply(this,a);if($e(u,i,this),"tagName"in this.canvas&&!Q(this.canvas,r,o,!0)){const e=Ue(a,i,this),r={type:t,property:l,args:e};n(this.canvas,r)}return u}}));s.push(a)}catch{const r=$(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}const Ke="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Qe="undefined"!=typeof window&&window.Blob&&new Blob([(et=Ke,Uint8Array.from(atob(et),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var et;function tt(e){let t;try{if(t=Qe&&(window.URL||window.webkitURL).createObjectURL(Qe),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Ke,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class nt{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(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)}));const{sampling:t="all",win:r,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,o,i),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,o,i,{dataURLOptions:a})}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,t,n,r,o){const i=Xe(t,n,r,!0),s=new Map,a=new tt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{Q(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,i=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:r,resizeHeight:i});a.postMessage({id:n,bitmap:l,width:r,height:i,dataURLOptions:o.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Xe(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=j(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return Q(this.canvas,n,r,!0)||setTimeout((()=>{const n=Ue(a,t,this);e(this.canvas,{type:fe["2D"],property:s,args:n})}),0),o.apply(this,a)}}));o.push(i)}catch{const n=$(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:fe["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return o.push(...Je(t.WebGLRenderingContext.prototype,fe.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Je(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class rt{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new se),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){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:u(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ot{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).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(){}}let it,st,at,lt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}const ct=new p;function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:g,hooks:y,packFn:v,sampling:b={},dataURLOptions:_={},mousemoveWait:C,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:w=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:M=!1,collectFonts:T=!1,inlineImages:x=!1,plugins:A,keepIframeSrcFn:E=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:O}=e;we=O;const L=!w||window.parent===window;let R=!1;if(!L)try{window.parent.document&&(R=!1)}catch(e){R=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!R)return()=>{};void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),ct.reset();const D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},F=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};let H;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let P=0;const Z=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};it=(e,o)=>{var i;const s=e;if(s.timestamp=U(),!(null==(i=Me[0])?void 0:i.isFrozen())||s.type===ue.FullSnapshot||s.type===ue.IncrementalSnapshot&&s.data.source===de.Mutation||Me.forEach((e=>e.unfreeze())),L)null==t||t(Z(s),o);else if(R){const e={type:"rrweb",event:Z(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===ue.FullSnapshot)H=s,P=0;else if(s.type===ue.IncrementalSnapshot){if(s.data.source===de.Mutation&&s.data.isAttachIframe)return;P++;const e=r&&P>=r,t=n&&s.timestamp-H.timestamp>n;(e||t)&&st(!0)}};const B=e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Mutation,...e}})},q=e=>it({type:ue.IncrementalSnapshot,data:{source:de.Scroll,...e}}),V=e=>it({type:ue.IncrementalSnapshot,data:{source:de.CanvasMutation,...e}}),Y=new rt({mutationCb:B,adoptedStyleSheetCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.AdoptedStyleSheet,...e}})}),$=new Be({mirror:ct,mutationCb:B,stylesheetManager:Y,recordCrossOriginIframes:w,wrappedEmit:it});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:ct,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const j=new ot;at=new nt({recordCanvas:S,mutationCb:V,win:window,blockClass:o,blockSelector:i,mirror:ct,sampling:b.canvas,dataURLOptions:_});const K=new We({mutationCb:B,scrollCb:q,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:_,maskTextFn:g,maskInputFn:m,recordCanvas:S,inlineImages:x,sampling:b,slimDOMOptions:F,iframeManager:$,stylesheetManager:Y,canvasManager:at,keepIframeSrcFn:E,processedNodeManager:j},mirror:ct});st=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I)return;it({type:ue.Meta,data:{href:window.location.href,width:J(),height:X()}},e),Y.reset(),K.init(),Me.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new p,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:_,stylesheetLoadTimeout:C,keepIframeSrcFn:I=(()=>!1)}=t||{};return W(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:_,stylesheetLoadTimeout:C,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ct,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:m,slimDOM:F,dataURLOptions:_,recordCanvas:S,inlineImages:x,onSerialize:e=>{re(e,ct)&&$.addIframe(e),oe(e,ct)&&Y.trackLinkElement(e),ie(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{$.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!t)return console.warn("Failed to snapshot the document");it({type:ue.FullSnapshot,data:{node:t,initialOffset:z(window)}},e),Me.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,ct.getId(document))};try{const e=[],t=e=>{var t;return ke(Fe)({mutationCb:B,mousemoveCb:(e,t)=>it({type:ue.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.ViewportResize,...e}}),inputCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Input,...e}}),mediaInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.MediaInteraction,...e}}),styleSheetRuleCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleSheetRule,...e}}),styleDeclarationCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>it({type:ue.IncrementalSnapshot,data:{source:de.Font,...e}}),selectionCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.Selection,...e}})},customElementCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:de.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:b,recordDOM:I,recordCanvas:S,inlineImages:x,userTriggeredOnInput:M,collectFonts:T,doc:e,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:F,dataURLOptions:_,mirror:ct,iframeManager:$,stylesheetManager:Y,shadowDomManager:K,processedNodeManager:j,canvasManager:at,ignoreCSSAttributes:N,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>it({type:ue.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};$.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{st(),e.push(t(document)),lt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(G("DOMContentLoaded",(()=>{it({type:ue.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(G("load",(()=>{it({type:ue.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),j.destroy(),lt=!1,we=void 0}}catch(e){console.warn(e)}}var dt,pt;ut.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");it({type:ue.Custom,data:{tag:e,payload:t}})},ut.freezePage=()=>{Me.forEach((e=>e.freeze()))},ut.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");st(e)},ut.mirror=ct,(pt=dt||(dt={}))[pt.NotStarted=0]="NotStarted",pt[pt.Running=1]="Running",pt[pt.Stopped=2]="Stopped";const ht="2.0.0-alpha.16";var ft,mt=Object.defineProperty,gt=(e,t,n)=>(((e,t,n)=>{t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),yt=Object.defineProperty,vt=(e,t,n)=>(((e,t,n)=>{t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bt=Object.defineProperty,_t=(e,t,n)=>(((e,t,n)=>{t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class Ct{constructor(){_t(this,"idNodeMap",new Map),_t(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function It(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&It(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&It(e.parentNode,t,n)}const St="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.";let wt={map:{},getId:()=>(console.error(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get:(e,t,n)=>("map"===t&&console.error(St),Reflect.get(e,t,n))}));let kt=Date.now;function Mt(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}/[1-9][0-9]{12}/.test(Date.now().toString())||(kt=()=>(new Date).getTime());function Tt(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function xt(e){let t,n=e;for(;t=Tt(n);)n=t;return n}function At(e){const t=e.ownerDocument;if(!t)return!1;const n=xt(e);return t.contains(n)}const Et=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){vt(this,"id",1),vt(this,"styleIDMap",new WeakMap),vt(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 wt},closestElementOfNode:Mt,getBaseDimension:function e(t,n){var r,o;const i=null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.frameElement;if(!i||i===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=e(i,n),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:xt,getShadowHost:Tt,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(i=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:i.scrollTop)||(null==(s=null==a?void 0:a.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return Boolean(null==e?void 0:e.shadowRoot)},hookSetter:function e(t,n,r,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=i.Object.getOwnPropertyDescriptor(t,n);return i.Object.defineProperty(t,n,o?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||At(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const o=Mt(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(It(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.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,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return kt},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const o of e){const{nextId:e,parentId:i}=o;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,n(o,i.parent))}else{const e=r.indexOf(i);r.splice(e,0,n(o,null))}}else if(i in t){const e=t[i];e.children.push(n(o,e))}else r.push(n(o,null))}return r},shadowHostInDom:At,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ot="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Lt=0;Lt<64;Lt++)Ot[Nt.charCodeAt(Lt)]=Lt;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ft=e.contentWindow)?void 0:ft.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt;new Ct,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Rt||(Rt={}));class Dt{constructor(e){gt(this,"fileName"),gt(this,"functionName"),gt(this,"lineNumber"),gt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ft=/(^|@)\S+:\d+/,Ht=/^\s*at .*(\S+:\d+|\(native\))/m,Pt=/^(eval@)?(\[native code])?$/,Zt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ht)?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];const 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(Ht)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Dt({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Pt)}),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 Dt({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Dt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Dt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ft)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Dt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Wt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Gt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Wt(e[r])&&Gt(e[r],t-1))return!0;return!1}function qt(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Wt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Wt(e)&&Gt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Bt(r.length?r[0]:null):e[n]=r}return e}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}))}const Vt={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 Yt(e,t,n){const r=n?Object.assign({},Vt,n):Vt,o=r.logger;if(!o)return()=>{};let i;i="string"==typeof o?t[o]:o;let s=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,i=Zt.parse(o).map((e=>e.toString())),s=[qt(n,r.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[qt(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[qt("Uncaught (in promise)",r.stringifyOptions),qt(t.reason,r.stringifyOptions)]);const i=Zt.parse(n).map((e=>e.toString()));e({level:"error",trace:i,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(i,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?Et.patch(t,n,(t=>function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=Zt.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>qt(e,r.stringifyOptions)));s++,s<r.lengthThreshold?e({level:n,trace:t,payload:o}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[qt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const $t=e=>({name:"rrweb/console@1",observer:Yt,options:e}),jt=Array.isArray,Ut=Object.prototype,zt=Ut.hasOwnProperty,Xt=Ut.toString,Jt=jt||function(e){return"[object Array]"===Xt.call(e)},Kt=function(e){return"function"==typeof e},Qt=function(e){return e===Object(e)&&!Jt(e)},en=function(e){return void 0===e},tn=function(e){return"[object String]"==Xt.call(e)},nn=function(e){return tn(e)&&0===e.trim().length},rn=function(e){return null===e},on=function(e){return en(e)||rn(e)},sn=function(e){return"[object Number]"==Xt.call(e)},an=function(e){return"[object Boolean]"===Xt.call(e)},ln=e=>e instanceof Document,cn=e=>e instanceof FormData,un="undefined"!=typeof window?window:void 0,dn="undefined"!=typeof globalThis?globalThis:un,pn=Array.prototype.forEach,hn=null==dn?void 0:dn.navigator,fn=null==dn?void 0:dn.document;null==dn||dn.location,null==dn||dn.fetch,null!=dn&&dn.XMLHttpRequest&&"withCredentials"in new dn.XMLHttpRequest&&dn.XMLHttpRequest,null==dn||dn.AbortController,null==hn||hn.userAgent;const mn=null!=un?un:{},gn="[PostHog.js]",yn={_log:function(e){if(un&&mn.POSTHOG_DEBUG&&!en(un.console)&&un.console){const o="__rrweb_original__"in un.console[e]?un.console[e].__rrweb_original__:un.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(gn,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(gn,...t)},uninitializedWarning:e=>{yn.error(`You must initialize PostHog before calling ${e}`)}},vn={},bn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function _n(e,t,n){if(Jt(e))if(pn&&e.forEach===pn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===vn)return}function Cn(e,t,n){if(!on(e)){if(Jt(e))return _n(e,t,n);if(cn(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===vn)return}else for(const r in e)if(zt.call(e,r)&&t.call(n,e[r],r)===vn)return}}const In=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return _n(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function Sn(e,t){return-1!==e.indexOf(t)}function wn(e){const t=Object.keys(e);let n=t.length;const r=new Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r}const kn=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return Cn(e,(function(e,r){en(e)||en(r)||"undefined"===r||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},Mn="__POSTHOG_TOOLBAR__";function Tn(e){return!!e&&1===e.nodeType}function xn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function An(e){return e?bn(e).split(/\s+/):[]}function En(e){let 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 An(t)}function Nn(e){let t="";return Ln(e)&&!Rn(e)&&e.childNodes&&e.childNodes.length&&Cn(e.childNodes,(function(e){var n;(function(e){return!!e&&3===e.nodeType})(e)&&e.textContent&&(t+=null!==(n=function(e){return on(e)?null:bn(e).split(/(\s+)/).filter((e=>Wn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==n?n:"")})),bn(t)}const On=["a","button","form","input","select","textarea","label"];function Ln(e){for(let t=e;t.parentNode&&!xn(t,"body");t=t.parentNode){const e=En(t);if(Sn(e,"ph-sensitive")||Sn(e,"ph-no-capture"))return!1}if(Sn(En(e),"ph-include"))return!0;const t=e.type||"";if(tn(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(tn(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Rn(e){return!!(xn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||xn(e,"select")||xn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const Dn="(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})",Fn=new RegExp(`^(?:${Dn})$`),Hn=new RegExp(Dn),Pn="\\d{3}-?\\d{2}-?\\d{4}",Zn=new RegExp(`^(${Pn})$`),Bn=new RegExp(`(${Pn})`);function Wn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(on(e))return!1;if(tn(e)){e=bn(e);if((t?Fn:Hn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Zn:Bn).test(e))return!1}return!0}function Gn(e){let t=Nn(e);return t=`${t} ${qn(e)}`.trim(),Wn(t)?t:""}function qn(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Cn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Nn(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${qn(e)}`.trim())}catch(e){yn.error(e)}})),t}function Vn(e){return function(e){const t=e.map((e=>{var t,n;let r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)r+=`.${t.replace(/"/g,"")}`}const o={...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},i={};return wn(o).sort(((e,t)=>{let[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{let[t,n]=e;return i[Yn(t.toString())]=Yn(n.toString())})),r+=":",r+=wn(o).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),r}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:$n(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wn(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return r.attributes[t]=n})),r}))}(e))}function Yn(e){return e.replace(/"|\\"/g,'\\"')}function $n(e){const t=e.attr__class;return t?Jt(t)?t:An(t):void 0}const jn={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"]};function Un(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return Kt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function zn(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const Xn=e=>"navigation"===e.entryType,Jn=e=>"resource"===e.entryType;function Kn(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>Xn(e)||Jn(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>or({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>Xn(e)||Jn(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>or({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function Qn(e,t){return!!t&&(an(t)||t[e])}function er(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(an(n))return!0;if(Jt(n))return o(n);const i=n[t];return an(i)?i:o(i)}async function tr(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i>10)return yn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const s=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>Jn(e)&&e.initiatorType===t&&(en(r)||e.startTime>=r)&&(en(o)||e.startTime<=o)));return s||(await new Promise((e=>setTimeout(e,50*i))),tr(e,t,n,r,o,i+1))}function nr(e){let{body:t,options:n,url:r}=e;if(on(t))return null;const{hostname:o,isHostDenied:i}=zn(r,n);if(i)return o+" is in deny list";if(tn(t))return t;if(ln(t))return t.textContent;if(cn(t))return kn(t);if(Qt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const rr=e=>!rn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function or(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:i,start:s,end:a,url:l,initiatorType:c}=e;s=t?t.startTime:s,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(s||0)),p=[{...t?t.toJSON():{name:l},startTime:en(s)?void 0:Math.round(s),endTime:en(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:i}];if(rr(t))for(const e of t.serverTiming||[])p.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return p}const ir=["video/","audio/"];function sr(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function ar(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=ir.some((e=>null==i?void 0:i.startsWith(e)));if(i&&s)return`Content-Type ${i} is not supported`;const{hostname:a,isHostDenied:l}=zn(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return rn(o)?sr(t):Promise.resolve(o)}function lr(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=Qn("request",n.recordHeaders),o=Qn("response",n.recordHeaders),i=Un(t,"fetch",(i=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,p;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(u.requestHeaders=e),er({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:i}=zn(r,n);return i?Promise.resolve(o+" is in deny list"):sr(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await i(l),p=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(u.responseHeaders=a),er({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await ar({r:c,options:n,url:s})),c}finally{tr(t,"fetch",l.url,d,p).then((t=>{var n;const r=or({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:p,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{i()}}let cr=null;function ur(e,t,n){if(!("performance"in t))return()=>{};if(cr)return yn.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},jn,n):jn,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},i=Kn(o,t,r);let s=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=Qn("request",n.recordHeaders),o=Qn("response",n.recordHeaders),i=Un(t.XMLHttpRequest.prototype,"open",(i=>function(s,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,p=new Request(a),h={};let f,m;const g={},y=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(g[e]=t,y(e,t)),r&&(h.requestHeaders=g);const v=d.send.bind(d);d.send=e=>(er({type:"request",headers:g,url:a,recordBody:n.recordBody})&&(h.requestBody=nr({body:e,options:n,url:a})),f=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;m=t.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(h.responseHeaders=r),er({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(h.responseBody=nr({body:d.response,options:n,url:a})),tr(t,"xmlhttprequest",p.url,f,m).then((t=>{const n=or({entry:t,method:p.method,status:null==d?void 0:d.status,networkRequest:h,start:f,end:m,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),i.call(d,s,a,l,c,u)}));return()=>{i()}}(o,t,r),a=lr(o,t,r)),cr=()=>{i(),s(),a()},cr}const dr=e=>({name:"rrweb/network@1",observer:ur,options:e});let pr,hr,fr;mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$t,getRecordNetworkPlugin:dr},mn.__PosthogExtensions__.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrweb={record:ut,version:"v2",rrwebVersion:ht},mn.rrwebConsoleRecord={getRecordConsolePlugin:$t},mn.getRecordNetworkPlugin=dr,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(pr||(pr={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(hr||(hr={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(fr||(fr={}));var mr,gr,yr,vr,br,_r,Cr,Ir,Sr={},wr=[],kr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mr=Array.isArray;function Tr(e,t){for(var n in t)e[n]=t[n];return e}function xr(e){var t=e.parentNode;t&&t.removeChild(e)}function Ar(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?mr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return Er(e,s,r,o,null)}function Er(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++yr:o,__i:-1,__u:0};return null==o&&null!=gr.vnode&&gr.vnode(i),i}function Nr(e){return e.children}function Or(e,t){this.props=e,this.context=t}function Lr(e,t){if(null==t)return e.__?Lr(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Lr(e):null}function Rr(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Rr(e)}}function Dr(e){(!e.__d&&(e.__d=!0)&&vr.push(e)&&!Fr.__r++||br!==gr.debounceRendering)&&((br=gr.debounceRendering)||_r)(Fr)}function Fr(){var e,t,n,r,o,i,s,a,l;for(vr.sort(Cr);e=vr.shift();)e.__d&&(t=vr.length,r=void 0,i=(o=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=Tr({},o)).__v=o.__v+1,gr.vnode&&gr.vnode(r),Vr(s,r,o,n.__n,void 0!==s.ownerSVGElement,32&o.__u?[i]:null,a,null==i?Lr(o):i,!!(32&o.__u),l),r.__.__k[r.__i]=r,Yr(a,r,l),r.__e!=i&&Rr(r)),vr.length>t&&vr.sort(Cr));Fr.__r=0}function Hr(e,t,n,r,o,i,s,a,l,c,u){var d,p,h,f,m,g=r&&r.__k||wr,y=t.length;for(n.__d=l,function(e,t,n){var r,o,i,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Er(null,o,null,null,o):Mr(o)?Er(Nr,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Er(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=Zr(o,n,s=r+d,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=Lr(i)),jr(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=Lr(i)),jr(i,i))}(n,t,g),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?Sr:g[h.__i]||Sr,h.__i=d,Vr(e,h,p,o,i,s,a,l,c,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&$r(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),65536&h.__u||p.__k===h.__k?l=Pr(h,l,e):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=m}function Pr(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Pr(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Zr(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&i===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&i===l.type)return a;a++}}return-1}function Br(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||kr.test(t)?n:n+"px"}function Wr(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Br(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Br(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=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+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?qr:Gr,i)):e.removeEventListener(t,i?qr:Gr,i);else{if(o)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==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Gr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(gr.event?gr.event(e):e)}function qr(e){return this.l[e.type+!0](gr.event?gr.event(e):e)}function Vr(e,t,n,r,o,i,s,a,l,c){var u,d,p,h,f,m,g,y,v,b,_,C,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=gr.__b)&&u(t);e:if("function"==typeof k)try{if(y=t.props,v=(u=k.contextType)&&r[u.__c],b=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(y,b):(t.__c=d=new Or(y,b),d.constructor=k,d.render=Ur),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Tr({},d.__s)),Tr(d.__s,k.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,m)}))}if(d.context=b,d.props=y,d.__P=e,d.__e=!1,C=gr.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,C&&C(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,C&&C(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=Tr(Tr({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(h,f)),Hr(e,Mr(w=null!=u&&u.type===Nr&&null==u.key?u.props.children:u)?w:[w],t,n,r,o,i,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=i?(t.__e=a,t.__u|=l?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),gr.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,s,a,l){var c,u,d,p,h,f,m,g=n.props,y=t.props,v=t.type;if("svg"===v&&(o=!0),null!=i)for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!v&&(v?h.localName===v:3===h.nodeType)){e=h,i[c]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),i=null,a=!1}if(null===v)g===y||a&&e.data===y||(e.data=y);else{if(i=i&&mr.call(e.childNodes),g=n.props||Sr,!a&&null!=i)for(g={},c=0;c<e.attributes.length;c++)g[(h=e.attributes[c]).name]=h.value;for(c in g)h=g[c],"children"==c||("dangerouslySetInnerHTML"==c?d=h:"key"===c||c in y||Wr(e,c,null,h,o));for(c in y)h=y[c],"children"==c?p=h:"dangerouslySetInnerHTML"==c?u=h:"value"==c?f=h:"checked"==c?m=h:"key"===c||a&&"function"!=typeof h||g[c]===h||Wr(e,c,h,g[c],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Hr(e,Mr(p)?p:[p],t,n,r,o&&"foreignObject"!==v,i,s,i?i[0]:n.__k&&Lr(n,0),a,l),null!=i)for(c=i.length;c--;)null!=i[c]&&xr(i[c]);a||(c="value",void 0!==f&&(f!==e[c]||"progress"===v&&!f||"option"===v&&f!==g[c])&&Wr(e,c,f,g[c],!1),c="checked",void 0!==m&&m!==e[c]&&Wr(e,c,m,g[c],!1))}return e}(n.__e,t,n,r,o,i,s,l,c);(u=gr.diffed)&&u(t)}function Yr(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)$r(n[r],n[++r],n[++r]);gr.__c&&gr.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){gr.__e(e,t.__v)}}))}function $r(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){gr.__e(e,n)}}function jr(e,t,n){var r,o;if(gr.unmount&&gr.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||$r(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){gr.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&jr(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||xr(e.__e),e.__=e.__e=e.__d=void 0}function Ur(e,t,n){return this.constructor(e,n)}function zr(e,t,n){var r,o,i,s;gr.__&&gr.__(e,t),o=(r="function"==typeof n)?null:t.__k,i=[],s=[],Vr(t,e=(!r&&n||t).__k=Ar(Nr,null,[e]),o||Sr,Sr,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?mr.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Yr(i,e,s)}function Xr(e,t,n){var r,o,i,s,a=Tr({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=void 0===t[i]&&void 0!==s?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?mr.call(arguments,2):n),Er(e.type,a,r||e.key,o||e.ref,null)}mr=wr.slice,gr={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},yr=0,Or.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Tr({},this.state),"function"==typeof e&&(e=e(Tr({},n),this.props)),e&&Tr(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Dr(this))},Or.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Dr(this))},Or.prototype.render=Nr,vr=[],_r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cr=function(e,t){return e.__v.__b-t.__v.__b},Fr.__r=0,Ir=0;const Jr=un,Kr=fn,Qr="seenSurvey_",eo=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n 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%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${no((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function to(e){if("#"===e[0]){const 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 no(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oo;"#"===t[0]&&(e=to(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=to(n)),!e)return"black";const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const ro={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:"right"},oo="#eeeded",io=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;r&&(localStorage.setItem(po(n),"true"),r.capture("survey sent",{$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=>e.question)),sessionRecordingUrl:null===(e=r.get_session_replay_url)||void 0===e?void 0:e.call(r),...t,$set:{[ho(n,"responded")]:!0}}),Jr.dispatchEvent(new Event("PHSurveySent")))},so=(e,t,n)=>{var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:{[ho(e,"dismissed")]:!0}}),localStorage.setItem(po(e),"true"),Jr.dispatchEvent(new Event("PHSurveyClosed")))},ao=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),lo=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,co=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?lo(e.questions,ao(e.questions)):e.questions),uo=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,r,o,i,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(s=i.values)||void 0===s?void 0:s.length)>0})(e))},po=e=>{let t=`${Qr}${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`${Qr}${e.id}_${e.current_iteration}`),t},ho=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},fo=function(e,t){var n={__c:t="__cC"+Ir++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Dr(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),mo=e=>{let{component:t,children:n,renderAsHtml:r,style:o}=e;return Xr(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},go=fn;var yo,vo,bo,_o,Co=0,Io=[],So=[],wo=gr.__b,ko=gr.__r,Mo=gr.diffed,To=gr.__c,xo=gr.unmount;function Ao(e,t){gr.__h&&gr.__h(vo,e,Co||t),Co=0;var n=vo.__H||(vo.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:So}),n.__[e]}function Eo(e){return Co=1,function(e,t,n){var r=Ao(yo++,2);if(r.t=e,!r.__c&&(r.__=[Wo(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=vo,!vo.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};vo.u=!0;var i=vo.shouldComponentUpdate,s=vo.componentWillUpdate;vo.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},vo.shouldComponentUpdate=o}return r.__N||r.__}(Wo,e)}function No(e,t){var n=Ao(yo++,3);!gr.__s&&Bo(n.__H,t)&&(n.__=e,n.i=t,vo.__H.__h.push(n))}function Oo(e){return Co=5,Lo((function(){return{current:e}}),[])}function Lo(e,t){var n=Ao(yo++,7);return Bo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Ro(e){var t=vo.context[e.__c],n=Ao(yo++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(vo)),t.props.value):e.__}function Do(){for(var e;e=Io.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Po),e.__H.__h.forEach(Zo),e.__H.__h=[]}catch(t){e.__H.__h=[],gr.__e(t,e.__v)}}gr.__b=function(e){vo=null,wo&&wo(e)},gr.__r=function(e){ko&&ko(e),yo=0;var t=(vo=e.__c).__H;t&&(bo===vo?(t.__h=[],vo.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=So,e.__N=e.i=void 0}))):(t.__h.forEach(Po),t.__h.forEach(Zo),t.__h=[],yo=0)),bo=vo},gr.diffed=function(e){Mo&&Mo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Io.push(t)&&_o===gr.requestAnimationFrame||((_o=gr.requestAnimationFrame)||Ho)(Do)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==So&&(e.__=e.__V),e.i=void 0,e.__V=So}))),bo=vo=null},gr.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Po),e.__h=e.__h.filter((function(e){return!e.__||Zo(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],gr.__e(n,e.__v)}})),To&&To(e,t)},gr.unmount=function(e){xo&&xo(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Po(e)}catch(e){t=e}})),n.__H=void 0,t&&gr.__e(t,n.__v))};var Fo="function"==typeof requestAnimationFrame;function Ho(e){var t,n=function(){clearTimeout(r),Fo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Fo&&(t=requestAnimationFrame(n))}function Po(e){var t=vo,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),vo=t}function Zo(e){var t=vo;e.__c=e.__(),vo=t}function Bo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Wo(e,t){return"function"==typeof t?t(e):t}var Go=0;function qo(e,t,n,r,o,i){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Go,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return gr.vnode&&gr.vnode(c),c}const Vo=qo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:qo("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"})}),Yo=qo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:qo("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"})}),$o=qo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:qo("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"})}),jo=qo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:qo("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"})}),Uo=qo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:qo("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"})}),zo=qo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:qo("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"})}),Xo=qo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[qo("g",{"clip-path":"url(#clip0_2415_6911)",children:[qo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:qo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),qo("g",{mask:"url(#mask0_2415_6911)",children:[qo("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"}),qo("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"}),qo("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"}),qo("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"}),qo("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"}),qo("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"})]})]}),qo("defs",{children:qo("clipPath",{id:"clip0_2415_6911",children:qo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Jo=qo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:qo("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 Ko(){return qo("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Xo]})}function Qo(e){let{text:t,submitDisabled:n,appearance:r,onSubmit:o,link:i}=e;const{isPreviewMode:s,isPopup:a}=Ro(fo),l=r.submitButtonTextColor||no(r.submitButtonColor||ro.submitButtonColor);return qo("div",{className:"bottom-section",children:[qo("div",{className:"buttons",children:qo("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(i&&(null==un||un.open(i)),o())},children:t})}),!r.whiteLabel&&qo(Ko,{})]})}function ei(e){let{question:t,description:n,descriptionContentType:r,backgroundColor:o,forceDisableHtml:i}=e;const{isPopup:s}=Ro(fo);return qo("div",{style:s?{backgroundColor:o||ro.backgroundColor}:{},children:[qo("div",{className:"survey-question",children:t}),n&&mo({component:Ar("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function ti(e){let{onClick:t}=e;const{isPreviewMode:n}=Ro(fo);return qo("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:qo("button",{className:"form-cancel",onClick:t,disabled:n,children:zo})})}function ni(e){let{header:t,description:n,contentType:r,forceDisableHtml:o,appearance:i,onClose:s,styleOverrides:a}=e;const l=no(i.backgroundColor||ro.backgroundColor),{isPopup:c}=Ro(fo);return qo(Nr,{children:qo("div",{className:"thank-you-message",style:{...a},children:qo("div",{className:"thank-you-message-container",children:[c&&qo(ti,{onClick:()=>s()}),qo("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&mo({component:Ar("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==r,style:{color:l}}),c&&qo(Qo,{text:i.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:i,onSubmit:()=>s()})]})})})}function ri(e){var t;const n=Oo(null),[r,o]=Eo(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return No((()=>{if(n.current){const e=function(e){const t=Jr.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const r=parseInt(n[1]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function oi(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;const i=Oo(null),[s,a]=Eo("");return qo("div",{ref:i,children:[qo(ei,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),qo("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:e=>a(e.currentTarget.value)}),qo(Qo,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:()=>o(s)})]})}function ii(e){let{question:t,forceDisableHtml:n,appearance:r,onSubmit:o}=e;return qo(Nr,{children:[qo(ei,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),qo(Qo,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>o("link clicked")})]})}function si(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=Eo(null);return qo(Nr,{children:[qo(ei,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),qo("div",{className:"rating-section",children:[qo("div",{className:"rating-options",children:["emoji"===t.display&&qo("div",{className:"rating-options-emoji",children:(3===t.scale?ci:ui).map(((e,t)=>{const n=t+1===l;return qo("button",{className:`ratings-emoji question-${r}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&qo("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:fi(t.scale).map(((e,t)=>qo(ai,{displayQuestionIndex:r,active:l===e,appearance:o,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),qo("div",{className:"rating-text",children:[qo("div",{children:t.lowerBoundLabel}),qo("div",{children:t.upperBoundLabel})]})]}),qo(Qo,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:rn(l)&&!t.optional,appearance:o,onSubmit:()=>i(l)})]})}function ai(e){let{num:t,active:n,displayQuestionIndex:r,appearance:o,setActiveNumber:i}=e;const{textColor:s,ref:a}=ri({appearance:o,defaultTextColor:"black",forceUpdate:n});return qo("button",{ref:a,className:`ratings-number question-${r}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function li(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s=Oo(null),a=Lo((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const r=lo(t,ao(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r})(t)),[t]),[l,c]=Eo(t.type===hr.MultipleChoice?[]:null),[u,d]=Eo(!1),[p,h]=Eo(""),f=t.type===hr.SingleChoice?"radio":"checkbox";return qo("div",{ref:s,children:[qo(ei,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),qo("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let o="choice-option";const i=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),qo("div",{className:o,children:[qo("input",{type:f,id:`surveyQuestion${r}Choice${n}`,name:`question${r}`,value:i,disabled:!i,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===hr.SingleChoice?c(i):t.type===hr.MultipleChoice&&Jt(l)?l.includes(i)?c(l.filter((e=>e!==i))):c([...l,i]):void 0}),qo("label",{htmlFor:`surveyQuestion${r}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?qo(Nr,{children:[qo("span",{children:[s,":"]}),qo("input",{type:"text",id:`surveyQuestion${r}Choice${n}Open`,name:`question${r}`,onInput:e=>{const n=e.currentTarget.value;return t.type===hr.SingleChoice?c(n):t.type===hr.MultipleChoice&&Jt(l)?h(n):void 0}})]}):s}),qo("span",{className:"choice-check",style:{color:"black"},children:Jo})]})}))}),qo(Qo,{text:t.buttonText||"Submit",submitDisabled:(rn(l)||Jt(l)&&!u&&0===l.length||Jt(l)&&u&&!p&&0===l.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:()=>{u&&t.type===hr.MultipleChoice?Jt(l)&&i([...l,p]):i(l)}})]})}const ci=[$o,Yo,Vo],ui=[jo,$o,Yo,Vo,Uo],di=[1,2,3,4,5],pi=[1,2,3,4,5,6,7],hi=[0,1,2,3,4,5,6,7,8,9,10];function fi(e){switch(e){case 5:default:return di;case 7:return pi;case 10:return hi}}const mi=un,gi=fn;class yi{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=gi.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,r=localStorage.getItem("lastSeenSurveyDate");if(n&&r){const e=new Date,t=Math.abs(e.getTime()-new Date(r).getTime());if(Math.ceil(t/864e5)<n)return}const o=(e=>!!localStorage.getItem(po(e))&&!uo(e))(e);if(!o){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const r=Kr.createElement("div");r.className=`PostHogSurvey${t}`;const o=r.attachShadow({mode:"open"});if(e){const t=Object.assign(Kr.createElement("style"),{innerText:e});o.appendChild(t)}return Kr.body.appendChild(r),o})(eo(null==e?void 0:e.appearance),e.id);zr(qo(_i,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=go.createElement("div");n.className=`PostHogWidget${e.id}`;const r=n.attachShadow({mode:"open"}),o=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return r.append(Object.assign(go.createElement("style"),{innerText:o})),go.body.appendChild(n),r}(e),n=eo(e.appearance);t.appendChild(Object.assign(gi.createElement("style"),{innerText:n})),zr(qo(Ii,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&gi.querySelector(e.appearance.widgetSelector);if(n)if(0===gi.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===gi.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var r,o;const t=null===(r=gi.querySelector(`.PostHogWidget${e.id}`))||void 0===r||null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=pr.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{zr(qo(_i,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(rn(e.surveyInFocus)){var n,r,o;if(t.type===pr.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===gi.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(r=t.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=t.appearance)&&void 0!==o&&o.widgetSelector&&e.handleWidgetSelector(t);t.type===pr.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{rn(this.surveyInFocus)||yn.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&yn.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function vi(e){if(!gi||!mi)return;const t=new yi(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function bi(e,t,n,r,o){const[i,s]=Eo(r||0===n),[a,l]=Eo(!1);return No((()=>{if(r||!t)return;const i=()=>{o(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(o(e.id),s(!1))},c=()=>{var n;s(!0),mi.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===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return mi.addEventListener("PHSurveyClosed",i),mi.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),mi.removeEventListener("PHSurveyClosed",i),mi.removeEventListener("PHSurveySent",a)}})():(c(),()=>{mi.removeEventListener("PHSurveyClosed",i),mi.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:i,isSurveySent:a,setIsPopupVisible:s}}function _i(e){var t,n,r,o,i,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:p,isPopup:h}=e;const f=Number.isInteger(d),m=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:g,isSurveySent:y,setIsPopupVisible:v}=bi(a,c,m,f,p),b=y||d===a.questions.length,_=null!==(n=u)&&void 0!==n&&n.left&&sn(null===(r=u)||void 0===r?void 0:r.left)?{left:u.left-40}:{};return f&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),g?qo(fo.Provider,{value:{isPreviewMode:f,previewPageIndex:d,handleCloseSurveyPopup:()=>so(a,c,f),isPopup:h||!1},children:b?qo(ni,{header:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(i=a.appearance)||void 0===i?void 0:i.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||ro,styleOverrides:{...u,..._},onClose:()=>v(!1)}):qo(Ci,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):qo(Nr,{})}function Ci(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,styleOverrides:s}=e;const a=no((null===(t=r.appearance)||void 0===t?void 0:t.backgroundColor)||ro.backgroundColor),[l,c]=Eo({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:p,isPopup:h}=Ro(fo),[f,m]=Eo(d||0),g=Lo((()=>co(r)),[r]);No((()=>{m(null!=d?d:0)}),[d]);return qo("form",{className:"survey-form",style:h?{color:a,borderColor:null===(n=r.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:g.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?f===s:f===t)&&qo("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=r.appearance)||void 0===n?void 0:n.backgroundColor)||ro.backgroundColor}:{},children:[h&&qo(ti,{onClick:()=>p()}),Si({question:e,forceDisableHtml:o,displayQuestionIndex:t,appearance:r.appearance||ro,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(!i)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!i.getNextSurveyStep)return void(o===r.questions.length-1?io({...l,[s]:t},r,i):m(o+1));const a=i.getNextSurveyStep(r,o,t);a===fr.End?io({...l,[s]:t},r,i):m(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function Ii(e){var t,n;let{survey:r,forceDisableHtml:o,posthog:i,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=Eo(!1),[u,d]=Eo({}),p=Oo(null);return No((()=>{var e,t;if(!s&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&p.current){var n;const e=p.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){const e=gi.querySelector(r.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),qo(Nr,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&qo("div",{className:"ph-survey-widget-tab",ref:p,onClick:()=>!s&&c(!l),style:{color:no(r.appearance.widgetColor)},children:[qo("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&qo(_i,{posthog:i,survey:r,forceDisableHtml:o,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const Si=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:r,appearance:o,onSubmit:i}=e;const s={[hr.Open]:oi,[hr.Link]:ii,[hr.Rating]:si,[hr.SingleChoice]:li,[hr.MultipleChoice]:li},a={question:t,forceDisableHtml:n,appearance:o,onSubmit:i},l={[hr.Open]:{},[hr.Link]:{},[hr.Rating]:{displayQuestionIndex:r},[hr.SingleChoice]:{displayQuestionIndex:r},[hr.MultipleChoice]:{displayQuestionIndex:r}};return qo(s[t.type],{...{...a,...l[t.type]}})};function wi(e){return!en(Event)&&ki(e,Event)}function ki(e,t){try{return e instanceof t}catch{return!1}}function Mi(e){return rn(e)||!Qt(e)&&!Kt(e)}function Ti(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function xi(e){return Ti(e,"DOMError")}mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.canActivateRepeatedly=uo,mn.__PosthogExtensions__.generateSurveys=vi,mn.extendPostHogWithSurveys=vi;const Ai=/\(error: (.*)\)/,Ei=50,Ni="?";function Oi(e,t,n,r){const o={platform:"javascript",filename:e,function:"<anonymous>"===t?Ni:t,in_app:!0};return en(n)||(o.lineno=n),en(r)||(o.colno=r),o}const Li=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ri=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Di=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pi=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],o=e.split("\n");for(let e=t;e<o.length;e++){const t=o[e];if(t.length>1024)continue;const i=Ai.test(t)?t.replace(Ai,"$1"):t;if(!i.match(/\S*Error: /)){for(const e of r){const t=e(i);if(t){n.push(t);break}}if(n.length>=Ei)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Ei).map((e=>({...e,filename:e.filename||Zi(t).filename,function:e.function||Ni})))}(n)}}(...[[30,e=>{const t=Li.exec(e);if(t){const[,e,n,r]=t;return Oi(e,Ni,+n,+r)}const n=Ri.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=Di.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Bi(n[1]||Ni,n[2]);return Oi(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=Fi.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Hi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Ni;return[n,e]=Bi(n,e),Oi(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Zi(e){return e[e.length-1]||{}}const Bi=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Ni,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Wi;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Wi||(Wi={}));const Gi=["fatal","error","warning","log","info","debug"],qi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Vi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",r=function(e){if(e&&Yi.test(e.message))return 1;return 0}(e);try{const e=Pi(n,r);return e.slice(0,e.length-t)}catch{}return[]}const Yi=/Minified React error #\d+;/i;function $i(e,t){var n,r;const o=Vi(e),i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:o,type:"raw"},mechanism:{handled:i,synthetic:s}}],$exception_level:"error"}}function ji(e,t){var n,r,o;const i=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(o=null==t?void 0:t.defaultExceptionType)&&void 0!==o?o:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:i,synthetic:s}};if(null!=t&&t.syntheticException){const e=Vi(t.syntheticException,1);e.length&&(a.stacktrace={frames:e,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Ui(e){return tn(e)&&!nn(e)&&Gi.indexOf(e)>=0}function zi(e,t){var n,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:wi(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length||r.length<=t?r:`${r.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:o,synthetic:i}};if(null!=t&&t.syntheticException){const e=Vi(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e,type:"raw"})}return{$exception_list:[l],$exception_level:Ui(e.level)?e.level:"error"}}function Xi(e,t){let[n,r,o,i,s]=e,a={$exception_list:[]};const l=s||n;if(xi(l)||function(e){return Ti(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=$i(l,t);else{const n=e.name||(xi(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n,o=xi(e)?"DOMError":"DOMException";a=ji(r,{...t,overrideExceptionType:o,defaultExceptionMessage:r})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Ti(e,"ErrorEvent")}(l)&&l.error)return $i(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return ki(e,Error)}}(l))return $i(l,t);if(function(e){return Ti(e,"Object")}(l)||wi(l)){return zi(l,t)}if(en(s)&&tn(n)){let e="Error",r=n;const o=n.match(qi);return o&&(e=o[1],r=o[2]),ji(r,{...t,overrideExceptionType:e,defaultExceptionMessage:r})}return ji(l,t)}function Ji(e){let[t]=e;const n=function(e){if(Mi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return Mi(n)?ji(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Xi([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const Ki={wrapOnError:e=>{const t=un;t||yn.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const s=Xi(o);return e(s),null!==(t=null==n?void 0:n(...o))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=un;t||yn.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];const a=Ji(i);return e(a),null!==(r=null==n?void 0:n.apply(t,i))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.errorWrappingFunctions=Ki,mn.__PosthogExtensions__.parseErrorAsProperties=Xi,mn.posthogErrorWrappingFunctions=Ki,mn.parseErrorAsProperties=Xi;const Qi=(e,t)=>{const{sessionId:n,windowId:r}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",r)};mn.__PosthogExtensions__=mn.__PosthogExtensions__||{};const es={_patchFetch:e=>Un(un,"fetch",(t=>async function(n,r){const o=new Request(n,r);return Qi(e,o),t(o)})),_patchXHR:e=>Un(un.XMLHttpRequest.prototype,"open",(t=>function(n,r){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(r);return Qi(e,a),t.call(this,n,a.url,o,i,s)}))};mn.__PosthogExtensions__.tracingHeadersPatchFns=es,mn.postHogTracingHeadersPatchFns=es;var ts,ns,rs,os=-1,is=function(e){addEventListener("pageshow",(function(t){t.persisted&&(os=t.timeStamp,e(t))}),!0)},ss=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},as=function(){var e=ss();return e&&e.activationStart||0},ls=function(e,t){var n=ss(),r="navigate";return os>=0?r="back-forward-cache":n&&(document.prerendering||as()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.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:r}},cs=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},us=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ds=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ps=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},hs=function(e){var t=!1;return function(){t||(e(),t=!0)}},fs=-1,ms=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},gs=function(e){"hidden"===document.visibilityState&&fs>-1&&(fs="visibilitychange"===e.type?e.timeStamp:0,vs())},ys=function(){addEventListener("visibilitychange",gs,!0),addEventListener("prerenderingchange",gs,!0)},vs=function(){removeEventListener("visibilitychange",gs,!0),removeEventListener("prerenderingchange",gs,!0)},bs=function(){return fs<0&&(fs=ms(),ys(),is((function(){setTimeout((function(){fs=ms(),ys()}),0)}))),{get firstHiddenTime(){return fs}}},_s=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Cs=[1800,3e3],Is=function(e,t){t=t||{},_s((function(){var n,r=bs(),o=ls("FCP"),i=cs("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-as(),0),o.entries.push(e),n(!0)))}))}));i&&(n=us(e,o,Cs,t.reportAllChanges),is((function(r){o=ls("FCP"),n=us(e,o,Cs,t.reportAllChanges),ds((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Ss=[.1,.25],ws=[2500,4e3],ks={},Ms=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ts=function(e){if("loading"===document.readyState)return"loading";var t=Ms();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"},xs=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},As=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:xs(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},Es=-1,Ns=function(e,t){var n=Ms(),r="navigate";return Es>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=Ms();return e&&e.activationStart||0}()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Os=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Ls=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Rs=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ds=0,Fs=1/0,Hs=0,Ps=function(e){e.forEach((function(e){e.interactionId&&(Fs=Math.min(Fs,e.interactionId),Hs=Math.max(Hs,e.interactionId),Ds=Hs?(Hs-Fs)/7+1:0)}))},Zs=function(){"interactionCount"in performance||ts||(ts=Os("event",Ps,{type:"event",buffered:!0,durationThreshold:0}))},Bs=[],Ws=new Map,Gs=0,qs=function(){return(ts?Ds:performance.interactionCount||0)-Gs},Vs=[],Ys=function(e){if(Vs.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Bs[Bs.length-1],n=Ws.get(e.interactionId);if(n||Bs.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ws.set(r.id,r),Bs.push(r)}Bs.sort((function(e,t){return t.latency-e.latency})),Bs.length>10&&Bs.splice(10).forEach((function(e){return Ws.delete(e.id)}))}}},$s=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Rs(e)),n},js=[200,500],Us=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;Zs();var r,o=Ns("INP"),i=function(e){$s((function(){e.forEach(Ys);var t,n=(t=Math.min(Bs.length-1,Math.floor(qs()/50)),Bs[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},s=Os("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ls(e,o,js,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Rs((function(){i(s.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Es=t.timeStamp,e(t))}),!0)}((function(){Gs=0,Bs.length=0,Ws.clear(),o=Ns("INP"),r=Ls(e,o,js,t.reportAllChanges)})))})))},zs=[],Xs=[],Js=new WeakMap,Ks=new Map,Qs=-1,ea=function(e){zs=zs.concat(e),ta()},ta=function(){Qs<0&&(Qs=$s(na))},na=function(){Ks.size>10&&Ks.forEach((function(e,t){Ws.has(t)||Ks.delete(t)}));var e=Bs.map((function(e){return Js.get(e.entries[0])})),t=Xs.length-50;Xs=Xs.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Xs.length;r++){var o=Xs[r];ra(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var s=zs[zs.length-1-i];if(!s||s.startTime<rs)break;n.add(s)}zs=Array.from(n),Qs=-1};Vs.push((function(e){e.interactionId&&e.target&&!Ks.has(e.interactionId)&&Ks.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;rs=Math.max(rs,e.processingEnd);for(var r=Xs.length-1;r>=0;r--){var o=Xs[r];if(Math.abs(n-o.renderTime)<=8){(t=o).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:n,entries:[e]},Xs.push(t)),(e.interactionId||"first-input"===e.entryType)&&Js.set(e,t),ta()}));var ra=function(e,t){for(var n,r=[],o=0;n=zs[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r};const oa={onLCP:function(e,t){t=t||{},_s((function(){var n,r=bs(),o=ls("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-as(),0),o.entries=[e],n())}))},s=cs("largest-contentful-paint",i);if(s){n=us(e,o,ws,t.reportAllChanges);var a=hs((function(){ks[o.id]||(i(s.takeRecords()),s.disconnect(),ks[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=hs(e),"hidden"===document.visibilityState?e():(n=t(e),ps(e)),n}(a)}),!0)})),ps(a),is((function(r){o=ls("LCP"),n=us(e,o,ws,t.reportAllChanges),ds((function(){o.value=performance.now()-r.timeStamp,ks[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Is(hs((function(){var n,r=ls("CLS",0),o=0,i=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},a=cs("layout-shift",s);a&&(n=us(e,r,Ss,t.reportAllChanges),ps((function(){s(a.takeRecords()),n(!0)})),is((function(){o=0,r=ls("CLS",0),n=us(e,r,Ss,t.reportAllChanges),ds((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Is,onINP:function(e,t){ns||(ns=Os("long-animation-frame",ea)),Us((function(t){var n=function(e){var t=e.entries[0],n=Js.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=ra(t.startTime,o),a=e.entries.find((function(e){return e.target})),l=a&&a.target||Ks.get(t.interactionId),c=[t.startTime+t.duration,o].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:As(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:i,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(u-o,0),loadState:Ts(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};function ia(e,t){return t.length>e?t.slice(0,e)+"...":t}function sa(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!Tn(t));return t}function aa(e,t,n,r){const o=e.tagName.toLowerCase(),i={tag_name:o};On.indexOf(o)>-1&&!n&&("a"===o.toLowerCase()||"button"===o.toLowerCase()?i.$el_text=ia(1024,Gn(e)):i.$el_text=ia(1024,Nn(e)));const s=En(e);s.length>0&&(i.classes=s.filter((function(e){return""!==e}))),Cn(e.attributes,(function(n){var o;if((!Rn(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&Wn(n.value)&&(o=n.name,!tn(o)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7)))){let e=n.value;"class"===n.name&&(e=An(e).join(" ")),i["attr__"+n.name]=ia(1024,e)}}));let a=1,l=1,c=e;for(;c=sa(c);)a++,c.tagName===e.tagName&&l++;return i.nth_child=a,i.nth_of_type=l,i}function la(e,t){var n,r;let{e:o,maskAllElementAttributes:i,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t;const c=[e];let u=e;for(;u.parentNode&&!xn(u,"body");)(d=u.parentNode)&&11===d.nodeType?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d;const p=[],h={};let f,m=!1,g=!1;if(Cn(c,(e=>{const t=Ln(e);"a"===e.tagName.toLowerCase()&&(m=e.getAttribute("href"),m=t&&m&&Wn(m)&&m);Sn(En(e),"ph-no-capture")&&(g=!0),p.push(aa(e,i,s,a));const n=function(e){if(!Ln(e))return{};const t={};return Cn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Wn(r)&&(t[n]=r)}})),t}(e);In(h,n)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=Gn(e):p[0].$el_text=Nn(e)),m){var y,v;p[0].attr__href=m;const e=null===(y=(e=>{const t=null==fn?void 0:fn.createElement("a");return en(t)?null:(t.href=e,t)})(m))||void 0===y?void 0:y.host,t=null==un||null===(v=un.location)||void 0===v?void 0:v.host;e&&t&&e!==t&&(f=m)}return{props:In({$event_type:o.type,$ce_version:1},l?{$elements_chain:Vn(p)}:{$elements:p},null!==(n=p[0])&&void 0!==n&&n.$el_text?{$el_text:null===(r=p[0])||void 0===r?void 0:r.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},h)}}mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.postHogWebVitalsCallbacks=oa,mn.postHogWebVitalsCallbacks=oa;const ca={element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500};function ua(e){const t=function(e){return en(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}function da(e,t){return sn(e)&&e>=t}class pa{_clicks=[];asRequiredConfig(e){var t,n,r,o;return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:ca.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:ca.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==r?r:ca.selection_change_threshold_ms,mutation_threshold_ms:null!==(o=null==e?void 0:e.mutation_threshold_ms)&&void 0!==o?o:ca.mutation_threshold_ms}}constructor(e,t){this.instance=e,this._config=this.asRequiredConfig(t)}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){this._mutationObserver||(this._mutationObserver=new MutationObserver((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0}))}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,mn.removeEventListener("click",this._onClick),mn.removeEventListener("scroll",this._onScroll,!0),mn.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){mn.addEventListener("click",this._onClick)}_onClick=e=>{const t=ua(e);rn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&en(this._checkClickTimer)&&(this._checkClickTimer=mn.setTimeout((()=>{this._checkClicks()}),1e3))};_startScrollObserver(){mn.addEventListener("scroll",this._onScroll,!0)}_onScroll=()=>{const e=Date.now();e%50==0&&this._clicks.forEach((t=>{en(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))};_startSelectionChangedObserver(){mn.addEventListener("selectionchange",this._onSelectionChange)}_onSelectionChange=()=>{this._lastSelectionChanged=Date.now()};_ignoreClick(e){if(!e)return!0;if((t=e.node).id===Mn||null!==(n=t.closest)&&void 0!==n&&n.call(t,"#"+Mn))return!0;var t,n;const r=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!xn(e.node,"html")&&Tn(e.node)&&!On.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(!this._clicks.length)return;clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;const e=this._clicks;this._clicks=[];for(const n of e){var t;n.mutationDelayMs=null!==(t=n.mutationDelayMs)&&void 0!==t?t:this._lastMutation&&n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp,n.selectionChangedDelayMs=this._lastSelectionChanged&&n.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-n.timestamp:void 0;const e=da(n.scrollDelayMs,this._config.scroll_threshold_ms),r=da(n.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=da(n.mutationDelayMs,this._config.mutation_threshold_ms),i=da(n.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),s=sn(n.scrollDelayMs)&&n.scrollDelayMs<this._config.scroll_threshold_ms,a=sn(n.mutationDelayMs)&&n.mutationDelayMs<this._config.mutation_threshold_ms,l=sn(n.selectionChangedDelayMs)&&n.selectionChangedDelayMs<this._config.selection_change_threshold_ms;s||a||l||(e||o||i||r?this._captureDeadClick(n,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:n.timestamp,$dead_click_scroll_timeout:e,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:i,$dead_click_selection_changed_timeout:r}):n.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(n))}this._clicks.length&&en(this._checkClickTimer)&&(this._checkClickTimer=mn.setTimeout((()=>{this._checkClicks()}),1e3))}_captureDeadClick(e,t){this.instance.capture("$dead_click",{...t,...la(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).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)})}}mn.__PosthogExtensions__=mn.__PosthogExtensions__||{},mn.__PosthogExtensions__.initDeadClicksAutocapture=e=>new pa(e)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map