posthog-js 1.184.2 → 1.185.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.
@@ -1,4 +1,4 @@
1
- !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i),i=Object.defineProperty,r=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),o=(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))(o||{});const s={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};function c(e){if(l[e])return l[e];const t=globalThis[e],n=t.prototype,i=e in s?s[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in a?a[e]:void 0,c=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&c)return l[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?l[e]=o:n}catch{return n}}const u={};function d(e,t,n){var i;const r=`${e}.${String(n)}`;if(u[r])return u[r].call(t);const o=c(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(u[r]=s,s.call(t)):t[n]}const h={};function p(e,t,n){const i=`${e}.${String(n)}`;if(h[i])return h[i].bind(t);const r=c(e)[n];return"function"!=typeof r?t[n]:(h[i]=r,r.bind(t))}const g={childNodes:function(e){return d("Node",e,"childNodes")},parentNode:function(e){return d("Node",e,"parentNode")},parentElement:function(e){return d("Node",e,"parentElement")},textContent:function(e){return d("Node",e,"textContent")},contains:function(e,t){return p("Node",e,"contains")(t)},getRootNode:function(e){return p("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?d("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?d("Element",e,"shadowRoot"):null},querySelector:function(e,t){return d("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return d("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return c("MutationObserver").constructor}};function f(e){return e.nodeType===e.ELEMENT_NODE}function m(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function _(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function v(e){try{const n=e.rules||e.cssRules;if(!n)return null;const i=Array.from(n,(t=>y(t,e.href))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function y(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=v(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(n){t=e.cssText}return e.styleSheet.href?A(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?A(n,t):n}}function b(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let w=class{constructor(){r(this,"idNodeMap",new Map),r(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 S(e){let{element:t,maskInputOptions:n,tagName:i,type:r,value:o,maskInputFn:s}=e,a=o||"";const l=r&&C(r);return(n[i.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function C(e){return e.toLowerCase()}const I="__rrweb_original__";function k(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?C(t):null}function E(e,t){var n;let i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==r?void 0:r[1])&&void 0!==n?n:null}const x=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,T=/^(?:[a-z+]+:)?\/\//i,M=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(x,((e,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return e;if(T.test(a)||M.test(a))return`url(${l}${a}${l})`;if(R.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})`}))}let N=1;const F=new RegExp("[^a-z0-9-_:]"),O=-2;function L(){return N++}let P,D;const $=/^[^ \t\n\r\u000c]+/,B=/^[, \t\n\r\u000c]+/;const q=new WeakMap;function H(e,t){return t&&""!==t.trim()?V(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function V(e,t){let n=q.get(e);if(n||(n=e.createElement("a"),q.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Z(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?H(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function i(e){let i;const r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(B),!(n>=t.length);){let o=i($);if(","===o.slice(-1))o=H(e,o.substring(0,o.length-1)),r.push(o);else{let i="";o=H(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((o+i).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,r.push((o+i).trim());break}"("===e&&(s=!0)}i+=e,n+=1}}}return r.join(", ")}(e,i):"style"===n?A(i,V(e)):"object"===t&&"data"===n?H(e,i):i:H(e,i):i}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function U(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&U(g.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&U(g.parentNode(e),t,n)}function z(e,t,n,i){let r;if(f(e)){if(r=e,!g.childNodes(r).length)return!1}else{if(null===g.parentElement(e))return!1;r=g.parentElement(e)}try{if("string"==typeof t){if(i){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(U(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(e){}return!1}function j(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:o.Document,childNodes:[],compatMode:e.compatMode}:{type:o.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:f}=t,m=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 i=e.classList[n];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,r),_=function(e){if(e instanceof HTMLFormElement)return"form";const t=C(e.tagName);return F.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const i=e.attributes[t];G(_,i.name,i.value)||(y[i.name]=Z(n,_,C(i.name),i.value))}if("link"===_&&s){const t=e.href;let i=b(n,t);if(!i&&t.includes(".css")){i=b(n,window.location.origin+"/"+t.replace(window.location.href,""))}let r=null;i&&(r=v(i)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===_&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){const t=v(e.sheet);t&&(y._cssText=t)}if("input"===_||"textarea"===_||"select"===_){const t=e.value,n=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=S({element:e,type:k(e),tagName:_,value:t,maskInputOptions:a,maskInputFn:l}):n&&(y.checked=n)}"option"===_&&(e.selected&&!a.select?y.selected=!0:delete y.selected);"dialog"===_&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===_&&d)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 i=0;i<e.height;i+=50){const r=t.getImageData,o=I in r?r[I]:r;if(new Uint32Array(o.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=e.width,i.height=e.height;t!==i.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===_&&u){P||(P=n.createElement("canvas"),D=P.getContext("2d"));const t=e,i=t.currentSrc||t.getAttribute("src")||"<unknown-src>",r=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{P.width=t.naturalWidth,P.height=t.naturalHeight,D.drawImage(t,0,0),y.rr_dataURL=P.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${i}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(r?y.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===_||"video"===_){const t=y;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}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==_||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let E;try{customElements.get(_)&&(E=!0)}catch(e){}return{type:o.Element,tagName:_,attributes:y,childNodes:[],isSVG:W(e)||void 0,needBlock:m,rootId:f,isCustom:E}}(e,{doc:n,blockClass:r,blockSelector:s,inlineStylesheet:l,maskInputOptions:c,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_,rootId:y});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:i,maskTextFn:r,rootId:s}=t,a=g.parentNode(e),l=a&&a.tagName;let c=g.textContent(e);const u="STYLE"===l||void 0,d="SCRIPT"===l||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null==(n=a.sheet)?void 0:n.cssRules)&&(c=v(a.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}c=A(c,V(t.doc))}d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&i&&(c=r?r(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:o.Text,textContent:c||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:u,rootId:y});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:o.Comment,textContent:g.textContent(e)||"",rootId:y};default:return!1}}function Y(e){return null==e?"":e.toLowerCase()}function X(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:M=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:A=!0}=t;if(!R){R=z(e,a,l,void 0===R)}const N=j(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:T,newlyAddedElement:M});if(!N)return console.warn(e,"not serialized"),null;let F;F=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===o.Comment)return!0;if(e.type===o.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===E(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}(N,v)&&(A||N.type!==o.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?L():O;const P=Object.assign(N,{id:F});if(i.add(e,P),F===O)return null;S&&S(e);let D=!c;if(P.type===o.Element){D=D&&!P.needBlock,delete P.needBlock;const t=g.shadowRoot(e);t&&_(t)&&(P.isShadowHost=!0)}if((P.type===o.Document||P.type===o.Element)&&D){v.headWhitespace&&P.type===o.Element&&"head"===P.tagName&&(A=!1);const t={doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T};if(P.type===o.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(g.childNodes(e))){const e=X(n,t);e&&P.childNodes.push(e)}let m=null;if(f(e)&&(m=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(m))){const n=X(e,t);n&&(_(m)&&(n.isShadow=!0),P.childNodes.push(n))}}const $=g.parentNode(e);return $&&m($)&&_($)&&(P.isShadow=!0),P.type===o.Element&&"iframe"===P.tagName&&function(e,t,n){const i=e.contentWindow;if(!i)return;let r,o=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){const i=setTimeout((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}const s="about:blank";if(i.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&&C){const n=X(t,{doc:t,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});n&&C(e,n)}}),I),P.type===o.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===E(P.attributes.href))&&function(e,t,n){let i,r=!1;try{i=e.sheet}catch(e){return}if(i)return;const o=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),r=!0,t()}))}(e,(()=>{if(k){const t=X(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});t&&k(e,t)}}),x),P}let J=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};const K={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Q={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ee={};function te(e){if(ee[e])return ee[e];const t=globalThis[e],n=t.prototype,i=e in K?K[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Q?Q[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return ee[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?ee[e]=o:n}catch{return n}}const ne={};function ie(e,t,n){var i;const r=`${e}.${String(n)}`;if(ne[r])return ne[r].call(t);const o=te(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(ne[r]=s,s.call(t)):t[n]}const re={};function oe(e,t,n){const i=`${e}.${String(n)}`;if(re[i])return re[i].bind(t);const r=te(e)[n];return"function"!=typeof r?t[n]:(re[i]=r,r.bind(t))}function se(){return te("MutationObserver").constructor}const ae={childNodes:function(e){return ie("Node",e,"childNodes")},parentNode:function(e){return ie("Node",e,"parentNode")},parentElement:function(e){return ie("Node",e,"parentElement")},textContent:function(e){return ie("Node",e,"textContent")},contains:function(e,t){return oe("Node",e,"contains")(t)},getRootNode:function(e){return oe("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ie("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ie("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ie("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ie("Element",e,"querySelectorAll")(t)},mutationObserver:se};function le(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}const ce="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 ue={map:{},getId:()=>(console.error(ce),-1),getNode:()=>(console.error(ce),null),removeNodeFromMap(){console.error(ce)},has:()=>(console.error(ce),!1),reset(){console.error(ce)}};function de(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}}function he(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const o=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>he(e,t,o||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ue=new Proxy(ue,{get:(e,t,n)=>("map"===t&&console.error(ce),Reflect.get(e,t,n))}));let ge=Date.now;function fe(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ae.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=ae.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}}function me(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ve(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ae.parentElement(e)}function ye(e,t,n,i){if(!e)return!1;const r=ve(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(U(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function be(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===O}function we(e,t){if(m(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const i=ae.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||we(i,t))}function Se(e){return Boolean(e.changedTouches)}function Ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ie(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ke(e){return!!e&&(e instanceof J&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ae.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ge=()=>(new Date).getTime());let Ee=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 xe(e){var t;let n=null;return"getRootNode"in e&&(null==(t=ae.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ae.host(ae.getRootNode(e))&&(n=ae.host(ae.getRootNode(e))),n}function Te(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=xe(n);)n=t;return n}(e);return ae.contains(t,n)}function Me(e){const t=e.ownerDocument;return!!t&&(ae.contains(t,e)||Te(e))}var Re=(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))(Re||{}),Ae=(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))(Ae||{}),Ne=(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))(Ne||{}),Fe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Fe||{}),Oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Oe||{}),Le=(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))(Le||{});function Pe(e){return"__ln"in e}class De{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&&Pe(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&&Pe(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 $e=(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 De,i=e=>{let t=e,n=O;for(;n===O;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{const o=ae.parentNode(r);if(!o||!Me(r)||"TEXTAREA"===o.tagName)return;const s=m(o)?this.mirror.getId(xe(r)):this.mirror.getId(o),a=i(r);if(-1===s||-1===a)return n.addNode(r);const l=X(r,{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=>{Ce(e,this.mirror)&&this.iframeManager.addIframe(e),Ie(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ke(r)&&this.shadowDomManager.addShadowRoot(ae.shadowRoot(r),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:s,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)He(this.removes,e,this.mirror)&&!this.movedSet.has(ae.parentNode(e))||r(e);for(const e of this.addedSet)We(this.droppedSet,e)||He(this.removes,e,this.mirror)?We(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(ae.parentNode(o.value)),n=i(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(ae.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,i=ae.parentNode(t);if(i&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ae.host(i);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),r(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,n=ae.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{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),i=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(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(ae.childNodes(e),(e=>ae.textContent(e)||"")).join("")})),n(this,"processMutation",(e=>{if(!be(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ae.textContent(e.target);ye(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,ve(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){const e=k(t);i=S({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(ye(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let r=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(t.contentDocument)return;n="rr_src"}if(r||(r={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(e.target,r)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!G(t.tagName,n))if(r.attributes[n]=Z(this.doc,C(t.tagName),C(n),i),"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 i=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);i!==n.style.getPropertyValue(e)||o!==n.style.getPropertyPriority(e)?r.styleDiff[e]=""===o?i:[i,o]:r._unchangedStyles[e]=[i,o]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":if(ye(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),i=m(e.target)?this.mirror.getId(ae.host(e.target)):this.mirror.getId(e.target);ye(e.target,this.blockClass,this.blockSelector,!1)||be(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(qe(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||we(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$e(n,i)]?qe(this.movedSet,t):this.removes.push({parentId:i,id:n,isShadow:!(!m(e.target)||!_(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(be(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[$e(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ye(e,this.blockClass,this.blockSelector,!1)||(ae.childNodes(e).forEach((e=>this.genAdds(e))),ke(e)&&ae.childNodes(ae.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function qe(e,t){e.delete(t),ae.childNodes(t).forEach((t=>qe(e,t)))}function He(e,t,n){return 0!==e.length&&function(e,t,n){let i=ae.parentNode(t);for(;i;){const t=n.getId(i);if(e.some((e=>e.id===t)))return!0;i=ae.parentNode(i)}return!1}(e,t,n)}function We(e,t){return 0!==e.size&&Ve(e,t)}function Ve(e,t){const n=ae.parentNode(t);return!!n&&(!!e.has(n)||Ve(e,n))}let Ze;const Ge=e=>{if(!Ze)return e;return function(){try{return e(...arguments)}catch(e){if(Ze&&!0===Ze(e))return;throw e}}},Ue=[];function ze(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 je(e,t){const n=new Be;Ue.push(n),n.init(e);const i=new(se())(Ge(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ye(e){let{mouseInteractionCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,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(Ne).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=C(e);const a=(e=>n=>{const s=ze(n);if(ye(s,r,o,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=Fe.Mouse;break;case"touch":a=Fe.Touch;break;case"pen":a=Fe.Pen}a===Fe.Touch?Ne[e]===Ne.MouseDown?l="TouchStart":Ne[e]===Ne.MouseUp&&(l="TouchEnd"):Fe.Pen}else Se(n)&&(a=Fe.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Fe.Touch||l.startsWith("Mouse")&&a===Fe.Mouse)&&(a=null)):Ne[e]===Ne.Click&&(a=c,c=null);const u=Se(n)?n.changedTouches[0]:n;if(!u)return;const d=i.getId(s),{clientX:h,clientY:p}=u;Ge(t)({type:Ne[l],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(Ne[e]){case Ne.MouseDown:case Ne.MouseUp:s=s.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}l.push(le(s,a,n))})),Ge((()=>{l.forEach((e=>e()))}))}function Xe(e){let{scrollCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,sampling:s}=e;return le("scroll",Ge(de(Ge((e=>{const s=ze(e);if(!s||ye(s,r,o,!0))return;const a=i.getId(s);if(s===n&&n.defaultView){const e=fe(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 Je=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Qe(e){return function(e,t){if(it("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||it("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||it("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||it("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 et(e,t,n){let i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function tt(e,t){let{mirror:n,stylesheetManager:i}=e;var r,o,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(ae.host(t));const l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(s=null==(o=t.ownerDocument)?void 0:o.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{i.adoptStyleSheets(e,a)}catch(e){}return n}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let i;!function(e,t){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),r(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...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),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(i=je(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:i,mirror:r}=e;if(!1===n.mousemove)return()=>{};const o="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=de(Ge((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=Ge(de(Ge((e=>{const t=ze(e),{clientX:n,clientY:i}=Se(e)?e.changedTouches[0]:e;a||(a=ge()),l.push({x:n,y:i,id:r.getId(t),timeOffset:ge()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ae.Drag:e instanceof MouseEvent?Ae.MouseMove:Ae.TouchMove)})),o,{trailing:!1})),d=[le("mousemove",u,i),le("touchmove",u,i),le("drag",u,i)];return Ge((()=>{d.forEach((e=>e()))}))}(e),o=Ye(e),s=Xe(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:i}=t,r=-1,o=-1;return le("resize",Ge(de(Ge((()=>{const e=me(),t=_e();r===e&&o===t||(n({width:Number(t),height:Number(e)}),r=e,o=t)})),200)),i)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function h(e){let t=ze(e);const i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=ae.parentElement(t)),!t||!u||Je.indexOf(u)<0||ye(t,r,o,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let h=t.value,g=!1;const f=k(t)||"";"radio"===f||"checkbox"===f?g=t.checked:(l[u.toLowerCase()]||l[f])&&(h=S({element:t,maskInputOptions:l,tagName:u,type:f,value:h,maskInputFn:c})),p(t,d?{text:h,isChecked:g,userTriggered:i}:{text:h,isChecked:g});const m=t.name;"radio"===f&&m&&g&&n.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==t){const t=e.value;p(e,d?{text:t,isChecked:!g,userTriggered:!1}:{text:t,isChecked:!g})}}))}function p(e,n){const r=Ke.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){Ke.set(e,n);const r=i.getId(e);Ge(t)({...n,id:r})}}const g=("last"===u.input?["change"]:["input","change"]).map((e=>le(e,Ge(h),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>he(e[0],e[1],{set(){Ge(h)({target:this,isTrusted:!1})}},!1,f)))),Ge((()=>{g.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:i,mirror:r,sampling:o,doc:s}=e;const a=Ge((e=>de(Ge((o=>{const s=ze(o);if(!s||ye(s,n,i,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:r.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),o.media||500))),l=[le("play",a(Le.Play),s),le("pause",a(Le.Pause),s),le("seeked",a(Le.Seeked),s),le("volumechange",a(Le.VolumeChange),s),le("ratechange",a(Le.RateChange),s)];return Ge((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:i,stylesheetManager:r}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};const s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length;const i=`${e} { ${t} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const a=o.CSSStyleSheet.prototype.deleteRule;let l,c;o.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(l=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));const u={};rt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(rt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),rt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),rt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t.parentStyleSheet,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Qe(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t.parentStyleSheet,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Qe(t),s]}]}),e.apply(t,o)}))})})),Ge((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=a,l&&(o.CSSStyleSheet.prototype.replace=l),c&&(o.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=tt(e,e.doc),h=function(e,t){let{styleDeclarationCb:n,mirror:i,ignoreCSSAttributes:r,stylesheetManager:o}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ge(((e,t,s)=>{var l;const[c,u,d]=s;if(r.has(c))return a.apply(t,[c,u,d]);const{id:h,styleId:p}=et(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:Qe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,s)=>{var a;const[c]=s;if(r.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=et(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Qe(t.parentRule)}),e.apply(t,s)}))}),Ge((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(p=function(e){let{fontCb:t,doc:n}=e;const i=n.defaultView;if(!i)return()=>{};const r=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,n){const i=new s(e,t,n);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};const a=pe(n.fonts,"add",(function(e){return function(n){return setTimeout(Ge((()=>{const e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{i.FontFace=s})),r.push(a),Ge((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=e;let s=!0;const a=Ge((()=>{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 o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=o;ye(s,i,r,!0)||ye(c,i,r,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}o({ranges:a})}));return a(),le("selectionchange",a)}(e),f=function(e){let{doc:t,customElementCb:n}=e;const i=t.defaultView;return i&&i.customElements?pe(i.customElements,"define",(function(e){return function(t,i,r){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,i,r])}})):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Ge((()=>{Ue.forEach((e=>e.reset())),null==i||i.disconnect(),r(),o(),s(),a(),l(),c(),u(),d(),h(),p(),g(),f(),m.forEach((e=>e()))}))}function it(e){return void 0!==window[e]}function rt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ot{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,i){const r=n||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,i)))}getRemoteId(e,t,n){const i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=i.get(t);return r||-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 st{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new ot(L)),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 ot(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,i;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==(i=this.loadListener)||i.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 i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Re.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:Re.IncrementalSnapshot,data:{source:Ae.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Re.Meta:case Re.Load:case Re.DomContentLoaded:return!1;case Re.Plugin:return t;case Re.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Re.IncrementalSnapshot:switch(t.data.source){case Ae.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 Ae.Drag:case Ae.TouchMove:case Ae.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ae.ViewportResize:return!1;case Ae.MediaInteraction:case Ae.MouseInteraction:case Ae.Scroll:case Ae.CanvasMutation:case Ae.Input:return this.replaceIds(t.data,e,["id"]),t;case Ae.StyleSheetRule:case Ae.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ae.Font:return t;case Ae.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ae.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,i){for(const r of i)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));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===o.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class at{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(!_(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=je({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Xe({...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(ae.host(e))),this.restoreHandlers.push(tt({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(pe(e.prototype,"attachShadow",(function(e){return function(i){const r=e.call(this,i),o=ae.shadowRoot(this);return o&&Me(this)&&n.addShadowRoot(o,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ut=0;ut<64;ut++)ct[lt.charCodeAt(ut)]=ut;const dt=new Map;const ht=(e,t,n)=>{if(!e||!ft(e,t)&&"object"!=typeof e)return;const i=function(e,t){let n=dt.get(e);return n||(n=new Map,dt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r};function pt(e,t,n){if(e instanceof Array)return e.map((e=>pt(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),i=n.length,r="";for(t=0;t<i;t+=3)r+=lt[n[t]>>2],r+=lt[(3&n[t])<<4|n[t+1]>>4],r+=lt[(15&n[t+1])<<2|n[t+2]>>6],r+=lt[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[pt(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:[pt(e.data,t,n),e.width,e.height]}}if(ft(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ht(e,t,n)}}return e}const gt=(e,t,n)=>e.map((e=>pt(e,t,n))),ft=(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 mt(e,t,n,i){const r=[];try{const o=pe(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!ye(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),i&&["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,[r,...s])}}));r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function _t(e,t,n,i,r,o){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=pe(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(ht(u,o,this),"tagName"in this.canvas&&!ye(this.canvas,i,r,!0)){const e=gt(a,o,this),i={type:t,property:l,args:e};n(this.canvas,i)}return u}}));s.push(a)}catch{const i=he(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(i)}return s}const vt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",yt="undefined"!=typeof window&&window.Blob&&new Blob([(bt=vt,Uint8Array.from(atob(bt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var bt;function wt(e){let t;try{if(t=yt&&(window.URL||window.webkitURL).createObjectURL(yt),!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,"+vt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class St{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:i,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(i,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,i,r,o,{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,i,r){const o=mt(t,n,i,!0),s=new Map,a=new wt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:r,height:o}=e.data;this.mutationCb({id:t,type:Oe["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],r=t=>{t.querySelectorAll("canvas").forEach((t=>{ye(t,n,i,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&r(e.shadowRoot)}))};return r(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 i=e.clientWidth||e.width,o=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:i,resizeHeight:o});a.postMessage({id:n,bitmap:l,width:i,height:o,dataURLOptions:r.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=mt(e,t,n,!1),r=function(e,t,n,i){const r=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=pe(t.CanvasRenderingContext2D.prototype,s,(function(r){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ye(this.canvas,n,i,!0)||setTimeout((()=>{const n=gt(a,t,this);e(this.canvas,{type:Oe["2D"],property:s,args:n})}),0),r.apply(this,a)}}));r.push(o)}catch{const n=he(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Oe["2D"],property:s,args:[t],setter:!0})}});r.push(n)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,i){const r=[];return r.push(..._t(t.WebGLRenderingContext.prototype,Oe.WebGL,e,n,i,t)),void 0!==t.WebGL2RenderingContext&&r.push(..._t(t.WebGL2RenderingContext.prototype,Oe.WebGL2,e,n,i,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{i(),r(),o()}}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 i=n.map((e=>{const{type:t,...n}=e;return n})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}class Ct{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new Ee),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:[]},i=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,n)=>({rule:y(e,t.href),index:n})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class It{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 kt,Et,xt,Tt=!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 Mt=new w;function Rt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:N}=e;Ze=N;const F=!I||window.parent===window;let O=!1;if(!F)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!O)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),Mt.reset();const L=!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},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let D;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let $=0;const B=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!O&&(e=_(e)),e};kt=(e,r)=>{var o;const s=e;if(s.timestamp=ge(),!(null==(o=Ue[0])?void 0:o.isFrozen())||s.type===Re.FullSnapshot||s.type===Re.IncrementalSnapshot&&s.data.source===Ae.Mutation||Ue.forEach((e=>e.unfreeze())),F)null==t||t(B(s),r);else if(O){const e={type:"rrweb",event:B(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(e,"*")}if(s.type===Re.FullSnapshot)D=s,$=0;else if(s.type===Re.IncrementalSnapshot){if(s.data.source===Ae.Mutation&&s.data.isAttachIframe)return;$++;const e=i&&$>=i,t=n&&s.timestamp-D.timestamp>n;(e||t)&&Et(!0)}};const q=e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Mutation,...e}})},H=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Scroll,...e}}),W=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.CanvasMutation,...e}}),V=new Ct({mutationCb:q,adoptedStyleSheetCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.AdoptedStyleSheet,...e}})}),Z=new st({mirror:Mt,mutationCb:q,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:kt});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Mt,crossOriginIframeMirror:Z.crossOriginIframeMirror,crossOriginIframeStyleMirror:Z.crossOriginIframeStyleMirror});const G=new It;xt=new St({recordCanvas:C,mutationCb:W,win:window,blockClass:r,blockSelector:o,mirror:Mt,sampling:v.canvas,dataURLOptions:y});const U=new at({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:y,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:T,sampling:v,slimDOMOptions:P,iframeManager:Z,stylesheetManager:V,canvasManager:xt,keepIframeSrcFn:R,processedNodeManager:G},mirror:Mt});Et=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!S)return;kt({type:Re.Meta,data:{href:window.location.href,width:_e(),height:me()}},e),V.reset(),U.init(),Ue.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new w,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:g,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return X(e,{doc:e,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,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===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:Mt,blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:f,maskInputFn:g,slimDOM:P,dataURLOptions:y,recordCanvas:C,inlineImages:T,onSerialize:e=>{Ce(e,Mt)&&Z.addIframe(e),Ie(e,Mt)&&V.trackLinkElement(e),ke(e)&&U.addShadowRoot(ae.shadowRoot(e),document)},onIframeLoad:(e,t)=>{Z.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kt({type:Re.FullSnapshot,data:{node:t,initialOffset:fe(window)}},e),Ue.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Mt.getId(document))};try{const e=[],t=e=>{var t;return Ge(nt)({mutationCb:q,mousemoveCb:(e,t)=>kt({type:Re.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.ViewportResize,...e}}),inputCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Input,...e}}),mediaInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MediaInteraction,...e}}),styleSheetRuleCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleSheetRule,...e}}),styleDeclarationCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Font,...e}}),selectionCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Selection,...e}})},customElementCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.CustomElement,...e}})},blockClass:r,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:T,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:P,dataURLOptions:y,mirror:Mt,iframeManager:Z,stylesheetManager:V,shadowDomManager:U,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:A,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Re.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};Z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{Et(),e.push(t(document)),Tt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(le("DOMContentLoaded",(()=>{kt({type:Re.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(le("load",(()=>{kt({type:Re.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),G.destroy(),Tt=!1,Ze=void 0}}catch(e){console.warn(e)}}var At,Nt;Rt.addCustomEvent=(e,t)=>{if(!Tt)throw new Error("please add custom event after start recording");kt({type:Re.Custom,data:{tag:e,payload:t}})},Rt.freezePage=()=>{Ue.forEach((e=>e.freeze()))},Rt.takeFullSnapshot=e=>{if(!Tt)throw new Error("please take full snapshot after start recording");Et(e)},Rt.mirror=Mt,(Nt=At||(At={}))[Nt.NotStarted=0]="NotStarted",Nt[Nt.Running=1]="Running",Nt[Nt.Stopped=2]="Stopped";var Ft,Ot=Object.defineProperty,Lt=(e,t,n)=>((e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Pt=Object.defineProperty,Dt=(e,t,n)=>((e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),$t=Object.defineProperty,Bt=(e,t,n)=>((e,t,n)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const qt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ht={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wt={};function Vt(e){if(Wt[e])return Wt[e];const t=globalThis[e],n=t.prototype,i=e in qt?qt[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Ht?Ht[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return Wt[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?Wt[e]=o:n}catch{return n}}const Zt={};function Gt(e,t,n){var i;const r=`${e}.${String(n)}`;if(Zt[r])return Zt[r].call(t);const o=Vt(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(Zt[r]=s,s.call(t)):t[n]}const Ut={};function zt(e,t,n){const i=`${e}.${String(n)}`;if(Ut[i])return Ut[i].bind(t);const r=Vt(e)[n];return"function"!=typeof r?t[n]:(Ut[i]=r,r.bind(t))}const jt={childNodes:function(e){return Gt("Node",e,"childNodes")},parentNode:function(e){return Gt("Node",e,"parentNode")},parentElement:function(e){return Gt("Node",e,"parentElement")},textContent:function(e){return Gt("Node",e,"textContent")},contains:function(e,t){return zt("Node",e,"contains")(t)},getRootNode:function(e){return zt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Gt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Gt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Gt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Vt("MutationObserver").constructor}};class Yt{constructor(){Bt(this,"idNodeMap",new Map),Bt(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 Xt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Xt(jt.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&Xt(jt.parentNode(e),t,n)}class Jt{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Jt))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Kt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},en={};function tn(e){if(en[e])return en[e];const t=globalThis[e],n=t.prototype,i=e in Kt?Kt[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Qt?Qt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return en[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?en[e]=o:n}catch{return n}}const nn={};function rn(e,t,n){var i;const r=`${e}.${String(n)}`;if(nn[r])return nn[r].call(t);const o=tn(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(nn[r]=s,s.call(t)):t[n]}const on={};function sn(e,t,n){const i=`${e}.${String(n)}`;if(on[i])return on[i].bind(t);const r=tn(e)[n];return"function"!=typeof r?t[n]:(on[i]=r,r.bind(t))}const an={childNodes:function(e){return rn("Node",e,"childNodes")},parentNode:function(e){return rn("Node",e,"parentNode")},parentElement:function(e){return rn("Node",e,"parentElement")},textContent:function(e){return rn("Node",e,"textContent")},contains:function(e,t){return sn("Node",e,"contains")(t)},getRootNode:function(e){return sn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?rn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?rn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return rn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return rn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return tn("MutationObserver").constructor}};const ln="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 cn={map:{},getId:()=>(console.error(ln),-1),getNode:()=>(console.error(ln),null),removeNodeFromMap(){console.error(ln)},has:()=>(console.error(ln),!1),reset(){console.error(ln)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get:(e,t,n)=>("map"===t&&console.error(ln),Reflect.get(e,t,n))}));let un=Date.now;function dn(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:an.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(un=()=>(new Date).getTime());function hn(e){var t;let n=null;return"getRootNode"in e&&(null==(t=an.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&an.host(an.getRootNode(e))&&(n=an.host(an.getRootNode(e))),n}function pn(e){let t,n=e;for(;t=hn(n);)n=t;return n}function gn(e){const t=e.ownerDocument;if(!t)return!1;const n=pn(e);return an.contains(t,n)}const fn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Dt(this,"id",1),Dt(this,"styleIDMap",new WeakMap),Dt(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 cn},closestElementOfNode:dn,getBaseDimension:function e(t,n){var i,r;const o=null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,n),l=s.height/o.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 i=t[n[0]];return 1===n.length?i:e(i.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:pn,getShadowHost:hn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=an.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=an.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Jt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(an.shadowRoot(e)))},hookSetter:function e(t,n,i,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,r?i:{set(e){setTimeout((()=>{i.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&&(an.contains(t,e)||gn(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&jt.host(e)||null;return Boolean(t&&"shadowRoot"in t&&jt.shadowRoot(t)===e)}(t))return!1;const i=n.getId(t);if(!n.has(i))return!0;const r=an.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n))},isBlocked:function(e,t,n,i){if(!e)return!1;const r=dn(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(Xt(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.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 i=t.children.length-1;i>=0;i--)e(t.children[i],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return un},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}},polyfill:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const r of e){const{nextId:e,parentId:o}=r;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(r,o.parent))}else{const e=i.indexOf(o);i.splice(e,0,n(r,null))}}else if(o in t){const e=t[o];e.children.push(n(r,e))}else i.push(n(r,null))}return i},shadowHostInDom:gn,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let i=e.length;i--;){const r=e[i];t.has(r.id)||(n.push(r),t.add(r.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vn=0;vn<64;vn++)_n[mn.charCodeAt(vn)]=vn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){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 yn;new Yt,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(yn||(yn={}));class bn{constructor(e){Lt(this,"fileName"),Lt(this,"functionName"),Lt(this,"lineNumber"),Lt(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 wn=/(^|@)\S+:\d+/,Sn=/^\s*at .*(\S+:\d+|\(native\))/m,Cn=/^(eval@)?(\[native code])?$/,In={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Sn)?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(Sn)}),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 i=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new bn({functionName:o,fileName:s,lineNumber:r[1],columnNumber:r[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Cn)}),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 bn({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new bn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[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"),i=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(wn)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new bn({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function kn(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(let e=0;e<i.children.length;e++){const t=i.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=i}return t}function En(e){return"[object Object]"===Object.prototype.toString.call(e)}function xn(e,t){if(0===t)return!0;const n=Object.keys(e);for(const i of n)if(En(e[i])&&xn(e[i],t-1))return!0;return!1}function Tn(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const i=[],r=[];return JSON.stringify(e,(function(e,t){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(En(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(En(e)&&xn(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 i=t[n];Array.isArray(i)?e[n]=kn(i.length?i[0]:null):e[n]=i}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 Mn={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 Rn(e,t,n){const i=n?Object.assign({},Mn,n):Mn,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?t[r]:r;let s=0,a=!1;const l=[];if(i.level.includes("error")){const n=t=>{const n=t.message,r=t.error,o=In.parse(r).map((e=>e.toString())),s=[Tn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const r=t=>{let n,r;t.reason instanceof Error?(n=t.reason,r=[Tn(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Tn("Uncaught (in promise)",i.stringifyOptions),Tn(t.reason,i.stringifyOptions)]);const o=In.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",r),l.push((()=>{t.removeEventListener("unhandledrejection",r)}))}for(const e of i.level)l.push(c(o,e));return()=>{l.forEach((e=>e()))};function c(t,n){var r=this;return t[n]?fn.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{const t=In.parse(new Error).map((e=>e.toString())).splice(1),r=("assert"===n?l.slice(1):l).map((e=>Tn(e,i.stringifyOptions)));s++,s<i.lengthThreshold?e({level:n,trace:t,payload:r}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Tn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const An=e=>({name:"rrweb/console@1",observer:Rn,options:e}),Nn=Array.isArray,Fn=Object.prototype,On=Fn.hasOwnProperty,Ln=Fn.toString,Pn=Nn||function(e){return"[object Array]"===Ln.call(e)},Dn=function(e){return"function"==typeof e},$n=function(e){return e===Object(e)&&!Pn(e)},Bn=function(e){if($n(e)){for(const t in e)if(On.call(e,t))return!1;return!0}return!1},qn=function(e){return void 0===e},Hn=function(e){return"[object String]"==Ln.call(e)},Wn=function(e){return Hn(e)&&0===e.trim().length},Vn=function(e){return null===e},Zn=function(e){return qn(e)||Vn(e)},Gn=function(e){return"[object Number]"==Ln.call(e)},Un=function(e){return"[object Boolean]"===Ln.call(e)},zn=e=>e instanceof Document,jn=e=>e instanceof FormData;const Yn={DEBUG:!1,LIB_VERSION:"1.184.2"},Xn="undefined"!=typeof window?window:void 0,Jn="undefined"!=typeof globalThis?globalThis:Xn,Kn=Array.prototype,Qn=Kn.forEach,ei=Kn.indexOf,ti=null==Jn?void 0:Jn.navigator,ni=null==Jn?void 0:Jn.document,ii=null==Jn?void 0:Jn.location,ri=null==Jn?void 0:Jn.fetch,oi=null!=Jn&&Jn.XMLHttpRequest&&"withCredentials"in new Jn.XMLHttpRequest?Jn.XMLHttpRequest:void 0,si=null==Jn?void 0:Jn.AbortController,ai=null==ti?void 0:ti.userAgent,li=null!=Xn?Xn:{},ci="[PostHog.js]",ui={_log:function(e){if(Xn&&(Yn.DEBUG||li.POSTHOG_DEBUG)&&!qn(Xn.console)&&Xn.console){const r="__rrweb_original__"in Xn.console[e]?Xn.console[e].__rrweb_original__:Xn.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(ci,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._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(ci,...t)},uninitializedWarning:e=>{ui.error(`You must initialize PostHog before calling ${e}`)}},di={},hi=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function pi(e,t,n){if(Pn(e))if(Qn&&e.forEach===Qn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===di)return}function gi(e,t,n){if(!Zn(e)){if(Pn(e))return pi(e,t,n);if(jn(e)){for(const i of e.entries())if(t.call(n,i[1],i[0])===di)return}else for(const i in e)if(On.call(e,i)&&t.call(n,e[i],i)===di)return}}const fi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return pi(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function mi(e,t){return-1!==e.indexOf(t)}function _i(e){const t=Object.keys(e);let n=t.length;const i=new Array(n);for(;n--;)i[n]=[t[n],e[t[n]]];return i}const vi=function(e){try{return e()}catch{return}},yi=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){ui.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ui.critical(e)}}},bi=function(e){const t={};return gi(e,(function(e,n){Hn(e)&&e.length>0&&(t[n]=e)})),t},wi=function(e){return e.replace(/^\$/,"")};function Si(e,t){return function(e,t){const n=new Set;return function e(i,r){if(i!==Object(i))return t?t(i,r):i;if(n.has(i))return;let o;return n.add(i),Pn(i)?(o=[],pi(i,(t=>{o.push(e(t))}))):(o={},gi(i,((t,i)=>{n.has(t)||(o[i]=e(t,i))}))),o}(e)}(e,(e=>Hn(e)&&!Vn(t)?e.slice(0,t):e))}const Ci=function(e){let t,n,i,r="",o=0;for(t=n=0,o=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<o;i++){const o=e.charCodeAt(i);let s=null;o<128?n++:s=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Vn(s)||(n>t&&(r+=e.substring(t,n)),r+=s,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},Ii=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{const r="on"+n,o=t[r];t[r]=function(t,n,i){return function(r){if(!(r=r||e(null==Xn?void 0:Xn.event)))return;let o,s=!0;Dn(i)&&(o=i(r));const a=n.call(t,r);return!1!==o&&!1!==a||(s=!1),s}}(t,i,o)}else ui.error("No valid element provided to register_event")}}();function ki(e){const t=null==e?void 0:e.hostname;return!!Hn(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}function Ei(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}const xi=["localhost","127.0.0.1"],Ti=e=>{const t=null==ni?void 0:ni.createElement("a");return qn(t)?null:(t.href=e,t)},Mi=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},Ri=function(e){let t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const r=[];return gi(e,(function(e,i){qn(e)||qn(i)||"undefined"===i||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},Ai=function(e,t){const n=((e.split("#")[0]||"").split("?")[1]||"").split("&");let i;for(let e=0;e<n.length;e++){const r=n[e].split("=");if(r[0]===t){i=r;break}}if(!Pn(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{ui.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},Ni=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Fi="$people_distinct_id",Oi="__alias",Li="__timers",Pi="$autocapture_disabled_server_side",Di="$heatmaps_enabled_server_side",$i="$exception_capture_enabled_server_side",Bi="$exception_capture_endpoint_suffix",qi="$web_vitals_enabled_server_side",Hi="$dead_clicks_enabled_server_side",Wi="$web_vitals_allowed_metrics",Vi="$session_recording_enabled_server_side",Zi="$console_log_recording_enabled_server_side",Gi="$session_recording_network_payload_capture",Ui="$session_recording_canvas_recording",zi="$replay_sample_rate",ji="$replay_minimum_duration",Yi="$sesid",Xi="$session_is_sampled",Ji="$session_recording_url_trigger_activated_session",Ki="$session_recording_url_trigger_status",Qi="$enabled_feature_flags",er="$early_access_features",tr="$stored_person_properties",nr="$stored_group_properties",ir="$surveys",rr="$surveys_activated",or="$flag_call_reported",sr="$user_state",ar="$client_session_props",lr="$capture_rate_limit",cr="$initial_campaign_params",ur="$initial_referrer_info",dr="$initial_person_info",hr="$epp",pr="__POSTHOG_TOOLBAR__",gr=[Fi,Oi,"__cmpns",Li,Vi,Di,Yi,Qi,sr,er,nr,tr,ir,or,ar,lr,cr,ur,hr];function fr(e){var t;return e.id===pr||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container"))}function mr(e){return!!e&&1===e.nodeType}function _r(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function vr(e){return!!e&&3===e.nodeType}function yr(e){return!!e&&11===e.nodeType}function br(e){return e?hi(e).split(/\s+/):[]}function wr(e){const t=null==Xn?void 0:Xn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Sr(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 br(t)}function Cr(e){return Zn(e)?null:hi(e).split(/(\s+)/).filter((e=>Dr(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ir(e){let t="";return Mr(e)&&!Rr(e)&&e.childNodes&&e.childNodes.length&&gi(e.childNodes,(function(e){var n;vr(e)&&e.textContent&&(t+=null!==(n=Cr(e.textContent))&&void 0!==n?n:"")})),hi(t)}function kr(e){return qn(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}const Er=["a","button","form","input","select","textarea","label"];function xr(e){const t=e.parentNode;return!(!t||!mr(t))&&t}function Tr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Xn||!e||_r(e,"html")||!mr(e))return!1;if(null!=n&&n.url_allowlist&&!wr(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&wr(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){const e=n.dom_event_allowlist;if(e&&!e.some((e=>t.type===e)))return!1}let o=!1;const s=[e];let a=!0,l=e;for(;l.parentNode&&!_r(l,"body");)if(yr(l.parentNode))s.push(l.parentNode.host),l=l.parentNode.host;else{if(a=xr(l),!a)break;if(i||Er.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{const e=Xn.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(o=!0)}s.push(a),l=a}if(!function(e,t){const n=null==t?void 0:t.element_allowlist;if(qn(n))return!0;for(const t of e)if(n.some((e=>t.tagName.toLowerCase()===e)))return!0;return!1}(s,n))return!1;if(!function(e,t){const n=null==t?void 0:t.css_selector_allowlist;if(qn(n))return!0;for(const t of e)if(n.some((e=>t.matches(e))))return!0;return!1}(s,n))return!1;const c=Xn.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return o?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Er.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function Mr(e){for(let t=e;t.parentNode&&!_r(t,"body");t=t.parentNode){const e=Sr(t);if(mi(e,"ph-sensitive")||mi(e,"ph-no-capture"))return!1}if(mi(Sr(e),"ph-include"))return!0;const t=e.type||"";if(Hn(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(Hn(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 Rr(e){return!!(_r(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_r(e,"select")||_r(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const Ar="(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})",Nr=new RegExp(`^(?:${Ar})$`),Fr=new RegExp(Ar),Or="\\d{3}-?\\d{2}-?\\d{4}",Lr=new RegExp(`^(${Or})$`),Pr=new RegExp(`(${Or})`);function Dr(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zn(e))return!1;if(Hn(e)){e=hi(e);if((t?Nr:Fr).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Lr:Pr).test(e))return!1}return!0}function $r(e){let t=Ir(e);return t=`${t} ${Br(e)}`.trim(),Dr(t)?t:""}function Br(e){let t="";return e&&e.childNodes&&e.childNodes.length&&gi(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Ir(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${Br(e)}`.trim())}catch(e){ui.error(e)}})),t}function qr(e){return function(e){const t=e.map((e=>{var t,n;let i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)i+=`.${t.replace(/"/g,"")}`}const r={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},o={};return _i(r).sort(((e,t)=>{let[n]=e,[i]=t;return n.localeCompare(i)})).forEach((e=>{let[t,n]=e;return o[Hr(t.toString())]=Hr(n.toString())})),i+=":",i+=_i(r).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),i}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const i={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:Wr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _i(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return i.attributes[t]=n})),i}))}(e))}function Hr(e){return e.replace(/"|\\"/g,'\\"')}function Wr(e){const t=e.attr__class;return t?Pn(t)?t:br(t):void 0}const Vr="[SessionRecording]",Zr="redacted",Gr={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"]},Ur=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],zr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],jr=["/s/","/e/","/i/"];function Yr(e,t,n,i){if(Zn(e))return e;let r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Hn(r)&&(r=parseInt(r)),r>n?Vr+` ${i} body too large to record (${r} bytes)`:e}function Xr(e,t){if(Zn(e))return e;let n=e;return Dr(n,!1)||(n=Vr+" "+t+" body "+Zr),gi(zr,(e=>{var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Vr+" "+t+" body "+Zr+" as might contain: "+e)})),n}const Jr=(e,t)=>{const n={payloadSizeLimitBytes:Gr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Gr.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Gr.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,r=!1!==e.session_recording.recordBody&&t.recordBody,o=!1!==e.capture_performance&&t.recordPerformance,s=(e=>{var t;const n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=Yr(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=Yr(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>s((e=>{const t=Ti(e.name);if(!(t&&t.pathname&&jr.some((e=>0===t.pathname.indexOf(e)))))return e})((e=>{const t=e.requestHeaders;return Zn(t)||gi(Object.keys(null!=t?t:{}),(e=>{Ur.includes(e.toLowerCase())&&(t[e]=Zr)})),e})(e))),l=Dn(e.session_recording.maskNetworkRequestFn);return l&&Dn(e.session_recording.maskCapturedNetworkRequestFn)&&ui.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{const n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=Dn(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,i,r;const o=a(t);return o&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,o))&&void 0!==n?n:void 0}:e=>function(e){if(!qn(e))return e.requestBody=Xr(e.requestBody,"Request"),e.responseBody=Xr(e.responseBody,"Response"),e}(a(e)),{...Gr,...n,recordHeaders:i,recordBody:r,recordPerformance:o,recordInitialRequests:o}};function Kr(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return Dn(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}function Qr(e,t){var n;const i=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),r={hostname:i,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==i||!i.trim().length)return r;for(const e of t.payloadHostDenyList)if(i.endsWith(e))return{hostname:i,isHostDenied:!0};return r}const eo=e=>"navigation"===e.entryType,to=e=>"resource"===e.entryType;function no(e,t,n){if(n.recordInitialRequests){const i=t.performance.getEntries().filter((e=>eo(e)||to(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>lo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const i=new t.PerformanceObserver((t=>{const i=t.getEntries().filter((e=>eo(e)||to(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>lo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),r=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:r}),()=>{i.disconnect()}}function io(e,t){return!!t&&(Un(t)||t[e])}function ro(e){let{type:t,recordBody:n,headers:i}=e;function r(e){const t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),n=t&&i[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Un(n))return!0;if(Pn(n))return r(n);const o=n[t];return Un(o)?o:r(o)}async function oo(e,t,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return ui.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=>to(e)&&e.initiatorType===t&&(qn(i)||e.startTime>=i)&&(qn(r)||e.startTime<=r)));return s||(await new Promise((e=>setTimeout(e,50*o))),oo(e,t,n,i,r,o+1))}function so(e){let{body:t,options:n,url:i}=e;if(Zn(t))return null;const{hostname:r,isHostDenied:o}=Qr(i,n);if(o)return r+" is in deny list";if(Hn(t))return t;if(zn(t))return t.textContent;if(jn(t))return Ri(t);if($n(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 ao=e=>!Vn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function lo(e){let{entry:t,method:n,status:i,networkRequest:r,isInitial:o,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)),h=[{...t?t.toJSON():{name:l},startTime:qn(s)?void 0:Math.round(s),endTime:qn(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o}];if(ao(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const co=["video/","audio/"];function uo(e){return new Promise(((t,n)=>{const i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(i)))}catch{clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}async function ho(e){let{r:t,options:n,url:i}=e;const r=function(e){var t;let{r:n,options:i,url:r}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=co.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return`Content-Type ${o} is not supported`;const{hostname:a,isHostDenied:l}=Qr(r,i);return l?a+" is in deny list":null}({r:t,options:n,url:i});return Vn(r)?uo(t):Promise.resolve(r)}function po(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=io("request",n.recordHeaders),r=io("response",n.recordHeaders),o=Kr(t,"fetch",(o=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),i&&(u.requestHeaders=e),ro({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:i}=e;const{hostname:r,isHostDenied:o}=Qr(i,n);return o?Promise.resolve(r+" is in deny list"):uo(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await o(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),r&&(u.responseHeaders=a),ro({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await ho({r:c,options:n,url:s})),c}finally{oo(t,"fetch",l.url,d,h).then((t=>{var n;const i=lo({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:h,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return()=>{o()}}let go=null;function fo(e,t,n){if(!("performance"in t))return()=>{};if(go)return ui.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Gr,n):Gr,r=t=>{const n=[];t.requests.forEach((e=>{const t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},o=no(r,t,i);let s=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=io("request",n.recordHeaders),r=io("response",n.recordHeaders),o=Kr(t.XMLHttpRequest.prototype,"open",(o=>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,h=new Request(a),p={};let g,f;const m={},_=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,_(e,t)),i&&(p.requestHeaders=m);const v=d.send.bind(d);d.send=e=>(ro({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(p.requestBody=so({body:e,options:n,url:a})),g=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;f=t.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");n&&(i[n]=r)})),r&&(p.responseHeaders=i),ro({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(p.responseBody=so({body:d.response,options:n,url:a})),oo(t,"xmlhttprequest",h.url,g,f).then((t=>{const n=lo({entry:t,method:h.method,status:null==d?void 0:d.status,networkRequest:p,start:g,end:f,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),o.call(d,s,a,l,c,u)}));return()=>{o()}}(r,t,i),a=po(r,t,i)),go=()=>{o(),s(),a()},go}const mo=e=>({name:"rrweb/network@1",observer:fo,options:e});let _o,vo,yo;li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:An,getRecordNetworkPlugin:mo},li.__PosthogExtensions__.rrweb={record:Rt,version:"v2"},li.rrweb={record:Rt,version:"v2"},li.rrwebConsoleRecord={getRecordConsolePlugin:An},li.getRecordNetworkPlugin=mo,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(_o||(_o={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(vo||(vo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(yo||(yo={}));var bo,wo,So,Co,Io,ko,Eo,xo,To={},Mo=[],Ro=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ao=Array.isArray;function No(e,t){for(var n in t)e[n]=t[n];return e}function Fo(e){var t=e.parentNode;t&&t.removeChild(e)}function Oo(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?bo.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Lo(e,s,i,r,null)}function Lo(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++So:r,__i:-1,__u:0};return null==r&&null!=wo.vnode&&wo.vnode(o),o}function Po(e){return e.children}function Do(e,t){this.props=e,this.context=t}function $o(e,t){if(null==t)return e.__?$o(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?$o(e):null}function Bo(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 Bo(e)}}function qo(e){(!e.__d&&(e.__d=!0)&&Co.push(e)&&!Ho.__r++||Io!==wo.debounceRendering)&&((Io=wo.debounceRendering)||ko)(Ho)}function Ho(){var e,t,n,i,r,o,s,a,l;for(Co.sort(Eo);e=Co.shift();)e.__d&&(t=Co.length,i=void 0,o=(r=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((i=No({},r)).__v=r.__v+1,wo.vnode&&wo.vnode(i),Yo(s,i,r,n.__n,void 0!==s.ownerSVGElement,32&r.__u?[o]:null,a,null==o?$o(r):o,!!(32&r.__u),l),i.__.__k[i.__i]=i,Xo(a,i,l),i.__e!=o&&Bo(i)),Co.length>t&&Co.sort(Eo));Ho.__r=0}function Wo(e,t,n,i,r,o,s,a,l,c,u){var d,h,p,g,f,m=i&&i.__k||Mo,_=t.length;for(n.__d=l,function(e,t,n){var i,r,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],i=0;i<l;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?Lo(null,r,null,null,r):Ao(r)?Lo(Po,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?Lo(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Zo(r,n,s=i+d,u),r.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__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!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=$o(o)),Ko(o,o,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(o=n[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=$o(o)),Ko(o,o))}(n,t,m),l=n.__d,d=0;d<_;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?To:m[p.__i]||To,p.__i=d,Yo(e,p,h,r,o,s,a,l,c,u),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Jo(h.ref,null,p),u.push(p.ref,p.__c||g,p)),null==f&&null!=g&&(f=g),65536&p.__u||h.__k===p.__k?l=Vo(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=f}function Vo(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Vo(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Zo(e,t,n,i){var r=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&r==l.key&&o===l.type)return n;if(i>(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)&&r==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&r==l.key&&o===l.type)return a;a++}}return-1}function Go(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ro.test(t)?n:n+"px"}function Uo(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Go(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Go(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?jo:zo,o)):e.removeEventListener(t,o?jo:zo,o);else{if(r)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 zo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(wo.event?wo.event(e):e)}function jo(e){return this.l[e.type+!0](wo.event?wo.event(e):e)}function Yo(e,t,n,i,r,o,s,a,l,c){var u,d,h,p,g,f,m,_,v,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=wo.__b)&&u(t);e:if("function"==typeof k)try{if(_=t.props,v=(u=k.contextType)&&i[u.__c],y=u?v?v.props.value:u.__:i,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(_,y):(t.__c=d=new Do(_,y),d.constructor=k,d.render=Qo),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=No({},d.__s)),No(d.__s,k.getDerivedStateFromProps(_,d.__s))),p=d.props,g=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,f)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,w=wo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=No(No({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(p,g)),Wo(e,Ao(I=null!=u&&u.type===Po&&null==u.key?u.props.children:u)?I:[I],t,n,i,r,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),wo.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a,l){var c,u,d,h,p,g,f,m=n.props,_=t.props,v=t.type;if("svg"===v&&(r=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!v&&(v?p.localName===v:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===v)return document.createTextNode(_);e=r?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,_.is&&_),o=null,a=!1}if(null===v)m===_||a&&e.data===_||(e.data=_);else{if(o=o&&bo.call(e.childNodes),m=n.props||To,!a&&null!=o)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)p=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in _||Uo(e,c,null,p,r));for(c in _)p=_[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?g=p:"checked"==c?f=p:"key"===c||a&&"function"!=typeof p||m[c]===p||Uo(e,c,p,m[c],r);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Wo(e,Ao(h)?h:[h],t,n,i,r&&"foreignObject"!==v,o,s,o?o[0]:n.__k&&$o(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&Fo(o[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===v&&!g||"option"===v&&g!==m[c])&&Uo(e,c,g,m[c],!1),c="checked",void 0!==f&&f!==e[c]&&Uo(e,c,f,m[c],!1))}return e}(n.__e,t,n,i,r,o,s,l,c);(u=wo.diffed)&&u(t)}function Xo(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)Jo(n[i],n[++i],n[++i]);wo.__c&&wo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wo.__e(e,t.__v)}}))}function Jo(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wo.__e(e,n)}}function Ko(e,t,n){var i,r;if(wo.unmount&&wo.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Jo(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){wo.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Ko(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Fo(e.__e),e.__=e.__e=e.__d=void 0}function Qo(e,t,n){return this.constructor(e,n)}function es(e,t,n){var i,r,o,s;wo.__&&wo.__(e,t),r=(i="function"==typeof n)?null:t.__k,o=[],s=[],Yo(t,e=(!i&&n||t).__k=Oo(Po,null,[e]),r||To,To,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?bo.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),Xo(o,e,s)}function ts(e,t,n){var i,r,o,s,a=No({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?bo.call(arguments,2):n),Lo(e.type,a,i||e.key,r||e.ref,null)}bo=Mo.slice,wo={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},So=0,Do.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=No({},this.state),"function"==typeof e&&(e=e(No({},n),this.props)),e&&No(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),qo(this))},Do.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qo(this))},Do.prototype.render=Po,Co=[],ko="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Eo=function(e,t){return e.__v.__b-t.__v.__b},Ho.__r=0,xo=0;const ns=Xn,is=ni,rs="seenSurvey_",os=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: ${as((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 ss(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 as(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cs;"#"===t[0]&&(e=ss(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=ss(n)),!e)return"black";const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const ls={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"},cs="#eeeded",us=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(ms(n),"true"),i.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=i.get_session_replay_url)||void 0===e?void 0:e.call(i),...t,$set:{[_s(n,"responded")]:!0}}),ns.dispatchEvent(new Event("PHSurveySent")))},ds=(e,t,n)=>{var i;!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===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:{[_s(e,"dismissed")]:!0}}),localStorage.setItem(ms(e),"true"),ns.dispatchEvent(new Event("PHSurveyClosed")))},hs=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ps=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,gs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?ps(e.questions,hs(e.questions)):e.questions),fs=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,i,r,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},ms=e=>{let t=`${rs}${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`${rs}${e.id}_${e.current_iteration}`),t},_s=(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},vs=function(e,t){var n={__c:t="__cC"+xo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,qo(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}),ys=e=>{let{component:t,children:n,renderAsHtml:i,style:r}=e;return ts(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},bs=ni;var ws,Ss,Cs,Is,ks=0,Es=[],xs=[],Ts=wo.__b,Ms=wo.__r,Rs=wo.diffed,As=wo.__c,Ns=wo.unmount;function Fs(e,t){wo.__h&&wo.__h(Ss,e,ks||t),ks=0;var n=Ss.__H||(Ss.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:xs}),n.__[e]}function Os(e){return ks=1,function(e,t,n){var i=Fs(ws++,2);if(i.t=e,!i.__c&&(i.__=[Gs(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Ss,!Ss.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Ss.u=!0;var o=Ss.shouldComponentUpdate,s=Ss.componentWillUpdate;Ss.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},Ss.shouldComponentUpdate=r}return i.__N||i.__}(Gs,e)}function Ls(e,t){var n=Fs(ws++,3);!wo.__s&&Zs(n.__H,t)&&(n.__=e,n.i=t,Ss.__H.__h.push(n))}function Ps(e){return ks=5,Ds((function(){return{current:e}}),[])}function Ds(e,t){var n=Fs(ws++,7);return Zs(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function $s(e){var t=Ss.context[e.__c],n=Fs(ws++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Ss)),t.props.value):e.__}function Bs(){for(var e;e=Es.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ws),e.__H.__h.forEach(Vs),e.__H.__h=[]}catch(t){e.__H.__h=[],wo.__e(t,e.__v)}}wo.__b=function(e){Ss=null,Ts&&Ts(e)},wo.__r=function(e){Ms&&Ms(e),ws=0;var t=(Ss=e.__c).__H;t&&(Cs===Ss?(t.__h=[],Ss.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=xs,e.__N=e.i=void 0}))):(t.__h.forEach(Ws),t.__h.forEach(Vs),t.__h=[],ws=0)),Cs=Ss},wo.diffed=function(e){Rs&&Rs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Es.push(t)&&Is===wo.requestAnimationFrame||((Is=wo.requestAnimationFrame)||Hs)(Bs)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==xs&&(e.__=e.__V),e.i=void 0,e.__V=xs}))),Cs=Ss=null},wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ws),e.__h=e.__h.filter((function(e){return!e.__||Vs(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],wo.__e(n,e.__v)}})),As&&As(e,t)},wo.unmount=function(e){Ns&&Ns(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Ws(e)}catch(e){t=e}})),n.__H=void 0,t&&wo.__e(t,n.__v))};var qs="function"==typeof requestAnimationFrame;function Hs(e){var t,n=function(){clearTimeout(i),qs&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);qs&&(t=requestAnimationFrame(n))}function Ws(e){var t=Ss,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ss=t}function Vs(e){var t=Ss;e.__c=e.__(),Ss=t}function Zs(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Gs(e,t){return"function"==typeof t?t(e):t}var Us=0;function zs(e,t,n,i,r,o){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:--Us,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return wo.vnode&&wo.vnode(c),c}const js=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Ys=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Xs=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Js=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Ks=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Qs=zs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:zs("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"})}),ea=zs("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[zs("g",{"clip-path":"url(#clip0_2415_6911)",children:[zs("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:zs("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),zs("g",{mask:"url(#mask0_2415_6911)",children:[zs("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"}),zs("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"}),zs("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"}),zs("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"}),zs("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"}),zs("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"})]})]}),zs("defs",{children:zs("clipPath",{id:"clip0_2415_6911",children:zs("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),ta=zs("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:zs("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 na(){return zs("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ea]})}function ia(e){let{text:t,submitDisabled:n,appearance:i,onSubmit:r,link:o}=e;const{isPreviewMode:s,isPopup:a}=$s(vs),l=i.submitButtonTextColor||as(i.submitButtonColor||ls.submitButtonColor);return zs("div",{className:"bottom-section",children:[zs("div",{className:"buttons",children:zs("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(o&&(null==Xn||Xn.open(o)),r())},children:t})}),!i.whiteLabel&&zs(na,{})]})}function ra(e){let{question:t,description:n,descriptionContentType:i,backgroundColor:r,forceDisableHtml:o}=e;const{isPopup:s}=$s(vs);return zs("div",{style:s?{backgroundColor:r||ls.backgroundColor}:{},children:[zs("div",{className:"survey-question",children:t}),n&&ys({component:Oo("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==i})]})}function oa(e){let{onClick:t}=e;const{isPreviewMode:n}=$s(vs);return zs("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:zs("button",{className:"form-cancel",onClick:t,disabled:n,children:Qs})})}function sa(e){let{header:t,description:n,contentType:i,forceDisableHtml:r,appearance:o,onClose:s,styleOverrides:a}=e;const l=as(o.backgroundColor||ls.backgroundColor),{isPopup:c}=$s(vs);return zs(Po,{children:zs("div",{className:"thank-you-message",style:{...a},children:zs("div",{className:"thank-you-message-container",children:[c&&zs(oa,{onClick:()=>s()}),zs("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&ys({component:Oo("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:l}}),c&&zs(ia,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})})})}function aa(e){var t;const n=Ps(null),[i,r]=Os(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Ls((()=>{if(n.current){const e=function(e){const t=ns.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 i=parseInt(n[1]),r=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+o*o*.114)>127.5?"black":"white"}(n.current);r(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function la(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;const o=Ps(null),[s,a]=Os("");return zs("div",{ref:o,children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),zs("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>a(e.currentTarget.value)}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:i,onSubmit:()=>r(s)})]})}function ca(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;return zs(Po,{children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>r("link clicked")})]})}function ua(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=Os(null);return zs(Po,{children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),zs("div",{className:"rating-section",children:[zs("div",{className:"rating-options",children:["emoji"===t.display&&zs("div",{className:"rating-options-emoji",children:(3===t.scale?pa:ga).map(((e,t)=>{const n=t+1===l;return zs("button",{className:`ratings-emoji question-${i}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&zs("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:va(t.scale).map(((e,t)=>zs(da,{displayQuestionIndex:i,active:l===e,appearance:r,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),zs("div",{className:"rating-text",children:[zs("div",{children:t.lowerBoundLabel}),zs("div",{children:t.upperBoundLabel})]})]}),zs(ia,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:Vn(l)&&!t.optional,appearance:r,onSubmit:()=>o(l)})]})}function da(e){let{num:t,active:n,displayQuestionIndex:i,appearance:r,setActiveNumber:o}=e;const{textColor:s,ref:a}=aa({appearance:r,defaultTextColor:"black",forceUpdate:n});return zs("button",{ref:a,className:`ratings-number question-${i}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function ha(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=Ps(null),a=Ds((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const i=ps(t,hs(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i})(t)),[t]),[l,c]=Os(t.type===vo.MultipleChoice?[]:null),[u,d]=Os(!1),[h,p]=Os(""),g=t.type===vo.SingleChoice?"radio":"checkbox";return zs("div",{ref:s,children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),zs("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let r="choice-option";const o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(r+=" choice-option-open"),zs("div",{className:r,children:[zs("input",{type:g,id:`surveyQuestion${i}Choice${n}`,name:`question${i}`,value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===vo.SingleChoice?c(o):t.type===vo.MultipleChoice&&Pn(l)?l.includes(o)?c(l.filter((e=>e!==o))):c([...l,o]):void 0}),zs("label",{htmlFor:`surveyQuestion${i}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?zs(Po,{children:[zs("span",{children:[s,":"]}),zs("input",{type:"text",id:`surveyQuestion${i}Choice${n}Open`,name:`question${i}`,onInput:e=>{const n=e.currentTarget.value;return t.type===vo.SingleChoice?c(n):t.type===vo.MultipleChoice&&Pn(l)?p(n):void 0}})]}):s}),zs("span",{className:"choice-check",style:{color:"black"},children:ta})]})}))}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:(Vn(l)||Pn(l)&&!u&&0===l.length||Pn(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:r,onSubmit:()=>{u&&t.type===vo.MultipleChoice?Pn(l)&&o([...l,h]):o(l)}})]})}const pa=[Xs,Ys,js],ga=[Js,Xs,Ys,js,Ks],fa=[1,2,3,4,5],ma=[1,2,3,4,5,6,7],_a=[0,1,2,3,4,5,6,7,8,9,10];function va(e){switch(e){case 5:default:return fa;case 7:return ma;case 10:return _a}}const ya=Xn,ba=ni;class wa{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=ba.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,i=localStorage.getItem("lastSeenSurveyDate");if(n&&i){const e=new Date,t=Math.abs(e.getTime()-new Date(i).getTime());if(Math.ceil(t/864e5)<n)return}const r=(e=>!!localStorage.getItem(ms(e))&&!fs(e))(e);if(!r){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const i=is.createElement("div");i.className=`PostHogSurvey${t}`;const r=i.attachShadow({mode:"open"});if(e){const t=Object.assign(is.createElement("style"),{innerText:e});r.appendChild(t)}return is.body.appendChild(i),r})(os(null==e?void 0:e.appearance),e.id);es(zs(Ia,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=bs.createElement("div");n.className=`PostHogWidget${e.id}`;const i=n.attachShadow({mode:"open"}),r=`\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 i.append(Object.assign(bs.createElement("style"),{innerText:r})),bs.body.appendChild(n),i}(e),n=os(e.appearance);t.appendChild(Object.assign(ba.createElement("style"),{innerText:n})),es(zs(Ea,{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)&&ba.querySelector(e.appearance.widgetSelector);if(n)if(0===ba.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===ba.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var i,r;const t=null===(i=ba.querySelector(`.PostHogWidget${e.id}`))||void 0===i||null===(r=i.shadowRoot)||void 0===r?void 0:r.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,i;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.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!=_o.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)=>{es(zs(Ia,{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(Vn(e.surveyInFocus)){var n,i,r;if(t.type===_o.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===ba.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)&&null!==(r=t.appearance)&&void 0!==r&&r.widgetSelector&&e.handleWidgetSelector(t);t.type===_o.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{Vn(this.surveyInFocus)||ui.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&ui.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 Sa(e){if(!ba||!ya)return;const t=new wa(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function Ca(e,t,n,i,r){const[o,s]=Os(i||0===n),[a,l]=Os(!1);return Ls((()=>{if(i||!t)return;const o=()=>{r(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(r(e.id),s(!1))},c=()=>{var n;s(!0),ya.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 ya.addEventListener("PHSurveyClosed",o),ya.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),ya.removeEventListener("PHSurveyClosed",o),ya.removeEventListener("PHSurveySent",a)}})():(c(),()=>{ya.removeEventListener("PHSurveyClosed",o),ya.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}function Ia(e){var t,n,i,r,o,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:h,isPopup:p}=e;const g=Number.isInteger(d),f=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:_,setIsPopupVisible:v}=Ca(a,c,f,g,h),y=_||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&Gn(null===(i=u)||void 0===i?void 0:i.left)?{left:u.left-40}:{};return g&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?zs(vs.Provider,{value:{isPreviewMode:g,previewPageIndex:d,handleCloseSurveyPopup:()=>ds(a,c,g),isPopup:p||!1},children:y?zs(sa,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||ls,styleOverrides:{...u,...b},onClose:()=>v(!1)}):zs(ka,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):zs(Po,{})}function ka(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,styleOverrides:s}=e;const a=as((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||ls.backgroundColor),[l,c]=Os({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:h,isPopup:p}=$s(vs),[g,f]=Os(d||0),m=Ds((()=>gs(i)),[i]);Ls((()=>{f(null!=d?d:0)}),[d]);return zs("form",{className:"survey-form",style:p?{color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?g===s:g===t)&&zs("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||ls.backgroundColor}:{},children:[p&&zs(oa,{onClick:()=>h()}),xa({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||ls,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:r}=e;if(!o)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!o.getNextSurveyStep)return void(r===i.questions.length-1?us({...l,[s]:t},i,o):f(r+1));const a=o.getNextSurveyStep(i,r,t);a===yo.End?us({...l,[s]:t},i,o):f(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function Ea(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=Os(!1),[u,d]=Os({}),h=Ps(null);return Ls((()=>{var e,t;if(!s&&o){if("tab"===(null===(e=i.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n;const e=h.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=i.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)){const e=ba.querySelector(i.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),zs(Po,{children:["tab"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)&&zs("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:as(i.appearance.widgetColor)},children:[zs("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=i.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&zs(Ia,{posthog:o,survey:i,forceDisableHtml:r,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const xa=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s={[vo.Open]:la,[vo.Link]:ca,[vo.Rating]:ua,[vo.SingleChoice]:ha,[vo.MultipleChoice]:ha},a={question:t,forceDisableHtml:n,appearance:r,onSubmit:o},l={[vo.Open]:{},[vo.Link]:{},[vo.Rating]:{displayQuestionIndex:i},[vo.SingleChoice]:{displayQuestionIndex:i},[vo.MultipleChoice]:{displayQuestionIndex:i}};return zs(s[t.type],{...{...a,...l[t.type]}})};function Ta(e){return!qn(Event)&&Ma(e,Event)}function Ma(e,t){try{return e instanceof t}catch{return!1}}function Ra(e){return Vn(e)||!$n(e)&&!Dn(e)}function Aa(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function Na(e){return Aa(e,"DOMError")}li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.canActivateRepeatedly=fs,li.__PosthogExtensions__.generateSurveys=Sa,li.extendPostHogWithSurveys=Sa;const Fa=/\(error: (.*)\)/,Oa=50,La="?";function Pa(e,t,n,i){const r={platform:"javascript",filename:e,function:"<anonymous>"===t?La:t,in_app:!0};return qn(n)||(r.lineno=n),qn(i)||(r.colno=i),r}const Da=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,$a=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ba=/\((\S*)(?::(\d+))(?::(\d+))\)/,qa=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ha=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Wa=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=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=[],r=e.split("\n");for(let e=t;e<r.length;e++){const t=r[e];if(t.length>1024)continue;const o=Fa.test(t)?t.replace(Fa,"$1"):t;if(!o.match(/\S*Error: /)){for(const e of i){const t=e(o);if(t){n.push(t);break}}if(n.length>=Oa)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Oa).map((e=>({...e,filename:e.filename||Va(t).filename,function:e.function||La})))}(n)}}(...[[30,e=>{const t=Da.exec(e);if(t){const[,e,n,i]=t;return Pa(e,La,+n,+i)}const n=$a.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=Ba.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Za(n[1]||La,n[2]);return Pa(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=qa.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Ha.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]||La;return[n,e]=Za(n,e),Pa(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Va(e){return e[e.length-1]||{}}const Za=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:La,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Ga;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Ga||(Ga={}));const Ua=["fatal","error","warning","log","info","debug"],za=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function ja(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",i=function(e){if(e&&Ya.test(e.message))return 1;return 0}(e);try{const e=Wa(n,i);return e.slice(0,e.length-t)}catch{}return[]}const Ya=/Minified React error #\d+;/i;function Xa(e,t){var n,i;const r=ja(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;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:r,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Ja(e,t){var n,i,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){const e=ja(t.syntheticException,1);e.length&&(a.stacktrace={frames:e,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Ka(e){return Hn(e)&&!Wn(e)&&Ua.indexOf(e)>=0}function Qa(e,t){var n,i;const r=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Ta(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 i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(null!=t&&t.syntheticException){const e=ja(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e,type:"raw"})}return{$exception_list:[l],$exception_level:Ka(e.level)?e.level:"error"}}function el(e,t){let[n,i,r,o,s]=e,a={$exception_list:[]};const l=s||n;if(Na(l)||function(e){return Aa(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=Xa(l,t);else{const n=e.name||(Na(e)?"DOMError":"DOMException"),i=e.message?`${n}: ${e.message}`:n,r=Na(e)?"DOMError":"DOMException";a=Ja(i,{...t,overrideExceptionType:r,defaultExceptionMessage:i})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Aa(e,"ErrorEvent")}(l)&&l.error)return Xa(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 Ma(e,Error)}}(l))return Xa(l,t);if(function(e){return Aa(e,"Object")}(l)||Ta(l)){return Qa(l,t)}if(qn(s)&&Hn(n)){let e="Error",i=n;const r=n.match(za);return r&&(e=r[1],i=r[2]),Ja(i,{...t,overrideExceptionType:e,defaultExceptionMessage:i})}return Ja(l,t)}function tl(e){let[t]=e;const n=function(e){if(Ra(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 Ra(n)?Ja(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):el([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const nl={wrapOnError:e=>{const t=Xn;t||ui.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];const s=el(r);return e(s),null!==(t=null==n?void 0:n(...r))&&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=Xn;t||ui.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];const a=tl(o);return e(a),null!==(i=null==n?void 0:n.apply(t,o))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.errorWrappingFunctions=nl,li.__PosthogExtensions__.parseErrorAsProperties=el,li.posthogErrorWrappingFunctions=nl,li.parseErrorAsProperties=el;const il=(e,t)=>{const{sessionId:n,windowId:i}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",i)};li.__PosthogExtensions__=li.__PosthogExtensions__||{};const rl={_patchFetch:e=>Kr(Xn,"fetch",(t=>async function(n,i){const r=new Request(n,i);return il(e,r),t(r)})),_patchXHR:e=>Kr(Xn.XMLHttpRequest.prototype,"open",(t=>function(n,i){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(i);return il(e,a),t.call(this,n,a.url,r,o,s)}))};li.__PosthogExtensions__.tracingHeadersPatchFns=rl,li.postHogTracingHeadersPatchFns=rl;var ol,sl,al,ll=-1,cl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(ll=t.timeStamp,e(t))}),!0)},ul=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},dl=function(){var e=ul();return e&&e.activationStart||0},hl=function(e,t){var n=ul(),i="navigate";return ll>=0?i="back-forward-cache":n&&(document.prerendering||dl()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=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:i}},pl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},gl=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},fl=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ml=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},_l=function(e){var t=!1;return function(){t||(e(),t=!0)}},vl=-1,yl=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},bl=function(e){"hidden"===document.visibilityState&&vl>-1&&(vl="visibilitychange"===e.type?e.timeStamp:0,Sl())},wl=function(){addEventListener("visibilitychange",bl,!0),addEventListener("prerenderingchange",bl,!0)},Sl=function(){removeEventListener("visibilitychange",bl,!0),removeEventListener("prerenderingchange",bl,!0)},Cl=function(){return vl<0&&(vl=yl(),wl(),cl((function(){setTimeout((function(){vl=yl(),wl()}),0)}))),{get firstHiddenTime(){return vl}}},Il=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},kl=[1800,3e3],El=function(e,t){t=t||{},Il((function(){var n,i=Cl(),r=hl("FCP"),o=pl("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-dl(),0),r.entries.push(e),n(!0)))}))}));o&&(n=gl(e,r,kl,t.reportAllChanges),cl((function(i){r=hl("FCP"),n=gl(e,r,kl,t.reportAllChanges),fl((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},xl=[.1,.25],Tl=[2500,4e3],Ml={},Rl=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Al=function(e){if("loading"===document.readyState)return"loading";var t=Rl();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"},Nl=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Fl=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:Nl(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},Ol=-1,Ll=function(e,t){var n=Rl(),i="navigate";return Ol>=0?i="back-forward-cache":n&&(document.prerendering||function(){var e=Rl();return e&&e.activationStart||0}()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=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:i}},Pl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Dl=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},$l=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Bl=0,ql=1/0,Hl=0,Wl=function(e){e.forEach((function(e){e.interactionId&&(ql=Math.min(ql,e.interactionId),Hl=Math.max(Hl,e.interactionId),Bl=Hl?(Hl-ql)/7+1:0)}))},Vl=function(){"interactionCount"in performance||ol||(ol=Pl("event",Wl,{type:"event",buffered:!0,durationThreshold:0}))},Zl=[],Gl=new Map,Ul=0,zl=function(){return(ol?Bl:performance.interactionCount||0)-Ul},jl=[],Yl=function(e){if(jl.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Zl[Zl.length-1],n=Gl.get(e.interactionId);if(n||Zl.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 i={id:e.interactionId,latency:e.duration,entries:[e]};Gl.set(i.id,i),Zl.push(i)}Zl.sort((function(e,t){return t.latency-e.latency})),Zl.length>10&&Zl.splice(10).forEach((function(e){return Gl.delete(e.id)}))}}},Xl=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),$l(e)),n},Jl=[200,500],Kl=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;Vl();var i,r=Ll("INP"),o=function(e){Xl((function(){e.forEach(Yl);var t,n=(t=Math.min(Zl.length-1,Math.floor(zl()/50)),Zl[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())}))},s=Pl("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Dl(e,r,Jl,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),$l((function(){o(s.takeRecords()),i(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ol=t.timeStamp,e(t))}),!0)}((function(){Ul=0,Zl.length=0,Gl.clear(),r=Ll("INP"),i=Dl(e,r,Jl,t.reportAllChanges)})))})))},Ql=[],ec=[],tc=new WeakMap,nc=new Map,ic=-1,rc=function(e){Ql=Ql.concat(e),oc()},oc=function(){ic<0&&(ic=Xl(sc))},sc=function(){nc.size>10&&nc.forEach((function(e,t){Gl.has(t)||nc.delete(t)}));var e=Zl.map((function(e){return tc.get(e.entries[0])})),t=ec.length-50;ec=ec.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<ec.length;i++){var r=ec[i];ac(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=Ql[Ql.length-1-o];if(!s||s.startTime<al)break;n.add(s)}Ql=Array.from(n),ic=-1};jl.push((function(e){e.interactionId&&e.target&&!nc.has(e.interactionId)&&nc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;al=Math.max(al,e.processingEnd);for(var i=ec.length-1;i>=0;i--){var r=ec[i];if(Math.abs(n-r.renderTime)<=8){(t=r).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]},ec.push(t)),(e.interactionId||"first-input"===e.entryType)&&tc.set(e,t),oc()}));var ac=function(e,t){for(var n,i=[],r=0;n=Ql[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i};const lc={onLCP:function(e,t){t=t||{},Il((function(){var n,i=Cl(),r=hl("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-dl(),0),r.entries=[e],n())}))},s=pl("largest-contentful-paint",o);if(s){n=gl(e,r,Tl,t.reportAllChanges);var a=_l((function(){Ml[r.id]||(o(s.takeRecords()),s.disconnect(),Ml[r.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=_l(e),"hidden"===document.visibilityState?e():(n=t(e),ml(e)),n}(a)}),!0)})),ml(a),cl((function(i){r=hl("LCP"),n=gl(e,r,Tl,t.reportAllChanges),fl((function(){r.value=performance.now()-i.timeStamp,Ml[r.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},El(_l((function(){var n,i=hl("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=pl("layout-shift",s);a&&(n=gl(e,i,xl,t.reportAllChanges),ml((function(){s(a.takeRecords()),n(!0)})),cl((function(){r=0,i=hl("CLS",0),n=gl(e,i,xl,t.reportAllChanges),fl((function(){return n()}))})),setTimeout(n,0))})))},onFCP:El,onINP:function(e,t){sl||(sl=Pl("long-animation-frame",rc)),Kl((function(t){var n=function(e){var t=e.entries[0],n=tc.get(t),i=t.processingStart,r=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=ac(t.startTime,r),a=e.entries.find((function(e){return e.target})),l=a&&a.target||nc.get(t.interactionId),c=[t.startTime+t.duration,r].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Fl(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(u-r,0),loadState:Al(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.postHogWebVitalsCallbacks=lc,li.postHogWebVitalsCallbacks=lc;class cc{constructor(){this.clicks=[]}isRageClick(e,t,n){const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}const uc="$copy_autocapture";function dc(e,t){return t.length>e?t.slice(0,e)+"...":t}function hc(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!mr(t));return t}function pc(e,t,n,i){const r=e.tagName.toLowerCase(),o={tag_name:r};Er.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=dc(1024,$r(e)):o.$el_text=dc(1024,Ir(e)));const s=Sr(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),gi(e.attributes,(function(n){var r;if((!Rr(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==i||!i.includes(n.name))&&!t&&Dr(n.value)&&(r=n.name,!Hn(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){let e=n.value;"class"===n.name&&(e=br(e).join(" ")),o["attr__"+n.name]=dc(1024,e)}}));let a=1,l=1,c=e;for(;c=hc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function gc(e,t){var n,i;let{e:r,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t;const c=[e];let u=e;for(;u.parentNode&&!_r(u,"body");)yr(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);const d=[],h={};let p,g=!1,f=!1;if(gi(c,(e=>{const t=Mr(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&Dr(g)&&g);mi(Sr(e),"ph-no-capture")&&(f=!0),d.push(pc(e,o,s,a));const n=function(e){if(!Mr(e))return{};const t={};return gi(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&Dr(i)&&(t[n]=i)}})),t}(e);fi(h,n)})),f)return{props:{},explicitNoCapture:f};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?d[0].$el_text=$r(e):d[0].$el_text=Ir(e)),g){var m,_;d[0].attr__href=g;const e=null===(m=Ti(g))||void 0===m?void 0:m.host,t=null==Xn||null===(_=Xn.location)||void 0===_?void 0:_.host;e&&t&&e!==t&&(p=g)}return{props:fi({$event_type:r.type,$ce_version:1},l?{$elements_chain:qr(d)}:{$elements:d},null!==(n=d[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=d[0])||void 0===i?void 0:i.$el_text}:{},p&&"click"===r.type?{$external_click_url:p}:{},h)}}class fc{_initialized=!1;_isDisabledServerSide=null;rageclicks=new cc;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;const n=$n(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void ui.info("Disabling Automatic Event Collection because this browser is not supported");if(!Xn||!ni)return;const e=e=>{e=e||(null==Xn?void 0:Xn.event);try{this._captureEvent(e)}catch(e){ui.error("Failed to capture event",e)}},t=e=>{e=e||(null==Xn?void 0:Xn.event),this._captureEvent(e,uc)};Ii(ni,"submit",e,!1,!0),Ii(ni,"change",e,!1,!0),Ii(ni,"click",e,!1,!0),this.config.capture_copied_text&&(Ii(ni,"copy",t,!1,!0),Ii(ni,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Pi]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;const n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{const i=null==ni?void 0:ni.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&n.push(t)}))})),n}get isEnabled(){var e,t;const n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Pi],i=this._isDisabledServerSide;if(Vn(i)&&!Un(n)&&!this.instance.config.advanced_disable_decide)return!1;const r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=kr(e);var i;(vr(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)&&(this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick"));const r=t===uc;if(n&&Tr(n,e,this.config,r,r?["copy","cut"]:void 0)){const{props:i,explicitNoCapture:r}=gc(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(r)return!1;const s=this.getElementSelectors(n);if(s&&s.length>0&&(i.$element_selectors=s),t===uc){var o;const t=Cr(null==Xn||null===(o=Xn.getSelection())||void 0===o?void 0:o.toString()),n=e.type||"clipboard";if(!t)return!1;i.$selected_content=t,i.$copy_type=n}return this.instance.capture(t,i),!0}}isBrowserSupported(){return Dn(null==ni?void 0:ni.querySelectorAll)}}function mc(e,t){return Gn(e)&&e>=t}class _c{_clicks=[];_defaultConfig=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e});asRequiredConfig(e){var t,n,i,r;const o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==e?void 0:e.mutation_threshold_ms)&&void 0!==r?r:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}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,li.removeEventListener("click",this._onClick),li.removeEventListener("scroll",this._onScroll,!0),li.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){li.addEventListener("click",this._onClick)}_onClick=e=>{const t=function(e){const t=kr(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Vn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&qn(this._checkClickTimer)&&(this._checkClickTimer=li.setTimeout((()=>{this._checkClicks()}),1e3))};_startScrollObserver(){li.addEventListener("scroll",this._onScroll,!0)}_onScroll=()=>{const e=Date.now();e%50==0&&this._clicks.forEach((t=>{qn(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))};_startSelectionChangedObserver(){li.addEventListener("selectionchange",this._onSelectionChange)}_onSelectionChange=()=>{this._lastSelectionChanged=Date.now()};_ignoreClick(e){if(!e)return!0;if(fr(e.node))return!0;const t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!_r(e.node,"html")&&mr(e.node)&&!Er.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=mc(n.scrollDelayMs,this._config.scroll_threshold_ms),i=mc(n.selectionChangedDelayMs,this._config.selection_change_threshold_ms),r=mc(n.mutationDelayMs,this._config.mutation_threshold_ms),o=mc(n.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),s=Gn(n.scrollDelayMs)&&n.scrollDelayMs<this._config.scroll_threshold_ms,a=Gn(n.mutationDelayMs)&&n.mutationDelayMs<this._config.mutation_threshold_ms,l=Gn(n.selectionChangedDelayMs)&&n.selectionChangedDelayMs<this._config.selection_change_threshold_ms;s||a||l||(e||r||o||i?this._onCapture(n,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:n.timestamp,$dead_click_scroll_timeout:e,$dead_click_mutation_timeout:r,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i}):n.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(n))}this._clicks.length&&qn(this._checkClickTimer)&&(this._checkClickTimer=li.setTimeout((()=>{this._checkClicks()}),1e3))}_captureDeadClick(e,t){this.instance.capture("$dead_click",{...t,...gc(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)})}}li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new _c(e,t);const vc=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return ui.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const i=()=>{if(!ni)return n("document not found");const e=ni.createElement("script");e.type="text/javascript",e.crossOrigin="anonymous",e.src=t,e.onload=e=>n(void 0,e),e.onerror=e=>n(e);const i=ni.querySelectorAll("body > script");var r;i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):ni.body.appendChild(e)};null!=ni&&ni.body?i():null==ni||ni.addEventListener("DOMContentLoaded",i)};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{let i=`/static/${t}.js?v=${e.version}`;if("toolbar"===t){const e=3e5;i=`${i}&t=${Math.floor(Date.now()/e)*e}`}const r=e.requestRouter.endpointFor("assets",i);vc(e,r,n)},li.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{const i=e.requestRouter.endpointFor("api",t);vc(e,i,n)};const yc="$active_feature_flags",bc="$override_feature_flags",wc="$feature_flag_payloads",Sc=e=>{const t={};for(const[n,i]of _i(e||{}))i&&(t[n]=i);return t};class Cc{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){const e=this.instance.get_property(Qi),t=this.instance.get_property(bc);if(!t)return e||{};const n=fi({},e),i=Object.keys(t);for(let e=0;e<i.length;e++)n[i[e]]=t[i[e]];return this._override_warning||(ui.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(wc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);const e=this.instance.config.token,t=this.instance.get_property(tr),n=this.instance.get_property(nr),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:Ga.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void ui.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");const n=this.getFlagVariants()[e],i=`${n}`,r=this.instance.get_property(or)||{};var o;!t.send_event&&"send_event"in t||(e in r&&r[e].includes(i)||(Pn(r[e])?r[e].push(i):r[e]=[i],null===(o=this.instance.persistence)||void 0===o||o.register({[or]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})));return n}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);ui.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;const n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=e.featureFlags,o=e.featureFlagPayloads;if(!r)return;if(Pn(r)){const e={};if(r)for(let t=0;t<r.length;t++)e[r[t]]=!0;return void(t&&t.register({[yc]:r,[Qi]:e}))}let s=r,a=o;e.errorsWhileComputingFlags&&(s={...n,...s},a={...i,...a}),t&&t.register({[yc]:Object.keys(Sc(s)),[Qi]:s||{},[wc]:a||{}})}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return ui.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(bc);else if(Pn(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[bc]:t})}else this.instance.persistence.register({[bc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;const i={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);const r={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[yc]:Object.keys(Sc(r)),[Qi]:r}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.instance.get_property(er);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;const i=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[er]:i}),e(i)}})}_prepareFeatureFlagsForCallbacks(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(tr)||{};this.instance.register({[tr]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(tr)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(nr)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((t=>{n[t]={...n[t],...e[t]},delete e[t]})),this.instance.register({[nr]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.instance.get_property(nr)||{};this.instance.register({[nr]:{...t,[e]:{}}})}else this.instance.unregister(nr)}}
1
+ !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i),i=Object.defineProperty,r=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),o=(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))(o||{});const s={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};function c(e){if(l[e])return l[e];const t=globalThis[e],n=t.prototype,i=e in s?s[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in a?a[e]:void 0,c=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&c)return l[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?l[e]=o:n}catch{return n}}const u={};function d(e,t,n){var i;const r=`${e}.${String(n)}`;if(u[r])return u[r].call(t);const o=c(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(u[r]=s,s.call(t)):t[n]}const h={};function p(e,t,n){const i=`${e}.${String(n)}`;if(h[i])return h[i].bind(t);const r=c(e)[n];return"function"!=typeof r?t[n]:(h[i]=r,r.bind(t))}const g={childNodes:function(e){return d("Node",e,"childNodes")},parentNode:function(e){return d("Node",e,"parentNode")},parentElement:function(e){return d("Node",e,"parentElement")},textContent:function(e){return d("Node",e,"textContent")},contains:function(e,t){return p("Node",e,"contains")(t)},getRootNode:function(e){return p("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?d("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?d("Element",e,"shadowRoot"):null},querySelector:function(e,t){return d("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return d("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return c("MutationObserver").constructor}};function f(e){return e.nodeType===e.ELEMENT_NODE}function m(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function _(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function v(e){try{const n=e.rules||e.cssRules;if(!n)return null;const i=Array.from(n,(t=>y(t,e.href))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function y(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=v(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(n){t=e.cssText}return e.styleSheet.href?A(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?A(n,t):n}}function b(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let w=class{constructor(){r(this,"idNodeMap",new Map),r(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 S(e){let{element:t,maskInputOptions:n,tagName:i,type:r,value:o,maskInputFn:s}=e,a=o||"";const l=r&&C(r);return(n[i.toLowerCase()]||l&&n[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function C(e){return e.toLowerCase()}const I="__rrweb_original__";function k(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?C(t):null}function E(e,t){var n;let i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==r?void 0:r[1])&&void 0!==n?n:null}const x=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,T=/^(?:[a-z+]+:)?\/\//i,M=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(x,((e,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return e;if(T.test(a)||M.test(a))return`url(${l}${a}${l})`;if(R.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})`}))}let N=1;const F=new RegExp("[^a-z0-9-_:]"),O=-2;function L(){return N++}let P,D;const $=/^[^ \t\n\r\u000c]+/,B=/^[, \t\n\r\u000c]+/;const q=new WeakMap;function H(e,t){return t&&""!==t.trim()?V(e,t):t}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function V(e,t){let n=q.get(e);if(n||(n=e.createElement("a"),q.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Z(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?H(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function i(e){let i;const r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(B),!(n>=t.length);){let o=i($);if(","===o.slice(-1))o=H(e,o.substring(0,o.length-1)),r.push(o);else{let i="";o=H(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((o+i).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,r.push((o+i).trim());break}"("===e&&(s=!0)}i+=e,n+=1}}}return r.join(", ")}(e,i):"style"===n?A(i,V(e)):"object"===t&&"data"===n?H(e,i):i:H(e,i):i}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function U(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&U(g.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&U(g.parentNode(e),t,n)}function z(e,t,n,i){let r;if(f(e)){if(r=e,!g.childNodes(r).length)return!1}else{if(null===g.parentElement(e))return!1;r=g.parentElement(e)}try{if("string"==typeof t){if(i){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(U(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(e){}return!1}function j(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:o.Document,childNodes:[],compatMode:e.compatMode}:{type:o.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:f}=t,m=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 i=e.classList[n];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,r),_=function(e){if(e instanceof HTMLFormElement)return"form";const t=C(e.tagName);return F.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const i=e.attributes[t];G(_,i.name,i.value)||(y[i.name]=Z(n,_,C(i.name),i.value))}if("link"===_&&s){const t=e.href;let i=b(n,t);if(!i&&t.includes(".css")){i=b(n,window.location.origin+"/"+t.replace(window.location.href,""))}let r=null;i&&(r=v(i)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===_&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){const t=v(e.sheet);t&&(y._cssText=t)}if("input"===_||"textarea"===_||"select"===_){const t=e.value,n=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=S({element:e,type:k(e),tagName:_,value:t,maskInputOptions:a,maskInputFn:l}):n&&(y.checked=n)}"option"===_&&(e.selected&&!a.select?y.selected=!0:delete y.selected);"dialog"===_&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===_&&d)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 i=0;i<e.height;i+=50){const r=t.getImageData,o=I in r?r[I]:r;if(new Uint32Array(o.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=e.width,i.height=e.height;t!==i.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===_&&u){P||(P=n.createElement("canvas"),D=P.getContext("2d"));const t=e,i=t.currentSrc||t.getAttribute("src")||"<unknown-src>",r=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{P.width=t.naturalWidth,P.height=t.naturalHeight,D.drawImage(t,0,0),y.rr_dataURL=P.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${i}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(r?y.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===_||"video"===_){const t=y;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}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==_||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let E;try{customElements.get(_)&&(E=!0)}catch(e){}return{type:o.Element,tagName:_,attributes:y,childNodes:[],isSVG:W(e)||void 0,needBlock:m,rootId:f,isCustom:E}}(e,{doc:n,blockClass:r,blockSelector:s,inlineStylesheet:l,maskInputOptions:c,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:_,rootId:y});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:i,maskTextFn:r,rootId:s}=t,a=g.parentNode(e),l=a&&a.tagName;let c=g.textContent(e);const u="STYLE"===l||void 0,d="SCRIPT"===l||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null==(n=a.sheet)?void 0:n.cssRules)&&(c=v(a.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}c=A(c,V(t.doc))}d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&i&&(c=r?r(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:o.Text,textContent:c||"",isStyle:u,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:u,rootId:y});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:o.Comment,textContent:g.textContent(e)||"",rootId:y};default:return!1}}function Y(e){return null==e?"":e.toLowerCase()}function X(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:M=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:A=!0}=t;if(!R){R=z(e,a,l,void 0===R)}const N=j(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:T,newlyAddedElement:M});if(!N)return console.warn(e,"not serialized"),null;let F;F=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===o.Comment)return!0;if(e.type===o.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===E(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}(N,v)&&(A||N.type!==o.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?L():O;const P=Object.assign(N,{id:F});if(i.add(e,P),F===O)return null;S&&S(e);let D=!c;if(P.type===o.Element){D=D&&!P.needBlock,delete P.needBlock;const t=g.shadowRoot(e);t&&_(t)&&(P.isShadowHost=!0)}if((P.type===o.Document||P.type===o.Element)&&D){v.headWhitespace&&P.type===o.Element&&"head"===P.tagName&&(A=!1);const t={doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T};if(P.type===o.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(g.childNodes(e))){const e=X(n,t);e&&P.childNodes.push(e)}let m=null;if(f(e)&&(m=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(m))){const n=X(e,t);n&&(_(m)&&(n.isShadow=!0),P.childNodes.push(n))}}const $=g.parentNode(e);return $&&m($)&&_($)&&(P.isShadow=!0),P.type===o.Element&&"iframe"===P.tagName&&function(e,t,n){const i=e.contentWindow;if(!i)return;let r,o=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){const i=setTimeout((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}const s="about:blank";if(i.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&&C){const n=X(t,{doc:t,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});n&&C(e,n)}}),I),P.type===o.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===E(P.attributes.href))&&function(e,t,n){let i,r=!1;try{i=e.sheet}catch(e){return}if(i)return;const o=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(o),r=!0,t()}))}(e,(()=>{if(k){const t=X(e,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:w,preserveWhiteSpace:A,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:T});t&&k(e,t)}}),x),P}let J=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};const K={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Q={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ee={};function te(e){if(ee[e])return ee[e];const t=globalThis[e],n=t.prototype,i=e in K?K[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Q?Q[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return ee[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?ee[e]=o:n}catch{return n}}const ne={};function ie(e,t,n){var i;const r=`${e}.${String(n)}`;if(ne[r])return ne[r].call(t);const o=te(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(ne[r]=s,s.call(t)):t[n]}const re={};function oe(e,t,n){const i=`${e}.${String(n)}`;if(re[i])return re[i].bind(t);const r=te(e)[n];return"function"!=typeof r?t[n]:(re[i]=r,r.bind(t))}function se(){return te("MutationObserver").constructor}const ae={childNodes:function(e){return ie("Node",e,"childNodes")},parentNode:function(e){return ie("Node",e,"parentNode")},parentElement:function(e){return ie("Node",e,"parentElement")},textContent:function(e){return ie("Node",e,"textContent")},contains:function(e,t){return oe("Node",e,"contains")(t)},getRootNode:function(e){return oe("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ie("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ie("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ie("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ie("Element",e,"querySelectorAll")(t)},mutationObserver:se};function le(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}const ce="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 ue={map:{},getId:()=>(console.error(ce),-1),getNode:()=>(console.error(ce),null),removeNodeFromMap(){console.error(ce)},has:()=>(console.error(ce),!1),reset(){console.error(ce)}};function de(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}}function he(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const o=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>he(e,t,o||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ue=new Proxy(ue,{get:(e,t,n)=>("map"===t&&console.error(ce),Reflect.get(e,t,n))}));let ge=Date.now;function fe(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ae.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=ae.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}}function me(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ve(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ae.parentElement(e)}function ye(e,t,n,i){if(!e)return!1;const r=ve(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(U(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function be(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===O}function we(e,t){if(m(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const i=ae.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||we(i,t))}function Se(e){return Boolean(e.changedTouches)}function Ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ie(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ke(e){return!!e&&(e instanceof J&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ae.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ge=()=>(new Date).getTime());let Ee=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 xe(e){var t;let n=null;return"getRootNode"in e&&(null==(t=ae.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ae.host(ae.getRootNode(e))&&(n=ae.host(ae.getRootNode(e))),n}function Te(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=xe(n);)n=t;return n}(e);return ae.contains(t,n)}function Me(e){const t=e.ownerDocument;return!!t&&(ae.contains(t,e)||Te(e))}var Re=(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))(Re||{}),Ae=(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))(Ae||{}),Ne=(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))(Ne||{}),Fe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Fe||{}),Oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Oe||{}),Le=(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))(Le||{});function Pe(e){return"__ln"in e}class De{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&&Pe(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&&Pe(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 $e=(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 De,i=e=>{let t=e,n=O;for(;n===O;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{const o=ae.parentNode(r);if(!o||!Me(r)||"TEXTAREA"===o.tagName)return;const s=m(o)?this.mirror.getId(xe(r)):this.mirror.getId(o),a=i(r);if(-1===s||-1===a)return n.addNode(r);const l=X(r,{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=>{Ce(e,this.mirror)&&this.iframeManager.addIframe(e),Ie(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ke(r)&&this.shadowDomManager.addShadowRoot(ae.shadowRoot(r),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:s,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)He(this.removes,e,this.mirror)&&!this.movedSet.has(ae.parentNode(e))||r(e);for(const e of this.addedSet)We(this.droppedSet,e)||He(this.removes,e,this.mirror)?We(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(ae.parentNode(o.value)),n=i(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(ae.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,i=ae.parentNode(t);if(i&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ae.host(i);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),r(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,n=ae.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{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),i=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(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(ae.childNodes(e),(e=>ae.textContent(e)||"")).join("")})),n(this,"processMutation",(e=>{if(!be(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ae.textContent(e.target);ye(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,ve(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){const e=k(t);i=S({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(ye(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let r=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(t.contentDocument)return;n="rr_src"}if(r||(r={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(e.target,r)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!G(t.tagName,n))if(r.attributes[n]=Z(this.doc,C(t.tagName),C(n),i),"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 i=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);i!==n.style.getPropertyValue(e)||o!==n.style.getPropertyPriority(e)?r.styleDiff[e]=""===o?i:[i,o]:r._unchangedStyles[e]=[i,o]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":if(ye(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),i=m(e.target)?this.mirror.getId(ae.host(e.target)):this.mirror.getId(e.target);ye(e.target,this.blockClass,this.blockSelector,!1)||be(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(qe(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||we(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$e(n,i)]?qe(this.movedSet,t):this.removes.push({parentId:i,id:n,isShadow:!(!m(e.target)||!_(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(be(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[$e(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ye(e,this.blockClass,this.blockSelector,!1)||(ae.childNodes(e).forEach((e=>this.genAdds(e))),ke(e)&&ae.childNodes(ae.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function qe(e,t){e.delete(t),ae.childNodes(t).forEach((t=>qe(e,t)))}function He(e,t,n){return 0!==e.length&&function(e,t,n){let i=ae.parentNode(t);for(;i;){const t=n.getId(i);if(e.some((e=>e.id===t)))return!0;i=ae.parentNode(i)}return!1}(e,t,n)}function We(e,t){return 0!==e.size&&Ve(e,t)}function Ve(e,t){const n=ae.parentNode(t);return!!n&&(!!e.has(n)||Ve(e,n))}let Ze;const Ge=e=>{if(!Ze)return e;return function(){try{return e(...arguments)}catch(e){if(Ze&&!0===Ze(e))return;throw e}}},Ue=[];function ze(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 je(e,t){const n=new Be;Ue.push(n),n.init(e);const i=new(se())(Ge(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ye(e){let{mouseInteractionCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,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(Ne).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let s=C(e);const a=(e=>n=>{const s=ze(n);if(ye(s,r,o,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=Fe.Mouse;break;case"touch":a=Fe.Touch;break;case"pen":a=Fe.Pen}a===Fe.Touch?Ne[e]===Ne.MouseDown?l="TouchStart":Ne[e]===Ne.MouseUp&&(l="TouchEnd"):Fe.Pen}else Se(n)&&(a=Fe.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Fe.Touch||l.startsWith("Mouse")&&a===Fe.Mouse)&&(a=null)):Ne[e]===Ne.Click&&(a=c,c=null);const u=Se(n)?n.changedTouches[0]:n;if(!u)return;const d=i.getId(s),{clientX:h,clientY:p}=u;Ge(t)({type:Ne[l],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(Ne[e]){case Ne.MouseDown:case Ne.MouseUp:s=s.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}l.push(le(s,a,n))})),Ge((()=>{l.forEach((e=>e()))}))}function Xe(e){let{scrollCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,sampling:s}=e;return le("scroll",Ge(de(Ge((e=>{const s=ze(e);if(!s||ye(s,r,o,!0))return;const a=i.getId(s);if(s===n&&n.defaultView){const e=fe(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 Je=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Qe(e){return function(e,t){if(it("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||it("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||it("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||it("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 et(e,t,n){let i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function tt(e,t){let{mirror:n,stylesheetManager:i}=e;var r,o,s;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(ae.host(t));const l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(s=null==(o=t.ownerDocument)?void 0:o.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{i.adoptStyleSheets(e,a)}catch(e){}return n}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let i;!function(e,t){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),r(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...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),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(i=je(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:i,mirror:r}=e;if(!1===n.mousemove)return()=>{};const o="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=de(Ge((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),s),u=Ge(de(Ge((e=>{const t=ze(e),{clientX:n,clientY:i}=Se(e)?e.changedTouches[0]:e;a||(a=ge()),l.push({x:n,y:i,id:r.getId(t),timeOffset:ge()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ae.Drag:e instanceof MouseEvent?Ae.MouseMove:Ae.TouchMove)})),o,{trailing:!1})),d=[le("mousemove",u,i),le("touchmove",u,i),le("drag",u,i)];return Ge((()=>{d.forEach((e=>e()))}))}(e),o=Ye(e),s=Xe(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:i}=t,r=-1,o=-1;return le("resize",Ge(de(Ge((()=>{const e=me(),t=_e();r===e&&o===t||(n({width:Number(t),height:Number(e)}),r=e,o=t)})),200)),i)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:i,blockClass:r,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function h(e){let t=ze(e);const i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=ae.parentElement(t)),!t||!u||Je.indexOf(u)<0||ye(t,r,o,!0))return;if(t.classList.contains(s)||a&&t.matches(a))return;let h=t.value,g=!1;const f=k(t)||"";"radio"===f||"checkbox"===f?g=t.checked:(l[u.toLowerCase()]||l[f])&&(h=S({element:t,maskInputOptions:l,tagName:u,type:f,value:h,maskInputFn:c})),p(t,d?{text:h,isChecked:g,userTriggered:i}:{text:h,isChecked:g});const m=t.name;"radio"===f&&m&&g&&n.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==t){const t=e.value;p(e,d?{text:t,isChecked:!g,userTriggered:!1}:{text:t,isChecked:!g})}}))}function p(e,n){const r=Ke.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){Ke.set(e,n);const r=i.getId(e);Ge(t)({...n,id:r})}}const g=("last"===u.input?["change"]:["input","change"]).map((e=>le(e,Ge(h),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>he(e[0],e[1],{set(){Ge(h)({target:this,isTrusted:!1})}},!1,f)))),Ge((()=>{g.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:i,mirror:r,sampling:o,doc:s}=e;const a=Ge((e=>de(Ge((o=>{const s=ze(o);if(!s||ye(s,n,i,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:r.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),o.media||500))),l=[le("play",a(Le.Play),s),le("pause",a(Le.Pause),s),le("seeked",a(Le.Seeked),s),le("volumechange",a(Le.VolumeChange),s),le("ratechange",a(Le.RateChange),s)];return Ge((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:i,stylesheetManager:r}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};const s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length;const i=`${e} { ${t} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const a=o.CSSStyleSheet.prototype.deleteRule;let l,c;o.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(l=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));const u={};rt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(rt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),rt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),rt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ge(((e,t,o)=>{const[s,a]=o,{id:l,styleId:c}=et(t.parentStyleSheet,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:s,index:[...Qe(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ge(((e,t,o)=>{const[s]=o,{id:a,styleId:l}=et(t.parentStyleSheet,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Qe(t),s]}]}),e.apply(t,o)}))})})),Ge((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=a,l&&(o.CSSStyleSheet.prototype.replace=l),c&&(o.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=tt(e,e.doc),h=function(e,t){let{styleDeclarationCb:n,mirror:i,ignoreCSSAttributes:r,stylesheetManager:o}=e,{win:s}=t;const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ge(((e,t,s)=>{var l;const[c,u,d]=s;if(r.has(c))return a.apply(t,[c,u,d]);const{id:h,styleId:p}=et(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:Qe(t.parentRule)}),e.apply(t,s)}))});const l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,s)=>{var a;const[c]=s;if(r.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=et(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Qe(t.parentRule)}),e.apply(t,s)}))}),Ge((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(p=function(e){let{fontCb:t,doc:n}=e;const i=n.defaultView;if(!i)return()=>{};const r=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,n){const i=new s(e,t,n);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};const a=pe(n.fonts,"add",(function(e){return function(n){return setTimeout(Ge((()=>{const e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{i.FontFace=s})),r.push(a),Ge((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=e;let s=!0;const a=Ge((()=>{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 o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:u}=o;ye(s,i,r,!0)||ye(c,i,r,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:u})}o({ranges:a})}));return a(),le("selectionchange",a)}(e),f=function(e){let{doc:t,customElementCb:n}=e;const i=t.defaultView;if(!i||!i.customElements)return()=>{};const r=pe(i.customElements,"define",(function(e){return function(t,i,r){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,i,r])}}));return r}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Ge((()=>{Ue.forEach((e=>e.reset())),null==i||i.disconnect(),r(),o(),s(),a(),l(),c(),u(),d(),h(),p(),g(),f(),m.forEach((e=>e()))}))}function it(e){return void 0!==window[e]}function rt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ot{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,i){const r=n||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,i)))}getRemoteId(e,t,n){const i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=i.get(t);return r||-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 st{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new ot(L)),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 ot(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,i;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==(i=this.loadListener)||i.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 i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Re.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:Re.IncrementalSnapshot,data:{source:Ae.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Re.Meta:case Re.Load:case Re.DomContentLoaded:return!1;case Re.Plugin:return t;case Re.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Re.IncrementalSnapshot:switch(t.data.source){case Ae.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 Ae.Drag:case Ae.TouchMove:case Ae.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ae.ViewportResize:return!1;case Ae.MediaInteraction:case Ae.MouseInteraction:case Ae.Scroll:case Ae.CanvasMutation:case Ae.Input:return this.replaceIds(t.data,e,["id"]),t;case Ae.StyleSheetRule:case Ae.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ae.Font:return t;case Ae.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ae.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,i){for(const r of i)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));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===o.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class at{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(!_(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=je({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Xe({...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(ae.host(e))),this.restoreHandlers.push(tt({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(pe(e.prototype,"attachShadow",(function(e){return function(i){const r=e.call(this,i),o=ae.shadowRoot(this);return o&&Me(this)&&n.addShadowRoot(o,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ut=0;ut<64;ut++)ct[lt.charCodeAt(ut)]=ut;const dt=new Map;const ht=(e,t,n)=>{if(!e||!ft(e,t)&&"object"!=typeof e)return;const i=function(e,t){let n=dt.get(e);return n||(n=new Map,dt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r};function pt(e,t,n){if(e instanceof Array)return e.map((e=>pt(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),i=n.length,r="";for(t=0;t<i;t+=3)r+=lt[n[t]>>2],r+=lt[(3&n[t])<<4|n[t+1]>>4],r+=lt[(15&n[t+1])<<2|n[t+2]>>6],r+=lt[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[pt(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:[pt(e.data,t,n),e.width,e.height]}}if(ft(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ht(e,t,n)}}return e}const gt=(e,t,n)=>e.map((e=>pt(e,t,n))),ft=(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 mt(e,t,n,i){const r=[];try{const o=pe(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!ye(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),i&&["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,[r,...s])}}));r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function _t(e,t,n,i,r,o){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=pe(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(ht(u,o,this),"tagName"in this.canvas&&!ye(this.canvas,i,r,!0)){const e=gt(a,o,this),i={type:t,property:l,args:e};n(this.canvas,i)}return u}}));s.push(a)}catch{const i=he(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(i)}return s}const vt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",yt="undefined"!=typeof window&&window.Blob&&new Blob([(bt=vt,Uint8Array.from(atob(bt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var bt;function wt(e){let t;try{if(t=yt&&(window.URL||window.webkitURL).createObjectURL(yt),!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,"+vt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class St{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:i,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(i,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,i,r,o,{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,i,r){const o=mt(t,n,i,!0),s=new Map,a=new wt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:r,height:o}=e.data;this.mutationCb({id:t,type:Oe["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],r=t=>{t.querySelectorAll("canvas").forEach((t=>{ye(t,n,i,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&r(e.shadowRoot)}))};return r(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 i=e.clientWidth||e.width,o=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:i,resizeHeight:o});a.postMessage({id:n,bitmap:l,width:i,height:o,dataURLOptions:r.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=mt(e,t,n,!1),r=function(e,t,n,i){const r=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=pe(t.CanvasRenderingContext2D.prototype,s,(function(r){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ye(this.canvas,n,i,!0)||setTimeout((()=>{const n=gt(a,t,this);e(this.canvas,{type:Oe["2D"],property:s,args:n})}),0),r.apply(this,a)}}));r.push(o)}catch{const n=he(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Oe["2D"],property:s,args:[t],setter:!0})}});r.push(n)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,i){const r=[];return r.push(..._t(t.WebGLRenderingContext.prototype,Oe.WebGL,e,n,i,t)),void 0!==t.WebGL2RenderingContext&&r.push(..._t(t.WebGL2RenderingContext.prototype,Oe.WebGL2,e,n,i,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{i(),r(),o()}}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 i=n.map((e=>{const{type:t,...n}=e;return n})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}class Ct{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new Ee),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:[]},i=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,n)=>({rule:y(e,t.href),index:n})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class It{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 kt,Et,xt,Tt=!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 Mt=new w;function Rt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:N}=e;Ze=N;const F=!I||window.parent===window;let O=!1;if(!F)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!O)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),Mt.reset();const L=!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},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let D;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let $=0;const B=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!O&&(e=_(e)),e};kt=(e,r)=>{var o;const s=e;if(s.timestamp=ge(),!(null==(o=Ue[0])?void 0:o.isFrozen())||s.type===Re.FullSnapshot||s.type===Re.IncrementalSnapshot&&s.data.source===Ae.Mutation||Ue.forEach((e=>e.unfreeze())),F)null==t||t(B(s),r);else if(O){const e={type:"rrweb",event:B(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(e,"*")}if(s.type===Re.FullSnapshot)D=s,$=0;else if(s.type===Re.IncrementalSnapshot){if(s.data.source===Ae.Mutation&&s.data.isAttachIframe)return;$++;const e=i&&$>=i,t=n&&s.timestamp-D.timestamp>n;(e||t)&&Et(!0)}};const q=e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Mutation,...e}})},H=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Scroll,...e}}),W=e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.CanvasMutation,...e}}),V=new Ct({mutationCb:q,adoptedStyleSheetCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.AdoptedStyleSheet,...e}})}),Z=new st({mirror:Mt,mutationCb:q,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:kt});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:Mt,crossOriginIframeMirror:Z.crossOriginIframeMirror,crossOriginIframeStyleMirror:Z.crossOriginIframeStyleMirror});const G=new It;xt=new St({recordCanvas:C,mutationCb:W,win:window,blockClass:r,blockSelector:o,mirror:Mt,sampling:v.canvas,dataURLOptions:y});const U=new at({mutationCb:q,scrollCb:H,bypassOptions:{blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:y,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:T,sampling:v,slimDOMOptions:P,iframeManager:Z,stylesheetManager:V,canvasManager:xt,keepIframeSrcFn:R,processedNodeManager:G},mirror:Mt});Et=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!S)return;kt({type:Re.Meta,data:{href:window.location.href,width:_e(),height:me()}},e),V.reset(),U.init(),Ue.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new w,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:g,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S=(()=>!1)}=t||{};return X(e,{doc:e,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,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===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:m,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:Mt,blockClass:r,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:L,maskTextFn:f,maskInputFn:g,slimDOM:P,dataURLOptions:y,recordCanvas:C,inlineImages:T,onSerialize:e=>{Ce(e,Mt)&&Z.addIframe(e),Ie(e,Mt)&&V.trackLinkElement(e),ke(e)&&U.addShadowRoot(ae.shadowRoot(e),document)},onIframeLoad:(e,t)=>{Z.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kt({type:Re.FullSnapshot,data:{node:t,initialOffset:fe(window)}},e),Ue.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Mt.getId(document))};try{const e=[],t=e=>{var t;return Ge(nt)({mutationCb:q,mousemoveCb:(e,t)=>kt({type:Re.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.ViewportResize,...e}}),inputCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Input,...e}}),mediaInteractionCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.MediaInteraction,...e}}),styleSheetRuleCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleSheetRule,...e}}),styleDeclarationCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>kt({type:Re.IncrementalSnapshot,data:{source:Ae.Font,...e}}),selectionCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.Selection,...e}})},customElementCb:e=>{kt({type:Re.IncrementalSnapshot,data:{source:Ae.CustomElement,...e}})},blockClass:r,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:T,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:P,dataURLOptions:y,mirror:Mt,iframeManager:Z,stylesheetManager:V,shadowDomManager:U,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:A,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Re.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};Z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{Et(),e.push(t(document)),Tt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(le("DOMContentLoaded",(()=>{kt({type:Re.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(le("load",(()=>{kt({type:Re.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),G.destroy(),Tt=!1,Ze=void 0}}catch(e){console.warn(e)}}var At,Nt;Rt.addCustomEvent=(e,t)=>{if(!Tt)throw new Error("please add custom event after start recording");kt({type:Re.Custom,data:{tag:e,payload:t}})},Rt.freezePage=()=>{Ue.forEach((e=>e.freeze()))},Rt.takeFullSnapshot=e=>{if(!Tt)throw new Error("please take full snapshot after start recording");Et(e)},Rt.mirror=Mt,(Nt=At||(At={}))[Nt.NotStarted=0]="NotStarted",Nt[Nt.Running=1]="Running",Nt[Nt.Stopped=2]="Stopped";var Ft,Ot=Object.defineProperty,Lt=(e,t,n)=>((e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Pt=Object.defineProperty,Dt=(e,t,n)=>((e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),$t=Object.defineProperty,Bt=(e,t,n)=>((e,t,n)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const qt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ht={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Wt={};function Vt(e){if(Wt[e])return Wt[e];const t=globalThis[e],n=t.prototype,i=e in qt?qt[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Ht?Ht[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return Wt[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?Wt[e]=o:n}catch{return n}}const Zt={};function Gt(e,t,n){var i;const r=`${e}.${String(n)}`;if(Zt[r])return Zt[r].call(t);const o=Vt(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(Zt[r]=s,s.call(t)):t[n]}const Ut={};function zt(e,t,n){const i=`${e}.${String(n)}`;if(Ut[i])return Ut[i].bind(t);const r=Vt(e)[n];return"function"!=typeof r?t[n]:(Ut[i]=r,r.bind(t))}const jt={childNodes:function(e){return Gt("Node",e,"childNodes")},parentNode:function(e){return Gt("Node",e,"parentNode")},parentElement:function(e){return Gt("Node",e,"parentElement")},textContent:function(e){return Gt("Node",e,"textContent")},contains:function(e,t){return zt("Node",e,"contains")(t)},getRootNode:function(e){return zt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Gt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Gt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Gt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Vt("MutationObserver").constructor}};class Yt{constructor(){Bt(this,"idNodeMap",new Map),Bt(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 Xt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Xt(jt.parentNode(e),t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&Xt(jt.parentNode(e),t,n)}class Jt{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Jt))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Kt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},en={};function tn(e){if(en[e])return en[e];const t=globalThis[e],n=t.prototype,i=e in Kt?Kt[e]:void 0,r=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),o=e in Qt?Qt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(r&&s)return en[e]=t.prototype,t.prototype;try{const i=document.createElement("iframe");document.body.appendChild(i);const r=i.contentWindow;if(!r)return t.prototype;const o=r[e].prototype;return document.body.removeChild(i),o?en[e]=o:n}catch{return n}}const nn={};function rn(e,t,n){var i;const r=`${e}.${String(n)}`;if(nn[r])return nn[r].call(t);const o=tn(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(nn[r]=s,s.call(t)):t[n]}const on={};function sn(e,t,n){const i=`${e}.${String(n)}`;if(on[i])return on[i].bind(t);const r=tn(e)[n];return"function"!=typeof r?t[n]:(on[i]=r,r.bind(t))}const an={childNodes:function(e){return rn("Node",e,"childNodes")},parentNode:function(e){return rn("Node",e,"parentNode")},parentElement:function(e){return rn("Node",e,"parentElement")},textContent:function(e){return rn("Node",e,"textContent")},contains:function(e,t){return sn("Node",e,"contains")(t)},getRootNode:function(e){return sn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?rn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?rn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return rn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return rn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return tn("MutationObserver").constructor}};const ln="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 cn={map:{},getId:()=>(console.error(ln),-1),getNode:()=>(console.error(ln),null),removeNodeFromMap(){console.error(ln)},has:()=>(console.error(ln),!1),reset(){console.error(ln)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get:(e,t,n)=>("map"===t&&console.error(ln),Reflect.get(e,t,n))}));let un=Date.now;function dn(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:an.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(un=()=>(new Date).getTime());function hn(e){var t;let n=null;return"getRootNode"in e&&(null==(t=an.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&an.host(an.getRootNode(e))&&(n=an.host(an.getRootNode(e))),n}function pn(e){let t,n=e;for(;t=hn(n);)n=t;return n}function gn(e){const t=e.ownerDocument;if(!t)return!1;const n=pn(e);return an.contains(t,n)}const fn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Dt(this,"id",1),Dt(this,"styleIDMap",new WeakMap),Dt(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 cn},closestElementOfNode:dn,getBaseDimension:function e(t,n){var i,r;const o=null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,n),l=s.height/o.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 i=t[n[0]];return 1===n.length?i:e(i.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:pn,getShadowHost:hn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,i,r;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=an.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=an.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Jt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(an.shadowRoot(e)))},hookSetter:function e(t,n,i,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,r?i:{set(e){setTimeout((()=>{i.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&&(an.contains(t,e)||gn(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&jt.host(e)||null;return Boolean(t&&"shadowRoot"in t&&jt.shadowRoot(t)===e)}(t))return!1;const i=n.getId(t);if(!n.has(i))return!0;const r=an.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n))},isBlocked:function(e,t,n,i){if(!e)return!1;const r=dn(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(Xt(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.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 i=t.children.length-1;i>=0;i--)e(t.children[i],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return un},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}},polyfill:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const r of e){const{nextId:e,parentId:o}=r;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(r,o.parent))}else{const e=i.indexOf(o);i.splice(e,0,n(r,null))}}else if(o in t){const e=t[o];e.children.push(n(r,e))}else i.push(n(r,null))}return i},shadowHostInDom:gn,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let i=e.length;i--;){const r=e[i];t.has(r.id)||(n.push(r),t.add(r.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vn=0;vn<64;vn++)_n[mn.charCodeAt(vn)]=vn;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){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 yn;new Yt,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(yn||(yn={}));class bn{constructor(e){Lt(this,"fileName"),Lt(this,"functionName"),Lt(this,"lineNumber"),Lt(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 wn=/(^|@)\S+:\d+/,Sn=/^\s*at .*(\S+:\d+|\(native\))/m,Cn=/^(eval@)?(\[native code])?$/,In={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Sn)?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(Sn)}),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 i=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new bn({functionName:o,fileName:s,lineNumber:r[1],columnNumber:r[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Cn)}),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 bn({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new bn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[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"),i=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new bn({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(wn)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new bn({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function kn(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(let e=0;e<i.children.length;e++){const t=i.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=i}return t}function En(e){return"[object Object]"===Object.prototype.toString.call(e)}function xn(e,t){if(0===t)return!0;const n=Object.keys(e);for(const i of n)if(En(e[i])&&xn(e[i],t-1))return!0;return!1}function Tn(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const i=[],r=[];return JSON.stringify(e,(function(e,t){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(En(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(En(e)&&xn(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 i=t[n];Array.isArray(i)?e[n]=kn(i.length?i[0]:null):e[n]=i}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 Mn={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 Rn(e,t,n){const i=n?Object.assign({},Mn,n):Mn,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?t[r]:r;let s=0,a=!1;const l=[];if(i.level.includes("error")){const n=t=>{const n=t.message,r=t.error,o=In.parse(r).map((e=>e.toString())),s=[Tn(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const r=t=>{let n,r;t.reason instanceof Error?(n=t.reason,r=[Tn(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Tn("Uncaught (in promise)",i.stringifyOptions),Tn(t.reason,i.stringifyOptions)]);const o=In.parse(n).map((e=>e.toString()));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",r),l.push((()=>{t.removeEventListener("unhandledrejection",r)}))}for(const e of i.level)l.push(c(o,e));return()=>{l.forEach((e=>e()))};function c(t,n){var r=this;return t[n]?fn.patch(t,n,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(r,l),!("assert"===n&&l[0]||a)){a=!0;try{const t=In.parse(new Error).map((e=>e.toString())).splice(1),r=("assert"===n?l.slice(1):l).map((e=>Tn(e,i.stringifyOptions)));s++,s<i.lengthThreshold?e({level:n,trace:t,payload:r}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Tn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const An=e=>({name:"rrweb/console@1",observer:Rn,options:e}),Nn=Array.isArray,Fn=Object.prototype,On=Fn.hasOwnProperty,Ln=Fn.toString,Pn=Nn||function(e){return"[object Array]"===Ln.call(e)},Dn=function(e){return"function"==typeof e},$n=function(e){return e===Object(e)&&!Pn(e)},Bn=function(e){if($n(e)){for(const t in e)if(On.call(e,t))return!1;return!0}return!1},qn=function(e){return void 0===e},Hn=function(e){return"[object String]"==Ln.call(e)},Wn=function(e){return Hn(e)&&0===e.trim().length},Vn=function(e){return null===e},Zn=function(e){return qn(e)||Vn(e)},Gn=function(e){return"[object Number]"==Ln.call(e)},Un=function(e){return"[object Boolean]"===Ln.call(e)},zn=e=>e instanceof Document,jn=e=>e instanceof FormData;const Yn={DEBUG:!1,LIB_VERSION:"1.185.0"},Xn="undefined"!=typeof window?window:void 0,Jn="undefined"!=typeof globalThis?globalThis:Xn,Kn=Array.prototype,Qn=Kn.forEach,ei=Kn.indexOf,ti=null==Jn?void 0:Jn.navigator,ni=null==Jn?void 0:Jn.document,ii=null==Jn?void 0:Jn.location,ri=null==Jn?void 0:Jn.fetch,oi=null!=Jn&&Jn.XMLHttpRequest&&"withCredentials"in new Jn.XMLHttpRequest?Jn.XMLHttpRequest:void 0,si=null==Jn?void 0:Jn.AbortController,ai=null==ti?void 0:ti.userAgent,li=null!=Xn?Xn:{},ci="[PostHog.js]",ui={_log:function(e){if(Xn&&(Yn.DEBUG||li.POSTHOG_DEBUG)&&!qn(Xn.console)&&Xn.console){const r="__rrweb_original__"in Xn.console[e]?Xn.console[e].__rrweb_original__:Xn.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(ci,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ui._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(ci,...t)},uninitializedWarning:e=>{ui.error(`You must initialize PostHog before calling ${e}`)}},di={},hi=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function pi(e,t,n){if(Pn(e))if(Qn&&e.forEach===Qn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===di)return}function gi(e,t,n){if(!Zn(e)){if(Pn(e))return pi(e,t,n);if(jn(e)){for(const i of e.entries())if(t.call(n,i[1],i[0])===di)return}else for(const i in e)if(On.call(e,i)&&t.call(n,e[i],i)===di)return}}const fi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return pi(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function mi(e,t){return-1!==e.indexOf(t)}function _i(e){const t=Object.keys(e);let n=t.length;const i=new Array(n);for(;n--;)i[n]=[t[n],e[t[n]]];return i}const vi=function(e){try{return e()}catch{return}},yi=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){ui.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ui.critical(e)}}},bi=function(e){const t={};return gi(e,(function(e,n){Hn(e)&&e.length>0&&(t[n]=e)})),t},wi=function(e){return e.replace(/^\$/,"")};function Si(e,t){return function(e,t){const n=new Set;return function e(i,r){if(i!==Object(i))return t?t(i,r):i;if(n.has(i))return;let o;return n.add(i),Pn(i)?(o=[],pi(i,(t=>{o.push(e(t))}))):(o={},gi(i,((t,i)=>{n.has(t)||(o[i]=e(t,i))}))),o}(e)}(e,(e=>Hn(e)&&!Vn(t)?e.slice(0,t):e))}const Ci=function(e){let t,n,i,r="",o=0;for(t=n=0,o=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<o;i++){const o=e.charCodeAt(i);let s=null;o<128?n++:s=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Vn(s)||(n>t&&(r+=e.substring(t,n)),r+=s,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},Ii=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{const r="on"+n,o=t[r];t[r]=function(t,n,i){return function(r){if(!(r=r||e(null==Xn?void 0:Xn.event)))return;let o,s=!0;Dn(i)&&(o=i(r));const a=n.call(t,r);return!1!==o&&!1!==a||(s=!1),s}}(t,i,o)}else ui.error("No valid element provided to register_event")}}();function ki(e){const t=null==e?void 0:e.hostname;return!!Hn(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}function Ei(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}const xi=["localhost","127.0.0.1"],Ti=e=>{const t=null==ni?void 0:ni.createElement("a");return qn(t)?null:(t.href=e,t)},Mi=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},Ri=function(e){let t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const r=[];return gi(e,(function(e,i){qn(e)||qn(i)||"undefined"===i||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},Ai=function(e,t){const n=((e.split("#")[0]||"").split("?")[1]||"").split("&");let i;for(let e=0;e<n.length;e++){const r=n[e].split("=");if(r[0]===t){i=r;break}}if(!Pn(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{ui.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},Ni=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Fi="$people_distinct_id",Oi="__alias",Li="__timers",Pi="$autocapture_disabled_server_side",Di="$heatmaps_enabled_server_side",$i="$exception_capture_enabled_server_side",Bi="$exception_capture_endpoint_suffix",qi="$web_vitals_enabled_server_side",Hi="$dead_clicks_enabled_server_side",Wi="$web_vitals_allowed_metrics",Vi="$session_recording_enabled_server_side",Zi="$console_log_recording_enabled_server_side",Gi="$session_recording_network_payload_capture",Ui="$session_recording_canvas_recording",zi="$replay_sample_rate",ji="$replay_minimum_duration",Yi="$sesid",Xi="$session_is_sampled",Ji="$session_recording_url_trigger_activated_session",Ki="$session_recording_url_trigger_status",Qi="$enabled_feature_flags",er="$early_access_features",tr="$stored_person_properties",nr="$stored_group_properties",ir="$surveys",rr="$surveys_activated",or="$flag_call_reported",sr="$user_state",ar="$client_session_props",lr="$capture_rate_limit",cr="$initial_campaign_params",ur="$initial_referrer_info",dr="$initial_person_info",hr="$epp",pr="__POSTHOG_TOOLBAR__",gr=[Fi,Oi,"__cmpns",Li,Vi,Di,Yi,Qi,sr,er,nr,tr,ir,or,ar,lr,cr,ur,hr];function fr(e){var t;return e.id===pr||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container"))}function mr(e){return!!e&&1===e.nodeType}function _r(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function vr(e){return!!e&&3===e.nodeType}function yr(e){return!!e&&11===e.nodeType}function br(e){return e?hi(e).split(/\s+/):[]}function wr(e){const t=null==Xn?void 0:Xn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Sr(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 br(t)}function Cr(e){return Zn(e)?null:hi(e).split(/(\s+)/).filter((e=>Dr(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ir(e){let t="";return Mr(e)&&!Rr(e)&&e.childNodes&&e.childNodes.length&&gi(e.childNodes,(function(e){var n;vr(e)&&e.textContent&&(t+=null!==(n=Cr(e.textContent))&&void 0!==n?n:"")})),hi(t)}function kr(e){return qn(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}const Er=["a","button","form","input","select","textarea","label"];function xr(e){const t=e.parentNode;return!(!t||!mr(t))&&t}function Tr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Xn||!e||_r(e,"html")||!mr(e))return!1;if(null!=n&&n.url_allowlist&&!wr(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&wr(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){const e=n.dom_event_allowlist;if(e&&!e.some((e=>t.type===e)))return!1}let o=!1;const s=[e];let a=!0,l=e;for(;l.parentNode&&!_r(l,"body");)if(yr(l.parentNode))s.push(l.parentNode.host),l=l.parentNode.host;else{if(a=xr(l),!a)break;if(i||Er.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{const e=Xn.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(o=!0)}s.push(a),l=a}if(!function(e,t){const n=null==t?void 0:t.element_allowlist;if(qn(n))return!0;for(const t of e)if(n.some((e=>t.tagName.toLowerCase()===e)))return!0;return!1}(s,n))return!1;if(!function(e,t){const n=null==t?void 0:t.css_selector_allowlist;if(qn(n))return!0;for(const t of e)if(n.some((e=>t.matches(e))))return!0;return!1}(s,n))return!1;const c=Xn.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return o?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Er.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function Mr(e){for(let t=e;t.parentNode&&!_r(t,"body");t=t.parentNode){const e=Sr(t);if(mi(e,"ph-sensitive")||mi(e,"ph-no-capture"))return!1}if(mi(Sr(e),"ph-include"))return!0;const t=e.type||"";if(Hn(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(Hn(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 Rr(e){return!!(_r(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_r(e,"select")||_r(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const Ar="(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})",Nr=new RegExp(`^(?:${Ar})$`),Fr=new RegExp(Ar),Or="\\d{3}-?\\d{2}-?\\d{4}",Lr=new RegExp(`^(${Or})$`),Pr=new RegExp(`(${Or})`);function Dr(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zn(e))return!1;if(Hn(e)){e=hi(e);if((t?Nr:Fr).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Lr:Pr).test(e))return!1}return!0}function $r(e){let t=Ir(e);return t=`${t} ${Br(e)}`.trim(),Dr(t)?t:""}function Br(e){let t="";return e&&e.childNodes&&e.childNodes.length&&gi(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Ir(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${Br(e)}`.trim())}catch(e){ui.error(e)}})),t}function qr(e){return function(e){const t=e.map((e=>{var t,n;let i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)i+=`.${t.replace(/"/g,"")}`}const r={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},o={};return _i(r).sort(((e,t)=>{let[n]=e,[i]=t;return n.localeCompare(i)})).forEach((e=>{let[t,n]=e;return o[Hr(t.toString())]=Hr(n.toString())})),i+=":",i+=_i(r).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),i}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const i={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:Wr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _i(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return i.attributes[t]=n})),i}))}(e))}function Hr(e){return e.replace(/"|\\"/g,'\\"')}function Wr(e){const t=e.attr__class;return t?Pn(t)?t:br(t):void 0}const Vr="[SessionRecording]",Zr="redacted",Gr={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"]},Ur=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],zr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],jr=["/s/","/e/","/i/"];function Yr(e,t,n,i){if(Zn(e))return e;let r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Hn(r)&&(r=parseInt(r)),r>n?Vr+` ${i} body too large to record (${r} bytes)`:e}function Xr(e,t){if(Zn(e))return e;let n=e;return Dr(n,!1)||(n=Vr+" "+t+" body "+Zr),gi(zr,(e=>{var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Vr+" "+t+" body "+Zr+" as might contain: "+e)})),n}const Jr=(e,t)=>{const n={payloadSizeLimitBytes:Gr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Gr.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Gr.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,r=!1!==e.session_recording.recordBody&&t.recordBody,o=!1!==e.capture_performance&&t.recordPerformance,s=(e=>{var t;const n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=Yr(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=Yr(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>s((e=>{const t=Ti(e.name);if(!(t&&t.pathname&&jr.some((e=>0===t.pathname.indexOf(e)))))return e})((e=>{const t=e.requestHeaders;return Zn(t)||gi(Object.keys(null!=t?t:{}),(e=>{Ur.includes(e.toLowerCase())&&(t[e]=Zr)})),e})(e))),l=Dn(e.session_recording.maskNetworkRequestFn);return l&&Dn(e.session_recording.maskCapturedNetworkRequestFn)&&ui.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{const n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=Dn(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,i,r;const o=a(t);return o&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,o))&&void 0!==n?n:void 0}:e=>function(e){if(!qn(e))return e.requestBody=Xr(e.requestBody,"Request"),e.responseBody=Xr(e.responseBody,"Response"),e}(a(e)),{...Gr,...n,recordHeaders:i,recordBody:r,recordPerformance:o,recordInitialRequests:o}};function Kr(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return Dn(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}function Qr(e,t){var n;const i=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),r={hostname:i,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==i||!i.trim().length)return r;for(const e of t.payloadHostDenyList)if(i.endsWith(e))return{hostname:i,isHostDenied:!0};return r}const eo=e=>"navigation"===e.entryType,to=e=>"resource"===e.entryType;function no(e,t,n){if(n.recordInitialRequests){const i=t.performance.getEntries().filter((e=>eo(e)||to(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>lo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const i=new t.PerformanceObserver((t=>{const i=t.getEntries().filter((e=>eo(e)||to(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>lo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),r=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:r}),()=>{i.disconnect()}}function io(e,t){return!!t&&(Un(t)||t[e])}function ro(e){let{type:t,recordBody:n,headers:i}=e;function r(e){const t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),n=t&&i[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Un(n))return!0;if(Pn(n))return r(n);const o=n[t];return Un(o)?o:r(o)}async function oo(e,t,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return ui.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=>to(e)&&e.initiatorType===t&&(qn(i)||e.startTime>=i)&&(qn(r)||e.startTime<=r)));return s||(await new Promise((e=>setTimeout(e,50*o))),oo(e,t,n,i,r,o+1))}function so(e){let{body:t,options:n,url:i}=e;if(Zn(t))return null;const{hostname:r,isHostDenied:o}=Qr(i,n);if(o)return r+" is in deny list";if(Hn(t))return t;if(zn(t))return t.textContent;if(jn(t))return Ri(t);if($n(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 ao=e=>!Vn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function lo(e){let{entry:t,method:n,status:i,networkRequest:r,isInitial:o,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)),h=[{...t?t.toJSON():{name:l},startTime:qn(s)?void 0:Math.round(s),endTime:qn(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o}];if(ao(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const co=["video/","audio/"];function uo(e){return new Promise(((t,n)=>{const i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(i)))}catch{clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}async function ho(e){let{r:t,options:n,url:i}=e;const r=function(e){var t;let{r:n,options:i,url:r}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=co.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return`Content-Type ${o} is not supported`;const{hostname:a,isHostDenied:l}=Qr(r,i);return l?a+" is in deny list":null}({r:t,options:n,url:i});return Vn(r)?uo(t):Promise.resolve(r)}function po(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=io("request",n.recordHeaders),r=io("response",n.recordHeaders),o=Kr(t,"fetch",(o=>async function(s,a){const l=new Request(s,a);let c;const u={};let d,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),i&&(u.requestHeaders=e),ro({type:"request",headers:e,url:s,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:i}=e;const{hostname:r,isHostDenied:o}=Qr(i,n);return o?Promise.resolve(r+" is in deny list"):uo(t)}({r:l,options:n,url:s})),d=t.performance.now(),c=await o(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),r&&(u.responseHeaders=a),ro({type:"response",headers:a,url:s,recordBody:n.recordBody})&&(u.responseBody=await ho({r:c,options:n,url:s})),c}finally{oo(t,"fetch",l.url,d,h).then((t=>{var n;const i=lo({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:h,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return()=>{o()}}let go=null;function fo(e,t,n){if(!("performance"in t))return()=>{};if(go)return ui.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Gr,n):Gr,r=t=>{const n=[];t.requests.forEach((e=>{const t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},o=no(r,t,i);let s=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=io("request",n.recordHeaders),r=io("response",n.recordHeaders),o=Kr(t.XMLHttpRequest.prototype,"open",(o=>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,h=new Request(a),p={};let g,f;const m={},_=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,_(e,t)),i&&(p.requestHeaders=m);const v=d.send.bind(d);d.send=e=>(ro({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(p.requestBody=so({body:e,options:n,url:a})),g=t.performance.now(),v(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;f=t.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");n&&(i[n]=r)})),r&&(p.responseHeaders=i),ro({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(p.responseBody=so({body:d.response,options:n,url:a})),oo(t,"xmlhttprequest",h.url,g,f).then((t=>{const n=lo({entry:t,method:h.method,status:null==d?void 0:d.status,networkRequest:p,start:g,end:f,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),o.call(d,s,a,l,c,u)}));return()=>{o()}}(r,t,i),a=po(r,t,i)),go=()=>{o(),s(),a()},go}const mo=e=>({name:"rrweb/network@1",observer:fo,options:e});let _o,vo,yo;li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:An,getRecordNetworkPlugin:mo},li.__PosthogExtensions__.rrweb={record:Rt,version:"v2"},li.rrweb={record:Rt,version:"v2"},li.rrwebConsoleRecord={getRecordConsolePlugin:An},li.getRecordNetworkPlugin=mo,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(_o||(_o={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(vo||(vo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(yo||(yo={}));var bo,wo,So,Co,Io,ko,Eo,xo,To={},Mo=[],Ro=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ao=Array.isArray;function No(e,t){for(var n in t)e[n]=t[n];return e}function Fo(e){var t=e.parentNode;t&&t.removeChild(e)}function Oo(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?bo.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Lo(e,s,i,r,null)}function Lo(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++So:r,__i:-1,__u:0};return null==r&&null!=wo.vnode&&wo.vnode(o),o}function Po(e){return e.children}function Do(e,t){this.props=e,this.context=t}function $o(e,t){if(null==t)return e.__?$o(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?$o(e):null}function Bo(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 Bo(e)}}function qo(e){(!e.__d&&(e.__d=!0)&&Co.push(e)&&!Ho.__r++||Io!==wo.debounceRendering)&&((Io=wo.debounceRendering)||ko)(Ho)}function Ho(){var e,t,n,i,r,o,s,a,l;for(Co.sort(Eo);e=Co.shift();)e.__d&&(t=Co.length,i=void 0,o=(r=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((i=No({},r)).__v=r.__v+1,wo.vnode&&wo.vnode(i),Yo(s,i,r,n.__n,void 0!==s.ownerSVGElement,32&r.__u?[o]:null,a,null==o?$o(r):o,!!(32&r.__u),l),i.__.__k[i.__i]=i,Xo(a,i,l),i.__e!=o&&Bo(i)),Co.length>t&&Co.sort(Eo));Ho.__r=0}function Wo(e,t,n,i,r,o,s,a,l,c,u){var d,h,p,g,f,m=i&&i.__k||Mo,_=t.length;for(n.__d=l,function(e,t,n){var i,r,o,s,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],i=0;i<l;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?Lo(null,r,null,null,r):Ao(r)?Lo(Po,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?Lo(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Zo(r,n,s=i+d,u),r.__i=a,o=null,-1!==a&&(u--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__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!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=$o(o)),Ko(o,o,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(o=n[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=$o(o)),Ko(o,o))}(n,t,m),l=n.__d,d=0;d<_;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?To:m[p.__i]||To,p.__i=d,Yo(e,p,h,r,o,s,a,l,c,u),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Jo(h.ref,null,p),u.push(p.ref,p.__c||g,p)),null==f&&null!=g&&(f=g),65536&p.__u||h.__k===p.__k?l=Vo(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=f}function Vo(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Vo(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Zo(e,t,n,i){var r=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&r==l.key&&o===l.type)return n;if(i>(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)&&r==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&r==l.key&&o===l.type)return a;a++}}return-1}function Go(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ro.test(t)?n:n+"px"}function Uo(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Go(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Go(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?jo:zo,o)):e.removeEventListener(t,o?jo:zo,o);else{if(r)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 zo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(wo.event?wo.event(e):e)}function jo(e){return this.l[e.type+!0](wo.event?wo.event(e):e)}function Yo(e,t,n,i,r,o,s,a,l,c){var u,d,h,p,g,f,m,_,v,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=wo.__b)&&u(t);e:if("function"==typeof k)try{if(_=t.props,v=(u=k.contextType)&&i[u.__c],y=u?v?v.props.value:u.__:i,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(_,y):(t.__c=d=new Do(_,y),d.constructor=k,d.render=Qo),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=No({},d.__s)),No(d.__s,k.getDerivedStateFromProps(_,d.__s))),p=d.props,g=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,f)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,w=wo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=No(No({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(p,g)),Wo(e,Ao(I=null!=u&&u.type===Po&&null==u.key?u.props.children:u)?I:[I],t,n,i,r,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),wo.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a,l){var c,u,d,h,p,g,f,m=n.props,_=t.props,v=t.type;if("svg"===v&&(r=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!v&&(v?p.localName===v:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===v)return document.createTextNode(_);e=r?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,_.is&&_),o=null,a=!1}if(null===v)m===_||a&&e.data===_||(e.data=_);else{if(o=o&&bo.call(e.childNodes),m=n.props||To,!a&&null!=o)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)p=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in _||Uo(e,c,null,p,r));for(c in _)p=_[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?g=p:"checked"==c?f=p:"key"===c||a&&"function"!=typeof p||m[c]===p||Uo(e,c,p,m[c],r);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Wo(e,Ao(h)?h:[h],t,n,i,r&&"foreignObject"!==v,o,s,o?o[0]:n.__k&&$o(n,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&Fo(o[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===v&&!g||"option"===v&&g!==m[c])&&Uo(e,c,g,m[c],!1),c="checked",void 0!==f&&f!==e[c]&&Uo(e,c,f,m[c],!1))}return e}(n.__e,t,n,i,r,o,s,l,c);(u=wo.diffed)&&u(t)}function Xo(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)Jo(n[i],n[++i],n[++i]);wo.__c&&wo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wo.__e(e,t.__v)}}))}function Jo(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wo.__e(e,n)}}function Ko(e,t,n){var i,r;if(wo.unmount&&wo.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Jo(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){wo.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Ko(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Fo(e.__e),e.__=e.__e=e.__d=void 0}function Qo(e,t,n){return this.constructor(e,n)}function es(e,t,n){var i,r,o,s;wo.__&&wo.__(e,t),r=(i="function"==typeof n)?null:t.__k,o=[],s=[],Yo(t,e=(!i&&n||t).__k=Oo(Po,null,[e]),r||To,To,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?bo.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),Xo(o,e,s)}function ts(e,t,n){var i,r,o,s,a=No({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?bo.call(arguments,2):n),Lo(e.type,a,i||e.key,r||e.ref,null)}bo=Mo.slice,wo={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},So=0,Do.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=No({},this.state),"function"==typeof e&&(e=e(No({},n),this.props)),e&&No(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),qo(this))},Do.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qo(this))},Do.prototype.render=Po,Co=[],ko="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Eo=function(e,t){return e.__v.__b-t.__v.__b},Ho.__r=0,xo=0;const ns=Xn,is=ni,rs="seenSurvey_",os=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: ${as((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 ss(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 as(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cs;"#"===t[0]&&(e=ss(t)),t.startsWith("rgb")&&(e=t);const n=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(n&&(e=ss(n)),!e)return"black";const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const ls={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"},cs="#eeeded",us=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(ms(n),"true"),i.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=i.get_session_replay_url)||void 0===e?void 0:e.call(i),...t,$set:{[_s(n,"responded")]:!0}}),ns.dispatchEvent(new Event("PHSurveySent")))},ds=(e,t,n)=>{var i;!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===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:{[_s(e,"dismissed")]:!0}}),localStorage.setItem(ms(e),"true"),ns.dispatchEvent(new Event("PHSurveyClosed")))},hs=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),ps=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,gs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?ps(e.questions,hs(e.questions)):e.questions),fs=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,i,r,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},ms=e=>{let t=`${rs}${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`${rs}${e.id}_${e.current_iteration}`),t},_s=(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},vs=function(e,t){var n={__c:t="__cC"+xo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,qo(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}),ys=e=>{let{component:t,children:n,renderAsHtml:i,style:r}=e;return ts(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},bs=ni;var ws,Ss,Cs,Is,ks=0,Es=[],xs=[],Ts=wo.__b,Ms=wo.__r,Rs=wo.diffed,As=wo.__c,Ns=wo.unmount;function Fs(e,t){wo.__h&&wo.__h(Ss,e,ks||t),ks=0;var n=Ss.__H||(Ss.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:xs}),n.__[e]}function Os(e){return ks=1,function(e,t,n){var i=Fs(ws++,2);if(i.t=e,!i.__c&&(i.__=[Gs(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Ss,!Ss.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Ss.u=!0;var o=Ss.shouldComponentUpdate,s=Ss.componentWillUpdate;Ss.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},Ss.shouldComponentUpdate=r}return i.__N||i.__}(Gs,e)}function Ls(e,t){var n=Fs(ws++,3);!wo.__s&&Zs(n.__H,t)&&(n.__=e,n.i=t,Ss.__H.__h.push(n))}function Ps(e){return ks=5,Ds((function(){return{current:e}}),[])}function Ds(e,t){var n=Fs(ws++,7);return Zs(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function $s(e){var t=Ss.context[e.__c],n=Fs(ws++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Ss)),t.props.value):e.__}function Bs(){for(var e;e=Es.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ws),e.__H.__h.forEach(Vs),e.__H.__h=[]}catch(t){e.__H.__h=[],wo.__e(t,e.__v)}}wo.__b=function(e){Ss=null,Ts&&Ts(e)},wo.__r=function(e){Ms&&Ms(e),ws=0;var t=(Ss=e.__c).__H;t&&(Cs===Ss?(t.__h=[],Ss.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=xs,e.__N=e.i=void 0}))):(t.__h.forEach(Ws),t.__h.forEach(Vs),t.__h=[],ws=0)),Cs=Ss},wo.diffed=function(e){Rs&&Rs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Es.push(t)&&Is===wo.requestAnimationFrame||((Is=wo.requestAnimationFrame)||Hs)(Bs)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==xs&&(e.__=e.__V),e.i=void 0,e.__V=xs}))),Cs=Ss=null},wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ws),e.__h=e.__h.filter((function(e){return!e.__||Vs(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],wo.__e(n,e.__v)}})),As&&As(e,t)},wo.unmount=function(e){Ns&&Ns(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Ws(e)}catch(e){t=e}})),n.__H=void 0,t&&wo.__e(t,n.__v))};var qs="function"==typeof requestAnimationFrame;function Hs(e){var t,n=function(){clearTimeout(i),qs&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);qs&&(t=requestAnimationFrame(n))}function Ws(e){var t=Ss,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ss=t}function Vs(e){var t=Ss;e.__c=e.__(),Ss=t}function Zs(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Gs(e,t){return"function"==typeof t?t(e):t}var Us=0;function zs(e,t,n,i,r,o){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:--Us,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return wo.vnode&&wo.vnode(c),c}const js=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Ys=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Xs=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Js=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Ks=zs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:zs("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"})}),Qs=zs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:zs("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"})}),ea=zs("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[zs("g",{"clip-path":"url(#clip0_2415_6911)",children:[zs("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:zs("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),zs("g",{mask:"url(#mask0_2415_6911)",children:[zs("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"}),zs("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"}),zs("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"}),zs("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"}),zs("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"}),zs("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"})]})]}),zs("defs",{children:zs("clipPath",{id:"clip0_2415_6911",children:zs("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),ta=zs("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:zs("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 na(){return zs("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ea]})}function ia(e){let{text:t,submitDisabled:n,appearance:i,onSubmit:r,link:o}=e;const{isPreviewMode:s,isPopup:a}=$s(vs),l=i.submitButtonTextColor||as(i.submitButtonColor||ls.submitButtonColor);return zs("div",{className:"bottom-section",children:[zs("div",{className:"buttons",children:zs("button",{className:"form-submit",disabled:n&&!s,type:"button",style:a?{color:l}:{},onClick:()=>{s||(o&&(null==Xn||Xn.open(o)),r())},children:t})}),!i.whiteLabel&&zs(na,{})]})}function ra(e){let{question:t,description:n,descriptionContentType:i,backgroundColor:r,forceDisableHtml:o}=e;const{isPopup:s}=$s(vs);return zs("div",{style:s?{backgroundColor:r||ls.backgroundColor}:{},children:[zs("div",{className:"survey-question",children:t}),n&&ys({component:Oo("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==i})]})}function oa(e){let{onClick:t}=e;const{isPreviewMode:n}=$s(vs);return zs("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:zs("button",{className:"form-cancel",onClick:t,disabled:n,children:Qs})})}function sa(e){let{header:t,description:n,contentType:i,forceDisableHtml:r,appearance:o,onClose:s,styleOverrides:a}=e;const l=as(o.backgroundColor||ls.backgroundColor),{isPopup:c}=$s(vs);return zs(Po,{children:zs("div",{className:"thank-you-message",style:{...a},children:zs("div",{className:"thank-you-message-container",children:[c&&zs(oa,{onClick:()=>s()}),zs("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&ys({component:Oo("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:l}}),c&&zs(ia,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>s()})]})})})}function aa(e){var t;const n=Ps(null),[i,r]=Os(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Ls((()=>{if(n.current){const e=function(e){const t=ns.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 i=parseInt(n[1]),r=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+o*o*.114)>127.5?"black":"white"}(n.current);r(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function la(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;const o=Ps(null),[s,a]=Os("");return zs("div",{ref:o,children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),zs("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>a(e.currentTarget.value)}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:i,onSubmit:()=>r(s)})]})}function ca(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;return zs(Po,{children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>r("link clicked")})]})}function ua(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=t.scale,a=10===t.scale?0:1,[l,c]=Os(null);return zs(Po,{children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),zs("div",{className:"rating-section",children:[zs("div",{className:"rating-options",children:["emoji"===t.display&&zs("div",{className:"rating-options-emoji",children:(3===t.scale?pa:ga).map(((e,t)=>{const n=t+1===l;return zs("button",{className:`ratings-emoji question-${i}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&zs("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${s-a+1}, minmax(0, 1fr))`},children:va(t.scale).map(((e,t)=>zs(da,{displayQuestionIndex:i,active:l===e,appearance:r,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),zs("div",{className:"rating-text",children:[zs("div",{children:t.lowerBoundLabel}),zs("div",{children:t.upperBoundLabel})]})]}),zs(ia,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:Vn(l)&&!t.optional,appearance:r,onSubmit:()=>o(l)})]})}function da(e){let{num:t,active:n,displayQuestionIndex:i,appearance:r,setActiveNumber:o}=e;const{textColor:s,ref:a}=aa({appearance:r,defaultTextColor:"black",forceUpdate:n});return zs("button",{ref:a,className:`ratings-number question-${i}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function ha(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s=Ps(null),a=Ds((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const i=ps(t,hs(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i})(t)),[t]),[l,c]=Os(t.type===vo.MultipleChoice?[]:null),[u,d]=Os(!1),[h,p]=Os(""),g=t.type===vo.SingleChoice?"radio":"checkbox";return zs("div",{ref:s,children:[zs(ra,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),zs("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let r="choice-option";const o=e,s=e;return t.hasOpenChoice&&n===t.choices.length-1&&(r+=" choice-option-open"),zs("div",{className:r,children:[zs("input",{type:g,id:`surveyQuestion${i}Choice${n}`,name:`question${i}`,value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===vo.SingleChoice?c(o):t.type===vo.MultipleChoice&&Pn(l)?l.includes(o)?c(l.filter((e=>e!==o))):c([...l,o]):void 0}),zs("label",{htmlFor:`surveyQuestion${i}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?zs(Po,{children:[zs("span",{children:[s,":"]}),zs("input",{type:"text",id:`surveyQuestion${i}Choice${n}Open`,name:`question${i}`,onInput:e=>{const n=e.currentTarget.value;return t.type===vo.SingleChoice?c(n):t.type===vo.MultipleChoice&&Pn(l)?p(n):void 0}})]}):s}),zs("span",{className:"choice-check",style:{color:"black"},children:ta})]})}))}),zs(ia,{text:t.buttonText||"Submit",submitDisabled:(Vn(l)||Pn(l)&&!u&&0===l.length||Pn(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:r,onSubmit:()=>{u&&t.type===vo.MultipleChoice?Pn(l)&&o([...l,h]):o(l)}})]})}const pa=[Xs,Ys,js],ga=[Js,Xs,Ys,js,Ks],fa=[1,2,3,4,5],ma=[1,2,3,4,5,6,7],_a=[0,1,2,3,4,5,6,7,8,9,10];function va(e){switch(e){case 5:default:return fa;case 7:return ma;case 10:return _a}}const ya=Xn,ba=ni;class wa{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=ba.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,i=localStorage.getItem("lastSeenSurveyDate");if(n&&i){const e=new Date,t=Math.abs(e.getTime()-new Date(i).getTime());if(Math.ceil(t/864e5)<n)return}const r=(e=>!!localStorage.getItem(ms(e))&&!fs(e))(e);if(!r){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const i=is.createElement("div");i.className=`PostHogSurvey${t}`;const r=i.attachShadow({mode:"open"});if(e){const t=Object.assign(is.createElement("style"),{innerText:e});r.appendChild(t)}return is.body.appendChild(i),r})(os(null==e?void 0:e.appearance),e.id);es(zs(Ia,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=bs.createElement("div");n.className=`PostHogWidget${e.id}`;const i=n.attachShadow({mode:"open"}),r=`\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 i.append(Object.assign(bs.createElement("style"),{innerText:r})),bs.body.appendChild(n),i}(e),n=os(e.appearance);t.appendChild(Object.assign(ba.createElement("style"),{innerText:n})),es(zs(Ea,{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)&&ba.querySelector(e.appearance.widgetSelector);if(n)if(0===ba.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===ba.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var i,r;const t=null===(i=ba.querySelector(`.PostHogWidget${e.id}`))||void 0===i||null===(r=i.shadowRoot)||void 0===r?void 0:r.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,i;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.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!=_o.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)=>{es(zs(Ia,{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(Vn(e.surveyInFocus)){var n,i,r;if(t.type===_o.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===ba.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)&&null!==(r=t.appearance)&&void 0!==r&&r.widgetSelector&&e.handleWidgetSelector(t);t.type===_o.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{Vn(this.surveyInFocus)||ui.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&ui.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 Sa(e){if(!ba||!ya)return;const t=new wa(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function Ca(e,t,n,i,r){const[o,s]=Os(i||0===n),[a,l]=Os(!1);return Ls((()=>{if(i||!t)return;const o=()=>{r(e.id),s(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(r(e.id),s(!1))},c=()=>{var n;s(!0),ya.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 ya.addEventListener("PHSurveyClosed",o),ya.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),ya.removeEventListener("PHSurveyClosed",o),ya.removeEventListener("PHSurveySent",a)}})():(c(),()=>{ya.removeEventListener("PHSurveyClosed",o),ya.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}function Ia(e){var t,n,i,r,o,s;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:h,isPopup:p}=e;const g=Number.isInteger(d),f=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:_,setIsPopupVisible:v}=Ca(a,c,f,g,h),y=_||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&Gn(null===(i=u)||void 0===i?void 0:i.left)?{left:u.left-40}:{};return g&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?zs(vs.Provider,{value:{isPreviewMode:g,previewPageIndex:d,handleCloseSurveyPopup:()=>ds(a,c,g),isPopup:p||!1},children:y?zs(sa,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||ls,styleOverrides:{...u,...b},onClose:()=>v(!1)}):zs(ka,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):zs(Po,{})}function ka(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,styleOverrides:s}=e;const a=as((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||ls.backgroundColor),[l,c]=Os({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:h,isPopup:p}=$s(vs),[g,f]=Os(d||0),m=Ds((()=>gs(i)),[i]);Ls((()=>{f(null!=d?d:0)}),[d]);return zs("form",{className:"survey-form",style:p?{color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor,...s}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:s}=e;return(u?g===s:g===t)&&zs("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||ls.backgroundColor}:{},children:[p&&zs(oa,{onClick:()=>h()}),xa({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||ls,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:r}=e;if(!o)return;const s=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[s]:t}),!o.getNextSurveyStep)return void(r===i.questions.length-1?us({...l,[s]:t},i,o):f(r+1));const a=o.getNextSurveyStep(i,r,t);a===yo.End?us({...l,[s]:t},i,o):f(a)})({res:e,originalQuestionIndex:s,displayQuestionIndex:t})})]})}))})}function Ea(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e;const[l,c]=Os(!1),[u,d]=Os({}),h=Ps(null);return Ls((()=>{var e,t;if(!s&&o){if("tab"===(null===(e=i.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n;const e=h.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=i.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)){const e=ba.querySelector(i.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),zs(Po,{children:["tab"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)&&zs("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:as(i.appearance.widgetColor)},children:[zs("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=i.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&zs(Ia,{posthog:o,survey:i,forceDisableHtml:r,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const xa=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:o}=e;const s={[vo.Open]:la,[vo.Link]:ca,[vo.Rating]:ua,[vo.SingleChoice]:ha,[vo.MultipleChoice]:ha},a={question:t,forceDisableHtml:n,appearance:r,onSubmit:o},l={[vo.Open]:{},[vo.Link]:{},[vo.Rating]:{displayQuestionIndex:i},[vo.SingleChoice]:{displayQuestionIndex:i},[vo.MultipleChoice]:{displayQuestionIndex:i}};return zs(s[t.type],{...{...a,...l[t.type]}})};function Ta(e){return!qn(Event)&&Ma(e,Event)}function Ma(e,t){try{return e instanceof t}catch{return!1}}function Ra(e){return Vn(e)||!$n(e)&&!Dn(e)}function Aa(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function Na(e){return Aa(e,"DOMError")}li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.canActivateRepeatedly=fs,li.__PosthogExtensions__.generateSurveys=Sa,li.extendPostHogWithSurveys=Sa;const Fa=/\(error: (.*)\)/,Oa=50,La="?";function Pa(e,t,n,i){const r={platform:"javascript",filename:e,function:"<anonymous>"===t?La:t,in_app:!0};return qn(n)||(r.lineno=n),qn(i)||(r.colno=i),r}const Da=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,$a=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ba=/\((\S*)(?::(\d+))(?::(\d+))\)/,qa=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ha=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Wa=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=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=[],r=e.split("\n");for(let e=t;e<r.length;e++){const t=r[e];if(t.length>1024)continue;const o=Fa.test(t)?t.replace(Fa,"$1"):t;if(!o.match(/\S*Error: /)){for(const e of i){const t=e(o);if(t){n.push(t);break}}if(n.length>=Oa)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Oa).map((e=>({...e,filename:e.filename||Va(t).filename,function:e.function||La})))}(n)}}(...[[30,e=>{const t=Da.exec(e);if(t){const[,e,n,i]=t;return Pa(e,La,+n,+i)}const n=$a.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=Ba.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Za(n[1]||La,n[2]);return Pa(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=qa.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Ha.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]||La;return[n,e]=Za(n,e),Pa(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Va(e){return e[e.length-1]||{}}const Za=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:La,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Ga;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Ga||(Ga={}));const Ua=["fatal","error","warning","log","info","debug"],za=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function ja(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",i=function(e){if(e&&Ya.test(e.message))return 1;return 0}(e);try{const e=Wa(n,i);return e.slice(0,e.length-t)}catch{}return[]}const Ya=/Minified React error #\d+;/i;function Xa(e,t){var n,i;const r=ja(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;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:r,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Ja(e,t){var n,i,r;const o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){const e=ja(t.syntheticException,1);e.length&&(a.stacktrace={frames:e,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Ka(e){return Hn(e)&&!Wn(e)&&Ua.indexOf(e)>=0}function Qa(e,t){var n,i;const r=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Ta(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 i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}(e)}`,l={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(null!=t&&t.syntheticException){const e=ja(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e,type:"raw"})}return{$exception_list:[l],$exception_level:Ka(e.level)?e.level:"error"}}function el(e,t){let[n,i,r,o,s]=e,a={$exception_list:[]};const l=s||n;if(Na(l)||function(e){return Aa(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=Xa(l,t);else{const n=e.name||(Na(e)?"DOMError":"DOMException"),i=e.message?`${n}: ${e.message}`:n,r=Na(e)?"DOMError":"DOMException";a=Ja(i,{...t,overrideExceptionType:r,defaultExceptionMessage:i})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Aa(e,"ErrorEvent")}(l)&&l.error)return Xa(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 Ma(e,Error)}}(l))return Xa(l,t);if(function(e){return Aa(e,"Object")}(l)||Ta(l)){return Qa(l,t)}if(qn(s)&&Hn(n)){let e="Error",i=n;const r=n.match(za);return r&&(e=r[1],i=r[2]),Ja(i,{...t,overrideExceptionType:e,defaultExceptionMessage:i})}return Ja(l,t)}function tl(e){let[t]=e;const n=function(e){if(Ra(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 Ra(n)?Ja(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):el([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const nl={wrapOnError:e=>{const t=Xn;t||ui.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];const s=el(r);return e(s),null!==(t=null==n?void 0:n(...r))&&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=Xn;t||ui.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];const a=tl(o);return e(a),null!==(i=null==n?void 0:n.apply(t,o))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.errorWrappingFunctions=nl,li.__PosthogExtensions__.parseErrorAsProperties=el,li.posthogErrorWrappingFunctions=nl,li.parseErrorAsProperties=el;const il=(e,t)=>{const{sessionId:n,windowId:i}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",i)};li.__PosthogExtensions__=li.__PosthogExtensions__||{};const rl={_patchFetch:e=>Kr(Xn,"fetch",(t=>async function(n,i){const r=new Request(n,i);return il(e,r),t(r)})),_patchXHR:e=>Kr(Xn.XMLHttpRequest.prototype,"open",(t=>function(n,i){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const a=new Request(i);return il(e,a),t.call(this,n,a.url,r,o,s)}))};li.__PosthogExtensions__.tracingHeadersPatchFns=rl,li.postHogTracingHeadersPatchFns=rl;var ol,sl,al,ll=-1,cl=function(e){addEventListener("pageshow",(function(t){t.persisted&&(ll=t.timeStamp,e(t))}),!0)},ul=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},dl=function(){var e=ul();return e&&e.activationStart||0},hl=function(e,t){var n=ul(),i="navigate";return ll>=0?i="back-forward-cache":n&&(document.prerendering||dl()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=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:i}},pl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},gl=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},fl=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ml=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},_l=function(e){var t=!1;return function(){t||(e(),t=!0)}},vl=-1,yl=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},bl=function(e){"hidden"===document.visibilityState&&vl>-1&&(vl="visibilitychange"===e.type?e.timeStamp:0,Sl())},wl=function(){addEventListener("visibilitychange",bl,!0),addEventListener("prerenderingchange",bl,!0)},Sl=function(){removeEventListener("visibilitychange",bl,!0),removeEventListener("prerenderingchange",bl,!0)},Cl=function(){return vl<0&&(vl=yl(),wl(),cl((function(){setTimeout((function(){vl=yl(),wl()}),0)}))),{get firstHiddenTime(){return vl}}},Il=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},kl=[1800,3e3],El=function(e,t){t=t||{},Il((function(){var n,i=Cl(),r=hl("FCP"),o=pl("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-dl(),0),r.entries.push(e),n(!0)))}))}));o&&(n=gl(e,r,kl,t.reportAllChanges),cl((function(i){r=hl("FCP"),n=gl(e,r,kl,t.reportAllChanges),fl((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},xl=[.1,.25],Tl=[2500,4e3],Ml={},Rl=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Al=function(e){if("loading"===document.readyState)return"loading";var t=Rl();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"},Nl=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Fl=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:Nl(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},Ol=-1,Ll=function(e,t){var n=Rl(),i="navigate";return Ol>=0?i="back-forward-cache":n&&(document.prerendering||function(){var e=Rl();return e&&e.activationStart||0}()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=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:i}},Pl=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Dl=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},$l=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Bl=0,ql=1/0,Hl=0,Wl=function(e){e.forEach((function(e){e.interactionId&&(ql=Math.min(ql,e.interactionId),Hl=Math.max(Hl,e.interactionId),Bl=Hl?(Hl-ql)/7+1:0)}))},Vl=function(){"interactionCount"in performance||ol||(ol=Pl("event",Wl,{type:"event",buffered:!0,durationThreshold:0}))},Zl=[],Gl=new Map,Ul=0,zl=function(){return(ol?Bl:performance.interactionCount||0)-Ul},jl=[],Yl=function(e){if(jl.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Zl[Zl.length-1],n=Gl.get(e.interactionId);if(n||Zl.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 i={id:e.interactionId,latency:e.duration,entries:[e]};Gl.set(i.id,i),Zl.push(i)}Zl.sort((function(e,t){return t.latency-e.latency})),Zl.length>10&&Zl.splice(10).forEach((function(e){return Gl.delete(e.id)}))}}},Xl=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),$l(e)),n},Jl=[200,500],Kl=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;Vl();var i,r=Ll("INP"),o=function(e){Xl((function(){e.forEach(Yl);var t,n=(t=Math.min(Zl.length-1,Math.floor(zl()/50)),Zl[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())}))},s=Pl("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Dl(e,r,Jl,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),$l((function(){o(s.takeRecords()),i(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ol=t.timeStamp,e(t))}),!0)}((function(){Ul=0,Zl.length=0,Gl.clear(),r=Ll("INP"),i=Dl(e,r,Jl,t.reportAllChanges)})))})))},Ql=[],ec=[],tc=new WeakMap,nc=new Map,ic=-1,rc=function(e){Ql=Ql.concat(e),oc()},oc=function(){ic<0&&(ic=Xl(sc))},sc=function(){nc.size>10&&nc.forEach((function(e,t){Gl.has(t)||nc.delete(t)}));var e=Zl.map((function(e){return tc.get(e.entries[0])})),t=ec.length-50;ec=ec.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<ec.length;i++){var r=ec[i];ac(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}for(var o=0;o<50;o++){var s=Ql[Ql.length-1-o];if(!s||s.startTime<al)break;n.add(s)}Ql=Array.from(n),ic=-1};jl.push((function(e){e.interactionId&&e.target&&!nc.has(e.interactionId)&&nc.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;al=Math.max(al,e.processingEnd);for(var i=ec.length-1;i>=0;i--){var r=ec[i];if(Math.abs(n-r.renderTime)<=8){(t=r).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]},ec.push(t)),(e.interactionId||"first-input"===e.entryType)&&tc.set(e,t),oc()}));var ac=function(e,t){for(var n,i=[],r=0;n=Ql[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i};const lc={onLCP:function(e,t){t=t||{},Il((function(){var n,i=Cl(),r=hl("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-dl(),0),r.entries=[e],n())}))},s=pl("largest-contentful-paint",o);if(s){n=gl(e,r,Tl,t.reportAllChanges);var a=_l((function(){Ml[r.id]||(o(s.takeRecords()),s.disconnect(),Ml[r.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=_l(e),"hidden"===document.visibilityState?e():(n=t(e),ml(e)),n}(a)}),!0)})),ml(a),cl((function(i){r=hl("LCP"),n=gl(e,r,Tl,t.reportAllChanges),fl((function(){r.value=performance.now()-i.timeStamp,Ml[r.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},El(_l((function(){var n,i=hl("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=pl("layout-shift",s);a&&(n=gl(e,i,xl,t.reportAllChanges),ml((function(){s(a.takeRecords()),n(!0)})),cl((function(){r=0,i=hl("CLS",0),n=gl(e,i,xl,t.reportAllChanges),fl((function(){return n()}))})),setTimeout(n,0))})))},onFCP:El,onINP:function(e,t){sl||(sl=Pl("long-animation-frame",rc)),Kl((function(t){var n=function(e){var t=e.entries[0],n=tc.get(t),i=t.processingStart,r=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=ac(t.startTime,r),a=e.entries.find((function(e){return e.target})),l=a&&a.target||nc.get(t.interactionId),c=[t.startTime+t.duration,r].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Fl(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(u-r,0),loadState:Al(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.postHogWebVitalsCallbacks=lc,li.postHogWebVitalsCallbacks=lc;class cc{constructor(){this.clicks=[]}isRageClick(e,t,n){const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}const uc="$copy_autocapture";function dc(e,t){return t.length>e?t.slice(0,e)+"...":t}function hc(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!mr(t));return t}function pc(e,t,n,i){const r=e.tagName.toLowerCase(),o={tag_name:r};Er.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=dc(1024,$r(e)):o.$el_text=dc(1024,Ir(e)));const s=Sr(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),gi(e.attributes,(function(n){var r;if((!Rr(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==i||!i.includes(n.name))&&!t&&Dr(n.value)&&(r=n.name,!Hn(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){let e=n.value;"class"===n.name&&(e=br(e).join(" ")),o["attr__"+n.name]=dc(1024,e)}}));let a=1,l=1,c=e;for(;c=hc(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function gc(e,t){var n,i;let{e:r,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t;const c=[e];let u=e;for(;u.parentNode&&!_r(u,"body");)yr(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);const d=[],h={};let p,g=!1,f=!1;if(gi(c,(e=>{const t=Mr(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&Dr(g)&&g);mi(Sr(e),"ph-no-capture")&&(f=!0),d.push(pc(e,o,s,a));const n=function(e){if(!Mr(e))return{};const t={};return gi(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&Dr(i)&&(t[n]=i)}})),t}(e);fi(h,n)})),f)return{props:{},explicitNoCapture:f};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?d[0].$el_text=$r(e):d[0].$el_text=Ir(e)),g){var m,_;d[0].attr__href=g;const e=null===(m=Ti(g))||void 0===m?void 0:m.host,t=null==Xn||null===(_=Xn.location)||void 0===_?void 0:_.host;e&&t&&e!==t&&(p=g)}return{props:fi({$event_type:r.type,$ce_version:1},l?{$elements_chain:qr(d)}:{$elements:d},null!==(n=d[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=d[0])||void 0===i?void 0:i.$el_text}:{},p&&"click"===r.type?{$external_click_url:p}:{},h)}}class fc{_initialized=!1;_isDisabledServerSide=null;rageclicks=new cc;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;const n=$n(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void ui.info("Disabling Automatic Event Collection because this browser is not supported");if(!Xn||!ni)return;const e=e=>{e=e||(null==Xn?void 0:Xn.event);try{this._captureEvent(e)}catch(e){ui.error("Failed to capture event",e)}},t=e=>{e=e||(null==Xn?void 0:Xn.event),this._captureEvent(e,uc)};Ii(ni,"submit",e,!1,!0),Ii(ni,"change",e,!1,!0),Ii(ni,"click",e,!1,!0),this.config.capture_copied_text&&(Ii(ni,"copy",t,!1,!0),Ii(ni,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Pi]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;const n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{const i=null==ni?void 0:ni.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&n.push(t)}))})),n}get isEnabled(){var e,t;const n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Pi],i=this._isDisabledServerSide;if(Vn(i)&&!Un(n)&&!this.instance.config.advanced_disable_decide)return!1;const r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=kr(e);var i;(vr(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)&&(this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick"));const r=t===uc;if(n&&Tr(n,e,this.config,r,r?["copy","cut"]:void 0)){const{props:i,explicitNoCapture:r}=gc(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(r)return!1;const s=this.getElementSelectors(n);if(s&&s.length>0&&(i.$element_selectors=s),t===uc){var o;const t=Cr(null==Xn||null===(o=Xn.getSelection())||void 0===o?void 0:o.toString()),n=e.type||"clipboard";if(!t)return!1;i.$selected_content=t,i.$copy_type=n}return this.instance.capture(t,i),!0}}isBrowserSupported(){return Dn(null==ni?void 0:ni.querySelectorAll)}}function mc(e,t){return Gn(e)&&e>=t}class _c{_clicks=[];_defaultConfig=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e});asRequiredConfig(e){var t,n,i,r;const o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==e?void 0:e.scroll_threshold_ms)&&void 0!==n?n:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==e?void 0:e.mutation_threshold_ms)&&void 0!==r?r:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}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,li.removeEventListener("click",this._onClick),li.removeEventListener("scroll",this._onScroll,!0),li.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){li.addEventListener("click",this._onClick)}_onClick=e=>{const t=function(e){const t=kr(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Vn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&qn(this._checkClickTimer)&&(this._checkClickTimer=li.setTimeout((()=>{this._checkClicks()}),1e3))};_startScrollObserver(){li.addEventListener("scroll",this._onScroll,!0)}_onScroll=()=>{const e=Date.now();e%50==0&&this._clicks.forEach((t=>{qn(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))};_startSelectionChangedObserver(){li.addEventListener("selectionchange",this._onSelectionChange)}_onSelectionChange=()=>{this._lastSelectionChanged=Date.now()};_ignoreClick(e){if(!e)return!0;if(fr(e.node))return!0;const t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!_r(e.node,"html")&&mr(e.node)&&!Er.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=mc(n.scrollDelayMs,this._config.scroll_threshold_ms),i=mc(n.selectionChangedDelayMs,this._config.selection_change_threshold_ms),r=mc(n.mutationDelayMs,this._config.mutation_threshold_ms),o=mc(n.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),s=Gn(n.scrollDelayMs)&&n.scrollDelayMs<this._config.scroll_threshold_ms,a=Gn(n.mutationDelayMs)&&n.mutationDelayMs<this._config.mutation_threshold_ms,l=Gn(n.selectionChangedDelayMs)&&n.selectionChangedDelayMs<this._config.selection_change_threshold_ms;s||a||l||(e||r||o||i?this._onCapture(n,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:n.timestamp,$dead_click_scroll_timeout:e,$dead_click_mutation_timeout:r,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i}):n.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(n))}this._clicks.length&&qn(this._checkClickTimer)&&(this._checkClickTimer=li.setTimeout((()=>{this._checkClicks()}),1e3))}_captureDeadClick(e,t){this.instance.capture("$dead_click",{...t,...gc(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)})}}li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new _c(e,t);const vc=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return ui.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const i=()=>{if(!ni)return n("document not found");const e=ni.createElement("script");e.type="text/javascript",e.crossOrigin="anonymous",e.src=t,e.onload=e=>n(void 0,e),e.onerror=e=>n(e);const i=ni.querySelectorAll("body > script");var r;i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):ni.body.appendChild(e)};null!=ni&&ni.body?i():null==ni||ni.addEventListener("DOMContentLoaded",i)};li.__PosthogExtensions__=li.__PosthogExtensions__||{},li.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{let i=`/static/${t}.js?v=${e.version}`;if("toolbar"===t){const e=3e5;i=`${i}&t=${Math.floor(Date.now()/e)*e}`}const r=e.requestRouter.endpointFor("assets",i);vc(e,r,n)},li.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{const i=e.requestRouter.endpointFor("api",t);vc(e,i,n)};const yc="$active_feature_flags",bc="$override_feature_flags",wc="$feature_flag_payloads",Sc=e=>{const t={};for(const[n,i]of _i(e||{}))i&&(t[n]=i);return t};class Cc{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){const e=this.instance.get_property(Qi),t=this.instance.get_property(bc);if(!t)return e||{};const n=fi({},e),i=Object.keys(t);for(let e=0;e<i.length;e++)n[i[e]]=t[i[e]];return this._override_warning||(ui.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(wc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);const e=this.instance.config.token,t=this.instance.get_property(tr),n=this.instance.get_property(nr),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:Ga.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void ui.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");const n=this.getFlagVariants()[e],i=`${n}`,r=this.instance.get_property(or)||{};var o;!t.send_event&&"send_event"in t||(e in r&&r[e].includes(i)||(Pn(r[e])?r[e].push(i):r[e]=[i],null===(o=this.instance.persistence)||void 0===o||o.register({[or]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})));return n}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);ui.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;const n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=e.featureFlags,o=e.featureFlagPayloads;if(!r)return;if(Pn(r)){const e={};if(r)for(let t=0;t<r.length;t++)e[r[t]]=!0;return void(t&&t.register({[yc]:r,[Qi]:e}))}let s=r,a=o;e.errorsWhileComputingFlags&&(s={...n,...s},a={...i,...a}),t&&t.register({[yc]:Object.keys(Sc(s)),[Qi]:s||{},[wc]:a||{}})}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return ui.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(bc);else if(Pn(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[bc]:t})}else this.instance.persistence.register({[bc]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;const i={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);const r={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[yc]:Object.keys(Sc(r)),[Qi]:r}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.instance.get_property(er);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;const i=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[er]:i}),e(i)}})}_prepareFeatureFlagsForCallbacks(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(tr)||{};this.instance.register({[tr]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(tr)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(nr)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((t=>{n[t]={...n[t],...e[t]},delete e[t]})),this.instance.register({[nr]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.instance.get_property(nr)||{};this.instance.register({[nr]:{...t,[e]:{}}})}else this.instance.unregister(nr)}}
2
2
  /**
3
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
4
4
  *