posthog-js 1.393.4 → 1.393.5
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.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/dead-clicks-autocapture.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/logs.js +1 -1
- package/dist/logs.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/lib/src/entrypoints/logs.js +71 -55
- package/lib/src/entrypoints/logs.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],a=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=(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))(s||{}),u=(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))(u||{}),l=(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))(l||{}),c=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(c||{}),d=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(d||{}),h=(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))(h||{}),v=(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))(v||{}),f={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},p={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in f?f[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),a=e in p?p[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&o)return m[e]=t.prototype,t.prototype;var s=document.createElement("iframe");try{document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return l?m[e]=l:r}catch(e){return r}finally{s.parentNode&&document.body.removeChild(s)}}var g={};function b(e,t,r){var n,i=e+"."+String(r);if(g[i])return g[i].call(t);var a=y(e),o=null==(n=Object.getOwnPropertyDescriptor(a,r))?void 0:n.get;return o?(g[i]=o,o.call(t)):t[r]}var w={};function k(e,t,r){var n=e+"."+String(r);if(w[n])return w[n].bind(t);var i=y(e)[r];return"function"!=typeof i?t[r]:(w[n]=i,i.bind(t))}function x(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}var C={childNodes:e=>b("Node",e,"childNodes"),parentNode:e=>b("Node",e,"parentNode"),parentElement:e=>b("Node",e,"parentElement"),textContent:e=>b("Node",e,"textContent"),contains:(e,t)=>k("Node",e,"contains")(t),getRootNode:e=>k("Node",e,"getRootNode")(),host:e=>e&&"host"in e?b("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?b("Element",e,"shadowRoot"):null,querySelector:(e,t)=>k("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>k("Element",e,"querySelectorAll")(t),mutationObserver:x,patch:S};function I(e){return e.nodeType===e.ELEMENT_NODE}function M(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function T(e){return"[object ShadowRoot]"==={}.toString.call(e)}function _(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(n=Array.from(t,(e=>L(e,r))).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function L(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var n;try{n=_(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){n=e.cssText}try{if(n&&(null==(r=e.styleSheet)?void 0:r.href))return B(n,e.styleSheet.href)}catch(e){}return n}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?B(i,t):i}class R{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),I(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:a,maskInputFn:o}=e,s=a||"",u=i&&E(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=o?o(s,t):"*".repeat(s.length)),s}function E(e){return e.toLowerCase()}var N="__rrweb_original__";function q(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?E(t):null}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,D=/^www\..*/i,F=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(P,((e,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return e;if(A.test(u)||D.test(u))return"url("+l+u+l+")";if(F.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+l+c.join("/")+l+")"}))}var H,j,U="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,V=1,Z=new RegExp("[^a-z0-9-_:]"),z=-2;function Q(){return V++}var G=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,J=new WeakMap;function K(e,t){return t&&""!==t.trim()?X(e,t):t}function X(e,t){var r=J.get(e);if(r||(r=e.createElement("a"),J.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ee(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?U:e}(e,t.maxBase64ImageLength):e}function te(e,t,r,n,i,a){var o;if(!n)return n;if("src"===r||"href"===r&&("use"!==t||"#"!==n[0])){if("link"===t&&i){var s=null==(o=i.sheet)?void 0:o.href;if(s)return s}var u=K(e,n);if(u.startsWith("data:")){if("img"===t&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,n){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>W||e.naturalHeight>W)return t;try{var i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;var a=i.getContext("2d");return a?(a.drawImage(e,0,0),i.toDataURL(r||"image/webp",null!=n?n:.4)):t}catch(e){return t}}(i,u,a.type,a.quality)),ee(l,a)}if("image"===t)return ee(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=K(e,n);return"image"===t&&c.startsWith("data:")?ee(c,a):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Y),t.length>r;){var a=n(G);if(","===a.slice(-1))a=K(e,a.substring(0,a.length-1)),i.push(a);else{var o="";a=K(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?B(n,X(e)):"object"===t&&"data"===r?K(e,n):n:K(e,n)}function re(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function ie(e,t,r,n){var i;if(I(e)){if(!C.childNodes(i=e).length)return!1}else{if(null===C.parentElement(e))return!1;i=C.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(ne(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}var ae=new Map;function oe(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function se(e){return null==e?"":e.toLowerCase()}var ue=50,le=!1,ce=!1;function de(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w=5e3,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:L=(()=>!1),newlyAddedElement:R=!1,depth:P=0,maxDepth:A=ue}=t,{needsMask:D}=t,{preserveWhiteSpace:F=!0}=t;if(P>=A)return ce=!0,le||(le=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+A+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;D||(D=ie(e,o,s,void 0===D));var U,W=function(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:o,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,y=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:v.Document,childNodes:[],compatMode:e.compatMode}:{type:v.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){for(var r,n,i,a,{doc:o,blockClass:s,blockSelector:u,inlineStylesheet:l,maskInputOptions:c={},maskInputFn:d,dataURLOptions:h={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:y=!1,rootId:g}=t,b=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,s,u),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=E(e.tagName);return Z.test(t)?"div":t}(e),k={},x=e.attributes.length,S=0;x>S;S++){var I=e.attributes[S];re(w,I.name)||(k[I.name]=te(o,w,E(I.name),I.value,e,h))}if("link"===w&&l){var M=e.sheet;if(!M){var T=function(e){return e.href}(e);T&&!(M=oe(o,T))&&T.includes(".css")&&(M=oe(o,window.location.origin+"/"+T.replace(window.location.href,"")))}var L=null;M&&(L=_(M)),L&&(delete k.rel,delete k.href,k._cssText=L)}if("style"===w&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var R=_(e.sheet);R&&(k._cssText=R)}if("input"===w||"textarea"===w||"select"===w){var P=e.value,A=e.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&P?k.value=O({element:e,type:q(e),tagName:w,value:P,maskInputOptions:c,maskInputFn:d}):A&&(k.checked=A)}if("option"===w&&(e.selected&&!c.select?k.selected=!0:delete k.selected),"dialog"===w&&e.open)try{k.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var n=0;e.height>n;n+=50){var i=t.getImageData;if(new Uint32Array((N in i?i[N]:i).call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(k.rr_dataURL=e.toDataURL(h.type,h.quality));else if(!("__context"in e)){var D=e.toDataURL(h.type,h.quality),F=o.createElement("canvas");F.width=e.width,F.height=e.height,D!==F.toDataURL(h.type,h.quality)&&(k.rr_dataURL=D)}if("img"===w&&f){H||(H=o.createElement("canvas"),j=H.getContext("2d"));var B=e,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",W=B.crossOrigin,V=()=>{B.removeEventListener("load",V);try{H.width=B.naturalWidth,H.height=B.naturalHeight,j.drawImage(B,0,0),k.rr_dataURL=H.toDataURL(h.type,h.quality)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?V():B.addEventListener("load",V));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===B.crossOrigin&&(W?k.crossOrigin=W:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?V():B.addEventListener("load",V)}if("audio"===w||"video"===w){var z=k;z.rr_mediaState=e.paused?"paused":"played",z.rr_mediaCurrentTime=e.currentTime,z.rr_mediaPlaybackRate=e.playbackRate,z.rr_mediaMuted=e.muted,z.rr_mediaLoop=e.loop,z.rr_mediaVolume=e.volume}if(y||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop)),b){var{width:Q,height:G,left:Y,top:J}=e.getBoundingClientRect(),K=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);k={class:k.class,rr_width:Q+"px",rr_height:G+"px",rr_left:Math.floor(Y+((null==(n=o.defaultView)?void 0:n.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollY)||0))+"px"},K&&(k.rr_position=K.position||"static",K.transform&&"none"!==K.transform&&(k.rr_transform=K.transform),K.display&&K.display.startsWith("inline")&&(k.rr_display=K.display))}"iframe"!==w||m(k.src)||(e.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(w)&&(a=!0)}catch(e){}return{type:v.Element,tagName:w,attributes:k,childNodes:[],isSVG:(X=e,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:g,isCustom:a};var X}(e,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:s,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:a}=t,o=C.parentNode(e),s=o&&o.tagName,u=C.textContent(e),l="STYLE"===s||void 0,c="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=_(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=B(u,X(t.doc))}return c&&(u="SCRIPT_PLACEHOLDER"),!l&&!c&&u&&n&&(u=i?i(u,C.parentElement(e)):u.replace(/[\S]/g,"*")),{type:v.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:o,maskTextFn:l,rootId:y});case e.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:v.Comment,textContent:C.textContent(e)||"",rootId:y};default:return!1}}(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,dataURLOptions:p,inlineImages:m,recordCanvas:y,keepIframeSrcFn:L,newlyAddedElement:R});if(!W)return console.warn(e,"not serialized"),null;U=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===v.Comment)return!0;if(e.type===v.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,n;try{n=new URL(e,window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(se(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===se(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(se(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&se(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(se(e.attributes.property).match(/^(og|twitter|fb):/)||se(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===se(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(se(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(se(e.attributes.name))||se(e.attributes.property).match(/^article:/)||se(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(se(e.attributes.name)))return!0}}return!1}(W,f)||!F&&W.type===v.Text&&!W.isStyle&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?z:Q();var V=Object.assign(W,{id:U});if(n.add(e,V),U===z)return null;g&&g(e);var G=!u;if(V.type===v.Element){G=G&&!V.needBlock,delete V.needBlock;var Y=C.shadowRoot(e);Y&&T(Y)&&(V.isShadowHost=!0)}if((V.type===v.Document||V.type===v.Element)&&G){f.headWhitespace&&V.type===v.Element&&"head"===V.tagName&&(F=!1);var J={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:L,depth:P+1,maxDepth:A};if(V.type===v.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(e))){var ee=de(K,J);ee&&V.childNodes.push(ee)}var ne=null;if(I(e)&&(ne=C.shadowRoot(e)))for(var he of Array.from(C.childNodes(ne))){var ve=de(he,J);ve&&(T(ne)&&(ve.isShadow=!0),V.childNodes.push(ve))}}var fe=C.parentNode(e);if(fe&&M(fe)&&T(fe)&&(V.isShadow=!0),V.type===v.Element&&"iframe"===V.tagName){var pe=function(e,t,r){var n,i=()=>{},a=e.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(e){return i}var o=()=>t();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),e.removeEventListener("load",c),e.addEventListener("load",o),t())},c=()=>l();return u=setTimeout(l,r),e.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?e.removeEventListener("load",o):(s=!0,e.removeEventListener("load",c))}}var d,h="about:blank";try{d=a.location.href}catch(e){return i}if(d!==h||e.src===h||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),e.removeEventListener("load",o)}}return e.addEventListener("load",o),()=>{e.removeEventListener("load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&b){var r=de(t,{doc:t,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:L,depth:P+1,maxDepth:A});r&&b(e,r)}}),w);null==k||k(e,pe)}return V.type===v.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(t,u,v){if(!ae.has(t)){var k;try{k=t.sheet}catch(e){return}if(!k){var C=new AbortController,I=!1,M=()=>{if(!I){I=!0;try{(()=>{if(x){var t=de(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:L,depth:P,maxDepth:A});t&&x(e,t)}})()}finally{ae.delete(t),C.abort()}}},T=setTimeout(M,v);C.signal.addEventListener("abort",(()=>clearTimeout(T)),{once:!0}),t.addEventListener("load",M,{signal:C.signal,once:!0}),ae.set(t,C)}}}(e,0,S),V}function he(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class ve{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof ve))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"}}function fe(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function pe(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var me="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.",ye={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};function ge(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;0>=l||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,o)}),l))}}function be(e,t,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>be(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ye=new Proxy(ye,{get(e,t,r){return"map"===t&&console.error(me),Reflect.get(e,t,r)}}));var we=Date.now;function ke(e){var t,r,n,i,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=C.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(n=C.parentElement(a.body))?void 0:n.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function xe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Se(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ce(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Ie(e,t,r,n){if(!e)return!1;var i=Ce(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(ne(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Me(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===z}function Te(e,t){if(M(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=C.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Te(n,t))}function _e(e){return Boolean(e.changedTouches)}function Le(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Re(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Oe(e){return!!e&&(e instanceof ve&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());class Ee{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function qe(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function Pe(e){return"__ln"in e}class Ae{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pe(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Pe(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var De,Fe=(e,t)=>e+"@"+t;class Be{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ae,n=e=>{for(var t=e,r=z;r===z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var a=C.parentNode(i);if(a&&qe(i)&&"TEXTAREA"!==a.tagName){var o=M(a)?this.mirror.getId(Ne(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=de(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Le(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Oe(i)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)je(this.removesSubTreeCache,a)&&!this.movedSet.has(C.parentNode(a))||i(a);for(var o of this.addedSet)Ue(this.droppedSet,o)||je(this.removesSubTreeCache,o)?Ue(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(C.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var v=this.mirror.getId(C.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=C.parentNode(h.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))}})),o(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),o(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:q(e),value:r,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(e=>{if(!Me(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ie(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ce(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var a=q(r);i=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(Ie(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!re(r.tagName,n))if(o.attributes[n]=te(this.doc,E(r.tagName),E(n),i,r,this.dataURLOptions),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&(s.style.cssText=e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?o.styleDiff[u]=""===c?l:[l,c]:o._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ie(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=M(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||Me(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(He(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fe(r,n)]?He(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!M(e.target)||!T(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),o(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Me(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Fe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ie(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Oe(e)&&C.childNodes(C.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]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function He(e,t){e.delete(t),C.childNodes(t).forEach((t=>He(e,t)))}function je(e,t,r){return 0!==e.size&&function(e,t,r){var n=C.parentNode(t);return!!n&&e.has(n)}(e,t)}function Ue(e,t){return 0!==e.size&&We(e,t)}function We(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||We(e,r))}var Ve=e=>De?function(){try{return e(...arguments)}catch(e){if(De&&!0===De(e))return;throw e}}:e,Ze=[];function ze(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function $e(e,t){var r=new Be;Ze.push(r),r.init(e);var n=new(x())(Ve(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:n,buffer:r}}function Qe(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:a,sampling:o}=e,s=new Map,u=e=>{var o=ze(e);if(o&&!Ie(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var d=ke(r.defaultView);u=d.left,l=d.top}else u=o.scrollLeft,l=o.scrollTop;var h=u+","+l;s.get(c)!==h&&(s.set(c,h),t({id:c,x:u,y:l}))}},l=[fe("scroll",Ve(ge(Ve((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(fe("scrollend",Ve(u),r)),()=>l.forEach((e=>e()))}function Ge(e,t){for(var r=Ze.length-1;r>=0;r--){var n=Ze[r];if(n){var i=n.bufferBelongsToIframe(e);!i&&t&&t.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),Ze.splice(r,1))}}}var Ye=["INPUT","TEXTAREA","SELECT"],Je=new WeakMap;function Ke(e){return function e(t,r){if(rt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||rt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||rt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||rt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(i)}return r}(e,[])}function Xe(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function et(e,t){var r,n,i,a,{mirror:o,stylesheetManager:s}=e;a=o.getId("#document"===t.nodeName?t:C.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Ve((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function tt(e,t){void 0===t&&(t={});var n,i,a=e.doc.defaultView;if(!a)return()=>{};if(function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=$e(e,e.doc);n=o.observer,i=o.buffer}var s=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=ge(Ve((e=>{var r=Date.now()-a;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],a=null})),s),d=Ve(ge(Ve((e=>{var t=ze(e),{clientX:r,clientY:n}=_e(e)?e.changedTouches[0]:e;a||(a=we()),l.push({x:r,y:n,id:i.getId(t),timeOffset:we()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),h=[fe("mousemove",d,n),fe("touchmove",d,n),fe("drag",d,n)];return Ve((()=>{h.forEach((e=>e()))}))}(e),d=function(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:a,blockSelector:o,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,d=[],h=null;return Object.keys(l).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=E(e),u=(e=>n=>{var s=ze(n);if(!Ie(s,a,o,!0)){var u=null,d=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(l[e]===l.MouseDown?d="TouchStart":l[e]===l.MouseUp&&(d="TouchEnd"))}else _e(n)&&(u=c.Touch);null!==u?(h=u,(d.startsWith("Touch")&&u===c.Touch||d.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):l[e]===l.Click&&(u=h,h=null);var v=_e(n)?n.changedTouches[0]:n;if(v){var f=i.getId(s),{clientX:p,clientY:m}=v;Ve(t)(r({type:l[d],id:f,x:p,y:m},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(l[e]){case l.MouseDown:case l.MouseUp:s=s.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}d.push(fe(s,u,n))})),Ve((()=>{d.forEach((e=>e()))}))}(e),v=Qe(e),f=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,a=-1;return fe("resize",Ve(ge(Ve((()=>{var e=xe(),t=Se();i===e&&a===t||(r({width:Number(t),height:Number(e)}),i=e,a=t)})),200)),n)}(e,{win:a}),p=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:a,blockSelector:o,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function v(e){var t=ze(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=C.parentElement(t)),t&&i&&Ye.indexOf(i)>=0&&!Ie(t,a,o,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,v=!1,p=q(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(l[i.toLowerCase()]||l[p])&&(d=O({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),f(t,h?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var m=t.name;"radio"===p&&m&&v&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,n){var a=Je.get(e);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){Je.set(e,n);var o=i.getId(e);Ve(t)(r({},n,{id:o}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>fe(e,Ve(v),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return y&&y.set&&p.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((e=>be(e[0],e[1],{set(){Ve(v)({target:this,isTrusted:!1})}},!1,m)))),Ve((()=>{p.forEach((e=>e()))}))}(e),m=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:a,doc:o}=e,s=Ve((e=>ge(Ve((a=>{var o=ze(a);if(o&&!Ie(o,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=o;t({type:e,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),a.media||500))),u=[fe("play",s(h.Play),o),fe("pause",s(h.Pause),o),fe("seeked",s(h.Seeked),o),fe("volumechange",s(h.VolumeChange),o),fe("ratechange",s(h.RateChange),o)];return Ve((()=>{u.forEach((e=>e()))}))}(e),y=()=>{},g=()=>{},b=()=>{},w=()=>{};e.recordDOM&&(y=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:a}=t;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var o=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ve(((e,t,a)=>{var[o,s]=a,{id:u,styleId:l}=Xe(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:s}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var s,u,l=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:o}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:o}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:o}),e.apply(t,a)}))}));var c={};nt("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(nt("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),nt("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),nt("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,a]=e;d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ve(((e,t,a)=>{var[o,s]=a,{id:u,styleId:l}=Xe(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Ke(t),s||0]}]}),e.apply(t,a)}))}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...Ke(t),o]}]}),e.apply(t,a)}))})})),Ve((()=>{a.CSSStyleSheet.prototype.insertRule=o,a.CSSStyleSheet.prototype.deleteRule=l,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:a}),g=et(e,e.doc),b=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:a}=e,{win:o}=t,s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ve(((e,t,o)=>{var u,[l,c,d]=o;if(i.has(l))return s.apply(t,[l,c,d]);var{id:h,styleId:v}=Xe(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,a.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:c,priority:d},index:Ke(t.parentRule)}),e.apply(t,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ve(((e,t,o)=>{var s,[l]=o;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=Xe(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,a.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:Ke(t.parentRule)}),e.apply(t,o)}))}),Ve((()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:a}),e.collectFonts&&(w=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,r){var n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ve((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),Ve((()=>{i.forEach((e=>e()))}))}(e)));var k=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:a}=e,o=!0,s=Ve((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;u>l;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:h,endContainer:v,endOffset:f}=c;Ie(d,n,i,!0)||Ie(v,n,i,!0)||s.push({start:r.getId(d),startOffset:h,end:r.getId(v),endOffset:f})}a({ranges:s})}}));return s(),fe("selectionchange",s)}(e),x=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?S(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),I=[];for(var M of e.plugins)I.push(M.observer(M.callback,a,M.options));return Ve((()=>{if(i){i.destroy(),i.reset();var e=Ze.indexOf(i);-1!==e&&Ze.splice(e,1)}null==n||n.disconnect(),s(),d(),v(),f(),p(),m(),y(),g(),b(),w(),k(),x(),I.forEach((e=>e()))}))}function rt(e){return void 0!==window[e]}function nt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class it{constructor(e){o(this,"iframeIdToRemoteIdMap",new WeakMap),o(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class at{constructor(e){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new it(Q)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new it(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var n=this.mirror.getId(e);-1!==n&&this.iframeElementsById.set(n,e)}getIframeElementById(e){var t,r,n;return null!==(t=null!==(r=null==(n=this.attachedIframes.get(e))?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>pe(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{var{win:t,handler:r}=e;pe((()=>t.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,n=this.trackIframeContent(e,t);if(e.contentDocument){var i=this.attachedDocuments.get(e);i||this.attachedDocuments.set(e,i=new Set),i.add(e.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);pe((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}pe((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var n of r)if(n.win===t)return;var i=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",i),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:i})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case s.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:s.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case s.Meta:case s.Load:case s.DomContentLoaded:return!1;case s.Plugin:return t;case s.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case s.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(t[i]=Array.isArray(t[i])?e.getIds(r,t[i]):e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===v.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var n=r.contentWindow,i=this.attachedWindows.get(r);if(i&&(i.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(pe((()=>e.removeEventListener("message",t))),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)){var a=this.nestedIframeListeners.get(n);pe((()=>n.removeEventListener("message",a))),this.nestedIframeListeners.delete(n)}n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((e=>{pe((()=>this.mirror.removeNodeFromMap(e)))})),pe((()=>Ge(r,o))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var{content:r}=e;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{pe((()=>t.removeEventListener("message",e)))})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>{var{element:r}=t;return e.add(r)})),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ot{constructor(e){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(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(T(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var{observer:n,buffer:i}=$e(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>{n.disconnect(),i.destroy(),i.releaseCanvasManager();var e=Ze.indexOf(i);-1!==e&&Ze.splice(e,1)})),this.restoreHandlers.push(Qe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(et({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(S(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),a=C.shadowRoot(this);return a&&qe(this)&&r.addShadowRoot(a,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut="undefined"==typeof Uint8Array?[]:new Uint8Array(256),lt=0;64>lt;lt++)ut[st.charCodeAt(lt)]=lt;var ct=new Map,dt=(e,t,r)=>{if(e&&(ft(e,t)||"object"==typeof e)){var n=function(e,t){var r=ct.get(e);return r||ct.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function ht(e,t,r,n){if(e instanceof Array)return e.map((e=>ht(e,t,r,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){var i=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;n>t;t+=3)i+=st[r[t]>>2],i+=st[(3&r[t])<<4|r[t+1]>>4],i+=st[(15&r[t+1])<<2|r[t+2]>>6],i+=st[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ht(e.buffer,t,r,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var o=e.constructor.name,{src:s}=e;return{rr_type:o,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(n.type,n.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ht(e.data,t,r,n),e.width,e.height]}:ft(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:dt(e,t,r)}:e}var vt=(e,t,r,n)=>e.map((e=>ht(e,t,r,n))),ft=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},pt=["webgl","webgl2"];function mt(e){return"nodeType"in e}function yt(e,t,n,i){var a=[];try{if(i){var o=function(e,t,n){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return S(i.prototype,"configure",(function(i){return function(a){var o=function(e){var{canvas:t}=e;return t&&"object"==typeof t?t:null}(this);if(!o||mt(o)&&Ie(o,t,n,!0))return i.call(this,a);mt(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(e,t,n);o&&a.push(o)}var s=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!Ie(this,t,n,!0)&&("__context"in this||(this.__context=a),i&&pt.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...s])}}));a.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}function gt(e,t,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=S(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var d=e.apply(this,l);if(dt(d,a,this),"tagName"in this.canvas&&!Ie(this.canvas,n,i,!0)){var h=vt(l,a,this,o);r(this.canvas,{type:t,property:u,args:h})}return d}}));s.push(l)}catch(n){var c=be(e,u,{set(e){r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var bt,wt,kt,xt='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, displayWidth, displayHeight });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, displayWidth, displayHeight });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-CSpkoNCs.js.map\n',St="undefined"!=typeof self&&self.Blob&&new Blob([xt],{type:"text/javascript;charset=utf-8"});function Ct(e){var t;try{if(!(t=St&&(self.URL||self.webkitURL).createObjectURL(St)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(xt),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class It{constructor(e){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:a,dataURLOptions:s,resolutionScale:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(r,n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s,resolutionScale:u})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,u=yt(r,n,i,!0),l=new Map,c=new Ct;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:n,displayWidth:i,displayHeight:a}=e.data;this.mutationCb({id:t,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0,i,a]}],displayWidth:i,displayHeight:a})}};var h,v=1e3/e,f=0,p=e=>{var u,d;f&&v>e-f||(f=e,(u=[],d=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Ie(e,n,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&d(e.shadowRoot)}))}catch(e){}},d(r.document),u).forEach(function(){var e=t((function*(e){var t,r,n=o.mirror.getId(e);if(!l.get(n)&&0!==e.width&&0!==e.height){l.set(n,!0);try{if(["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);if(null==(t=null==i?void 0:i.isContextLost)?void 0:t.call(i))return void l.set(n,!1);!1===(null==(r=null==i?void 0:i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var u=e.clientWidth||e.width,d=e.clientHeight||e.height,h=Math.max(1,Math.round(u*s)),v=Math.max(1,Math.round(d*s)),f=yield createImageBitmap(e,1>s?{resizeWidth:h,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:h,resizeHeight:v});c.postMessage({id:n,bitmap:f,width:h,height:v,displayWidth:u,displayHeight:d,dataURLOptions:a.dataURLOptions},[f])}catch(e){l.set(n,!1)}}}));return function(t){return e.apply(this,arguments)}}())),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{u(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(e,t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=yt(e,t,r,!1),a=function(e,t,r,n,i){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=S(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Ie(this.canvas,r,n,!0)||setTimeout((()=>{var r=vt(u,t,this,i);e(this.canvas,{type:d["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(r){var u=be(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:d["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n),o=function(e,t,r,n,i){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...gt(t.WebGLRenderingContext.prototype,d.WebGL,e,r,n,t,i)),void 0!==t.WebGL2RenderingContext&&a.push(...gt(t.WebGL2RenderingContext.prototype,d.WebGL2,e,r,n,t,i)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i);return t})),{type:a}=r[0];this.mutationCb({id:t,type:a,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Mt{constructor(e){o(this,"trackedLinkElements",new WeakSet),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(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){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],a=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:L(t,e.href),index:r})))})),n.styleIds.push(t)};for(var o of e)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,ae.forEach((e=>e.abort())),ae.clear()}trackStylesheetInLinkElement(e){}}class Tt{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var _t=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(n=Lt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt=new R;function Ot(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:a="rr-block",blockSelector:o=null,ignoreClass:l="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:m,maskInputFn:y,maskTextFn:g,hooks:b,packFn:w,sampling:k={},dataURLOptions:x={},canvasResolutionScale:S,mousemoveWait:I,recordDOM:M=!0,recordCanvas:T=!1,recordCrossOriginIframes:_=!1,recordAfter:L=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:N=!1,plugins:q,keepIframeSrcFn:P=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:D}=e;De=D;var F=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),B=!_||window.parent===window,H=!1;if(!B)try{window.parent.document&&(H=!1)}catch(e){H=!0}if(B&&!t)throw new Error("emit function is required");if(!B&&!H)return()=>{};void 0!==I&&void 0===k.mousemove&&(k.mousemove=I),Rt.reset();var j,U=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},W=he(void 0!==m&&m);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var V,Z,z=0,Q=new Map,G=e=>{for(var t of q||[])t.eventProcessor&&(e=t.eventProcessor(e));return w&&!H&&(e=w(e)),e};bt=(e,r)=>{var a,o=e;if(o.timestamp=we(),!(null==(a=Ze[0])?void 0:a.isFrozen())||o.type===s.FullSnapshot||o.type===s.IncrementalSnapshot&&o.data.source===u.Mutation||Ze.forEach((e=>e.unfreeze())),B)null==t||t(G(o),r);else if(H){var l={type:"rrweb",event:G(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(o.type===s.FullSnapshot)j=o,z=0;else if(o.type===s.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;z++,(i&&z>=i||n&&o.timestamp-j.timestamp>n)&&wt(!0)}};var Y=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,n=new Set;if(e.adds.length>0)for(var i of e.adds){var a=Rt.getNode(i.node.id);a&&"IFRAME"===a.nodeName&&n.add(a)}e.removes.forEach((e=>{var{id:r}=e;if(!t||!t.has(r)){var i=ee.getIframeElementById(r);i&&n.has(i)?ee.forgetIframeId(r):(null==V||V(r),ee.removeIframeById(r))}})),null==Z||Z(),ee.cleanupDetachedIframes()}bt({type:s.IncrementalSnapshot,data:r({source:u.Mutation},e)})},J=e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Scroll},e)}),K=e=>bt({type:s.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),X=new Mt({mutationCb:Y,adoptedStyleSheetCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),ee=new at({mirror:Rt,mutationCb:Y,stylesheetManager:X,recordCrossOriginIframes:_,wrappedEmit:bt});for(var te of q||[])te.getMirror&&te.getMirror({nodeMirror:Rt,crossOriginIframeMirror:ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:ee.crossOriginIframeStyleMirror});var re=new Tt;kt=new It({recordCanvas:T,mutationCb:K,win:window,blockClass:a,blockSelector:o,mirror:Rt,sampling:k.canvas,dataURLOptions:F,resolutionScale:S});var ne=new ot({mutationCb:Y,scrollCb:J,bypassOptions:{blockClass:a,blockSelector:o,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:U,dataURLOptions:F,maskTextFn:g,maskInputFn:y,recordCanvas:T,inlineImages:N,sampling:k,slimDOMOptions:W,iframeManager:ee,stylesheetManager:X,canvasManager:kt,keepIframeSrcFn:P,processedNodeManager:re},mirror:Rt});wt=function(e){if(void 0===e&&(e=!1),M){bt({type:s.Meta,data:{href:window.location.href,width:Se(),height:xe()}},e),X.reset(),ne.init(),Ze.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new R,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:a="rr-mask",maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onIframeListenerRegistered:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x=(()=>!1),maxDepth:S}=t||{};return de(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:he(v),dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onIframeListenerRegistered:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:Rt,blockClass:a,blockSelector:o,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:U,maskTextFn:g,maskInputFn:y,slimDOM:W,dataURLOptions:F,recordCanvas:T,inlineImages:N,onSerialize(e){Le(e,Rt)&&ee.addIframe(e),Re(e,Rt)&&X.trackLinkElement(e),Oe(e)&&ne.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){ee.attachIframe(e,t),ne.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ee.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){X.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");bt({type:s.FullSnapshot,data:{node:t,initialOffset:ke(window)}},e),Ze.forEach((e=>e.unlock())),_&&ee.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,Rt.getId(document))}};try{var ie=[];V=e=>{var t=Q.get(e);t&&(t.forEach((e=>{pe(e);var t=ie.indexOf(e);-1!==t&&ie.splice(t,1)})),Q.delete(e))},Z=()=>{for(var[e]of Q){var t=Rt.getNode(e);if(t)try{t.contentDocument&&t.contentDocument.defaultView||null==V||V(e)}catch(t){null==V||V(e)}else null==V||V(e)}};var ae=e=>{var t;return Ve(tt)({mutationCb:Y,mousemoveCb:(e,t)=>bt({type:s.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:J,viewportResizeCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:K,fontCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){bt({type:s.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){bt({type:s.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:a,ignoreClass:l,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:U,inlineStylesheet:v,sampling:k,recordDOM:M,recordCanvas:T,inlineImages:N,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:y,maskTextFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:W,dataURLOptions:F,mirror:Rt,iframeManager:ee,stylesheetManager:X,shadowDomManager:ne,processedNodeManager:re,canvasManager:kt,ignoreCSSAttributes:A,plugins:(null==(t=null==q?void 0:q.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>bt({type:s.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},b)};ee.addLoadListener((e=>{try{var t=Rt.getId(e),r=ae(e.contentDocument);if(ie.push(r),-1!==t){var n=Q.get(t);n||Q.set(t,n=new Set),n.add(r)}}catch(e){console.warn(e)}})),ee.addPageHideListener((e=>{var t=Rt.getId(e);null==V||V(t),Ge(e)}));var oe=-1,se=e=>bt({type:s.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),ue=()=>{var e,t,r,n,i=document,a=null!==(e=null!==(t=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==t?t:i.msFullscreenElement)&&void 0!==e?e:null,o=a?Rt.getId(a):-1;o!==oe&&(-1!==oe&&se({id:oe,enter:!1}),oe=o,-1!==o&&se({id:o,enter:!0}))},le=()=>{wt(),ie.push(ae(document)),ie.push(fe("fullscreenchange",ue)),ie.push(fe("webkitfullscreenchange",ue)),ie.push(fe("mozfullscreenchange",ue)),ie.push(fe("MSFullscreenChange",ue)),_t=!0};return["interactive","complete"].includes(document.readyState)?le():(ie.push(fe("DOMContentLoaded",(()=>{bt({type:s.DomContentLoaded,data:{}}),"DOMContentLoaded"===L&&le()}))),ie.push(fe("load",(()=>{bt({type:s.Load,data:{}}),"load"===L&&le()}),window))),()=>{ie.forEach((e=>pe(e))),re.destroy(),ee.removeLoadListener(),ee.destroy(),Q.clear(),Rt.reset(),_t=!1,De=void 0}}catch(e){console.warn(e)}}Ot.addCustomEvent=(e,t)=>{if(!_t)throw new Error("please add custom event after start recording");bt({type:s.Custom,data:{tag:e,payload:t}})},Ot.freezePage=()=>{Ze.forEach((e=>e.freeze()))},Ot.takeFullSnapshot=e=>{if(!_t)throw new Error("please take full snapshot after start recording");wt(e)},Ot.mirror=Rt;var Et=Object.defineProperty,Nt=(e,t,r)=>((e,t,r)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class qt{constructor(e){Nt(this,"fileName"),Nt(this,"functionName"),Nt(this,"lineNumber"),Nt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Pt=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Dt=/^(eval@)?(\[native code])?$/,Ft={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new qt({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Dt)}),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 qt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new qt({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new qt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new qt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Pt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new qt({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Ht(e){return Array.isArray(e)}function jt(e){return"object"==typeof e&&null!==e&&!Ht(e)}function Ut(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(jt(e[n])&&Ut(e[n],t-1))return!0;return!1}function Wt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(jt(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||jt(o)&&Ut(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=Ht(l)?Bt(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Vt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Zt(e,t,r){var n,i=r?Object.assign({},Vt,r):Vt,a=i.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=Ft.parse(t.error).map((e=>e.toString())),a=[Wt(r,i.stringifyOptions)];e({level:"error",trace:n,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Wt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Wt("Uncaught (in promise)",i.stringifyOptions),Wt(t.reason,i.stringifyOptions)]);var a=Ft.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(h(n,d));return()=>{u.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Ft.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Wt(e,i.stringifyOptions)));o++,i.lengthThreshold>o?e({level:r,trace:c,payload:d}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Wt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})(l);return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l}})),t[a]=c,()=>{t[a]=l}}catch(e){return()=>{}}}(t,r):()=>{}}}var zt=e=>({name:"rrweb/console@1",observer:Zt,options:e}),$t=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({});function Qt(e,t){return-1!==e.indexOf(t)}var Gt=function(e){return e.trim()},Yt=Object.prototype,Jt=Yt.hasOwnProperty,Kt=Yt.toString,Xt=Array.isArray||function(e){return"[object Array]"===Kt.call(e)},er=e=>"function"==typeof e,tr=e=>e===Object(e)&&!Xt(e),rr=e=>void 0===e,nr=e=>"[object String]"==Kt.call(e),ir=e=>null===e,ar=e=>rr(e)||ir(e),or=e=>"[object Number]"==Kt.call(e)&&e==e,sr=e=>"[object Boolean]"===Kt.call(e),ur=e=>e instanceof FormData;function lr(e){return null===e||"object"!=typeof e}function cr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function dr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var hr="Mobile",vr="Android",fr="Tablet",pr=vr+" "+fr,mr="iPad",yr="Apple Watch",gr="BlackBerry",br="Nintendo",wr="PlayStation",kr="Xbox",xr="Windows Phone",Sr="Nokia",Cr="Ouya",Ir="Generic",Mr=Ir+" "+hr.toLowerCase(),Tr=Ir+" "+fr.toLowerCase(),_r=new RegExp(kr,"i"),Lr=new RegExp(wr+" \\w+","i"),Rr=new RegExp(br+" \\w+","i"),Or=new RegExp(gr+"|PlayBook|BB10","i");function Er(e){return e?e.split("#")[0]:e}var Nr,qr,Pr;function Ar(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function Dr(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return Pr&&r.length===qr||(qr=r.length,Pr=r.reduce(((r,n)=>{Nr||(Nr={});var i=Nr[n];if(i)r[i[0]]=i[1];else for(var a=e(n),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,Nr[n]=[u,l];break}}return r}),{})),Pr}}var Fr="?";function Br(e,t,r,n,i){var a={platform:e,filename:t,function:"<anonymous>"===r?Fr:r,in_app:!0};return rr(n)||(a.lineno=n),rr(i)||(a.colno=i),a}var Hr=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:Fr,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},jr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ur=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Wr=/\((\S*)(?::(\d+))(?::(\d+))\)/,Vr=(e,t)=>{var r=jr.exec(e);if(r){var[,n,i,a]=r;return Br(t,n,Fr,+i,+a)}var o=Ur.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Wr.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[u,l]=Hr(o[1]||Fr,o[2]);return Br(t,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Zr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,zr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$r=(e,t)=>{var r=Zr.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=zr.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],a=r[1]||Fr;return[a,i]=Hr(a,i),Br(t,i,a,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Qr=/\(error: (.*)\)/;var Gr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Yr=["fatal","error","warning","log","info","debug"];function Jr(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(t>=i.length)return n===r.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Kr="undefined"!=typeof window?window:void 0,Xr="undefined"!=typeof globalThis?globalThis:Kr;"undefined"==typeof self&&(Xr.self=Xr),"undefined"==typeof File&&(Xr.File=function(){});var en=null==Xr?void 0:Xr.navigator,tn=null==Xr?void 0:Xr.document;null!=Xr&&Xr.XMLHttpRequest&&new Xr.XMLHttpRequest;var rn=null==en?void 0:en.userAgent,nn=null!=Kr?Kr:{},an=e=>e instanceof Document,on=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,n={k(t){if(Kr&&(nn.POSTHOG_DEBUG||r)&&!rr(Kr.console)&&Kr.console){for(var n=("__rrweb_original__"in Kr.console[t]?Kr.console[t].__rrweb_original__:Kr.console[t]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>on(e+" "+t,r)};return n},sn=on("[PostHog.js]"),un=sn.createLogger;function ln(e,t){if(!ar(e))if(Xt(e))e.forEach(t);else if(ur(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Jt.call(e,r)&&t(e[r],r)}var cn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var i of r)for(var a in i)void 0!==i[a]&&(e[a]=i[a]);return e};function dn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function hn(e,t,r,n){var{capture:i=!1,passive:a=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:a})}var vn=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return ln(e,(function(e,t){rr(e)||rr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function fn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return er(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=n)}}catch(e){return()=>{}}}function pn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of t.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var mn=1,yn=3,gn=11;function bn(e){return!!e&&e.nodeType===mn}function wn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kn(e){return!!e&&e.nodeType===gn&&bn(e.host)}function xn(e){return e?Gt(e).split(/\s+/):[]}function Sn(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return xn(t)}function Cn(e){var t="";return Rn(e)&&!On(e)&&e.childNodes&&e.childNodes.length&&ln(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===yn})(e)&&e.textContent&&(t+=null!==(r=function(e){return ar(e)?null:Gt(e).split(/(\s+)/).filter((e=>Fn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),Gt(t)}var In=["a","button","form","input","select","textarea","label"];function Mn(e){var t=e.parentNode;return!(!t||!bn(t))&&t}var Tn=[".ph-no-deadclick",".ph-no-capture"];var _n=e=>!e||wn(e,"html")||!bn(e),Ln=(e,t)=>{if(!Kr||_n(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],i=e;i.parentNode&&!wn(i,"body");)if(kn(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else{var a=Mn(i);if(!a)break;if(In.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var o=Kr.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}n.push(a),i=a}return{parentIsUsefulElement:r,targetElementList:n}};function Rn(e){for(var t=e;t.parentNode&&!wn(t,"body");t=t.parentNode){var r=Sn(t);if(Qt(r,"ph-sensitive")||Qt(r,"ph-no-capture"))return!1}if(Qt(Sn(e),"ph-include"))return!0;var n=e.type||"";if(nr(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!nr(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function On(e){return!!(wn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||wn(e,"select")||wn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var En="(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})",Nn=new RegExp("^(?:"+En+")$"),qn=new RegExp(En),Pn="\\d{3}-?\\d{2}-?\\d{4}",An=new RegExp("^("+Pn+")$"),Dn=new RegExp("("+Pn+")");function Fn(e,t){if(void 0===t&&(t=!0),ar(e))return!1;if(nr(e)){if(e=Gt(e),(t?Nn:qn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?An:Dn).test(e))return!1}return!0}function Bn(e){var t=Cn(e);return Fn(t=(t+" "+Hn(e)).trim())?t:""}function Hn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ln(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Cn(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Hn(e)).trim())}catch(e){sn.error("[AutoCapture]",e)}})),t}function jn(e){return e.replace(/"|\\"/g,'\\"')}function Un(e){var t=e.attr__class;return t?Xt(t)?t:xn(t):void 0}var Wn=1e6,Vn={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:Wn,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Zn=un("[Recorder]"),zn=e=>"navigation"===e.entryType,$n=e=>"resource"===e.entryType;function Qn(e,t){return!!t&&(sr(t)||t[e])}function Gn(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Yn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Jn(e){var{type:t,recordBody:r,headers:n,url:i}=e;function a(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Gn(t)&&e(t.url)}catch(e){return!1}}(i))return!1;if(a(Yn))return!1;if(sr(r))return!0;if(Xt(r))return a(r);var o=r[t];return sr(o)?o:a(o)}function Kn(e,t,r,n,i,a){return Xn.apply(this,arguments)}function Xn(){return Xn=t((function*(e,t,r,n,i,a){if(void 0===a&&(a=0),a>10)return Zn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if($n(o=e[a])&&o.initiatorType===t&&(rr(n)||o.startTime>=n)&&(rr(i)||i>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Kn(e,t,r,n,i,a+1))})),Xn.apply(this,arguments)}function ei(e){var{body:t,options:r,url:n}=e;if(ar(t))return null;var{hostname:i,isHostDenied:a}=pn(n,r);if(a)return i+" is in deny list";if(nr(t))return t;if(an(t))return t.textContent;if(ur(t))return vn(t);if(tr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ti=e=>!ir(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ri(e){var{entry:t,method:n,status:i,networkRequest:a,isInitial:o,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(s||0)),v=[r({},t?t.toJSON():{name:l},{startTime:rr(s)?void 0:Math.round(s),endTime:rr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(ti(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ni=["video/","audio/"];function ii(e){return tr(e)&&er(e.getReader)&&er(e.tee)}var ai=500,oi="[SessionReplay] Timeout while trying to read body",si="[SessionReplay] Failed to read body";function ui(e){return si+": "+e}function li(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function ci(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(oi)),ai);try{e.clone().text().then((e=>t(e)),(e=>t(ui(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(si)}}))}(e);var r=function(e){var t;return Math.min(Wn,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:Wn)}(t);return function(e,t){try{var r,n=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>t}catch(e){return!1}}(e,r)?Promise.resolve(li(r)):function(e,t){return new Promise((r=>{var n,i=!1;function a(){try{var e;null==(e=n)||e.cancel()}catch(e){}}function o(e){i||(i=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(oi)),ai);try{s=e.clone()}catch(e){return void o(si)}var l=s.body;if(ii(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(e){return void o(si)}var c=[],d=0;!function e(){n.read().then((r=>{var{done:n,value:s}=r;if(i)a();else if(n)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),n=0;for(var i of e)r.set(i,n),n+=i.byteLength;return r}(c,d)));else{if(s){if(d+s.byteLength>t)return void o(li(t));d+=s.byteLength,c.push(s)}e()}}),(e=>o(ui(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(ui(e))))}catch(e){o(si)}}))}(e,r)}function di(){return di=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:a}=pn(n,r);return a?Promise.resolve(i+" is in deny list"):ci(t,r)})),di.apply(this,arguments)}function hi(){return hi=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=ni.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var{hostname:s,isHostDenied:u}=pn(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return ir(i)?ci(t,r):Promise.resolve(i)})),hi.apply(this,arguments)}var vi=null;function fi(e,n,i){if(!("performance"in n))return()=>{};if(vi)return Zn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},Vn,i):Vn,o=t=>{var n=[];t.requests.forEach((e=>{var t=a.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},s=function(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>zn(e)||$n(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>zn(e)||$n(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Qn("request",r.recordHeaders),i=Qn("response",r.recordHeaders),a=fn(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var d,h,v=this,f=new Request(s),p={},m={},y=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=v.send.bind(v);v.send=e=>(Jn({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=ei({body:e,options:r,url:s})),d=t.performance.now(),g(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),h=t.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Jn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=ei({body:v.response,options:r,url:s})),Kn(t,"xmlhttprequest",f.url,d,h).then((t=>{var r=ri({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:d,end:h,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),a.call(v,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Qn("request",n.recordHeaders),a=Qn("response",n.recordHeaders),o=fn(r,"fetch",(o=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),h={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),i&&(h.requestHeaders=v),!ii(null==s?void 0:s.body)&&Jn({type:"request",headers:v,url:t,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return di.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=Gn(t)?yield o(d):yield o(t,s),c=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),a&&(h.responseHeaders=f),Jn({type:"response",headers:f,url:t,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return hi.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Kn(r,"fetch",d.url,l,c).then((t=>{var r,n=ri({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),vi=()=>{s(),u(),l(),vi=null}}var pi=e=>({name:"rrweb/network@1",observer:fi,options:e});nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:zt,getRecordNetworkPlugin:pi},nn.__PosthogExtensions__.rrweb={record:Ot,version:"v2",wasMaxDepthReached:()=>ce,resetMaxDepthState(){ce=!1,le=!1}},nn.rrweb={record:Ot,version:"v2"},nn.rrwebConsoleRecord={getRecordConsolePlugin:zt},nn.getRecordNetworkPlugin=pi;var mi,yi,gi,bi,wi,ki,xi,Si,Ci,Ii,Mi,Ti,_i,Li,Ri,Oi={},Ei=[],Ni=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qi=Array.isArray;function Pi(e,t){for(var r in t)e[r]=t[r];return e}function Ai(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Di(e,t,r){var n,i,a,o={};for(a in t)"key"==a?n=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?mi.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return Fi(e,o,n,i,null)}function Fi(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++gi:i,__i:-1,__u:0};return null==i&&null!=yi.vnode&&yi.vnode(a),a}function Bi(e){return e.children}function Hi(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function ji(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],i=[],a=Pi({},t);a.__v=t.__v+1,yi.vnode&&yi.vnode(a),Ji(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,null==r?$(t):r,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Xi(n,a,i),t.__e=t.__=null,a.__e!=r&&Ui(a)}}function Ui(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Ui(e)}function Wi(e){(!e.__d&&(e.__d=!0)&&bi.push(e)&&!Vi.__r++||wi!=yi.debounceRendering)&&((wi=yi.debounceRendering)||ki)(Vi)}function Vi(){try{for(var e,t=1;bi.length;)bi.length>t&&bi.sort(xi),e=bi.shift(),t=bi.length,ji(e)}finally{bi.length=Vi.__r=0}}function Zi(e,t,r,n,i,a,o,s,u,l,c){var d,h,v,f,p,m,y,g=n&&n.__k||Ei,b=t.length;for(u=function(e,t,r,n,i){var a,o,s,u,l,c=r.length,d=c,h=0;for(e.__k=new Array(i),a=0;i>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=Fi(null,o,null,null,null):qi(o)?o=e.__k[a]=Fi(Bi,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=Fi(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+h,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=$i(o,r,u,d))&&(d--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(i>c?h--:c>i&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;c>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==n&&(n=$(s)),na(s,s));return n}(r,t,g,u,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(h=-1!=v.__i&&g[v.__i]||Oi,v.__i=d,m=Ji(e,v,h,i,a,o,s,u,l,c),f=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&ra(h.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(y=!!(4&v.__u))||h.__k===v.__k?(u=zi(v,u,e,y),y&&h.__e&&(h.__e=null)):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function zi(e,t,r,n){var i,a;if("function"==typeof e.type){for(i=e.__k,a=0;i&&i.length>a;a++)i[a]&&(i[a].__=e,t=zi(i[a],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function $i(e,t,r,n){var i,a,o,s=e.key,u=e.type,l=t[r],c=null!=l&&0==(2&l.__u);if(null===l&&null==s||c&&s==l.key&&u==l.type)return r;if(n>(c?1:0))for(i=r-1,a=r+1;i>=0||t.length>a;)if(null!=(l=t[o=0>i?a++:i--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function Qi(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ni.test(t)?r:r+"px"}function Gi(e,t,r,n,i){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Qi(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Qi(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Mi,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r[Ii]=n[Ii]:(r[Ii]=Ti,e.addEventListener(t,a?Li:_i,a)):e.removeEventListener(t,a?Li:_i,a);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Yi(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Ci])t[Ci]=Ti++;else if(r[Ii]>t[Ci])return;return r(yi.event?yi.event(t):t)}}}function Ji(e,t,r,n,i,a,o,s,u,l){var c,d,h,v,f,p,m,y,g,b,$,w,k,x,S,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(c=yi.__b)&&c(t);e:if("function"==typeof C)try{if(y=t.props,g=C.prototype&&C.prototype.render,b=(c=C.contextType)&&n[c.__c],$=c?b?b.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:(g?t.__c=d=new C(y,$):(t.__c=d=new Hi(y,$),d.constructor=C,d.render=ia),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),g&&null==d.__s&&(d.__s=d.state),g&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Pi({},d.__s)),Pi(d.__s,C.getDerivedStateFromProps(y,d.__s))),v=d.props,f=d.state,d.__v=t,h)g&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),g&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(g&&null==C.getDerivedStateFromProps&&y!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,$),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,$)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),Ei.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,$),g&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=$,d.props=y,d.__P=e,d.__e=!1,w=yi.__r,k=0,g)d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),Ei.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++k);d.state=d.__s,null!=d.getChildContext&&(n=Pi(Pi({},n),d.getChildContext())),g&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),x=null!=c&&c.type===Bi&&null==c.key?ea(c.props.children):c,s=Zi(e,qi(x)?x:[x],t,r,n,i,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(S=a.length;S--;)Ai(a[S]);Ki(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Ki(t);yi.__e(e,t,r)}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=ta(r.__e,t,r,n,i,a,o,u,l);return(c=yi.diffed)&&c(t),128&t.__u?void 0:s}function Ki(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ki))}function Xi(e,t,r){for(var n=0;r.length>n;n++)ra(r[n],r[++n],r[++n]);yi.__c&&yi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){yi.__e(e,t.__v)}}))}function ea(e){return"object"!=typeof e||null==e||e.__b>0?e:qi(e)?e.map(ea):void 0!==e.constructor?null:Pi({},e)}function ta(e,t,r,n,i,a,o,s,u){var l,c,d,h,v,f,p,m=r.props||Oi,y=t.props,g=t.type;if("svg"==g?i="http://www.w3.org/2000/svg":"math"==g?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!g&&(g?v.localName==g:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(i,g,y.is&&y),s&&(yi.__m&&yi.__m(t,a),s=!1),a=null}if(null==g)m===y||s&&e.data==y||(e.data=y);else{if(a="textarea"==g&&null!=y.defaultValue?null:a&&mi.call(e.childNodes),!s&&null!=a)for(m={},l=0;e.attributes.length>l;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)v=m[l],"dangerouslySetInnerHTML"==l?d=v:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||Gi(e,l,null,v,i);for(l in y)v=y[l],"children"==l?h=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||Gi(e,l,v,m[l],i);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Zi("template"==t.type?e.content:e,qi(h)?h:[h],t,r,n,"foreignObject"==g?"http://www.w3.org/1999/xhtml":i,a,o,a?a[0]:r.__k&&$(r,0),s,u),null!=a)for(l=a.length;l--;)Ai(a[l]);s&&"textarea"!=g||(l="value","progress"==g&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==g&&!f||"option"==g&&f!=m[l])&&Gi(e,l,f,m[l],i),l="checked",null!=p&&p!=e[l]&&Gi(e,l,p,m[l],i))}return e}function ra(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){yi.__e(e,r)}}function na(e,t,r){var n,i;if(yi.unmount&&yi.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ra(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){yi.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;n.length>i;i++)n[i]&&na(n[i],t,r||"function"!=typeof e.type);r||Ai(e.__e),e.__c=e.__=e.__e=void 0}function ia(e,t,r){return this.constructor(e,r)}function aa(e,t,r){var n,i,a;t==document&&(t=document.documentElement),yi.__&&yi.__(e,t),n=t.__k,i=[],a=[],Ji(t,e=t.__k=Di(Bi,null,[e]),n||Oi,Oi,t.namespaceURI,n?null:t.firstChild?mi.call(t.childNodes):null,i,n?n.__e:t.firstChild,!1,a),Xi(i,e,a)}mi=Ei.slice,yi={__e(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},gi=0,Hi.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Pi({},this.state),"function"==typeof e&&(e=e(Pi({},r),this.props)),e&&Pi(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Wi(this))},Hi.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Wi(this))},Hi.prototype.render=Bi,bi=[],ki="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xi=function(e,t){return e.__v.__b-t.__v.__b},Vi.__r=0,Si=Math.random().toString(8),Ci="__d"+Si,Ii="__a"+Si,Mi=/(PointerCapture)$|Capture$/i,Ti=0,_i=Yi(!1),Li=Yi(!0),Ri=0;var oa,sa,ua,la,ca=0,da=[],ha=yi,va=ha.__b,fa=ha.__r,pa=ha.diffed,ma=ha.__c,ya=ha.unmount,ga=ha.__;function ba(e,t){ha.__h&&ha.__h(sa,e,ca||t),ca=0;var r=sa.__H||(sa.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function wa(e){return ca=1,function(e,t,r){var n=ba(oa++,2);if(n.t=e,!n.__c&&(n.__=[Oa(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=sa,!sa.__f)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!a||a.call(this,e,t,r);var o=n.__c.props!==e;return i.some((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a&&a.call(this,e,t,r)||o};sa.__f=!0;var a=sa.shouldComponentUpdate,o=sa.componentWillUpdate;sa.componentWillUpdate=function(e,t,r){if(this.__e){var n=a;a=void 0,i(e,t,r),a=n}o&&o.call(this,e,t,r)},sa.shouldComponentUpdate=i}return n.__N||n.__}(Oa,e)}function ka(e,t){var r=ba(oa++,3);!ha.__s&&Ra(r.__H,t)&&(r.__=e,r.u=t,sa.__H.__h.push(r))}function xa(e){return ca=5,Sa((function(){return{current:e}}),[])}function Sa(e,t){var r=ba(oa++,7);return Ra(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ca(e){var t=sa.context[e.__c],r=ba(oa++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(sa)),t.props.value):e.__}function Ia(){for(var e;e=da.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_a),t.__h.some(La),t.__h=[]}catch(r){t.__h=[],ha.__e(r,e.__v)}}}ha.__b=function(e){sa=null,va&&va(e)},ha.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ga&&ga(e,t)},ha.__r=function(e){fa&&fa(e),oa=0;var t=(sa=e.__c).__H;t&&(ua===sa?(t.__h=[],sa.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(_a),t.__h.some(La),t.__h=[],oa=0)),ua=sa},ha.diffed=function(e){pa&&pa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==da.push(t)&&la===ha.requestAnimationFrame||((la=ha.requestAnimationFrame)||Ta)(Ia)),t.__H.__.some((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),ua=sa=null},ha.__c=function(e,t){t.some((function(e){try{e.__h.some(_a),e.__h=e.__h.filter((function(e){return!e.__||La(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ha.__e(r,e.__v)}})),ma&&ma(e,t)},ha.unmount=function(e){ya&&ya(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{_a(e)}catch(e){t=e}})),r.__H=void 0,t&&ha.__e(t,r.__v))};var Ma="function"==typeof requestAnimationFrame;function Ta(e){var t,r=function(){clearTimeout(n),Ma&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Ma&&(t=requestAnimationFrame(r))}function _a(e){var t=sa,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),sa=t}function La(e){var t=sa;e.__c=e.__(),sa=t}function Ra(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Oa(e,t){return"function"==typeof t?t(e):t}var Ea={Tab:"tab",Selector:"selector"},Na={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},qa={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Pa={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Aa={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Da={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Fa="always",Ba={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Ha={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"};function ja(e){return"$survey_response_"+e}function Ua(e,t){if(!t)return null;var r=e[ja(t)];return Xt(r)?[...r]:r}function Wa(e,t){void 0===e&&(e={});var n={};return t.questions.forEach((t=>{if(!rr(t.originalQuestionIndex)){var r,i=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,a=Ua(e,t.id);rr(a)||(n[i]=a)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:Ua(e,t.id)})))},e,n)}function Va(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function Za(e){return"string"==typeof e&&e.trim()?e.trim():null}function za(e){return e.toLowerCase()}function $a(e,t,r){if(!e||!t)return null;var n=za(t),i=Object.keys(e).find((e=>za(e)===n));if(i)return null==r||r.debug("Found exact translation match: "+i),i;if(n.includes("-")){var a=n.split("-")[0],o=Object.keys(e).find((e=>za(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function Qa(e,t,n){var i,a=$a(e.translations,t,n),o=r({},e),s=!1;if(a){var u,l=null==(u=e.translations)?void 0:u[a];l&&(null==n||n.info("Applying survey-level translation for language: "+a),rr(l.name)||(o.name=l.name,s=!0),o.appearance?(o.appearance=r({},o.appearance),rr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,s=!0),rr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,s=!0),rr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,s=!0),rr(l.submitButtonText)||(o.appearance.submitButtonText=l.submitButtonText,s=!0),rr(l.backButtonText)||(o.appearance.backButtonText=l.backButtonText,s=!0)):function(e){return!(rr(e.thankYouMessageHeader)&&rr(e.thankYouMessageDescription)&&rr(e.thankYouMessageCloseButtonText)&&rr(e.submitButtonText)&&rr(e.backButtonText))}(l)&&(s=!0))}var c=e.questions.map((e=>function(e,t,n){var i,a=$a(e.translations,t,n);if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(i=e.translations)?void 0:i[a];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var s=r({},e),u=!1;return rr(o.question)||(s.question=o.question,u=!0),rr(o.description)||(s.description=o.description,u=!0),rr(o.buttonText)||(s.buttonText=o.buttonText,u=!0),"link"in s&&!rr(o.link)&&(s.link=o.link,u=!0),"lowerBoundLabel"in s&&!rr(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in s&&!rr(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in s&&function(e){return Xt(e.choices)}(o)&&(s.choices=o.choices,u=!0),{question:u?s:e,matchedKey:u?a:null,hasChanges:u}}(e,t,n))),d=c.map((e=>e.question)),h=c.some((e=>e.hasChanges)),v=null;return a||(v=(null==(i=c.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),h&&(o.questions=d,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?a||v:null}}var Ga=un("[Surveys]"),Ya="inProgressSurvey_",Ja=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Ka=e=>Ja("seenSurvey_",e),Xa=e=>{try{var t=Ka(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Ga.error("Failed to persist survey seen state",e)}},eo=[Pa.Popover,Pa.Widget,Pa.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return or(e)&&isFinite(e)&&Math.floor(e)===e});class to{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>t||0>r||0>n||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new to(i)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new to(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class ro{constructor(){this.S=0,this.C=0,this.I=new ao}generate(){var e=this.generateOrAbort();if(rr(e)){this.S=0;var t=this.generateOrAbort();if(rr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return to.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var no,io=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Kr&&!rr(Kr.crypto)&&crypto.getRandomValues&&(io=e=>crypto.getRandomValues(e));class ao{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(io(this.R),this.O=0),this.R[this.O++]}}var oo=()=>so().toString(),so=()=>(no||(no=new ro)).generate(),uo=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},lo={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>uo(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!uo(t,e))))),icontains:(e,t)=>t.map(co).some((t=>e.map(co).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(co).every((t=>e.map(co).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},co=e=>e.toLowerCase(),ho=null,vo={N(){if(!ir(ho))return ho;var e=!0;if(rr(Kr))e=!1;else try{var t="__mplssupport__";vo.q(t,"xyz"),'"xyz"'!==vo.P(t)&&(e=!1),vo.A(t)}catch(t){e=!1}return e||sn.error("localStorage unsupported; falling back to cookie store"),ho=e,e},D(e){sn.error("localStorage error: "+e)},P(e){try{return null==Kr?void 0:Kr.localStorage.getItem(e)}catch(e){vo.D(e)}return null},F(e){try{return JSON.parse(vo.P(e))||{}}catch(e){}return null},q(e,t){try{return null==Kr||Kr.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){vo.D(e)}return!1},A(e){try{null==Kr||Kr.localStorage.removeItem(e)}catch(e){vo.D(e)}}},fo=un("[Stylesheet Loader]"),po=Kr,mo=tn,yo="#020617",go={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Na.Right,widgetType:Ea.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:yo,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},bo=[Na.Center,Na.Left,Na.Right];function wo(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function ko(e){var t;void 0===e&&(e=go.backgroundColor),"#"===e[0]&&(t=wo(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=wo(r)),!t)return yo;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),a=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+a*a*.587+o*o*.114)>127.5?yo:"white"}return yo}var xo=(e,t,n)=>{var i=jo(e),a=mo.querySelector("."+i);if(a&&a.shadowRoot)return{shadow:a.shadowRoot,isNewlyCreated:!1};var o=mo.createElement("div");((e,t,n)=>{var i=r({},go,n),a=e.style,o=!bo.includes(i.position)||t===Pa.Widget&&(null==n?void 0:n.widgetType)===Ea.Tab;a.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),a.setProperty("--ph-survey-box-padding",i.boxPadding),a.setProperty("--ph-survey-max-width",i.maxWidth),a.setProperty("--ph-survey-z-index",i.zIndex),a.setProperty("--ph-survey-border-color",i.borderColor),o?(a.setProperty("--ph-survey-border-radius",i.borderRadius),a.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(a.setProperty("--ph-survey-border-bottom","none"),a.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),a.setProperty("--ph-survey-background-color",i.backgroundColor),a.setProperty("--ph-survey-box-shadow",i.boxShadow),a.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),a.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),a.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||ko(i.submitButtonColor)),a.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),a.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),a.setProperty("--ph-survey-rating-active-text-color",ko(i.ratingButtonActiveColor)),a.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||ko(i.backgroundColor)),a.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),a.setProperty("--ph-widget-color",i.widgetColor),a.setProperty("--ph-widget-text-color",ko(i.widgetColor)),a.setProperty("--ph-widget-z-index",i.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=s||i.inputBackground;s||"white"!==i.backgroundColor||(u="#f8f8f8"),a.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||ko(u);a.setProperty("--ph-survey-input-text-color",l),a.setProperty("--ph-survey-rating-text-color",l),a.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),a.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),a.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,e.type,e.appearance),o.className=i;var s=o.attachShadow({mode:"open"}),u=function(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(fo.error("prepare_external_dependency_stylesheet returned null"),null)})(mo,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return mo.body.appendChild(o),{shadow:s,isNewlyCreated:!0}},So=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:a,isSurveyCompleted:o,properties:s,surveyLanguage:u}=e;a?(Xa(n),a.capture(Ba.SENT,r({[Ha.SURVEY_NAME]:n.name,[Ha.SURVEY_ID]:n.id,[Ha.SURVEY_ITERATION]:n.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:n.current_iteration_start_date,[Ha.SURVEY_SUBMISSION_ID]:i,[Ha.SURVEY_COMPLETED]:o},u&&{[Ha.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},Wa(t,n),s,{$set:{[Va(n,"responded")]:!0}})),o&&(po.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),Ho(n))):Ga.error("[survey sent] event not captured, PostHog instance not found.")},Co=(e,t,n)=>{return r({[Ha.SURVEY_NAME]:e.name,[Ha.SURVEY_ID]:e.id,[Ha.SURVEY_ITERATION]:e.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ha.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!ar(e))))},(null==t?void 0:t.surveyLanguage)&&{[Ha.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url(),[Ha.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},Wa(null==t?void 0:t.responses,e));var i},Io=(e,t,n,i)=>{if(t){if(!n){var a=Fo(e);t.capture(Ba.DISMISSED,r({},Co(e,a,t),i&&{[Ha.SURVEY_LANGUAGE]:i},{$set:{[Va(e,"dismissed")]:!0}})),Ho(e),Xa(e),po.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ga.error("[survey dismissed] event not captured, PostHog instance not found.")},Mo=(e,t)=>{if(t){var r=(e=>Ja("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var n=Fo(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Ba.ABANDONED,Co(e,n,t),{transport:"sendBeacon"})}}else Ga.error("[survey abandoned] event not captured, PostHog instance not found.")},To=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),_o=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Lo=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?_o(e.questions,To(e.questions)):e.questions,Ro=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Fa||Bo(e)},Oo=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Wi(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ri++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Eo=()=>Ca(Oo),No=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return function(e,t,r){var n,i,a,o,s=Pi({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?n=t[a]:"ref"==a?i=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?mi.call(arguments,2):r),Fi(e.type,s,n||e.key,i||e.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function qo(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==po||null==(r=po.location)?void 0:r.href;if(!i)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(n=e.conditions)?void 0:n.urlMatchType);return lo[o](a,[i])}function Po(e){var t,r;return function(e,t){var r,n,i;if(!e||0===e.length)return!0;if(!rn)return!1;var a,o,s,u,l,c,d=(a={userAgentDataPlatform:null==en||null==(r=en.userAgentData)?void 0:r.platform,maxTouchPoints:null==en?void 0:en.maxTouchPoints,screenWidth:null==Kr||null==(n=Kr.screen)?void 0:n.width,screenHeight:null==Kr||null==(i=Kr.screen)?void 0:i.height,devicePixelRatio:null==Kr?void 0:Kr.devicePixelRatio},(c=function(e){return Rr.test(e)?br:Lr.test(e)?wr:_r.test(e)?kr:new RegExp(Cr,"i").test(e)?Cr:new RegExp("("+xr+"|WPDesktop)","i").test(e)?xr:/iPad/.test(e)?mr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?yr:Or.test(e)?gr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Sr,"i").test(e)?Sr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(hr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?vr:pr:new RegExp("(pda|"+hr+")","i").test(e)?Mr:new RegExp(fr,"i").test(e)&&!new RegExp(fr+" pc","i").test(e)?Tr:""}(rn))===mr||c===pr||"Kobo"===c||"Kindle Fire"===c||c===Tr?fr:c===br||c===kr||c===wr||c===Cr?"Console":c===yr?"Wearable":c?hr:"Android"===(null==a?void 0:a.userAgentDataPlatform)&&(null!==(o=null==a?void 0:a.maxTouchPoints)&&void 0!==o?o:0)>0?600>Math.min(null!==(s=null==a?void 0:a.screenWidth)&&void 0!==s?s:0,null!==(u=null==a?void 0:a.screenHeight)&&void 0!==u?u:0)/(null!==(l=null==a?void 0:a.devicePixelRatio)&&void 0!==l?l:1)?hr:fr:"Desktop");return lo[null!=t?t:"icontains"](e,[d])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}var Ao=e=>{var t=""+Ya+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ya+e.id+"_"+e.current_iteration),t},Do=(e,t)=>{try{localStorage.setItem(Ao(e),JSON.stringify(t))}catch(e){Ga.error("Error setting in-progress survey state in localStorage",e)}},Fo=e=>{try{var t=localStorage.getItem(Ao(e));if(t)return JSON.parse(t)}catch(e){Ga.error("Error getting in-progress survey state from localStorage",e)}return null},Bo=e=>{var t=Fo(e);return!ar(null==t?void 0:t.surveySubmissionId)},Ho=e=>{try{localStorage.removeItem(Ao(e))}catch(e){Ga.error("Error clearing in-progress survey state from localStorage",e)}};function jo(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Uo(e,t,r){if(void 0===t&&(t=Na.Right),e===Pa.ExternalSurvey)return{};switch(t){case Na.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Na.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Na.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Na.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Na.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Na.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Na.Left:return{left:"30px"};case Na.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Pa.Widget&&r===Ea.Tab?"60px":"30px"}}}var Wo=0;function Vo(e,t,r,n,i,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Wo,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return yi.vnode&&yi.vnode(l),l}var Zo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),zo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$o=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Qo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Go=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Yo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Vo("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Jo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Vo("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Ko=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Vo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Vo("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Vo("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:t})]})},Xo=Vo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Vo("g",{"clip-path":"url(#clip0_2415_6911)",children:[Vo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Vo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Vo("g",{mask:"url(#mask0_2415_6911)",children:[Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"})]})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2415_6911",children:Vo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function es(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Vo("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Xo]})}function ts(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:a,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:u,onBack:l}=e,{isPreviewMode:c}=Ca(Oo),d=!!u&&!!l,h=!s&&Vo("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==Kr||Kr.open(a)),c?null==o||o():i()},children:t});return Vo("div",{className:"bottom-section",children:[d?Vo("div",{className:"form-buttons form-buttons-with-back",children:[Vo("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),h]}):h,!n.whiteLabel&&Vo(es,{urlParams:{utm_source:"survey-footer"}})]})}function rs(e){var{question:t,forceDisableHtml:r,htmlFor:n}=e;return Vo("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Vo(t.type===Aa.Open?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&No({component:Di("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function ns(e){var{onClick:t}=e,{isPreviewMode:r}=Ca(Oo);return Vo("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ko({fill:"black"})})}Vo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Vo("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var is=Kr;function as(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:a,onClose:o}=e,{isPopup:s}=Ca(Oo);return ka((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return hn(is,"keydown",e),()=>{is.removeEventListener("keydown",e)}}),[o]),Vo("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&Vo(ns,{onClick:()=>o()}),Vo("h3",{className:"thank-you-message-header",children:t}),r&&No({component:Di("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&Vo(ts,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}var os=e=>Xt(e)&&e.every((e=>nr(e)));function ss(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:a,displayQuestionIndex:o,initialValue:s,canGoBack:u,onBack:l}=e,{isPreviewMode:c}=Eo(),d=xa(null),[h,v]=wa((()=>nr(s)?s:""));ka((()=>{setTimeout((()=>{var e;c||null==(e=d.current)||e.focus()}),100)}),[c]);var f="surveyQuestion"+o,p=Sa((()=>function(e,t,r){var n,i,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case $t.MinLength:if(void 0!==o.value&&o.value>a.length)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter at least "+o.value+" characters";break;case $t.MaxLength:if(void 0!==o.value&&a.length>o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter no more than "+o.value+" characters"}return!1}(h,t.validation,t.optional)),[h,t.validation,t.optional]),m=Ar(t.validation,$t.MinLength),y=Ar(t.validation,$t.MaxLength),g=Sa((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(m,y)),[m,y]),b=()=>{p||i(h.trim())},w=()=>{p||a(h.trim())};return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:t,forceDisableHtml:r,htmlFor:f}),Vo("textarea",{ref:d,id:f,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:y,onInput(e){v(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||p||(e.preventDefault(),c?w():b())},value:h}),g&&Vo("div",{className:"validation-hint",children:g})]}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:u,onBack:l})]})}function us(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:a,canGoBack:o,onBack:s}=e;return Vo(Bi,{children:[Vo("div",{className:"question-container",children:Vo(rs,{question:t,forceDisableHtml:r})}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>a("link clicked"),canGoBack:o,onBack:s})]})}function ls(e){var t,{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d=r.scale,h=10===r.scale?0:1,[v,f]=wa((()=>or(u)?u:Xt(u)&&u.length>0&&or(parseInt(u[0]))?parseInt(u[0]):nr(u)&&or(parseInt(u))?parseInt(u):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:m}=Eo(),y=e=>m?s(e):o(e);return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:r,forceDisableHtml:n}),Vo("div",{className:"rating-section",children:[Vo("div",{className:"rating-options",children:["emoji"===r.display&&Vo("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=ps[r.scale])?void 0:t.map(((e,t)=>Vo("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===v?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;f(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&Vo("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:ms(r.scale).map(((e,t)=>Vo(cs,{displayQuestionIndex:i,active:v===e,appearance:a,num:e,setActiveNumber(e){f(e),r.skipSubmitButton&&y(e)}},t)))})]}),!p&&Vo("div",{className:"rating-text",children:[Vo("div",{children:r.lowerBoundLabel}),Vo("div",{children:r.upperBoundLabel})]})]})]}),Vo(ts,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:ir(v)&&!r.optional,appearance:a,onSubmit:()=>o(v),onPreviewSubmit:()=>s(v),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:c})]})}function cs(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return Vo("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){i(t)},children:t})}function ds(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d=xa(null),h=Sa((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=_o(t,To(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[v,f]=wa((()=>((e,t)=>nr(e)||os(e)?e:t===Aa.SingleChoice?null:[])(u,t.type))),[p,m]=wa((()=>((e,t)=>{if(nr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(os(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:y}=Eo(),g=t.type===Aa.SingleChoice,b=t.type===Aa.MultipleChoice,w=t.skipSubmitButton&&g&&!t.hasOpenChoice,k=(e,t)=>{if(t){var n=!p.isSelected;return m((e=>r({},e,{isSelected:n,inputValue:n?e.inputValue:""}))),g&&f(""),void(n&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(g)return f(e),m((e=>r({},e,{isSelected:!1,inputValue:""}))),void(w&&(o(e),y&&s(e)));b&&Xt(v)&&(v.includes(e)?f(v.filter((t=>t!==e))):f([...v,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;m((e=>r({},e,{inputValue:t}))),g&&f(t)},S=e=>{e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),m((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&f(null))},C=()=>!(t.optional||!ir(v)&&(!Xt(v)||p.isSelected||0!==v.length)&&(!p.isSelected||""!==p.inputValue.trim())),I=()=>{p.isSelected&&b?Xt(v)&&(y?s([...v,p.inputValue]):o([...v,p.inputValue])):y?s(v):o(v)};return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:t,forceDisableHtml:n}),Vo("fieldset",{className:"multiple-choice-options limit-height",children:[Vo("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),h.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?p.isSelected:g?v===e:Xt(v)&&v.includes(e);return Vo("label",{className:n?"choice-option-open":"",children:[Vo("div",{className:"response-choice",children:[Vo("input",{type:g?"radio":"checkbox",name:a,checked:s,onChange:()=>k(e,n),id:a,"aria-controls":o}),Vo("span",{children:n?e+":":e})]}),n&&Vo("input",{type:"text",ref:d,id:o,name:"question"+i+"Open",value:p.inputValue,onKeyDown:S,onInput:x,onClick(t){p.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:a,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:w,canGoBack:l,onBack:c})]})}var hs=[1,2,3,4,5],vs=[1,2,3,4,5,6,7],fs=[0,1,2,3,4,5,6,7,8,9,10],ps={2:[Yo,Jo],3:[$o,zo,Zo],5:[Qo,$o,zo,Zo,Go]};function ms(e){switch(e){case 5:default:return hs;case 7:return vs;case 10:return fs}}var ys=un("[Surveys]");function gs(e,t,r){var n,i=e.questions[t],a=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?Da.End:a;if(i.branching.type===Da.End)return Da.End;if(i.branching.type===Da.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Da.ResponseBased){if(i.type===Aa.SingleChoice){var o,s=i.choices.indexOf(""+r);if(-1===s&&i.hasOpenChoice&&(s=i.choices.length-1),null!=(o=i.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=i.branching.responseValues[s];return Number.isInteger(u)?u:u===Da.End?Da.End:a}}else if(i.type===Aa.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===Da.End?Da.End:a}}return a}return ys.warn("Falling back to next question index due to unexpected branching type"),a}var bs=un("[SurveyTranslations]");function ws(e,t){var r=function(e){return function(e,t){var{overrideLanguage:r,storedPersonProperties:n,locale:i}=e,a=Za(r);if(a)return null==t||t.info("Using override display language: "+a),a;var o=function(e){return e&&"object"==typeof e&&"language"in e?Za(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=Za(i);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:er(e.get_property)?e.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},bs)}(t);if(!r)return bs.info("No user language detected"),{survey:e,language:null};var n=Qa(e,r,bs);return{survey:n.survey,language:n.matchedKey}}var ks=Kr,xs=tn,Ss="ph:show_survey_widget",Cs="PHWidgetSurveyClickListener";function Is(e,t){try{var r=e.getBoundingClientRect(),n=ks.innerHeight,i=ks.innerWidth,a=r.left+r.width/2-t/2;a+t>i-20&&(a=i-t-20),20>a&&(a=20);var o=n-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?n-r.top+12+"px":"auto",zIndex:go.zIndex}}catch(e){return Ga.warn("Failed to calculate trigger position:",e),null}}class Ms{constructor(e){var t=this;this.B=new Map,this.H=new Map,this.j=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Bo(t)&&Mo(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var n,i,a,o,{survey:s,language:u}=this.U(e),l=null!=t&&t.position||null!=t&&t.selector?r({},s,{appearance:r({},s.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):s;this.W(l.id);var{properties:c,initialResponses:d}=null!=t?t:{},h=!(!d||0>=Object.keys(d).length)&&this.V(l,d,c,u);if(!h||null!=(n=l.appearance)&&n.displayThankYouMessage){this.Z(l);var v={};if((null==(i=l.appearance)?void 0:i.position)===Na.NextToTrigger&&null!=(a=l.appearance)&&a.widgetSelector){var f,p=xs.querySelector(l.appearance.widgetSelector);p&&(v=Is(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||go.maxWidth))||{})}var m=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:y}=xo(l,this._posthog),g={posthog:this._posthog,survey:l,removeSurveyFromFocus:this.$,properties:c,style:v,isSurveyCompleted:h,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:u};if(0>=m)return aa(Vo(Rs,r({},g)),y);var b=setTimeout((()=>{if(this.B.delete(l.id),!this.G(l))return Ga.info("Survey "+l.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(l);aa(Vo(Rs,r({},g,{survey:r({},l,{appearance:r({},l.appearance,{surveyPopupDelaySeconds:0})})})),y)}),1e3*m);this.B.set(l.id,b)}},this.Y=e=>{var{survey:t,language:r}=this.U(e),{shadow:n,isNewlyCreated:i}=xo(t,this._posthog);i&&aa(Vo(Es,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),n)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Cs),this.H.delete(e.id),Ga.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=xs.querySelector(t),n=this.H.get(e.id);if(r){if(this.Y(e),n){if(r===n.element)return;Ga.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(Cs)){var i=t=>{var r,n;t.stopPropagation();var i=(null==(r=e.appearance)?void 0:r.position)===Na.NextToTrigger?Is(t.currentTarget,parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||go.maxWidth)):{};ks.dispatchEvent(new CustomEvent(Ss,{detail:{surveyId:e.id,position:i}}))};hn(r,"click",i),r.setAttribute(Cs,"true"),this.H.set(e.id,{element:r,listener:i,survey:e}),Ga.info("Attached click listener for feedback button survey "+e.id)}}else n&&this.J(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.U(e),{shadow:n}=xo(t,this._posthog);aa(Vo(Rs,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,surveyLanguage:r}),n)},this.renderSurvey=(e,t,r)=>{var n,{survey:i,language:a}=this.U(e),o=!1;null!=(n=this._posthog.config)&&null!=(n=n.surveys)&&n.prefillFromUrl&&(o=this.ee(i,a)),aa(Vo(Rs,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:a}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||null==(n=n.surveys)||n.getSurveys((r=>{var n=r.filter((e=>t.G(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Pa.Popover||e.type===Pa.Widget)),n=new Set(r.map((e=>e.id)));for(var i of Array.from(t.B.keys()))n.has(i)||t.cancelSurvey(i);var a=t.te(r),o=new Set;a.forEach((e=>{if(e.type===Pa.Widget){var r,n,i,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Ea.Tab)return void t.Y(e);(null==(n=e.appearance)?void 0:n.widgetType)===Ea.Selector&&null!=(i=e.appearance)&&i.widgetSelector&&(o.add(e.id),t.X(e,null==(a=e.appearance)?void 0:a.widgetSelector))}ir(t.re)&&e.type===Pa.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var{survey:r}=e;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{ir(this.re)||Ga.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Ga.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.B.get(e);t&&(clearTimeout(t),this.B.delete(e))}cancelSurvey(e){this.B.has(e)&&(Ga.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,n,i=Bo(e),a=Bo(t);if(i&&!a)return-1;if(!i&&a)return 1;var o=e.schedule===Fa,s=t.schedule===Fa;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}U(e){return ws(e,this._posthog)}ee(e,t){if(this.j.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};var i=n.split("&");for(var a of i){var[o,s]=a.split("=");if(o&&!rr(s)){var u=decodeURIComponent(o),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var c=u.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(l)}}else r=!0}}return{params:t,autoSubmit:r}}(ks.location.search);if(0===Object.keys(r).length)return!1;Ga.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(e,r,t);if(!n)return!1;var{responses:i,submissionId:a,isSurveyCompleted:o,skippedResponses:s}=n;return(Object.keys(s).length>0&&e.enable_partial_responses||o)&&So({responses:o?i:s,survey:e,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.j.add(e.id),o}V(e,t,r,n){var i={};for(var[a,o]of Object.entries(t))i[parseInt(a)]=Xt(o)?o.map(String):[String(o)];Ga.info("[Survey] Processing initial responses");var s=this.ne(e,i,n);if(!s)return!1;var{responses:u,submissionId:l,isSurveyCompleted:c}=s;return So({responses:u,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:c,properties:r,surveyLanguage:n}),c}ne(e,t,r){try{var n=function(e,t){var r={};return e.questions.forEach(((e,n)=>{if(t[n]&&e.id){var i=t[n],a=ja(e.id);try{switch(e.type){case Aa.SingleChoice:if(!e.choices||0===e.choices.length)return void sn.warn("[Survey Prefill] Question "+n+" has no choices");var o=parseInt(i[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void sn.warn("[Survey Prefill] Invalid choice index for q"+n+": "+i[0]);r[a]=e.choices[o];break;case Aa.MultipleChoice:if(!e.choices||0===e.choices.length)return void sn.warn("[Survey Prefill] Question "+n+" has no choices");var s=i.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void sn.warn("[Survey Prefill] No valid choices for q"+n);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&sn.warn("[Survey Prefill] Removed duplicate choices for q"+n),r[a]=u;break;case Aa.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void sn.warn("[Survey Prefill] Invalid rating for q"+n+": "+i[0]+" (scale: 0-"+c+")");r[a]=l;break;default:sn.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){sn.error("[Survey Prefill] Error converting q"+n+":",e)}}})),r}(e,t);if(0===Object.keys(n).length)return Ga.warn("[Survey Prefill] No valid responses after conversion"),null;var i=oo(),a=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:s}=function(e,t,r){for(var n=0,i={},a=e.questions.length+1;e.questions.length>n&&a>0&&t.includes(n);){var o=e.questions[n];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var s=ja(o.id);rr(r[s])||(i[s]=r[s])}var u=gs(e,n,o.id?r[ja(o.id)]:null);if(u===Da.End)return{startQuestionIndex:e.questions.length,skippedResponses:i};n=u}return{startQuestionIndex:n,skippedResponses:i}}(e,a,n),u=o>=e.questions.length;return Do(e,{surveySubmissionId:i,responses:n,lastQuestionIndex:o,surveyLanguage:r}),Ga.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:i,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:s}}catch(e){return Ga.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var n,i=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),a=!0;return t&&(a=(null==(n=this._posthog.featureFlags)?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&a}ae(e){return!e.conditions||qo(e)&&Po(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==mo||!mo.querySelector(e.conditions.selector))}(e)}oe(e){return Ro(e)||this.ie(e.internal_targeting_flag_key)||Bo(e)}checkSurveyEligibility(e){var t,r,n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason="Survey is not running. It was completed on "+e.end_date,n;if(!eo.includes(e.type))return n.eligible=!1,n.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",n;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ie(e.linked_flag_key,i)?this.ie(e.targeting_flag_key)?this.oe(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,n=new Date,i=Math.abs(n.getTime()-r.getTime());return Math.ceil(i/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,vo.P("lastSeenSurveyDate"))?(e=>!!vo.P(Ka(e))&&!Ro(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n):(n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n):(n.eligible=!1,n.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",n)}se(e){var t;if(!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ie(r)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=xs.querySelector(jo(e,!0));null!=t&&t.shadowRoot&&aa(null,t.shadowRoot),null==t||t.remove()}catch(t){Ga.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.B,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function Ts(e,t){if(xs&&ks){var r,n=new Ms(e);if(e.config.disable_surveys_automatic_display)return Ga.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===t)return Ga.info("There are no surveys to load or Surveys is disabled in the project settings."),n;n.callSurveysAndEvaluateDisplayLogic(!0);var i=()=>{rr(r)&&(r=setInterval((()=>{n.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return i(),hn(xs,"visibilitychange",(()=>{xs.hidden?rr(r)||(clearInterval(r),r=void 0):(n.callSurveysAndEvaluateDisplayLogic(!1),i())})),n}}function _s(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;ka((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var a=()=>{var e,i=t.type===Pa.Widget,a=qo(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Ea.Tab&&i;if(!a)return Ga.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);o&&(Ga.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};hn(ks,"popstate",a),hn(ks,"hashchange",a);var o=ks.history.pushState,s=ks.history.replaceState;return ks.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),a()},ks.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];s.apply(this,t),a()},()=>{ks.removeEventListener("popstate",a),ks.removeEventListener("hashchange",a),ks.history.pushState=o,ks.history.replaceState=s}}}),[i,t,r,n])}function Ls(e){switch(void 0===e&&(e=qa.Right),e){case qa.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case qa.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case qa.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Rs(e){var t,n,i,a,o,s,{survey:u,forceDisableHtml:l,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPreviewBack:m=(()=>{}),onPopupSurveyDismissed:y=(()=>{}),onCloseConfirmationMessage:g=(()=>{}),properties:b,isSurveyCompleted:w,skipShownEvent:k,surveyLanguage:x}=e,S=xa(null),C=Number.isInteger(h),I=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:M,isSurveySent:T,hidePopupWithViewTransition:_}=function(e,t,n,i,a,o,s,u,l){var[c,d]=wa(i||0===n||e.type===Pa.ExternalSurvey),[h,v]=wa(!1),f=()=>{var t=()=>{o&&a(e),d(!1)};xs.startViewTransition?xs.startViewTransition((()=>{var e;null==s||null==(e=s.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return ka((()=>{if(t){if(!i){var a=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{if(qo(e)){d(!0),ks.dispatchEvent(new Event("PHSurveyShown")),u||t.capture(Ba.SHOWN,r({[Ha.SURVEY_NAME]:e.name,[Ha.SURVEY_ID]:e.id,[Ha.SURVEY_ITERATION]:e.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},l&&{[Ha.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(hn(ks,"PHSurveyClosed",p),hn(ks,"PHSurveySent",a),n>0){var s=setTimeout(o,n);return()=>{clearTimeout(s),ks.removeEventListener("PHSurveyClosed",p),ks.removeEventListener("PHSurveySent",a)}}return o(),()=>{ks.removeEventListener("PHSurveyClosed",p),ks.removeEventListener("PHSurveySent",a)}}}else Ga.error("usePopupVisibility hook called without a PostHog instance.")}),[]),_s({survey:e,removeSurveyFromFocus:a,setSurveyVisible:d,isPreviewMode:i}),{isPopupVisible:c,isSurveySent:h,setIsPopupVisible:d,hidePopupWithViewTransition:f}}(u,c,I,C,v,f,S,k,x),L=T||h===u.questions.length||!0===w,R=Sa((()=>{var e=Fo(u),t=(null==e?void 0:e.surveySubmissionId)||oo();return{isPreviewMode:C,previewPageIndex:h,onPopupSurveyDismissed(){x?Io(u,c,C,x):Io(u,c,C),y()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,onPreviewBack:m,posthog:c,properties:b,surveyLanguage:x}}),[C,h,f,c,u,y,p,m,b,x]);return M?Vo(Oo.Provider,{value:R,children:Vo("div",{className:"ph-survey",style:r({},Uo(u.type,null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:S,children:L?Vo(as,{header:(null==(a=u.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||go,onClose(){_(),g()}}):Vo(Os,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function Os(e){var t,n,{survey:i,forceDisableHtml:a,posthog:o}=e,[s,u]=wa((()=>{var e=Fo(i);return null!=e&&e.responses&&Ga.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:c,isPopup:d,onPreviewSubmit:h,onPreviewBack:v,surveySubmissionId:f,isPreviewMode:p,properties:m,surveyLanguage:y}=Ca(Oo),[g,b]=wa((()=>{var e=Fo(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),[w,k]=wa((()=>{var e,t=Fo(i);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),x=Sa((()=>Lo(i)),[i]);ka((()=>{p&&!rr(l)&&b(l)}),[l,p]);var S=!(null==(t=i.appearance)||!t.allowGoBack)&&(p?(null!=l?l:0)>0:w.length>0),C=x.at(g);return C?Vo("form",{className:"survey-form",name:"surveyForm",children:[d&&!0!==(null==(n=i.appearance)?void 0:n.hideCancelButton)&&Vo(ns,{onClick(){c()}}),Vo("div",{className:"survey-box","data-question-index":g,children:Ns({question:C,forceDisableHtml:a,displayQuestionIndex:g,appearance:i.appearance||go,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:a}=e;if(o)if(a){var l=ja(a),c=r({},s,{[l]:t});u(c);var d=gs(i,n,t),h=d===Da.End,v=[...w,n];if(h||(k(v),b(d),Do(i,{surveySubmissionId:f,responses:c,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:y})),i.enable_partial_responses||h){var p=new Set(v.map((e=>{var t;return null==(t=x[e])?void 0:t.id})).filter((e=>!!e)).map((e=>ja(e)))),g=Object.fromEntries(Object.entries(c).filter((e=>{var[t]=e;return p.has(t)})));So({responses:g,survey:i,surveySubmissionId:f,isSurveyCompleted:h,posthog:o,properties:m,surveyLanguage:y})}}else Ga.error("onNextButtonClick called without a questionId.");else Ga.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:C.id}),onPreviewSubmit:h,initialValue:C.id?s[ja(C.id)]:void 0,canGoBack:S,onBack(){if(p)v();else if(0!==w.length){var e=w[w.length-1],t=w.slice(0,-1);k(t),b(e),Do(i,{surveySubmissionId:f,responses:s,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:y})}}})})]}):null}function Es(e){var t,r,n,i,a,o,s,{survey:u,forceDisableHtml:l,posthog:c,readOnly:d,surveyLanguage:h}=e,[v,f]=wa(!0),[p,m]=wa(!1),[y,g]=wa({}),b=()=>{m(!p)};if(ka((()=>{var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(Ga.info("Received show event for feedback button survey "+u.id),g(r.detail.position||{}),b())};return hn(ks,Ss,t),()=>{ks.removeEventListener(Ss,t)}}}else Ga.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(n=u.appearance)?void 0:n.borderColor]),_s({survey:u,setSurveyVisible:f}),!v)return null;var w=()=>{u.schedule!==Fa&&f(!1),setTimeout((()=>{m(!1)}),200)};return Vo(Bi,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&Vo("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===qa.Top?"widget-tab-top":""),onClick:b,disabled:d,style:Ls(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),p&&Vo(Rs,{posthog:c,survey:u,forceDisableHtml:l,style:y,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:h})]})}var Ns=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d={forceDisableHtml:n,appearance:a,onPreviewSubmit(e){s(e)},onSubmit(e){o(e)},initialValue:u,displayQuestionIndex:i,canGoBack:l,onBack:c};switch(t.type){case Aa.Open:return Di(ss,r({},d,{question:t,key:t.id}));case Aa.Link:return Di(us,r({},d,{question:t,key:t.id}));case Aa.Rating:return Di(ls,r({},d,{question:t,key:t.id}));case Aa.SingleChoice:case Aa.MultipleChoice:return Di(ds,r({},d,{question:t,key:t.id}));default:return Ga.error("Unsupported question type: "+t.type),null}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.generateSurveys=Ts,nn.extendPostHogWithSurveys=Ts;var qs=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Ps=(e,t,r)=>{var n=JSON.stringify(e);if(r.remaining>=n.length)return qs(t,n,r);if(r.truncated=!0,2>r.remaining)return!1;for(var i=0,a=Math.min(e.length,r.remaining-2);a>i;){var o=Math.ceil((i+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:i=o}return qs(t,JSON.stringify(e.slice(0,i)),r)},As=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Ds=function(e,t,r,n,i){if(void 0===i&&(i=!1),!As(e))return!i||qs(t,"null",r);if(ir(e)||(e=>{try{return or(e)||sr(e)}catch(e){return!1}})(e))return qs(t,JSON.stringify(e),r);if("string"==typeof e)return Ps(e,t,r);if(!tr(e)&&!Xt(e))return qs(t,JSON.stringify(e),r);if(n.has(e))return Ps("[Circular]",t,r);n.add(e);try{var a=e.toJSON;if(er(a))return Ds(a.call(e),t,r,n,i)}catch(e){}try{var o={}.toString.call(e);if("[object String]"===o)return Ps(String(e.valueOf()),t,r);if("[object Number]"===o||"[object Boolean]"===o)return qs(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var s={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(s[u]=e[u])}catch(e){}try{s.name=e.name}catch(e){}try{s.message=e.message}catch(e){}try{s.stack=e.stack}catch(e){}return Ds(s,t,r,n,i)}if(Xt(e)){if(!qs(t,"[",r))return!1;for(var l=0;e.length>l;l++){if(l>0&&!qs(t,",",r))return!1;var c=void 0;try{c=e[l]}catch(e){c=void 0}if(!Ds(c,t,r,n,!0))return!1}return qs(t,"]",r)}if(!qs(t,"{",r))return!1;var d=!0;try{for(var h in e)if({}.hasOwnProperty.call(e,h)){if(0>=r.remaining)return r.truncated=!0,!1;var v=void 0;try{v=e[h]}catch(e){continue}if(As(v)){var f=(d?"":",")+JSON.stringify(h)+":";if(f.length>=r.remaining)return r.truncated=!0,!1;var p=t.length,m=r.remaining,y=r.truncated;if(!qs(t,f,r))return!1;var g=t.length,b=Ds(v,t,r,n,!1),w=r.truncated;if(t.length!==g){if(d=!1,!b)return!1}else if(t.length=p,r.remaining=m,r.truncated=b?y:w,!b)return!1}}}catch(e){}return qs(t,"}",r)},Fs=function(e,t,r,n,i,a){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===n&&(n=50),void 0===i&&(i=1e4),void 0===a&&(a=new WeakSet),a.has(e))return r[t||"circular"]="[Circular]",r;a.add(e);try{for(var o in e)try{if(!{}.hasOwnProperty.call(e,o))continue;var s=e[o],u=t?t+"."+o:o;if(tr(s))Fs(s,u,r,n,i,a);else{if(n-=1,i-=String(s).length,i-=u.length,0>=n||0>=i)return void(r.attributes_truncated=!0);r[u]=s}}catch(e){continue}}catch(e){}return r},Bs={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.logs={initializeLogs(e){var t={host:nn.location.host},n=function(n){var i;nn.console[n]=(i=nn.console[n],function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];try{if(o.length>0&&e.is_capturing()){var u,{body:l,truncated:c}=((e,t)=>{for(var r=[],n={remaining:1e4,truncated:!1},i=0;e.length>i&&(0>=i||qs(r," ",n))&&Ds(e[i],r,n,new WeakSet);i++);return{body:r.join("")+(n.truncated?"...":""),truncated:n.truncated}})(o),d=r({},t,c?{body_truncated:"true"}:{});null==(u=e.logs)||u.le({level:Bs[n],body:l,attributes:r({"log.source":"console."+n},d,tr(o[0])?Fs(o[0]):{})})}}catch(e){}finally{i.apply(nn.console,o)}})};for(var i of Object.keys(Bs))n(i)}},un("[Error tracking]");var Hs=un("[ExceptionAutocapture]"),js=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Xt(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:n,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var n of r.modifiers)t=yield n(t);return t}))()}convertToExceptionList(e,t){var n,i,a,o={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(a=e.synthetic)&&void 0!==a&&a}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var s=[o];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),s}buildParsingContext(e){var t;return{chunkIdMap:Dr(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,n){void 0===n&&(n=0);var i=(r,n)=>{if(4>=n){var i=this.buildCoercingContext(e,t,n);return this.applyCoercers(r,i)}};return r({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,n),next:e=>i(e,n+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=nr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return cr(e,"DOMException")}isDOMError(e){return cr(e,"DOMError")}},new class{match(e){return cr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!dr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return lr(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return cr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return dr(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+Jr(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return dr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Jr(e)}isSeverityLevel(e){return nr(e)&&!(e=>nr(e)&&0===e.trim().length)(e)&&Yr.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,[n,i]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(Gr);return n&&(t=n[1],r=n[2]),[t,r]}},new class{match(e){return lr(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var a=[],o=t.split("\n"),s=i;o.length>s;s++){var u=o[s];if(1024>=u.length){var l=Qr.test(u)?u.replace(Qr,"$1"):u;if(!l.match(/\S*Error: /)){for(var c of n){var d=c(l,e);if(d){a.push(d);break}}if(a.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return r({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Fr});var n}))}(a)}}("web:javascript",Vr,$r)),Us={wrapOnError(e){var t=Kr;t||Hs.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),a=0;n>a;a++)i[a]=arguments[a];var o=js.buildFromUnknown(i[4]||i[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Kr;t||Hs.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var n,i=js.buildFromUnknown(t,{mechanism:{handled:!1}});return e(i),null!==(n=null==r?void 0:r(t))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||Hs.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,n=arguments.length,i=new Array(n),a=0;n>a;a++)i[a]=arguments[a];t=1==i.length?i[0]:i.join(" ");var o=i.find((e=>e instanceof Error)),s=js.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(s),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.errorWrappingFunctions=Us,nn.posthogErrorWrappingFunctions=Us;var Ws="X-POSTHOG-SESSION-ID",Vs="X-POSTHOG-WINDOW-ID",Zs="X-POSTHOG-DISTINCT-ID",zs=[Ws,Vs,Zs],$s=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Qs=(e,t)=>({}.hasOwnProperty.call(e,t)),Gs=e=>"object"==typeof e&&!ir(e)||er(e),Ys=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Js=e=>{try{var t;return Ys(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Kr||null==(t=Kr.location)?void 0:t.href).toString()}catch(e){return}},Ks=(e,t,r,n,i)=>{var a;try{a=new URL(n).hostname}catch(e){return!1}if(!e)return!1;if(Xt(e)&&!e.includes(a))return!1;var o=!1;if(r){var{sessionId:s,windowId:u}=r.checkAndGetSessionAndWindowId(!0);i.set(Ws,s),i.set(Vs,u),o=!0}var l=(e=>er(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(i.set(Zs,l),o=!0),o};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{};var Xs={_patchFetch:(e,t,n)=>fn(Kr,"fetch",(i=>function(a,o){var s=arguments.length>1?[a,o]:[a],u=s;try{var l=Js(a);if(l)if(Ys(a)){var c=new Request(a,o);Ks(e,t,n,c.url,c.headers),u=[c]}else{var d=new Headers(Gs(o)?o.headers:void 0);if(Ks(e,t,n,l,d)){var h=((e,t)=>{if(rr(e)||ir(e))return{headers:t};if(Gs(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(n);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>Qs(e,t)?Reflect.get(e,t):Reflect.get(n,t,n),has:(e,t)=>Qs(e,t)||t in n,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach((e=>t.add(e))),$s.forEach((e=>{e in n&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&$s.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,t,n)}};var a=Reflect.getOwnPropertyDescriptor(n,t);return a?r({},a,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})}})(o,d);h&&(u=[a,h])}}}catch(e){u=s}return i.apply(this,u)})),_patchXHR:(e,t,r)=>fn(Kr.XMLHttpRequest.prototype,"open",(n=>function(i,a,o,s,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=Js(a);d&&Ks(e,t,r,d,c);var h=n.call(l,i,a,o,s,u);return zs.forEach((e=>{var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),h}))};nn.__PosthogExtensions__.tracingHeadersPatchFns=Xs,nn.postHogTracingHeadersPatchFns=Xs;var eu=-1,tu=e=>{addEventListener("pageshow",(t=>{t.persisted&&(eu=t.timeStamp,e(t))}),!0)},ru=(e,t,r,n)=>{var i,a;return o=>{t.value>=0&&(o||n)&&((a=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},nu=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},iu=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},au=()=>{var e,t;return null!==(e=null==(t=iu())?void 0:t.activationStart)&&void 0!==e?e:0},ou=function(e,t){void 0===t&&(t=-1);var r=iu(),n="navigate";return 0>eu?r&&(document.prerendering||au()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))):n="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},su=new WeakMap;function uu(e,t){var r=su.get(t);return r||(r=new WeakMap,su.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class lu{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&1e3>e.startTime-n.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var cu,du=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},hu=e=>{var t=!1;return()=>{t||(e(),t=!0)}},vu=-1,fu=new Set,pu=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,mu=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of fu)t();isFinite(vu)||(vu="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",mu,!0))}},yu=()=>{if(0>vu){var e,t=au(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;vu=null!=r?r:pu(),addEventListener("visibilitychange",mu,!0),addEventListener("prerenderingchange",mu,!0),tu((()=>{setTimeout((()=>{vu=pu()}))}))}return{get firstHiddenTime(){return vu},onHidden(e){fu.add(e)}}},gu=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},bu=[1800,3e3],wu=function(e,t){void 0===t&&(t={}),gu((()=>{var r,n=yu(),i=ou("FCP"),a=du("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),n.firstHiddenTime>t.startTime&&(i.value=Math.max(t.startTime-au(),0),i.entries.push(t),r(!0)))}));a&&(r=ru(e,i,bu,t.reportAllChanges),tu((n=>{i=ou("FCP"),r=ru(e,i,bu,t.reportAllChanges),nu((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},ku=[.1,.25],xu=0,Su=1/0,Cu=0,Iu=e=>{for(var t of e)t.interactionId&&(Su=Math.min(Su,t.interactionId),Cu=Math.max(Cu,t.interactionId),xu=Cu?(Cu-Su)/7+1:0)},Mu=()=>{var e;return cu?xu:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Tu=0;class _u{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Tu=Mu(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((Mu()-Tu)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),n=this.u.get(e.interactionId);if(n||10>this.l.length||e.duration>r.L){var i;if(n?e.duration>n.L?(n.entries=[e],n.L=e.duration):e.duration===n.L&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(this.u.set((n={id:e.interactionId,entries:[e],L:e.duration}).id,n),this.l.push(n)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(i=this.p)||i.call(this,n)}}}}var Lu=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=hu(e),i=-1,a=()=>{r(i),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),i=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}))}},Ru=[200,500];class Ou{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Eu=[2500,4e3],Nu={onLCP(e,t){void 0===t&&(t={}),gu((()=>{var r,n=yu(),i=ou("LCP"),a=uu(t,Ou),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),n.firstHiddenTime>o.startTime&&(i.value=Math.max(o.startTime-au(),0),i.entries=[o],r())},s=du("largest-contentful-paint",o);if(s){r=ru(e,i,Eu,t.reportAllChanges);var u=hu((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Lu(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});tu((n=>{i=ou("LCP"),r=ru(e,i,Eu,t.reportAllChanges),nu((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=yu();wu(hu((()=>{var n,i=ou("CLS",0),a=uu(t,lu),o=e=>{for(var t of e)a.h(t);a.i>i.value&&(i.value=a.i,i.entries=a.o,n())},s=du("layout-shift",o);s&&(n=ru(e,i,ku,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),tu((()=>{a.i=0,i=ou("CLS",0),n=ru(e,i,ku,t.reportAllChanges),nu(n)})),setTimeout(n))})))},onFCP:wu,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=yu();gu((()=>{var n;"interactionCount"in performance||cu||(cu=du("event",Iu,{durationThreshold:0}));var i,a=ou("INP"),o=uu(t,_u),s=e=>{Lu((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,i())}))},u=du("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=ru(e,a,Ru,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),tu((()=>{o.v(),a=ou("INP"),i=ru(e,a,Ru,t.reportAllChanges)})))}))}}};function qu(e,t){return t.length>e?t.slice(0,e)+"...":t}function Pu(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!bn(t));return t}function Au(e,t){var n,i,{e:a,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:u,disableCaptureUrlHashes:l}=t;if(!bn(e))return{props:{}};for(var c=[e],d=e;d.parentNode&&!wn(d,"body");)if(kn(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!bn(d.parentNode))break;c.push(d.parentNode),d=d.parentNode}var h,v,f,p,m=[],y={},g=!1,b=!1;if(ln(c,(e=>{var t=Rn(e);if(wn(e,"a")){var r=e.getAttribute("href");g=!!(t&&r&&Fn(r))&&(l?Er(r):r)}Qt(Sn(e),"ph-no-capture")&&(b=!0),m.push(function(e,t,r,n,i){void 0===i&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};In.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?qu(1024,Bn(e)):qu(1024,Cn(e)));var s=Sn(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),ln(e.attributes,(function(r){var a;if((!On(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==n||!n.includes(r.name))&&!t&&Fn(r.value)&&(!nr(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=xn(s).join(" ")),o["attr__"+r.name]=qu(1024,"href"===r.name&&i?Er(s):s)}}));for(var u=1,l=1,c=e;c=Pu(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var n=function(e){if(!Rn(e))return{};var t={};return ln(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&Fn(n)&&(t[r]=n)}})),t}(e);cn(y,n)})),b)return{props:{},explicitNoCapture:b};if(s||(m[0].$el_text=wn(e,"a")||wn(e,"button")?Bn(e):Cn(e)),g){var w,k;m[0].attr__href=g;var x=null==(v=g,f=null==tn?void 0:tn.createElement("a"),w=rr(f)?null:(f.href=v,f))?void 0:w.host,S=null==Kr||null==(k=Kr.location)?void 0:k.host;x&&S&&x!==S&&(h=g)}return{props:cn({$event_type:a.type,$ce_version:1},{$elements:m},{$elements_chain:(p=m,function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var a of(e.attr_class.sort(),e.attr_class))i+="."+a.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return dn(o).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[jn(t.toString())]=jn(r.toString())})),(i+=":")+dn(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Un(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return dn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(p)))},null!=(n=m[0])&&n.$el_text?{$el_text:null==(i=m[0])?void 0:i.$el_text}:{},h&&"click"===a.type?{$external_click_url:h}:{},y)}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.postHogWebVitalsCallbacks=Nu,nn.postHogWebVitalsCallbacks=Nu,nn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Nu,un("[AutoCapture]");var Du={};function Fu(e){return function(e,t){var r=Du[e];if(r)return r;var n,i=t[e];if(er(n=i)&&-1!==n.toString().indexOf("[native code]")&&!Kr.Zone)return Du[e]=i.bind(t);var a=t.document;if(a&&er(a.createElement))try{var o=a.createElement("iframe");o.hidden=!0,a.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(i=s[e]),a.head.removeChild(o)}catch(t){sn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&er(i)?Du[e]=i.bind(t):i}("MutationObserver",e)}function Bu(e,t){return or(e)&&e>=t}class Hu{ce(e){var t,r,n,i,a,o=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:o.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(e,t){this.ve=[],this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.fe=e=>{var t=function(e){var t=function(e){return rr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ir(t)||this.pe(t)||this.ve.push(t),this.ve.length&&rr(this.me)&&(this.me=nn.setTimeout((()=>{this.ye()}),1e3))},this.ge=()=>{var e=Date.now();e%50==0&&this.ve.forEach((t=>{rr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.be=()=>{this.we=Date.now()},this.ke=()=>{"visible"===(null==tn?void 0:tn.visibilityState)&&(this.xe=Date.now())},this.instance=e,this.Se=this.ce(t),this._onCapture=this.Se.__onCapture}start(e){this.Ce(),this.Ie(),this.Me(),this.Te(),this._e(e)}_e(e){if(!this.Le){var t=Fu(nn);this.Le=new t((e=>{this.Re(e)})),this.Le.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Le)||e.disconnect(),this.Le=void 0,nn.removeEventListener("click",this.fe),nn.removeEventListener("scroll",this.ge,{capture:!0}),nn.removeEventListener("selectionchange",this.be),null==tn||tn.removeEventListener("visibilitychange",this.ke)}Re(e){this.Oe=Date.now()}Ce(){hn(nn,"click",this.fe)}Ie(){hn(nn,"scroll",this.ge,{capture:!0})}Me(){hn(nn,"selectionchange",this.be)}Te(){hn(tn,"visibilitychange",this.ke)}pe(e){if(!e)return!0;if(!this.Se.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t,r;if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var n=this.ve.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!n&&!wn(e.node,"html")&&bn(e.node)&&!function(e){if(!Kr||_n(e))return!1;var{targetElementList:t}=Ln(e);return t.some((e=>wn(e,"a")))}(e.node)&&function(e,t){var r;if(!Kr||_n(e))return!1;var n=sr(t)?Tn:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:Tn,{targetElementList:i}=Ln(e);return!function(e,t){if(rr(t))return!0;var r,n=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var i of e)if(r=n(i))return r.v;return!1}(i,n)}(e.node,{css_selector_ignorelist:this.Se.css_selector_ignorelist}))}ye(){if(this.ve.length){clearTimeout(this.me),this.me=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Oe&&this.Oe>=t.timestamp?this.Oe-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.we&&this.we>=t.timestamp?this.we-t.timestamp:void 0,t.visibilityChangedDelayMs=this.xe?Math.abs(t.timestamp-this.xe):void 0;var n=Bu(t.scrollDelayMs,this.Se.scroll_threshold_ms),i=Bu(t.selectionChangedDelayMs,this.Se.selection_change_threshold_ms),a=Bu(t.mutationDelayMs,this.Se.mutation_threshold_ms),o=Bu(t.absoluteDelayMs,1.1*this.Se.mutation_threshold_ms),s=or(t.scrollDelayMs)&&this.Se.scroll_threshold_ms>t.scrollDelayMs,u=or(t.mutationDelayMs)&&this.Se.mutation_threshold_ms>t.mutationDelayMs,l=or(t.selectionChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.selectionChangedDelayMs,c=or(t.visibilityChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(s||u||l||c)){var d=Bu(t.visibilityChangedDelayMs,this.Se.selection_change_threshold_ms);n||a||o||i||d?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Oe,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:a,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i,$dead_click_visibility_changed_timeout:d}):this.Se.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ve.length&&rr(this.me)&&(this.me=nn.setTimeout((()=>{this.ye()}),1e3))}}he(e,t){this.instance.capture("$dead_click",r({},t,Au(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Hu(e,t)}();
|
|
1
|
+
!function(){"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],a=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=(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))(s||{}),u=(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))(u||{}),l=(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))(l||{}),c=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(c||{}),d=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(d||{}),h=(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))(h||{}),v=(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))(v||{}),f={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},p={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in f?f[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),a=e in p?p[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&o)return m[e]=t.prototype,t.prototype;var s=document.createElement("iframe");try{document.body.appendChild(s);var u=s.contentWindow;if(!u)return t.prototype;var l=u[e].prototype;return l?m[e]=l:r}catch(e){return r}finally{s.parentNode&&document.body.removeChild(s)}}var g={};function b(e,t,r){var n,i=e+"."+String(r);if(g[i])return g[i].call(t);var a=y(e),o=null==(n=Object.getOwnPropertyDescriptor(a,r))?void 0:n.get;return o?(g[i]=o,o.call(t)):t[r]}var w={};function k(e,t,r){var n=e+"."+String(r);if(w[n])return w[n].bind(t);var i=y(e)[r];return"function"!=typeof i?t[r]:(w[n]=i,i.bind(t))}function x(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}var C={childNodes:e=>b("Node",e,"childNodes"),parentNode:e=>b("Node",e,"parentNode"),parentElement:e=>b("Node",e,"parentElement"),textContent:e=>b("Node",e,"textContent"),contains:(e,t)=>k("Node",e,"contains")(t),getRootNode:e=>k("Node",e,"getRootNode")(),host:e=>e&&"host"in e?b("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?b("Element",e,"shadowRoot"):null,querySelector:(e,t)=>k("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>k("Element",e,"querySelectorAll")(t),mutationObserver:x,patch:S};function I(e){return e.nodeType===e.ELEMENT_NODE}function M(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function T(e){return"[object ShadowRoot]"==={}.toString.call(e)}function _(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(n=Array.from(t,(e=>R(e,r))).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function R(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var n;try{n=_(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){n=e.cssText}try{if(n&&(null==(r=e.styleSheet)?void 0:r.href))return B(n,e.styleSheet.href)}catch(e){}return n}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?B(i,t):i}class L{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),I(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:a,maskInputFn:o}=e,s=a||"",u=i&&E(i);return(r[n.toLowerCase()]||u&&r[u])&&(s=o?o(s,t):"*".repeat(s.length)),s}function E(e){return e.toLowerCase()}var N="__rrweb_original__";function q(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?E(t):null}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,D=/^www\..*/i,F=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(P,((e,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return e;if(A.test(u)||D.test(u))return"url("+l+u+l+")";if(F.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+l+c.join("/")+l+")"}))}var H,j,U="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,V=1,z=new RegExp("[^a-z0-9-_:]"),Z=-2;function Q(){return V++}var G=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,J=new WeakMap;function K(e,t){return t&&""!==t.trim()?X(e,t):t}function X(e,t){var r=J.get(e);if(r||(r=e.createElement("a"),J.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ee(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?U:e}(e,t.maxBase64ImageLength):e}function te(e,t,r,n,i,a){var o;if(!n)return n;if("src"===r||"href"===r&&("use"!==t||"#"!==n[0])){if("link"===t&&i){var s=null==(o=i.sheet)?void 0:o.href;if(s)return s}var u=K(e,n);if(u.startsWith("data:")){if("img"===t&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,n){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>W||e.naturalHeight>W)return t;try{var i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;var a=i.getContext("2d");return a?(a.drawImage(e,0,0),i.toDataURL(r||"image/webp",null!=n?n:.4)):t}catch(e){return t}}(i,u,a.type,a.quality)),ee(l,a)}if("image"===t)return ee(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=K(e,n);return"image"===t&&c.startsWith("data:")?ee(c,a):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Y),t.length>r;){var a=n(G);if(","===a.slice(-1))a=K(e,a.substring(0,a.length-1)),i.push(a);else{var o="";a=K(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?B(n,X(e)):"object"===t&&"data"===r?K(e,n):n:K(e,n)}function re(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function ie(e,t,r,n){var i;if(I(e)){if(!C.childNodes(i=e).length)return!1}else{if(null===C.parentElement(e))return!1;i=C.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(ne(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}var ae=new Map;function oe(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function se(e){return null==e?"":e.toLowerCase()}var ue=50,le=!1,ce=!1;function de(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w=5e3,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:R=(()=>!1),newlyAddedElement:L=!1,depth:P=0,maxDepth:A=ue}=t,{needsMask:D}=t,{preserveWhiteSpace:F=!0}=t;if(P>=A)return ce=!0,le||(le=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+A+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;D||(D=ie(e,o,s,void 0===D));var U,W=function(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:o,inlineStylesheet:s,maskInputOptions:u={},maskTextFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1}=t,y=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:v.Document,childNodes:[],compatMode:e.compatMode}:{type:v.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){for(var r,n,i,a,{doc:o,blockClass:s,blockSelector:u,inlineStylesheet:l,maskInputOptions:c={},maskInputFn:d,dataURLOptions:h={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:y=!1,rootId:g}=t,b=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,s,u),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=E(e.tagName);return z.test(t)?"div":t}(e),k={},x=e.attributes.length,S=0;x>S;S++){var I=e.attributes[S];re(w,I.name)||(k[I.name]=te(o,w,E(I.name),I.value,e,h))}if("link"===w&&l){var M=e.sheet;if(!M){var T=function(e){return e.href}(e);T&&!(M=oe(o,T))&&T.includes(".css")&&(M=oe(o,window.location.origin+"/"+T.replace(window.location.href,"")))}var R=null;M&&(R=_(M)),R&&(delete k.rel,delete k.href,k._cssText=R)}if("style"===w&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var L=_(e.sheet);L&&(k._cssText=L)}if("input"===w||"textarea"===w||"select"===w){var P=e.value,A=e.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&P?k.value=O({element:e,type:q(e),tagName:w,value:P,maskInputOptions:c,maskInputFn:d}):A&&(k.checked=A)}if("option"===w&&(e.selected&&!c.select?k.selected=!0:delete k.selected),"dialog"===w&&e.open)try{k.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var n=0;e.height>n;n+=50){var i=t.getImageData;if(new Uint32Array((N in i?i[N]:i).call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(k.rr_dataURL=e.toDataURL(h.type,h.quality));else if(!("__context"in e)){var D=e.toDataURL(h.type,h.quality),F=o.createElement("canvas");F.width=e.width,F.height=e.height,D!==F.toDataURL(h.type,h.quality)&&(k.rr_dataURL=D)}if("img"===w&&f){H||(H=o.createElement("canvas"),j=H.getContext("2d"));var B=e,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",W=B.crossOrigin,V=()=>{B.removeEventListener("load",V);try{H.width=B.naturalWidth,H.height=B.naturalHeight,j.drawImage(B,0,0),k.rr_dataURL=H.toDataURL(h.type,h.quality)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?V():B.addEventListener("load",V));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===B.crossOrigin&&(W?k.crossOrigin=W:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?V():B.addEventListener("load",V)}if("audio"===w||"video"===w){var Z=k;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}if(y||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop)),b){var{width:Q,height:G,left:Y,top:J}=e.getBoundingClientRect(),K=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);k={class:k.class,rr_width:Q+"px",rr_height:G+"px",rr_left:Math.floor(Y+((null==(n=o.defaultView)?void 0:n.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollY)||0))+"px"},K&&(k.rr_position=K.position||"static",K.transform&&"none"!==K.transform&&(k.rr_transform=K.transform),K.display&&K.display.startsWith("inline")&&(k.rr_display=K.display))}"iframe"!==w||m(k.src)||(e.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(w)&&(a=!0)}catch(e){}return{type:v.Element,tagName:w,attributes:k,childNodes:[],isSVG:(X=e,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:g,isCustom:a};var X}(e,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:s,maskInputOptions:u,maskInputFn:c,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:a}=t,o=C.parentNode(e),s=o&&o.tagName,u=C.textContent(e),l="STYLE"===s||void 0,c="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=_(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=B(u,X(t.doc))}return c&&(u="SCRIPT_PLACEHOLDER"),!l&&!c&&u&&n&&(u=i?i(u,C.parentElement(e)):u.replace(/[\S]/g,"*")),{type:v.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:o,maskTextFn:l,rootId:y});case e.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:v.Comment,textContent:C.textContent(e)||"",rootId:y};default:return!1}}(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,dataURLOptions:p,inlineImages:m,recordCanvas:y,keepIframeSrcFn:R,newlyAddedElement:L});if(!W)return console.warn(e,"not serialized"),null;U=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===v.Comment)return!0;if(e.type===v.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,n;try{n=new URL(e,window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(se(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===se(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(se(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&se(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(se(e.attributes.property).match(/^(og|twitter|fb):/)||se(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===se(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(se(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(se(e.attributes.name))||se(e.attributes.property).match(/^article:/)||se(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(se(e.attributes.name)))return!0}}return!1}(W,f)||!F&&W.type===v.Text&&!W.isStyle&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?Z:Q();var V=Object.assign(W,{id:U});if(n.add(e,V),U===Z)return null;g&&g(e);var G=!u;if(V.type===v.Element){G=G&&!V.needBlock,delete V.needBlock;var Y=C.shadowRoot(e);Y&&T(Y)&&(V.isShadowHost=!0)}if((V.type===v.Document||V.type===v.Element)&&G){f.headWhitespace&&V.type===v.Element&&"head"===V.tagName&&(F=!1);var J={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:u,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:R,depth:P+1,maxDepth:A};if(V.type===v.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(e))){var ee=de(K,J);ee&&V.childNodes.push(ee)}var ne=null;if(I(e)&&(ne=C.shadowRoot(e)))for(var he of Array.from(C.childNodes(ne))){var ve=de(he,J);ve&&(T(ne)&&(ve.isShadow=!0),V.childNodes.push(ve))}}var fe=C.parentNode(e);if(fe&&M(fe)&&T(fe)&&(V.isShadow=!0),V.type===v.Element&&"iframe"===V.tagName){var pe=function(e,t,r){var n,i=()=>{},a=e.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(e){return i}var o=()=>t();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),e.removeEventListener("load",c),e.addEventListener("load",o),t())},c=()=>l();return u=setTimeout(l,r),e.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?e.removeEventListener("load",o):(s=!0,e.removeEventListener("load",c))}}var d,h="about:blank";try{d=a.location.href}catch(e){return i}if(d!==h||e.src===h||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),e.removeEventListener("load",o)}}return e.addEventListener("load",o),()=>{e.removeEventListener("load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&b){var r=de(t,{doc:t,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:k,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:R,depth:P+1,maxDepth:A});r&&b(e,r)}}),w);null==k||k(e,pe)}return V.type===v.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(t,u,v){if(!ae.has(t)){var k;try{k=t.sheet}catch(e){return}if(!k){var C=new AbortController,I=!1,M=()=>{if(!I){I=!0;try{(()=>{if(x){var t=de(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:p,inlineImages:m,recordCanvas:y,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:R,depth:P,maxDepth:A});t&&x(e,t)}})()}finally{ae.delete(t),C.abort()}}},T=setTimeout(M,v);C.signal.addEventListener("abort",(()=>clearTimeout(T)),{once:!0}),t.addEventListener("load",M,{signal:C.signal,once:!0}),ae.set(t,C)}}}(e,0,S),V}function he(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class ve{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof ve))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"}}function fe(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function pe(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var me="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.",ye={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};function ge(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;0>=l||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,o)}),l))}}function be(e,t,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),a&&a.set&&a.set.call(this,e)}}),()=>be(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ye=new Proxy(ye,{get(e,t,r){return"map"===t&&console.error(me),Reflect.get(e,t,r)}}));var we=Date.now;function ke(e){var t,r,n,i,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=C.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(n=C.parentElement(a.body))?void 0:n.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function xe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Se(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ce(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Ie(e,t,r,n){if(!e)return!1;var i=Ce(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(ne(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Me(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Z}function Te(e,t){if(M(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=C.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Te(n,t))}function _e(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Le(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Oe(e){return!!e&&(e instanceof ve&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());class Ee{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function qe(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function Pe(e){return"__ln"in e}class Ae{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pe(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Pe(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var De,Fe=(e,t)=>e+"@"+t;class Be{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ae,n=e=>{for(var t=e,r=Z;r===Z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var a=C.parentNode(i);if(a&&qe(i)&&"TEXTAREA"!==a.tagName){var o=M(a)?this.mirror.getId(Ne(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=de(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Le(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Oe(i)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)je(this.removesSubTreeCache,a)&&!this.movedSet.has(C.parentNode(a))||i(a);for(var o of this.addedSet)Ue(this.droppedSet,o)||je(this.removesSubTreeCache,o)?Ue(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(C.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var v=this.mirror.getId(C.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=C.parentNode(h.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))}})),o(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),o(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:q(e),value:r,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(e=>{if(!Me(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ie(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ce(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var a=q(r);i=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(Ie(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!re(r.tagName,n))if(o.attributes[n]=te(this.doc,E(r.tagName),E(n),i,r,this.dataURLOptions),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var s=this.unattachedDoc.createElement("span");for(var u of(e.oldValue&&(s.style.cssText=e.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==s.style.getPropertyValue(u)||c!==s.style.getPropertyPriority(u)?o.styleDiff[u]=""===c?l:[l,c]:o._unchangedStyles[u]=[l,c]}for(var d of Array.from(s.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ie(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=M(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||Me(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(He(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fe(r,n)]?He(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!M(e.target)||!T(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),o(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Me(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Fe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ie(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Oe(e)&&C.childNodes(C.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]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function He(e,t){e.delete(t),C.childNodes(t).forEach((t=>He(e,t)))}function je(e,t,r){return 0!==e.size&&function(e,t,r){var n=C.parentNode(t);return!!n&&e.has(n)}(e,t)}function Ue(e,t){return 0!==e.size&&We(e,t)}function We(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||We(e,r))}var Ve=e=>De?function(){try{return e(...arguments)}catch(e){if(De&&!0===De(e))return;throw e}}:e,ze=[];function Ze(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function $e(e,t){var r=new Be;ze.push(r),r.init(e);var n=new(x())(Ve(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:n,buffer:r}}function Qe(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:a,sampling:o}=e,s=new Map,u=e=>{var o=Ze(e);if(o&&!Ie(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var d=ke(r.defaultView);u=d.left,l=d.top}else u=o.scrollLeft,l=o.scrollTop;var h=u+","+l;s.get(c)!==h&&(s.set(c,h),t({id:c,x:u,y:l}))}},l=[fe("scroll",Ve(ge(Ve((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(fe("scrollend",Ve(u),r)),()=>l.forEach((e=>e()))}function Ge(e,t){for(var r=ze.length-1;r>=0;r--){var n=ze[r];if(n){var i=n.bufferBelongsToIframe(e);!i&&t&&t.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),ze.splice(r,1))}}}var Ye=["INPUT","TEXTAREA","SELECT"],Je=new WeakMap;function Ke(e){return function e(t,r){if(rt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||rt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||rt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||rt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(i)}return r}(e,[])}function Xe(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function et(e,t){var r,n,i,a,{mirror:o,stylesheetManager:s}=e;a=o.getId("#document"===t.nodeName?t:C.host(t));var u="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Ve((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function tt(e,t){void 0===t&&(t={});var n,i,a=e.doc.defaultView;if(!a)return()=>{};if(function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=$e(e,e.doc);n=o.observer,i=o.buffer}var s=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=ge(Ve((e=>{var r=Date.now()-a;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],a=null})),s),d=Ve(ge(Ve((e=>{var t=Ze(e),{clientX:r,clientY:n}=_e(e)?e.changedTouches[0]:e;a||(a=we()),l.push({x:r,y:n,id:i.getId(t),timeOffset:we()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),h=[fe("mousemove",d,n),fe("touchmove",d,n),fe("drag",d,n)];return Ve((()=>{h.forEach((e=>e()))}))}(e),d=function(e){var{mouseInteractionCb:t,doc:n,mirror:i,blockClass:a,blockSelector:o,sampling:s}=e;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,d=[],h=null;return Object.keys(l).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=E(e),u=(e=>n=>{var s=Ze(n);if(!Ie(s,a,o,!0)){var u=null,d=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(l[e]===l.MouseDown?d="TouchStart":l[e]===l.MouseUp&&(d="TouchEnd"))}else _e(n)&&(u=c.Touch);null!==u?(h=u,(d.startsWith("Touch")&&u===c.Touch||d.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):l[e]===l.Click&&(u=h,h=null);var v=_e(n)?n.changedTouches[0]:n;if(v){var f=i.getId(s),{clientX:p,clientY:m}=v;Ve(t)(r({type:l[d],id:f,x:p,y:m},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(l[e]){case l.MouseDown:case l.MouseUp:s=s.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}d.push(fe(s,u,n))})),Ve((()=>{d.forEach((e=>e()))}))}(e),v=Qe(e),f=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,a=-1;return fe("resize",Ve(ge(Ve((()=>{var e=xe(),t=Se();i===e&&a===t||(r({width:Number(t),height:Number(e)}),i=e,a=t)})),200)),n)}(e,{win:a}),p=function(e){var{inputCb:t,doc:n,mirror:i,blockClass:a,blockSelector:o,ignoreClass:s,ignoreSelector:u,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function v(e){var t=Ze(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=C.parentElement(t)),t&&i&&Ye.indexOf(i)>=0&&!Ie(t,a,o,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var d=t.value,v=!1,p=q(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(l[i.toLowerCase()]||l[p])&&(d=O({element:t,maskInputOptions:l,tagName:i,type:p,value:d,maskInputFn:c})),f(t,h?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var m=t.name;"radio"===p&&m&&v&&n.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,n){var a=Je.get(e);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){Je.set(e,n);var o=i.getId(e);Ve(t)(r({},n,{id:o}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>fe(e,Ve(v),n))),m=n.defaultView;if(!m)return()=>{p.forEach((e=>e()))};var y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return y&&y.set&&p.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((e=>be(e[0],e[1],{set(){Ve(v)({target:this,isTrusted:!1})}},!1,m)))),Ve((()=>{p.forEach((e=>e()))}))}(e),m=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:a,doc:o}=e,s=Ve((e=>ge(Ve((a=>{var o=Ze(a);if(o&&!Ie(o,r,n,!0)){var{currentTime:s,volume:u,muted:l,playbackRate:c,loop:d}=o;t({type:e,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),a.media||500))),u=[fe("play",s(h.Play),o),fe("pause",s(h.Pause),o),fe("seeked",s(h.Seeked),o),fe("volumechange",s(h.VolumeChange),o),fe("ratechange",s(h.RateChange),o)];return Ve((()=>{u.forEach((e=>e()))}))}(e),y=()=>{},g=()=>{},b=()=>{},w=()=>{};e.recordDOM&&(y=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:a}=t;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var o=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ve(((e,t,a)=>{var[o,s]=a,{id:u,styleId:l}=Xe(t,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:s}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var s,u,l=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:o}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replace:o}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,replaceSync:o}),e.apply(t,a)}))}));var c={};nt("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(nt("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),nt("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),nt("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,a]=e;d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ve(((e,t,a)=>{var[o,s]=a,{id:u,styleId:l}=Xe(t.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Ke(t),s||0]}]}),e.apply(t,a)}))}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ve(((e,t,a)=>{var[o]=a,{id:s,styleId:u}=Xe(t.parentStyleSheet,n,i.styleMirror);return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,removes:[{index:[...Ke(t),o]}]}),e.apply(t,a)}))})})),Ve((()=>{a.CSSStyleSheet.prototype.insertRule=o,a.CSSStyleSheet.prototype.deleteRule=l,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:a}),g=et(e,e.doc),b=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:a}=e,{win:o}=t,s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ve(((e,t,o)=>{var u,[l,c,d]=o;if(i.has(l))return s.apply(t,[l,c,d]);var{id:h,styleId:v}=Xe(null==(u=t.parentRule)?void 0:u.parentStyleSheet,n,a.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:c,priority:d},index:Ke(t.parentRule)}),e.apply(t,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ve(((e,t,o)=>{var s,[l]=o;if(i.has(l))return u.apply(t,[l]);var{id:c,styleId:d}=Xe(null==(s=t.parentRule)?void 0:s.parentStyleSheet,n,a.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:l},index:Ke(t.parentRule)}),e.apply(t,o)}))}),Ve((()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:a}),e.collectFonts&&(w=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,r){var n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ve((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),Ve((()=>{i.forEach((e=>e()))}))}(e)));var k=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:a}=e,o=!0,s=Ve((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,l=0;u>l;l++){var c=e.getRangeAt(l),{startContainer:d,startOffset:h,endContainer:v,endOffset:f}=c;Ie(d,n,i,!0)||Ie(v,n,i,!0)||s.push({start:r.getId(d),startOffset:h,end:r.getId(v),endOffset:f})}a({ranges:s})}}));return s(),fe("selectionchange",s)}(e),x=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;return n&&n.customElements?S(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,n,i])}})):()=>{}}(e),I=[];for(var M of e.plugins)I.push(M.observer(M.callback,a,M.options));return Ve((()=>{if(i){i.destroy(),i.reset();var e=ze.indexOf(i);-1!==e&&ze.splice(e,1)}null==n||n.disconnect(),s(),d(),v(),f(),p(),m(),y(),g(),b(),w(),k(),x(),I.forEach((e=>e()))}))}function rt(e){return void 0!==window[e]}function nt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class it{constructor(e){o(this,"iframeIdToRemoteIdMap",new WeakMap),o(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class at{constructor(e){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new it(Q)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new it(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var n=this.mirror.getId(e);-1!==n&&this.iframeElementsById.set(n,e)}getIframeElementById(e){var t,r,n;return null!==(t=null!==(r=null==(n=this.attachedIframes.get(e))?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>pe(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{var{win:t,handler:r}=e;pe((()=>t.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,n=this.trackIframeContent(e,t);if(e.contentDocument){var i=this.attachedDocuments.get(e);i||this.attachedDocuments.set(e,i=new Set),i.add(e.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);pe((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}pe((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var n of r)if(n.win===t)return;var i=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",i),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:i})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case s.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:s.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case s.Meta:case s.Load:case s.DomContentLoaded:return!1;case s.Plugin:return t;case s.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case s.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(t[i]=Array.isArray(t[i])?e.getIds(r,t[i]):e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===v.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var n=r.contentWindow,i=this.attachedWindows.get(r);if(i&&(i.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(pe((()=>e.removeEventListener("message",t))),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)){var a=this.nestedIframeListeners.get(n);pe((()=>n.removeEventListener("message",a))),this.nestedIframeListeners.delete(n)}n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((e=>{pe((()=>this.mirror.removeNodeFromMap(e)))})),pe((()=>Ge(r,o))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var{content:r}=e;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{pe((()=>t.removeEventListener("message",e)))})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>{var{element:r}=t;return e.add(r)})),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ot{constructor(e){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(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(T(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var{observer:n,buffer:i}=$e(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>{n.disconnect(),i.destroy(),i.releaseCanvasManager();var e=ze.indexOf(i);-1!==e&&ze.splice(e,1)})),this.restoreHandlers.push(Qe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(et({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(S(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),a=C.shadowRoot(this);return a&&qe(this)&&r.addShadowRoot(a,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut="undefined"==typeof Uint8Array?[]:new Uint8Array(256),lt=0;64>lt;lt++)ut[st.charCodeAt(lt)]=lt;var ct=new Map,dt=(e,t,r)=>{if(e&&(ft(e,t)||"object"==typeof e)){var n=function(e,t){var r=ct.get(e);return r||ct.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function ht(e,t,r,n){if(e instanceof Array)return e.map((e=>ht(e,t,r,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){var i=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;n>t;t+=3)i+=st[r[t]>>2],i+=st[(3&r[t])<<4|r[t+1]>>4],i+=st[(15&r[t+1])<<2|r[t+2]>>6],i+=st[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ht(e.buffer,t,r,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var o=e.constructor.name,{src:s}=e;return{rr_type:o,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(n.type,n.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ht(e.data,t,r,n),e.width,e.height]}:ft(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:dt(e,t,r)}:e}var vt=(e,t,r,n)=>e.map((e=>ht(e,t,r,n))),ft=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},pt=["webgl","webgl2"];function mt(e){return"nodeType"in e}function yt(e,t,n,i){var a=[];try{if(i){var o=function(e,t,n){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return S(i.prototype,"configure",(function(i){return function(a){var o=function(e){var{canvas:t}=e;return t&&"object"==typeof t?t:null}(this);if(!o||mt(o)&&Ie(o,t,n,!0))return i.call(this,a);mt(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(e,t,n);o&&a.push(o)}var s=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!Ie(this,t,n,!0)&&("__context"in this||(this.__context=a),i&&pt.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...s])}}));a.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}function gt(e,t,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=S(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var d=e.apply(this,l);if(dt(d,a,this),"tagName"in this.canvas&&!Ie(this.canvas,n,i,!0)){var h=vt(l,a,this,o);r(this.canvas,{type:t,property:u,args:h})}return d}}));s.push(l)}catch(n){var c=be(e,u,{set(e){r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var bt,wt,kt,xt='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, displayWidth, displayHeight });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, displayWidth, displayHeight });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-CSpkoNCs.js.map\n',St="undefined"!=typeof self&&self.Blob&&new Blob([xt],{type:"text/javascript;charset=utf-8"});function Ct(e){var t;try{if(!(t=St&&(self.URL||self.webkitURL).createObjectURL(St)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(xt),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class It{constructor(e){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:a,dataURLOptions:s,resolutionScale:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(r,n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s,resolutionScale:u})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,u=yt(r,n,i,!0),l=new Map,c=new Ct;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:n,displayWidth:i,displayHeight:a}=e.data;this.mutationCb({id:t,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0,i,a]}],displayWidth:i,displayHeight:a})}};var h,v=1e3/e,f=0,p=e=>{var u,d;f&&v>e-f||(f=e,(u=[],d=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Ie(e,n,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&d(e.shadowRoot)}))}catch(e){}},d(r.document),u).forEach(function(){var e=t((function*(e){var t,r,n=o.mirror.getId(e);if(!l.get(n)&&0!==e.width&&0!==e.height){l.set(n,!0);try{if(["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);if(null==(t=null==i?void 0:i.isContextLost)?void 0:t.call(i))return void l.set(n,!1);!1===(null==(r=null==i?void 0:i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var u=e.clientWidth||e.width,d=e.clientHeight||e.height,h=Math.max(1,Math.round(u*s)),v=Math.max(1,Math.round(d*s)),f=yield createImageBitmap(e,1>s?{resizeWidth:h,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:h,resizeHeight:v});c.postMessage({id:n,bitmap:f,width:h,height:v,displayWidth:u,displayHeight:d,dataURLOptions:a.dataURLOptions},[f])}catch(e){l.set(n,!1)}}}));return function(t){return e.apply(this,arguments)}}())),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{u(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(e,t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=yt(e,t,r,!1),a=function(e,t,r,n,i){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=S(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Ie(this.canvas,r,n,!0)||setTimeout((()=>{var r=vt(u,t,this,i);e(this.canvas,{type:d["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(r){var u=be(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:d["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n),o=function(e,t,r,n,i){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...gt(t.WebGLRenderingContext.prototype,d.WebGL,e,r,n,t,i)),void 0!==t.WebGL2RenderingContext&&a.push(...gt(t.WebGL2RenderingContext.prototype,d.WebGL2,e,r,n,t,i)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i);return t})),{type:a}=r[0];this.mutationCb({id:t,type:a,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Mt{constructor(e){o(this,"trackedLinkElements",new WeakSet),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(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){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],a=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:R(t,e.href),index:r})))})),n.styleIds.push(t)};for(var o of e)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,ae.forEach((e=>e.abort())),ae.clear()}trackStylesheetInLinkElement(e){}}class Tt{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var _t=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Rt=document.createElement("iframe");document.body.appendChild(Rt),Array.from=(null==(n=Rt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Rt)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt=new L;function Ot(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:a="rr-block",blockSelector:o=null,ignoreClass:l="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:m,maskInputFn:y,maskTextFn:g,hooks:b,packFn:w,sampling:k={},dataURLOptions:x={},canvasResolutionScale:S,mousemoveWait:I,recordDOM:M=!0,recordCanvas:T=!1,recordCrossOriginIframes:_=!1,recordAfter:R=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:N=!1,plugins:q,keepIframeSrcFn:P=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:D}=e;De=D;var F=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),B=!_||window.parent===window,H=!1;if(!B)try{window.parent.document&&(H=!1)}catch(e){H=!0}if(B&&!t)throw new Error("emit function is required");if(!B&&!H)return()=>{};void 0!==I&&void 0===k.mousemove&&(k.mousemove=I),Lt.reset();var j,U=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},W=he(void 0!==m&&m);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var V,z,Z=0,Q=new Map,G=e=>{for(var t of q||[])t.eventProcessor&&(e=t.eventProcessor(e));return w&&!H&&(e=w(e)),e};bt=(e,r)=>{var a,o=e;if(o.timestamp=we(),!(null==(a=ze[0])?void 0:a.isFrozen())||o.type===s.FullSnapshot||o.type===s.IncrementalSnapshot&&o.data.source===u.Mutation||ze.forEach((e=>e.unfreeze())),B)null==t||t(G(o),r);else if(H){var l={type:"rrweb",event:G(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(o.type===s.FullSnapshot)j=o,Z=0;else if(o.type===s.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;Z++,(i&&Z>=i||n&&o.timestamp-j.timestamp>n)&&wt(!0)}};var Y=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,n=new Set;if(e.adds.length>0)for(var i of e.adds){var a=Lt.getNode(i.node.id);a&&"IFRAME"===a.nodeName&&n.add(a)}e.removes.forEach((e=>{var{id:r}=e;if(!t||!t.has(r)){var i=ee.getIframeElementById(r);i&&n.has(i)?ee.forgetIframeId(r):(null==V||V(r),ee.removeIframeById(r))}})),null==z||z(),ee.cleanupDetachedIframes()}bt({type:s.IncrementalSnapshot,data:r({source:u.Mutation},e)})},J=e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Scroll},e)}),K=e=>bt({type:s.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),X=new Mt({mutationCb:Y,adoptedStyleSheetCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),ee=new at({mirror:Lt,mutationCb:Y,stylesheetManager:X,recordCrossOriginIframes:_,wrappedEmit:bt});for(var te of q||[])te.getMirror&&te.getMirror({nodeMirror:Lt,crossOriginIframeMirror:ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:ee.crossOriginIframeStyleMirror});var re=new Tt;kt=new It({recordCanvas:T,mutationCb:K,win:window,blockClass:a,blockSelector:o,mirror:Lt,sampling:k.canvas,dataURLOptions:F,resolutionScale:S});var ne=new ot({mutationCb:Y,scrollCb:J,bypassOptions:{blockClass:a,blockSelector:o,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:U,dataURLOptions:F,maskTextFn:g,maskInputFn:y,recordCanvas:T,inlineImages:N,sampling:k,slimDOMOptions:W,iframeManager:ee,stylesheetManager:X,canvasManager:kt,keepIframeSrcFn:P,processedNodeManager:re},mirror:Lt});wt=function(e){if(void 0===e&&(e=!1),M){bt({type:s.Meta,data:{href:window.location.href,width:Se(),height:xe()}},e),X.reset(),ne.init(),ze.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new L,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:a="rr-mask",maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onIframeListenerRegistered:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x=(()=>!1),maxDepth:S}=t||{};return de(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:he(v),dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:g,onIframeListenerRegistered:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:Lt,blockClass:a,blockSelector:o,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:U,maskTextFn:g,maskInputFn:y,slimDOM:W,dataURLOptions:F,recordCanvas:T,inlineImages:N,onSerialize(e){Re(e,Lt)&&ee.addIframe(e),Le(e,Lt)&&X.trackLinkElement(e),Oe(e)&&ne.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){ee.attachIframe(e,t),ne.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ee.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){X.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");bt({type:s.FullSnapshot,data:{node:t,initialOffset:ke(window)}},e),ze.forEach((e=>e.unlock())),_&&ee.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,Lt.getId(document))}};try{var ie=[];V=e=>{var t=Q.get(e);t&&(t.forEach((e=>{pe(e);var t=ie.indexOf(e);-1!==t&&ie.splice(t,1)})),Q.delete(e))},z=()=>{for(var[e]of Q){var t=Lt.getNode(e);if(t)try{t.contentDocument&&t.contentDocument.defaultView||null==V||V(e)}catch(t){null==V||V(e)}else null==V||V(e)}};var ae=e=>{var t;return Ve(tt)({mutationCb:Y,mousemoveCb:(e,t)=>bt({type:s.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:J,viewportResizeCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:K,fontCb:e=>bt({type:s.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){bt({type:s.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){bt({type:s.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:a,ignoreClass:l,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:U,inlineStylesheet:v,sampling:k,recordDOM:M,recordCanvas:T,inlineImages:N,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:y,maskTextFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:W,dataURLOptions:F,mirror:Lt,iframeManager:ee,stylesheetManager:X,shadowDomManager:ne,processedNodeManager:re,canvasManager:kt,ignoreCSSAttributes:A,plugins:(null==(t=null==q?void 0:q.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>bt({type:s.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},b)};ee.addLoadListener((e=>{try{var t=Lt.getId(e),r=ae(e.contentDocument);if(ie.push(r),-1!==t){var n=Q.get(t);n||Q.set(t,n=new Set),n.add(r)}}catch(e){console.warn(e)}})),ee.addPageHideListener((e=>{var t=Lt.getId(e);null==V||V(t),Ge(e)}));var oe=-1,se=e=>bt({type:s.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),ue=()=>{var e,t,r,n,i=document,a=null!==(e=null!==(t=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==t?t:i.msFullscreenElement)&&void 0!==e?e:null,o=a?Lt.getId(a):-1;o!==oe&&(-1!==oe&&se({id:oe,enter:!1}),oe=o,-1!==o&&se({id:o,enter:!0}))},le=()=>{wt(),ie.push(ae(document)),ie.push(fe("fullscreenchange",ue)),ie.push(fe("webkitfullscreenchange",ue)),ie.push(fe("mozfullscreenchange",ue)),ie.push(fe("MSFullscreenChange",ue)),_t=!0};return["interactive","complete"].includes(document.readyState)?le():(ie.push(fe("DOMContentLoaded",(()=>{bt({type:s.DomContentLoaded,data:{}}),"DOMContentLoaded"===R&&le()}))),ie.push(fe("load",(()=>{bt({type:s.Load,data:{}}),"load"===R&&le()}),window))),()=>{ie.forEach((e=>pe(e))),re.destroy(),ee.removeLoadListener(),ee.destroy(),Q.clear(),Lt.reset(),_t=!1,De=void 0}}catch(e){console.warn(e)}}Ot.addCustomEvent=(e,t)=>{if(!_t)throw new Error("please add custom event after start recording");bt({type:s.Custom,data:{tag:e,payload:t}})},Ot.freezePage=()=>{ze.forEach((e=>e.freeze()))},Ot.takeFullSnapshot=e=>{if(!_t)throw new Error("please take full snapshot after start recording");wt(e)},Ot.mirror=Lt;var Et=Object.defineProperty,Nt=(e,t,r)=>((e,t,r)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class qt{constructor(e){Nt(this,"fileName"),Nt(this,"functionName"),Nt(this,"lineNumber"),Nt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Pt=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Dt=/^(eval@)?(\[native code])?$/,Ft={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new qt({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Dt)}),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 qt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new qt({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new qt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new qt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Pt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new qt({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Ht(e){return Array.isArray(e)}function jt(e){return"object"==typeof e&&null!==e&&!Ht(e)}function Ut(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(jt(e[n])&&Ut(e[n],t-1))return!0;return!1}function Wt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(jt(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||jt(o)&&Ut(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=Ht(l)?Bt(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Vt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function zt(e,t,r){var n,i=r?Object.assign({},Vt,r):Vt,a=i.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=Ft.parse(t.error).map((e=>e.toString())),a=[Wt(r,i.stringifyOptions)];e({level:"error",trace:n,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[Wt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Wt("Uncaught (in promise)",i.stringifyOptions),Wt(t.reason,i.stringifyOptions)]);var a=Ft.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(h(n,d));return()=>{u.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Ft.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((e=>Wt(e,i.stringifyOptions)));o++,i.lengthThreshold>o?e({level:r,trace:c,payload:d}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Wt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})(l);return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l}})),t[a]=c,()=>{t[a]=l}}catch(e){return()=>{}}}(t,r):()=>{}}}var Zt=e=>({name:"rrweb/console@1",observer:zt,options:e}),$t=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({});function Qt(e,t){return-1!==e.indexOf(t)}var Gt=function(e){return e.trim()},Yt=Object.prototype,Jt=Yt.hasOwnProperty,Kt=Yt.toString,Xt=Array.isArray||function(e){return"[object Array]"===Kt.call(e)},er=e=>"function"==typeof e,tr=e=>e===Object(e)&&!Xt(e),rr=e=>void 0===e,nr=e=>"[object String]"==Kt.call(e),ir=e=>null===e,ar=e=>rr(e)||ir(e),or=e=>"[object Number]"==Kt.call(e)&&e==e,sr=e=>"[object Boolean]"===Kt.call(e),ur=e=>e instanceof FormData;function lr(e){return null===e||"object"!=typeof e}function cr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function dr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var hr="Mobile",vr="Android",fr="Tablet",pr=vr+" "+fr,mr="iPad",yr="Apple Watch",gr="BlackBerry",br="Nintendo",wr="PlayStation",kr="Xbox",xr="Windows Phone",Sr="Nokia",Cr="Ouya",Ir="Generic",Mr=Ir+" "+hr.toLowerCase(),Tr=Ir+" "+fr.toLowerCase(),_r=new RegExp(kr,"i"),Rr=new RegExp(wr+" \\w+","i"),Lr=new RegExp(br+" \\w+","i"),Or=new RegExp(gr+"|PlayBook|BB10","i");function Er(e){return e?e.split("#")[0]:e}var Nr,qr,Pr;function Ar(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function Dr(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return Pr&&r.length===qr||(qr=r.length,Pr=r.reduce(((r,n)=>{Nr||(Nr={});var i=Nr[n];if(i)r[i[0]]=i[1];else for(var a=e(n),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[n];if(u&&l){r[u]=l,Nr[n]=[u,l];break}}return r}),{})),Pr}}var Fr="?";function Br(e,t,r,n,i){var a={platform:e,filename:t,function:"<anonymous>"===r?Fr:r,in_app:!0};return rr(n)||(a.lineno=n),rr(i)||(a.colno=i),a}var Hr=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:Fr,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},jr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ur=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Wr=/\((\S*)(?::(\d+))(?::(\d+))\)/,Vr=(e,t)=>{var r=jr.exec(e);if(r){var[,n,i,a]=r;return Br(t,n,Fr,+i,+a)}var o=Ur.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Wr.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[u,l]=Hr(o[1]||Fr,o[2]);return Br(t,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},zr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Zr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$r=(e,t)=>{var r=zr.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=Zr.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],a=r[1]||Fr;return[a,i]=Hr(a,i),Br(t,i,a,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Qr=/\(error: (.*)\)/;var Gr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Yr=["fatal","error","warning","log","info","debug"];function Jr(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(t>=i.length)return n===r.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Kr="undefined"!=typeof window?window:void 0,Xr="undefined"!=typeof globalThis?globalThis:Kr;"undefined"==typeof self&&(Xr.self=Xr),"undefined"==typeof File&&(Xr.File=function(){});var en=null==Xr?void 0:Xr.navigator,tn=null==Xr?void 0:Xr.document;null!=Xr&&Xr.XMLHttpRequest&&new Xr.XMLHttpRequest;var rn=null==en?void 0:en.userAgent,nn=null!=Kr?Kr:{},an=e=>e instanceof Document,on=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,n={k(t){if(Kr&&(nn.POSTHOG_DEBUG||r)&&!rr(Kr.console)&&Kr.console){for(var n=("__rrweb_original__"in Kr.console[t]?Kr.console[t].__rrweb_original__:Kr.console[t]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>on(e+" "+t,r)};return n},sn=on("[PostHog.js]"),un=sn.createLogger;function ln(e,t){if(!ar(e))if(Xt(e))e.forEach(t);else if(ur(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Jt.call(e,r)&&t(e[r],r)}var cn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var i of r)for(var a in i)void 0!==i[a]&&(e[a]=i[a]);return e};function dn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}function hn(e,t,r,n){var{capture:i=!1,passive:a=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:a})}var vn=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return ln(e,(function(e,t){rr(e)||rr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)};function fn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return er(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=n)}}catch(e){return()=>{}}}function pn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of t.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var mn=1,yn=3,gn=11;function bn(e){return!!e&&e.nodeType===mn}function wn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kn(e){return!!e&&e.nodeType===gn&&bn(e.host)}function xn(e){return e?Gt(e).split(/\s+/):[]}function Sn(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return xn(t)}function Cn(e){var t="";return Ln(e)&&!On(e)&&e.childNodes&&e.childNodes.length&&ln(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===yn})(e)&&e.textContent&&(t+=null!==(r=function(e){return ar(e)?null:Gt(e).split(/(\s+)/).filter((e=>Fn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),Gt(t)}var In=["a","button","form","input","select","textarea","label"];function Mn(e){var t=e.parentNode;return!(!t||!bn(t))&&t}var Tn=[".ph-no-deadclick",".ph-no-capture"];var _n=e=>!e||wn(e,"html")||!bn(e),Rn=(e,t)=>{if(!Kr||_n(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],i=e;i.parentNode&&!wn(i,"body");)if(kn(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else{var a=Mn(i);if(!a)break;if(In.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var o=Kr.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}n.push(a),i=a}return{parentIsUsefulElement:r,targetElementList:n}};function Ln(e){for(var t=e;t.parentNode&&!wn(t,"body");t=t.parentNode){var r=Sn(t);if(Qt(r,"ph-sensitive")||Qt(r,"ph-no-capture"))return!1}if(Qt(Sn(e),"ph-include"))return!0;var n=e.type||"";if(nr(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!nr(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function On(e){return!!(wn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||wn(e,"select")||wn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var En="(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})",Nn=new RegExp("^(?:"+En+")$"),qn=new RegExp(En),Pn="\\d{3}-?\\d{2}-?\\d{4}",An=new RegExp("^("+Pn+")$"),Dn=new RegExp("("+Pn+")");function Fn(e,t){if(void 0===t&&(t=!0),ar(e))return!1;if(nr(e)){if(e=Gt(e),(t?Nn:qn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?An:Dn).test(e))return!1}return!0}function Bn(e){var t=Cn(e);return Fn(t=(t+" "+Hn(e)).trim())?t:""}function Hn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ln(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Cn(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Hn(e)).trim())}catch(e){sn.error("[AutoCapture]",e)}})),t}function jn(e){return e.replace(/"|\\"/g,'\\"')}function Un(e){var t=e.attr__class;return t?Xt(t)?t:xn(t):void 0}var Wn=1e6,Vn={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:Wn,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},zn=un("[Recorder]"),Zn=e=>"navigation"===e.entryType,$n=e=>"resource"===e.entryType;function Qn(e,t){return!!t&&(sr(t)||t[e])}function Gn(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Yn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Jn(e){var{type:t,recordBody:r,headers:n,url:i}=e;function a(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Gn(t)&&e(t.url)}catch(e){return!1}}(i))return!1;if(a(Yn))return!1;if(sr(r))return!0;if(Xt(r))return a(r);var o=r[t];return sr(o)?o:a(o)}function Kn(e,t,r,n,i,a){return Xn.apply(this,arguments)}function Xn(){return Xn=t((function*(e,t,r,n,i,a){if(void 0===a&&(a=0),a>10)return zn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if($n(o=e[a])&&o.initiatorType===t&&(rr(n)||o.startTime>=n)&&(rr(i)||i>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Kn(e,t,r,n,i,a+1))})),Xn.apply(this,arguments)}function ei(e){var{body:t,options:r,url:n}=e;if(ar(t))return null;var{hostname:i,isHostDenied:a}=pn(n,r);if(a)return i+" is in deny list";if(nr(t))return t;if(an(t))return t.textContent;if(ur(t))return vn(t);if(tr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ti=e=>!ir(e)&&("navigation"===e.entryType||"resource"===e.entryType);function ri(e){var{entry:t,method:n,status:i,networkRequest:a,isInitial:o,start:s,end:u,url:l,initiatorType:c}=e;s=t?t.startTime:s,u=t?t.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(s||0)),v=[r({},t?t.toJSON():{name:l},{startTime:rr(s)?void 0:Math.round(s),endTime:rr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(ti(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ni=["video/","audio/"];function ii(e){return tr(e)&&er(e.getReader)&&er(e.tee)}var ai=500,oi="[SessionReplay] Timeout while trying to read body",si="[SessionReplay] Failed to read body";function ui(e){return si+": "+e}function li(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function ci(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(oi)),ai);try{e.clone().text().then((e=>t(e)),(e=>t(ui(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(si)}}))}(e);var r=function(e){var t;return Math.min(Wn,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:Wn)}(t);return function(e,t){try{var r,n=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>t}catch(e){return!1}}(e,r)?Promise.resolve(li(r)):function(e,t){return new Promise((r=>{var n,i=!1;function a(){try{var e;null==(e=n)||e.cancel()}catch(e){}}function o(e){i||(i=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(oi)),ai);try{s=e.clone()}catch(e){return void o(si)}var l=s.body;if(ii(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(e){return void o(si)}var c=[],d=0;!function e(){n.read().then((r=>{var{done:n,value:s}=r;if(i)a();else if(n)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),n=0;for(var i of e)r.set(i,n),n+=i.byteLength;return r}(c,d)));else{if(s){if(d+s.byteLength>t)return void o(li(t));d+=s.byteLength,c.push(s)}e()}}),(e=>o(ui(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(ui(e))))}catch(e){o(si)}}))}(e,r)}function di(){return di=t((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:a}=pn(n,r);return a?Promise.resolve(i+" is in deny list"):ci(t,r)})),di.apply(this,arguments)}function hi(){return hi=t((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=ni.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var{hostname:s,isHostDenied:u}=pn(i,n);return u?s+" is in deny list":null}({r:t,options:r,url:n});return ir(i)?ci(t,r):Promise.resolve(i)})),hi.apply(this,arguments)}var vi=null;function fi(e,n,i){if(!("performance"in n))return()=>{};if(vi)return zn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},Vn,i):Vn,o=t=>{var n=[];t.requests.forEach((e=>{var t=a.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(r({},t,{requests:n}))},s=function(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Zn(e)||$n(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>Zn(e)||$n(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>ri({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Qn("request",r.recordHeaders),i=Qn("response",r.recordHeaders),a=fn(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var d,h,v=this,f=new Request(s),p={},m={},y=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=v.send.bind(v);v.send=e=>(Jn({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=ei({body:e,options:r,url:s})),d=t.performance.now(),g(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),h=t.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),Jn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=ei({body:v.response,options:r,url:s})),Kn(t,"xmlhttprequest",f.url,d,h).then((t=>{var r=ri({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:d,end:h,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),a.call(v,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=Qn("request",n.recordHeaders),a=Qn("response",n.recordHeaders),o=fn(r,"fetch",(o=>function(){var s=t((function*(t,s){var u,l,c,d=new Request(t,s),h={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),i&&(h.requestHeaders=v),!ii(null==s?void 0:s.body)&&Jn({type:"request",headers:v,url:t,recordBody:n.recordBody})&&(h.requestBody=yield function(e){return di.apply(this,arguments)}({r:d,options:n,url:t})),l=r.performance.now(),u=Gn(t)?yield o(d):yield o(t,s),c=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),a&&(h.responseHeaders=f),Jn({type:"response",headers:f,url:t,recordBody:n.recordBody})&&(h.responseBody=yield function(e){return hi.apply(this,arguments)}({r:u,options:n,url:t})),u}finally{Kn(r,"fetch",d.url,l,c).then((t=>{var r,n=ri({entry:t,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:c,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),vi=()=>{s(),u(),l(),vi=null}}var pi=e=>({name:"rrweb/network@1",observer:fi,options:e});nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Zt,getRecordNetworkPlugin:pi},nn.__PosthogExtensions__.rrweb={record:Ot,version:"v2",wasMaxDepthReached:()=>ce,resetMaxDepthState(){ce=!1,le=!1}},nn.rrweb={record:Ot,version:"v2"},nn.rrwebConsoleRecord={getRecordConsolePlugin:Zt},nn.getRecordNetworkPlugin=pi;var mi,yi,gi,bi,wi,ki,xi,Si,Ci,Ii,Mi,Ti,_i,Ri,Li,Oi={},Ei=[],Ni=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qi=Array.isArray;function Pi(e,t){for(var r in t)e[r]=t[r];return e}function Ai(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Di(e,t,r){var n,i,a,o={};for(a in t)"key"==a?n=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?mi.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return Fi(e,o,n,i,null)}function Fi(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++gi:i,__i:-1,__u:0};return null==i&&null!=yi.vnode&&yi.vnode(a),a}function Bi(e){return e.children}function Hi(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function ji(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],i=[],a=Pi({},t);a.__v=t.__v+1,yi.vnode&&yi.vnode(a),Ji(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,null==r?$(t):r,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Xi(n,a,i),t.__e=t.__=null,a.__e!=r&&Ui(a)}}function Ui(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Ui(e)}function Wi(e){(!e.__d&&(e.__d=!0)&&bi.push(e)&&!Vi.__r++||wi!=yi.debounceRendering)&&((wi=yi.debounceRendering)||ki)(Vi)}function Vi(){try{for(var e,t=1;bi.length;)bi.length>t&&bi.sort(xi),e=bi.shift(),t=bi.length,ji(e)}finally{bi.length=Vi.__r=0}}function zi(e,t,r,n,i,a,o,s,u,l,c){var d,h,v,f,p,m,y,g=n&&n.__k||Ei,b=t.length;for(u=function(e,t,r,n,i){var a,o,s,u,l,c=r.length,d=c,h=0;for(e.__k=new Array(i),a=0;i>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=Fi(null,o,null,null,null):qi(o)?o=e.__k[a]=Fi(Bi,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=Fi(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+h,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=$i(o,r,u,d))&&(d--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(i>c?h--:c>i&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;c>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==n&&(n=$(s)),na(s,s));return n}(r,t,g,u,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(h=-1!=v.__i&&g[v.__i]||Oi,v.__i=d,m=Ji(e,v,h,i,a,o,s,u,l,c),f=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&ra(h.ref,null,v),c.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(y=!!(4&v.__u))||h.__k===v.__k?(u=Zi(v,u,e,y),y&&h.__e&&(h.__e=null)):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Zi(e,t,r,n){var i,a;if("function"==typeof e.type){for(i=e.__k,a=0;i&&i.length>a;a++)i[a]&&(i[a].__=e,t=Zi(i[a],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function $i(e,t,r,n){var i,a,o,s=e.key,u=e.type,l=t[r],c=null!=l&&0==(2&l.__u);if(null===l&&null==s||c&&s==l.key&&u==l.type)return r;if(n>(c?1:0))for(i=r-1,a=r+1;i>=0||t.length>a;)if(null!=(l=t[o=0>i?a++:i--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function Qi(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ni.test(t)?r:r+"px"}function Gi(e,t,r,n,i){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Qi(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Qi(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Mi,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r[Ii]=n[Ii]:(r[Ii]=Ti,e.addEventListener(t,a?Ri:_i,a)):e.removeEventListener(t,a?Ri:_i,a);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Yi(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Ci])t[Ci]=Ti++;else if(r[Ii]>t[Ci])return;return r(yi.event?yi.event(t):t)}}}function Ji(e,t,r,n,i,a,o,s,u,l){var c,d,h,v,f,p,m,y,g,b,$,w,k,x,S,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(c=yi.__b)&&c(t);e:if("function"==typeof C)try{if(y=t.props,g=C.prototype&&C.prototype.render,b=(c=C.contextType)&&n[c.__c],$=c?b?b.props.value:c.__:n,r.__c?m=(d=t.__c=r.__c).__=d.__E:(g?t.__c=d=new C(y,$):(t.__c=d=new Hi(y,$),d.constructor=C,d.render=ia),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),g&&null==d.__s&&(d.__s=d.state),g&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Pi({},d.__s)),Pi(d.__s,C.getDerivedStateFromProps(y,d.__s))),v=d.props,f=d.state,d.__v=t,h)g&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),g&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(g&&null==C.getDerivedStateFromProps&&y!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,$),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,$)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),Ei.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,$),g&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=$,d.props=y,d.__P=e,d.__e=!1,w=yi.__r,k=0,g)d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),Ei.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++k);d.state=d.__s,null!=d.getChildContext&&(n=Pi(Pi({},n),d.getChildContext())),g&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),x=null!=c&&c.type===Bi&&null==c.key?ea(c.props.children):c,s=zi(e,qi(x)?x:[x],t,r,n,i,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(S=a.length;S--;)Ai(a[S]);Ki(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Ki(t);yi.__e(e,t,r)}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=ta(r.__e,t,r,n,i,a,o,u,l);return(c=yi.diffed)&&c(t),128&t.__u?void 0:s}function Ki(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ki))}function Xi(e,t,r){for(var n=0;r.length>n;n++)ra(r[n],r[++n],r[++n]);yi.__c&&yi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){yi.__e(e,t.__v)}}))}function ea(e){return"object"!=typeof e||null==e||e.__b>0?e:qi(e)?e.map(ea):void 0!==e.constructor?null:Pi({},e)}function ta(e,t,r,n,i,a,o,s,u){var l,c,d,h,v,f,p,m=r.props||Oi,y=t.props,g=t.type;if("svg"==g?i="http://www.w3.org/2000/svg":"math"==g?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!g&&(g?v.localName==g:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(i,g,y.is&&y),s&&(yi.__m&&yi.__m(t,a),s=!1),a=null}if(null==g)m===y||s&&e.data==y||(e.data=y);else{if(a="textarea"==g&&null!=y.defaultValue?null:a&&mi.call(e.childNodes),!s&&null!=a)for(m={},l=0;e.attributes.length>l;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)v=m[l],"dangerouslySetInnerHTML"==l?d=v:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||Gi(e,l,null,v,i);for(l in y)v=y[l],"children"==l?h=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||Gi(e,l,v,m[l],i);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),zi("template"==t.type?e.content:e,qi(h)?h:[h],t,r,n,"foreignObject"==g?"http://www.w3.org/1999/xhtml":i,a,o,a?a[0]:r.__k&&$(r,0),s,u),null!=a)for(l=a.length;l--;)Ai(a[l]);s&&"textarea"!=g||(l="value","progress"==g&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==g&&!f||"option"==g&&f!=m[l])&&Gi(e,l,f,m[l],i),l="checked",null!=p&&p!=e[l]&&Gi(e,l,p,m[l],i))}return e}function ra(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){yi.__e(e,r)}}function na(e,t,r){var n,i;if(yi.unmount&&yi.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ra(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){yi.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;n.length>i;i++)n[i]&&na(n[i],t,r||"function"!=typeof e.type);r||Ai(e.__e),e.__c=e.__=e.__e=void 0}function ia(e,t,r){return this.constructor(e,r)}function aa(e,t,r){var n,i,a;t==document&&(t=document.documentElement),yi.__&&yi.__(e,t),n=t.__k,i=[],a=[],Ji(t,e=t.__k=Di(Bi,null,[e]),n||Oi,Oi,t.namespaceURI,n?null:t.firstChild?mi.call(t.childNodes):null,i,n?n.__e:t.firstChild,!1,a),Xi(i,e,a)}mi=Ei.slice,yi={__e(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},gi=0,Hi.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Pi({},this.state),"function"==typeof e&&(e=e(Pi({},r),this.props)),e&&Pi(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Wi(this))},Hi.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Wi(this))},Hi.prototype.render=Bi,bi=[],ki="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xi=function(e,t){return e.__v.__b-t.__v.__b},Vi.__r=0,Si=Math.random().toString(8),Ci="__d"+Si,Ii="__a"+Si,Mi=/(PointerCapture)$|Capture$/i,Ti=0,_i=Yi(!1),Ri=Yi(!0),Li=0;var oa,sa,ua,la,ca=0,da=[],ha=yi,va=ha.__b,fa=ha.__r,pa=ha.diffed,ma=ha.__c,ya=ha.unmount,ga=ha.__;function ba(e,t){ha.__h&&ha.__h(sa,e,ca||t),ca=0;var r=sa.__H||(sa.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function wa(e){return ca=1,function(e,t,r){var n=ba(oa++,2);if(n.t=e,!n.__c&&(n.__=[Oa(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=sa,!sa.__f)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!a||a.call(this,e,t,r);var o=n.__c.props!==e;return i.some((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a&&a.call(this,e,t,r)||o};sa.__f=!0;var a=sa.shouldComponentUpdate,o=sa.componentWillUpdate;sa.componentWillUpdate=function(e,t,r){if(this.__e){var n=a;a=void 0,i(e,t,r),a=n}o&&o.call(this,e,t,r)},sa.shouldComponentUpdate=i}return n.__N||n.__}(Oa,e)}function ka(e,t){var r=ba(oa++,3);!ha.__s&&La(r.__H,t)&&(r.__=e,r.u=t,sa.__H.__h.push(r))}function xa(e){return ca=5,Sa((function(){return{current:e}}),[])}function Sa(e,t){var r=ba(oa++,7);return La(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ca(e){var t=sa.context[e.__c],r=ba(oa++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(sa)),t.props.value):e.__}function Ia(){for(var e;e=da.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_a),t.__h.some(Ra),t.__h=[]}catch(r){t.__h=[],ha.__e(r,e.__v)}}}ha.__b=function(e){sa=null,va&&va(e)},ha.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ga&&ga(e,t)},ha.__r=function(e){fa&&fa(e),oa=0;var t=(sa=e.__c).__H;t&&(ua===sa?(t.__h=[],sa.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(_a),t.__h.some(Ra),t.__h=[],oa=0)),ua=sa},ha.diffed=function(e){pa&&pa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==da.push(t)&&la===ha.requestAnimationFrame||((la=ha.requestAnimationFrame)||Ta)(Ia)),t.__H.__.some((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),ua=sa=null},ha.__c=function(e,t){t.some((function(e){try{e.__h.some(_a),e.__h=e.__h.filter((function(e){return!e.__||Ra(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ha.__e(r,e.__v)}})),ma&&ma(e,t)},ha.unmount=function(e){ya&&ya(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{_a(e)}catch(e){t=e}})),r.__H=void 0,t&&ha.__e(t,r.__v))};var Ma="function"==typeof requestAnimationFrame;function Ta(e){var t,r=function(){clearTimeout(n),Ma&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Ma&&(t=requestAnimationFrame(r))}function _a(e){var t=sa,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),sa=t}function Ra(e){var t=sa;e.__c=e.__(),sa=t}function La(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Oa(e,t){return"function"==typeof t?t(e):t}var Ea={Tab:"tab",Selector:"selector"},Na={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},qa={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Pa={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Aa={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Da={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Fa="always",Ba={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Ha={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"};function ja(e){return"$survey_response_"+e}function Ua(e,t){if(!t)return null;var r=e[ja(t)];return Xt(r)?[...r]:r}function Wa(e,t){void 0===e&&(e={});var n={};return t.questions.forEach((t=>{if(!rr(t.originalQuestionIndex)){var r,i=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,a=Ua(e,t.id);rr(a)||(n[i]=a)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:Ua(e,t.id)})))},e,n)}function Va(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function za(e){return"string"==typeof e&&e.trim()?e.trim():null}function Za(e){return e.toLowerCase()}function $a(e,t,r){if(!e||!t)return null;var n=Za(t),i=Object.keys(e).find((e=>Za(e)===n));if(i)return null==r||r.debug("Found exact translation match: "+i),i;if(n.includes("-")){var a=n.split("-")[0],o=Object.keys(e).find((e=>Za(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function Qa(e,t,n){var i,a=$a(e.translations,t,n),o=r({},e),s=!1;if(a){var u,l=null==(u=e.translations)?void 0:u[a];l&&(null==n||n.info("Applying survey-level translation for language: "+a),rr(l.name)||(o.name=l.name,s=!0),o.appearance?(o.appearance=r({},o.appearance),rr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,s=!0),rr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,s=!0),rr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,s=!0),rr(l.submitButtonText)||(o.appearance.submitButtonText=l.submitButtonText,s=!0),rr(l.backButtonText)||(o.appearance.backButtonText=l.backButtonText,s=!0)):function(e){return!(rr(e.thankYouMessageHeader)&&rr(e.thankYouMessageDescription)&&rr(e.thankYouMessageCloseButtonText)&&rr(e.submitButtonText)&&rr(e.backButtonText))}(l)&&(s=!0))}var c=e.questions.map((e=>function(e,t,n){var i,a=$a(e.translations,t,n);if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(i=e.translations)?void 0:i[a];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var s=r({},e),u=!1;return rr(o.question)||(s.question=o.question,u=!0),rr(o.description)||(s.description=o.description,u=!0),rr(o.buttonText)||(s.buttonText=o.buttonText,u=!0),"link"in s&&!rr(o.link)&&(s.link=o.link,u=!0),"lowerBoundLabel"in s&&!rr(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in s&&!rr(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in s&&function(e){return Xt(e.choices)}(o)&&(s.choices=o.choices,u=!0),{question:u?s:e,matchedKey:u?a:null,hasChanges:u}}(e,t,n))),d=c.map((e=>e.question)),h=c.some((e=>e.hasChanges)),v=null;return a||(v=(null==(i=c.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),h&&(o.questions=d,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?a||v:null}}var Ga=un("[Surveys]"),Ya="inProgressSurvey_",Ja=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Ka=e=>Ja("seenSurvey_",e),Xa=e=>{try{var t=Ka(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Ga.error("Failed to persist survey seen state",e)}},eo=[Pa.Popover,Pa.Widget,Pa.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return or(e)&&isFinite(e)&&Math.floor(e)===e});class to{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>t||0>r||0>n||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new to(i)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new to(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class ro{constructor(){this.S=0,this.C=0,this.I=new ao}generate(){var e=this.generateOrAbort();if(rr(e)){this.S=0;var t=this.generateOrAbort();if(rr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return to.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var no,io=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Kr&&!rr(Kr.crypto)&&crypto.getRandomValues&&(io=e=>crypto.getRandomValues(e));class ao{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(io(this.R),this.O=0),this.R[this.O++]}}var oo=()=>so().toString(),so=()=>(no||(no=new ro)).generate(),uo=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},lo={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>uo(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!uo(t,e))))),icontains:(e,t)=>t.map(co).some((t=>e.map(co).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(co).every((t=>e.map(co).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},co=e=>e.toLowerCase(),ho=null,vo={N(){if(!ir(ho))return ho;var e=!0;if(rr(Kr))e=!1;else try{var t="__mplssupport__";vo.q(t,"xyz"),'"xyz"'!==vo.P(t)&&(e=!1),vo.A(t)}catch(t){e=!1}return e||sn.error("localStorage unsupported; falling back to cookie store"),ho=e,e},D(e){sn.error("localStorage error: "+e)},P(e){try{return null==Kr?void 0:Kr.localStorage.getItem(e)}catch(e){vo.D(e)}return null},F(e){try{return JSON.parse(vo.P(e))||{}}catch(e){}return null},q(e,t){try{return null==Kr||Kr.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){vo.D(e)}return!1},A(e){try{null==Kr||Kr.localStorage.removeItem(e)}catch(e){vo.D(e)}}},fo=un("[Stylesheet Loader]"),po=Kr,mo=tn,yo="#020617",go={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Na.Right,widgetType:Ea.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:yo,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},bo=[Na.Center,Na.Left,Na.Right];function wo(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function ko(e){var t;void 0===e&&(e=go.backgroundColor),"#"===e[0]&&(t=wo(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=wo(r)),!t)return yo;var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),a=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+a*a*.587+o*o*.114)>127.5?yo:"white"}return yo}var xo=(e,t,n)=>{var i=jo(e),a=mo.querySelector("."+i);if(a&&a.shadowRoot)return{shadow:a.shadowRoot,isNewlyCreated:!1};var o=mo.createElement("div");((e,t,n)=>{var i=r({},go,n),a=e.style,o=!bo.includes(i.position)||t===Pa.Widget&&(null==n?void 0:n.widgetType)===Ea.Tab;a.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),a.setProperty("--ph-survey-box-padding",i.boxPadding),a.setProperty("--ph-survey-max-width",i.maxWidth),a.setProperty("--ph-survey-z-index",i.zIndex),a.setProperty("--ph-survey-border-color",i.borderColor),o?(a.setProperty("--ph-survey-border-radius",i.borderRadius),a.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(a.setProperty("--ph-survey-border-bottom","none"),a.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),a.setProperty("--ph-survey-background-color",i.backgroundColor),a.setProperty("--ph-survey-box-shadow",i.boxShadow),a.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),a.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),a.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||ko(i.submitButtonColor)),a.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),a.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),a.setProperty("--ph-survey-rating-active-text-color",ko(i.ratingButtonActiveColor)),a.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||ko(i.backgroundColor)),a.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),a.setProperty("--ph-widget-color",i.widgetColor),a.setProperty("--ph-widget-text-color",ko(i.widgetColor)),a.setProperty("--ph-widget-z-index",i.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=s||i.inputBackground;s||"white"!==i.backgroundColor||(u="#f8f8f8"),a.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||ko(u);a.setProperty("--ph-survey-input-text-color",l),a.setProperty("--ph-survey-rating-text-color",l),a.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),a.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),a.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,e.type,e.appearance),o.className=i;var s=o.attachShadow({mode:"open"}),u=function(e){var t=((e,t,r)=>{var n,i=e.createElement("style");return i.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(n=r.config)&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(fo.error("prepare_external_dependency_stylesheet returned null"),null)})(mo,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return mo.body.appendChild(o),{shadow:s,isNewlyCreated:!0}},So=e=>{var{responses:t,survey:n,surveySubmissionId:i,posthog:a,isSurveyCompleted:o,properties:s,surveyLanguage:u}=e;a?(Xa(n),a.capture(Ba.SENT,r({[Ha.SURVEY_NAME]:n.name,[Ha.SURVEY_ID]:n.id,[Ha.SURVEY_ITERATION]:n.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:n.current_iteration_start_date,[Ha.SURVEY_SUBMISSION_ID]:i,[Ha.SURVEY_COMPLETED]:o},u&&{[Ha.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},Wa(t,n),s,{$set:{[Va(n,"responded")]:!0}})),o&&(po.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:n.id}})),Ho(n))):Ga.error("[survey sent] event not captured, PostHog instance not found.")},Co=(e,t,n)=>{return r({[Ha.SURVEY_NAME]:e.name,[Ha.SURVEY_ID]:e.id,[Ha.SURVEY_ITERATION]:e.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Ha.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!ar(e))))},(null==t?void 0:t.surveyLanguage)&&{[Ha.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url(),[Ha.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},Wa(null==t?void 0:t.responses,e));var i},Io=(e,t,n,i)=>{if(t){if(!n){var a=Fo(e);t.capture(Ba.DISMISSED,r({},Co(e,a,t),i&&{[Ha.SURVEY_LANGUAGE]:i},{$set:{[Va(e,"dismissed")]:!0}})),Ho(e),Xa(e),po.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ga.error("[survey dismissed] event not captured, PostHog instance not found.")},Mo=(e,t)=>{if(t){var r=(e=>Ja("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var n=Fo(e);if(n){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Ba.ABANDONED,Co(e,n,t),{transport:"sendBeacon"})}}else Ga.error("[survey abandoned] event not captured, PostHog instance not found.")},To=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),_o=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Ro=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?_o(e.questions,To(e.questions)):e.questions,Lo=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Fa||Bo(e)},Oo=function(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Wi(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Li++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Eo=()=>Ca(Oo),No=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return function(e,t,r){var n,i,a,o,s=Pi({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?n=t[a]:"ref"==a?i=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?mi.call(arguments,2):r),Fi(e.type,s,n||e.key,i||e.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};function qo(e){var t,r,n;if(null==(t=e.conditions)||!t.url)return!0;var i=null==po||null==(r=po.location)?void 0:r.href;if(!i)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(n=e.conditions)?void 0:n.urlMatchType);return lo[o](a,[i])}function Po(e){var t,r;return function(e,t){var r,n,i;if(!e||0===e.length)return!0;if(!rn)return!1;var a,o,s,u,l,c,d=(a={userAgentDataPlatform:null==en||null==(r=en.userAgentData)?void 0:r.platform,maxTouchPoints:null==en?void 0:en.maxTouchPoints,screenWidth:null==Kr||null==(n=Kr.screen)?void 0:n.width,screenHeight:null==Kr||null==(i=Kr.screen)?void 0:i.height,devicePixelRatio:null==Kr?void 0:Kr.devicePixelRatio},(c=function(e){return Lr.test(e)?br:Rr.test(e)?wr:_r.test(e)?kr:new RegExp(Cr,"i").test(e)?Cr:new RegExp("("+xr+"|WPDesktop)","i").test(e)?xr:/iPad/.test(e)?mr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?yr:Or.test(e)?gr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Sr,"i").test(e)?Sr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(hr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?vr:pr:new RegExp("(pda|"+hr+")","i").test(e)?Mr:new RegExp(fr,"i").test(e)&&!new RegExp(fr+" pc","i").test(e)?Tr:""}(rn))===mr||c===pr||"Kobo"===c||"Kindle Fire"===c||c===Tr?fr:c===br||c===kr||c===wr||c===Cr?"Console":c===yr?"Wearable":c?hr:"Android"===(null==a?void 0:a.userAgentDataPlatform)&&(null!==(o=null==a?void 0:a.maxTouchPoints)&&void 0!==o?o:0)>0?600>Math.min(null!==(s=null==a?void 0:a.screenWidth)&&void 0!==s?s:0,null!==(u=null==a?void 0:a.screenHeight)&&void 0!==u?u:0)/(null!==(l=null==a?void 0:a.devicePixelRatio)&&void 0!==l?l:1)?hr:fr:"Desktop");return lo[null!=t?t:"icontains"](e,[d])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}var Ao=e=>{var t=""+Ya+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Ya+e.id+"_"+e.current_iteration),t},Do=(e,t)=>{try{localStorage.setItem(Ao(e),JSON.stringify(t))}catch(e){Ga.error("Error setting in-progress survey state in localStorage",e)}},Fo=e=>{try{var t=localStorage.getItem(Ao(e));if(t)return JSON.parse(t)}catch(e){Ga.error("Error getting in-progress survey state from localStorage",e)}return null},Bo=e=>{var t=Fo(e);return!ar(null==t?void 0:t.surveySubmissionId)},Ho=e=>{try{localStorage.removeItem(Ao(e))}catch(e){Ga.error("Error clearing in-progress survey state from localStorage",e)}};function jo(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Uo(e,t,r){if(void 0===t&&(t=Na.Right),e===Pa.ExternalSurvey)return{};switch(t){case Na.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Na.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Na.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Na.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Na.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Na.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Na.Left:return{left:"30px"};case Na.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Pa.Widget&&r===Ea.Tab?"60px":"30px"}}}var Wo=0;function Vo(e,t,r,n,i,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Wo,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return yi.vnode&&yi.vnode(l),l}var zo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Zo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$o=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Qo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Go=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("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"})}),Yo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Vo("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Jo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Vo("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Ko=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Vo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Vo("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Vo("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:t})]})},Xo=Vo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Vo("g",{"clip-path":"url(#clip0_2415_6911)",children:[Vo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Vo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Vo("g",{mask:"url(#mask0_2415_6911)",children:[Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"}),Vo("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"})]})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2415_6911",children:Vo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function es(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Vo("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Xo]})}function ts(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:a,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:u,onBack:l}=e,{isPreviewMode:c}=Ca(Oo),d=!!u&&!!l,h=!s&&Vo("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==Kr||Kr.open(a)),c?null==o||o():i()},children:t});return Vo("div",{className:"bottom-section",children:[d?Vo("div",{className:"form-buttons form-buttons-with-back",children:[Vo("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),h]}):h,!n.whiteLabel&&Vo(es,{urlParams:{utm_source:"survey-footer"}})]})}function rs(e){var{question:t,forceDisableHtml:r,htmlFor:n}=e;return Vo("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Vo(t.type===Aa.Open?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&No({component:Di("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function ns(e){var{onClick:t}=e,{isPreviewMode:r}=Ca(Oo);return Vo("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Ko({fill:"black"})})}Vo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Vo("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var is=Kr;function as(e){var{header:t,description:r,contentType:n,forceDisableHtml:i,appearance:a,onClose:o}=e,{isPopup:s}=Ca(Oo);return ka((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return hn(is,"keydown",e),()=>{is.removeEventListener("keydown",e)}}),[o]),Vo("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&Vo(ns,{onClick:()=>o()}),Vo("h3",{className:"thank-you-message-header",children:t}),r&&No({component:Di("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==n}),s&&Vo(ts,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}var os=e=>Xt(e)&&e.every((e=>nr(e)));function ss(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:a,displayQuestionIndex:o,initialValue:s,canGoBack:u,onBack:l}=e,{isPreviewMode:c}=Eo(),d=xa(null),[h,v]=wa((()=>nr(s)?s:""));ka((()=>{setTimeout((()=>{var e;c||null==(e=d.current)||e.focus()}),100)}),[c]);var f="surveyQuestion"+o,p=Sa((()=>function(e,t,r){var n,i,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case $t.MinLength:if(void 0!==o.value&&o.value>a.length)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter at least "+o.value+" characters";break;case $t.MaxLength:if(void 0!==o.value&&a.length>o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter no more than "+o.value+" characters"}return!1}(h,t.validation,t.optional)),[h,t.validation,t.optional]),m=Ar(t.validation,$t.MinLength),y=Ar(t.validation,$t.MaxLength),g=Sa((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(m,y)),[m,y]),b=()=>{p||i(h.trim())},w=()=>{p||a(h.trim())};return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:t,forceDisableHtml:r,htmlFor:f}),Vo("textarea",{ref:d,id:f,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:y,onInput(e){v(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||p||(e.preventDefault(),c?w():b())},value:h}),g&&Vo("div",{className:"validation-hint",children:g})]}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:u,onBack:l})]})}function us(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:a,canGoBack:o,onBack:s}=e;return Vo(Bi,{children:[Vo("div",{className:"question-container",children:Vo(rs,{question:t,forceDisableHtml:r})}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>a("link clicked"),canGoBack:o,onBack:s})]})}function ls(e){var t,{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d=r.scale,h=10===r.scale?0:1,[v,f]=wa((()=>or(u)?u:Xt(u)&&u.length>0&&or(parseInt(u[0]))?parseInt(u[0]):nr(u)&&or(parseInt(u))?parseInt(u):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:m}=Eo(),y=e=>m?s(e):o(e);return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:r,forceDisableHtml:n}),Vo("div",{className:"rating-section",children:[Vo("div",{className:"rating-options",children:["emoji"===r.display&&Vo("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=ps[r.scale])?void 0:t.map(((e,t)=>Vo("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===v?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;f(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&Vo("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:ms(r.scale).map(((e,t)=>Vo(cs,{displayQuestionIndex:i,active:v===e,appearance:a,num:e,setActiveNumber(e){f(e),r.skipSubmitButton&&y(e)}},t)))})]}),!p&&Vo("div",{className:"rating-text",children:[Vo("div",{children:r.lowerBoundLabel}),Vo("div",{children:r.upperBoundLabel})]})]})]}),Vo(ts,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:ir(v)&&!r.optional,appearance:a,onSubmit:()=>o(v),onPreviewSubmit:()=>s(v),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:c})]})}function cs(e){var{num:t,active:r,displayQuestionIndex:n,setActiveNumber:i}=e;return Vo("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+n+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){i(t)},children:t})}function ds(e){var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d=xa(null),h=Sa((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=_o(t,To(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[v,f]=wa((()=>((e,t)=>nr(e)||os(e)?e:t===Aa.SingleChoice?null:[])(u,t.type))),[p,m]=wa((()=>((e,t)=>{if(nr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(os(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:y}=Eo(),g=t.type===Aa.SingleChoice,b=t.type===Aa.MultipleChoice,w=t.skipSubmitButton&&g&&!t.hasOpenChoice,k=(e,t)=>{if(t){var n=!p.isSelected;return m((e=>r({},e,{isSelected:n,inputValue:n?e.inputValue:""}))),g&&f(""),void(n&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(g)return f(e),m((e=>r({},e,{isSelected:!1,inputValue:""}))),void(w&&(o(e),y&&s(e)));b&&Xt(v)&&(v.includes(e)?f(v.filter((t=>t!==e))):f([...v,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;m((e=>r({},e,{inputValue:t}))),g&&f(t)},S=e=>{e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),m((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&f(null))},C=()=>!(t.optional||!ir(v)&&(!Xt(v)||p.isSelected||0!==v.length)&&(!p.isSelected||""!==p.inputValue.trim())),I=()=>{p.isSelected&&b?Xt(v)&&(y?s([...v,p.inputValue]):o([...v,p.inputValue])):y?s(v):o(v)};return Vo(Bi,{children:[Vo("div",{className:"question-container",children:[Vo(rs,{question:t,forceDisableHtml:n}),Vo("fieldset",{className:"multiple-choice-options limit-height",children:[Vo("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),h.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?p.isSelected:g?v===e:Xt(v)&&v.includes(e);return Vo("label",{className:n?"choice-option-open":"",children:[Vo("div",{className:"response-choice",children:[Vo("input",{type:g?"radio":"checkbox",name:a,checked:s,onChange:()=>k(e,n),id:a,"aria-controls":o}),Vo("span",{children:n?e+":":e})]}),n&&Vo("input",{type:"text",ref:d,id:o,name:"question"+i+"Open",value:p.inputValue,onKeyDown:S,onInput:x,onClick(t){p.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Vo(ts,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:a,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:w,canGoBack:l,onBack:c})]})}var hs=[1,2,3,4,5],vs=[1,2,3,4,5,6,7],fs=[0,1,2,3,4,5,6,7,8,9,10],ps={2:[Yo,Jo],3:[$o,Zo,zo],5:[Qo,$o,Zo,zo,Go]};function ms(e){switch(e){case 5:default:return hs;case 7:return vs;case 10:return fs}}var ys=un("[Surveys]");function gs(e,t,r){var n,i=e.questions[t],a=t+1;if(null==(n=i.branching)||!n.type)return t===e.questions.length-1?Da.End:a;if(i.branching.type===Da.End)return Da.End;if(i.branching.type===Da.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Da.ResponseBased){if(i.type===Aa.SingleChoice){var o,s=i.choices.indexOf(""+r);if(-1===s&&i.hasOpenChoice&&(s=i.choices.length-1),null!=(o=i.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=i.branching.responseValues[s];return Number.isInteger(u)?u:u===Da.End?Da.End:a}}else if(i.type===Aa.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===Da.End?Da.End:a}}return a}return ys.warn("Falling back to next question index due to unexpected branching type"),a}var bs=un("[SurveyTranslations]");function ws(e,t){var r=function(e){return function(e,t){var{overrideLanguage:r,storedPersonProperties:n,locale:i}=e,a=za(r);if(a)return null==t||t.info("Using override display language: "+a),a;var o=function(e){return e&&"object"==typeof e&&"language"in e?za(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=za(i);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:er(e.get_property)?e.get_property("$stored_person_properties"):void 0,locale:navigator.language||navigator.userLanguage},bs)}(t);if(!r)return bs.info("No user language detected"),{survey:e,language:null};var n=Qa(e,r,bs);return{survey:n.survey,language:n.matchedKey}}var ks=Kr,xs=tn,Ss="ph:show_survey_widget",Cs="PHWidgetSurveyClickListener";function Is(e,t){try{var r=e.getBoundingClientRect(),n=ks.innerHeight,i=ks.innerWidth,a=r.left+r.width/2-t/2;a+t>i-20&&(a=i-t-20),20>a&&(a=20);var o=n-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?n-r.top+12+"px":"auto",zIndex:go.zIndex}}catch(e){return Ga.warn("Failed to calculate trigger position:",e),null}}class Ms{constructor(e){var t=this;this.B=new Map,this.H=new Map,this.j=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Bo(t)&&Mo(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var n,i,a,o,{survey:s,language:u}=this.U(e),l=null!=t&&t.position||null!=t&&t.selector?r({},s,{appearance:r({},s.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):s;this.W(l.id);var{properties:c,initialResponses:d}=null!=t?t:{},h=!(!d||0>=Object.keys(d).length)&&this.V(l,d,c,u);if(!h||null!=(n=l.appearance)&&n.displayThankYouMessage){this.Z(l);var v={};if((null==(i=l.appearance)?void 0:i.position)===Na.NextToTrigger&&null!=(a=l.appearance)&&a.widgetSelector){var f,p=xs.querySelector(l.appearance.widgetSelector);p&&(v=Is(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||go.maxWidth))||{})}var m=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:y}=xo(l,this._posthog),g={posthog:this._posthog,survey:l,removeSurveyFromFocus:this.$,properties:c,style:v,isSurveyCompleted:h,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:u};if(0>=m)return aa(Vo(Ls,r({},g)),y);var b=setTimeout((()=>{if(this.B.delete(l.id),!this.G(l))return Ga.info("Survey "+l.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(l);aa(Vo(Ls,r({},g,{survey:r({},l,{appearance:r({},l.appearance,{surveyPopupDelaySeconds:0})})})),y)}),1e3*m);this.B.set(l.id,b)}},this.Y=e=>{var{survey:t,language:r}=this.U(e),{shadow:n,isNewlyCreated:i}=xo(t,this._posthog);i&&aa(Vo(Es,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),n)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Cs),this.H.delete(e.id),Ga.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=xs.querySelector(t),n=this.H.get(e.id);if(r){if(this.Y(e),n){if(r===n.element)return;Ga.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(Cs)){var i=t=>{var r,n;t.stopPropagation();var i=(null==(r=e.appearance)?void 0:r.position)===Na.NextToTrigger?Is(t.currentTarget,parseInt((null==(n=e.appearance)?void 0:n.maxWidth)||go.maxWidth)):{};ks.dispatchEvent(new CustomEvent(Ss,{detail:{surveyId:e.id,position:i}}))};hn(r,"click",i),r.setAttribute(Cs,"true"),this.H.set(e.id,{element:r,listener:i,survey:e}),Ga.info("Attached click listener for feedback button survey "+e.id)}}else n&&this.J(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.U(e),{shadow:n}=xo(t,this._posthog);aa(Vo(Ls,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,surveyLanguage:r}),n)},this.renderSurvey=(e,t,r)=>{var n,{survey:i,language:a}=this.U(e),o=!1;null!=(n=this._posthog.config)&&null!=(n=n.surveys)&&n.prefillFromUrl&&(o=this.ee(i,a)),aa(Vo(Ls,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:a}),t)},this.getActiveMatchingSurveys=function(e,r){var n;void 0===r&&(r=!1),null==(n=t._posthog)||null==(n=n.surveys)||n.getSurveys((r=>{var n=r.filter((e=>t.G(e)));e(n)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Pa.Popover||e.type===Pa.Widget)),n=new Set(r.map((e=>e.id)));for(var i of Array.from(t.B.keys()))n.has(i)||t.cancelSurvey(i);var a=t.te(r),o=new Set;a.forEach((e=>{if(e.type===Pa.Widget){var r,n,i,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Ea.Tab)return void t.Y(e);(null==(n=e.appearance)?void 0:n.widgetType)===Ea.Selector&&null!=(i=e.appearance)&&i.widgetSelector&&(o.add(e.id),t.X(e,null==(a=e.appearance)?void 0:a.widgetSelector))}ir(t.re)&&e.type===Pa.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var{survey:r}=e;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{ir(this.re)||Ga.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Ga.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.B.get(e);t&&(clearTimeout(t),this.B.delete(e))}cancelSurvey(e){this.B.has(e)&&(Ga.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,n,i=Bo(e),a=Bo(t);if(i&&!a)return-1;if(!i&&a)return 1;var o=e.schedule===Fa,s=t.schedule===Fa;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(n=t.appearance)?void 0:n.surveyPopupDelaySeconds)||0)}))}U(e){return ws(e,this._posthog)}ee(e,t){if(this.j.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,n=e.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:r};var i=n.split("&");for(var a of i){var[o,s]=a.split("=");if(o&&!rr(s)){var u=decodeURIComponent(o),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var c=u.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(l)}}else r=!0}}return{params:t,autoSubmit:r}}(ks.location.search);if(0===Object.keys(r).length)return!1;Ga.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(e,r,t);if(!n)return!1;var{responses:i,submissionId:a,isSurveyCompleted:o,skippedResponses:s}=n;return(Object.keys(s).length>0&&e.enable_partial_responses||o)&&So({responses:o?i:s,survey:e,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.j.add(e.id),o}V(e,t,r,n){var i={};for(var[a,o]of Object.entries(t))i[parseInt(a)]=Xt(o)?o.map(String):[String(o)];Ga.info("[Survey] Processing initial responses");var s=this.ne(e,i,n);if(!s)return!1;var{responses:u,submissionId:l,isSurveyCompleted:c}=s;return So({responses:u,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:c,properties:r,surveyLanguage:n}),c}ne(e,t,r){try{var n=function(e,t){var r={};return e.questions.forEach(((e,n)=>{if(t[n]&&e.id){var i=t[n],a=ja(e.id);try{switch(e.type){case Aa.SingleChoice:if(!e.choices||0===e.choices.length)return void sn.warn("[Survey Prefill] Question "+n+" has no choices");var o=parseInt(i[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void sn.warn("[Survey Prefill] Invalid choice index for q"+n+": "+i[0]);r[a]=e.choices[o];break;case Aa.MultipleChoice:if(!e.choices||0===e.choices.length)return void sn.warn("[Survey Prefill] Question "+n+" has no choices");var s=i.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void sn.warn("[Survey Prefill] No valid choices for q"+n);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&sn.warn("[Survey Prefill] Removed duplicate choices for q"+n),r[a]=u;break;case Aa.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void sn.warn("[Survey Prefill] Invalid rating for q"+n+": "+i[0]+" (scale: 0-"+c+")");r[a]=l;break;default:sn.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){sn.error("[Survey Prefill] Error converting q"+n+":",e)}}})),r}(e,t);if(0===Object.keys(n).length)return Ga.warn("[Survey Prefill] No valid responses after conversion"),null;var i=oo(),a=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:s}=function(e,t,r){for(var n=0,i={},a=e.questions.length+1;e.questions.length>n&&a>0&&t.includes(n);){var o=e.questions[n];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var s=ja(o.id);rr(r[s])||(i[s]=r[s])}var u=gs(e,n,o.id?r[ja(o.id)]:null);if(u===Da.End)return{startQuestionIndex:e.questions.length,skippedResponses:i};n=u}return{startQuestionIndex:n,skippedResponses:i}}(e,a,n),u=o>=e.questions.length;return Do(e,{surveySubmissionId:i,responses:n,lastQuestionIndex:o,surveyLanguage:r}),Ga.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:n,submissionId:i,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:s}}catch(e){return Ga.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var n,i=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),a=!0;return t&&(a=(null==(n=this._posthog.featureFlags)?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&a}ae(e){return!e.conditions||qo(e)&&Po(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==mo||!mo.querySelector(e.conditions.selector))}(e)}oe(e){return Lo(e)||this.ie(e.internal_targeting_flag_key)||Bo(e)}checkSurveyEligibility(e){var t,r,n={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return n.eligible=!1,n.reason="Survey is not running. It was completed on "+e.end_date,n;if(!eo.includes(e.type))return n.eligible=!1,n.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",n;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ie(e.linked_flag_key,i)?this.ie(e.targeting_flag_key)?this.oe(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,n=new Date,i=Math.abs(n.getTime()-r.getTime());return Math.ceil(i/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,vo.P("lastSeenSurveyDate"))?(e=>!!vo.P(Ka(e))&&!Lo(e))(e)?(n.eligible=!1,n.reason="Survey has already been seen and it can't be activated again",n):n:(n.eligible=!1,n.reason="Survey wait period has not passed",n):(n.eligible=!1,n.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",n):(n.eligible=!1,n.reason="Survey targeting feature flag is not enabled",n):(n.eligible=!1,n.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",n)}se(e){var t;if(!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ie(r)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=xs.querySelector(jo(e,!0));null!=t&&t.shadowRoot&&aa(null,t.shadowRoot),null==t||t.remove()}catch(t){Ga.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.B,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function Ts(e,t){if(xs&&ks){var r,n=new Ms(e);if(e.config.disable_surveys_automatic_display)return Ga.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===t)return Ga.info("There are no surveys to load or Surveys is disabled in the project settings."),n;n.callSurveysAndEvaluateDisplayLogic(!0);var i=()=>{rr(r)&&(r=setInterval((()=>{n.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return i(),hn(xs,"visibilitychange",(()=>{xs.hidden?rr(r)||(clearInterval(r),r=void 0):(n.callSurveysAndEvaluateDisplayLogic(!1),i())})),n}}function _s(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:n,isPreviewMode:i=!1}=e;ka((()=>{var e;if(!i&&null!=(e=t.conditions)&&e.url){var a=()=>{var e,i=t.type===Pa.Widget,a=qo(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Ea.Tab&&i;if(!a)return Ga.info("Hiding survey "+t.id+" because URL does not match"),n(!1),r(t);o&&(Ga.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};hn(ks,"popstate",a),hn(ks,"hashchange",a);var o=ks.history.pushState,s=ks.history.replaceState;return ks.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),a()},ks.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];s.apply(this,t),a()},()=>{ks.removeEventListener("popstate",a),ks.removeEventListener("hashchange",a),ks.history.pushState=o,ks.history.replaceState=s}}}),[i,t,r,n])}function Rs(e){switch(void 0===e&&(e=qa.Right),e){case qa.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case qa.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case qa.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ls(e){var t,n,i,a,o,s,{survey:u,forceDisableHtml:l,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPreviewBack:m=(()=>{}),onPopupSurveyDismissed:y=(()=>{}),onCloseConfirmationMessage:g=(()=>{}),properties:b,isSurveyCompleted:w,skipShownEvent:k,surveyLanguage:x}=e,S=xa(null),C=Number.isInteger(h),I=null!=(t=u.appearance)&&t.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:M,isSurveySent:T,hidePopupWithViewTransition:_}=function(e,t,n,i,a,o,s,u,l){var[c,d]=wa(i||0===n||e.type===Pa.ExternalSurvey),[h,v]=wa(!1),f=()=>{var t=()=>{o&&a(e),d(!1)};xs.startViewTransition?xs.startViewTransition((()=>{var e;null==s||null==(e=s.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return ka((()=>{if(t){if(!i){var a=t=>{var r,n;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(n=e.appearance)&&n.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{if(qo(e)){d(!0),ks.dispatchEvent(new Event("PHSurveyShown")),u||t.capture(Ba.SHOWN,r({[Ha.SURVEY_NAME]:e.name,[Ha.SURVEY_ID]:e.id,[Ha.SURVEY_ITERATION]:e.current_iteration,[Ha.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},l&&{[Ha.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(hn(ks,"PHSurveyClosed",p),hn(ks,"PHSurveySent",a),n>0){var s=setTimeout(o,n);return()=>{clearTimeout(s),ks.removeEventListener("PHSurveyClosed",p),ks.removeEventListener("PHSurveySent",a)}}return o(),()=>{ks.removeEventListener("PHSurveyClosed",p),ks.removeEventListener("PHSurveySent",a)}}}else Ga.error("usePopupVisibility hook called without a PostHog instance.")}),[]),_s({survey:e,removeSurveyFromFocus:a,setSurveyVisible:d,isPreviewMode:i}),{isPopupVisible:c,isSurveySent:h,setIsPopupVisible:d,hidePopupWithViewTransition:f}}(u,c,I,C,v,f,S,k,x),R=T||h===u.questions.length||!0===w,L=Sa((()=>{var e=Fo(u),t=(null==e?void 0:e.surveySubmissionId)||oo();return{isPreviewMode:C,previewPageIndex:h,onPopupSurveyDismissed(){x?Io(u,c,C,x):Io(u,c,C),y()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,onPreviewBack:m,posthog:c,properties:b,surveyLanguage:x}}),[C,h,f,c,u,y,p,m,b,x]);return M?Vo(Oo.Provider,{value:L,children:Vo("div",{className:"ph-survey",style:r({},Uo(u.type,null==(n=u.appearance)?void 0:n.position,null==(i=u.appearance)?void 0:i.widgetType),d),ref:S,children:R?Vo(as,{header:(null==(a=u.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(s=u.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||go,onClose(){_(),g()}}):Vo(Os,{survey:u,forceDisableHtml:!!l,posthog:c})})}):null}function Os(e){var t,n,{survey:i,forceDisableHtml:a,posthog:o}=e,[s,u]=wa((()=>{var e=Fo(i);return null!=e&&e.responses&&Ga.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:c,isPopup:d,onPreviewSubmit:h,onPreviewBack:v,surveySubmissionId:f,isPreviewMode:p,properties:m,surveyLanguage:y}=Ca(Oo),[g,b]=wa((()=>{var e=Fo(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),[w,k]=wa((()=>{var e,t=Fo(i);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),x=Sa((()=>Ro(i)),[i]);ka((()=>{p&&!rr(l)&&b(l)}),[l,p]);var S=!(null==(t=i.appearance)||!t.allowGoBack)&&(p?(null!=l?l:0)>0:w.length>0),C=x.at(g);return C?Vo("form",{className:"survey-form",name:"surveyForm",children:[d&&!0!==(null==(n=i.appearance)?void 0:n.hideCancelButton)&&Vo(ns,{onClick(){c()}}),Vo("div",{className:"survey-box","data-question-index":g,children:Ns({question:C,forceDisableHtml:a,displayQuestionIndex:g,appearance:i.appearance||go,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:a}=e;if(o)if(a){var l=ja(a),c=r({},s,{[l]:t});u(c);var d=gs(i,n,t),h=d===Da.End,v=[...w,n];if(h||(k(v),b(d),Do(i,{surveySubmissionId:f,responses:c,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:y})),i.enable_partial_responses||h){var p=new Set(v.map((e=>{var t;return null==(t=x[e])?void 0:t.id})).filter((e=>!!e)).map((e=>ja(e)))),g=Object.fromEntries(Object.entries(c).filter((e=>{var[t]=e;return p.has(t)})));So({responses:g,survey:i,surveySubmissionId:f,isSurveyCompleted:h,posthog:o,properties:m,surveyLanguage:y})}}else Ga.error("onNextButtonClick called without a questionId.");else Ga.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:C.id}),onPreviewSubmit:h,initialValue:C.id?s[ja(C.id)]:void 0,canGoBack:S,onBack(){if(p)v();else if(0!==w.length){var e=w[w.length-1],t=w.slice(0,-1);k(t),b(e),Do(i,{surveySubmissionId:f,responses:s,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:y})}}})})]}):null}function Es(e){var t,r,n,i,a,o,s,{survey:u,forceDisableHtml:l,posthog:c,readOnly:d,surveyLanguage:h}=e,[v,f]=wa(!0),[p,m]=wa(!1),[y,g]=wa({}),b=()=>{m(!p)};if(ka((()=>{var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(Ga.info("Received show event for feedback button survey "+u.id),g(r.detail.position||{}),b())};return hn(ks,Ss,t),()=>{ks.removeEventListener(Ss,t)}}}else Ga.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(n=u.appearance)?void 0:n.borderColor]),_s({survey:u,setSurveyVisible:f}),!v)return null;var w=()=>{u.schedule!==Fa&&f(!1),setTimeout((()=>{m(!1)}),200)};return Vo(Bi,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&Vo("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===qa.Top?"widget-tab-top":""),onClick:b,disabled:d,style:Rs(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),p&&Vo(Ls,{posthog:c,survey:u,forceDisableHtml:l,style:y,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:h})]})}var Ns=e=>{var{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:a,onSubmit:o,onPreviewSubmit:s,initialValue:u,canGoBack:l,onBack:c}=e,d={forceDisableHtml:n,appearance:a,onPreviewSubmit(e){s(e)},onSubmit(e){o(e)},initialValue:u,displayQuestionIndex:i,canGoBack:l,onBack:c};switch(t.type){case Aa.Open:return Di(ss,r({},d,{question:t,key:t.id}));case Aa.Link:return Di(us,r({},d,{question:t,key:t.id}));case Aa.Rating:return Di(ls,r({},d,{question:t,key:t.id}));case Aa.SingleChoice:case Aa.MultipleChoice:return Di(ds,r({},d,{question:t,key:t.id}));default:return Ga.error("Unsupported question type: "+t.type),null}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.generateSurveys=Ts,nn.extendPostHogWithSurveys=Ts;var qs=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Ps=(e,t,r)=>{var n=JSON.stringify(e);if(r.remaining>=n.length)return qs(t,n,r);if(r.truncated=!0,2>r.remaining)return!1;for(var i=0,a=Math.min(e.length,r.remaining-2);a>i;){var o=Math.ceil((i+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:i=o}return qs(t,JSON.stringify(e.slice(0,i)),r)},As=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Ds=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},Fs=(e,t,r)=>{if(!r.truncated)if(tr(e)){if(r.seen.has(e))return void Ds(t||"circular","[Circular]",r);r.seen.add(e);try{for(var n in e)try{if(!{}.hasOwnProperty.call(e,n))continue;if(Fs(e[n],t?t+"."+n:n,r),r.truncated)return}catch(e){continue}}catch(e){}}else Ds(t,e,r)},Bs=function(e,t,r,n,i,a){if(void 0===i&&(i=!1),!As(e))return!i||qs(t,"null",r);if(ir(e)||(e=>{try{return or(e)||sr(e)}catch(e){return!1}})(e))return qs(t,JSON.stringify(e),r);if("string"==typeof e)return Ps(e,t,r);if(!tr(e)&&!Xt(e))return qs(t,JSON.stringify(e),r);if(n.has(e))return Ps("[Circular]",t,r);n.add(e);try{var o=e.toJSON;if(er(o))return Bs(o.call(e),t,r,n,i)}catch(e){}try{var s={}.toString.call(e);if("[object String]"===s)return Ps(String(e.valueOf()),t,r);if("[object Number]"===s||"[object Boolean]"===s)return qs(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var u={};try{for(var l in e)({}).hasOwnProperty.call(e,l)&&(u[l]=e[l])}catch(e){}try{u.name=e.name}catch(e){}try{u.message=e.message}catch(e){}try{u.stack=e.stack}catch(e){}return Bs(u,t,r,n,i,a)}if(Xt(e)){if(!qs(t,"[",r))return!1;for(var c=0;e.length>c;c++){if(c>0&&!qs(t,",",r))return!1;var d=void 0;try{d=e[c]}catch(e){d=void 0}if(!Bs(d,t,r,n,!0))return!1}return qs(t,"]",r)}if(!qs(t,"{",r))return!1;var h=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(a)try{Fs(f,v,a)}catch(e){}if(As(f)){var p=(h?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var m=t.length,y=r.remaining,g=r.truncated;if(!qs(t,p,r))return!1;var b=t.length,w=Bs(f,t,r,n,!1),k=r.truncated;if(t.length!==b){if(h=!1,!w)return!1}else if(t.length=m,r.remaining=y,r.truncated=w?g:k,!w)return!1}}}catch(e){}return qs(t,"}",r)},Hs={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.logs={initializeLogs(e){var t={host:nn.location.host},n=function(n){var i;nn.console[n]=(i=nn.console[n],function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];try{if(o.length>0&&e.is_capturing()){var u,{body:l,truncated:c,attributes:d}=((e,t)=>{for(var r=[],n={remaining:1e4,truncated:!1},i=tr(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,a=0;e.length>a&&(0>=a||qs(r," ",n))&&Bs(e[a],r,n,new WeakSet,!1,0===a?i:void 0);a++);return{body:r.join("")+(n.truncated?"...":""),truncated:n.truncated,attributes:(null==i?void 0:i.result)||{}}})(o),h=r({},t,c?{body_truncated:"true"}:{});null==(u=e.logs)||u.le({level:Hs[n],body:l,attributes:r({"log.source":"console."+n},h,d)})}}catch(e){}finally{i.apply(nn.console,o)}})};for(var i of Object.keys(Hs))n(i)}},un("[Error tracking]");var js=un("[ExceptionAutocapture]"),Us=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Xt(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:n,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var n of r.modifiers)t=yield n(t);return t}))()}convertToExceptionList(e,t){var n,i,a,o={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(a=e.synthetic)&&void 0!==a&&a}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var s=[o];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),s}buildParsingContext(e){var t;return{chunkIdMap:Dr(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,n){void 0===n&&(n=0);var i=(r,n)=>{if(4>=n){var i=this.buildCoercingContext(e,t,n);return this.applyCoercers(r,i)}};return r({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,n),next:e=>i(e,n+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=nr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return cr(e,"DOMException")}isDOMError(e){return cr(e,"DOMError")}},new class{match(e){return cr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!dr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return lr(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return cr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return dr(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+Jr(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return dr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Jr(e)}isSeverityLevel(e){return nr(e)&&!(e=>nr(e)&&0===e.trim().length)(e)&&Yr.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,[n,i]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(Gr);return n&&(t=n[1],r=n[2]),[t,r]}},new class{match(e){return lr(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var a=[],o=t.split("\n"),s=i;o.length>s;s++){var u=o[s];if(1024>=u.length){var l=Qr.test(u)?u.replace(Qr,"$1"):u;if(!l.match(/\S*Error: /)){for(var c of n){var d=c(l,e);if(d){a.push(d);break}}if(a.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return r({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Fr});var n}))}(a)}}("web:javascript",Vr,$r)),Ws={wrapOnError(e){var t=Kr;t||js.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),a=0;n>a;a++)i[a]=arguments[a];var o=Us.buildFromUnknown(i[4]||i[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Kr;t||js.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var n,i=Us.buildFromUnknown(t,{mechanism:{handled:!1}});return e(i),null!==(n=null==r?void 0:r(t))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||js.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,n=arguments.length,i=new Array(n),a=0;n>a;a++)i[a]=arguments[a];t=1==i.length?i[0]:i.join(" ");var o=i.find((e=>e instanceof Error)),s=Us.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(s),null==r?void 0:r(...i)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.errorWrappingFunctions=Ws,nn.posthogErrorWrappingFunctions=Ws;var Vs="X-POSTHOG-SESSION-ID",zs="X-POSTHOG-WINDOW-ID",Zs="X-POSTHOG-DISTINCT-ID",$s=[Vs,zs,Zs],Qs=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Gs=(e,t)=>({}.hasOwnProperty.call(e,t)),Ys=e=>"object"==typeof e&&!ir(e)||er(e),Js=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Ks=e=>{try{var t;return Js(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Kr||null==(t=Kr.location)?void 0:t.href).toString()}catch(e){return}},Xs=(e,t,r,n,i)=>{var a;try{a=new URL(n).hostname}catch(e){return!1}if(!e)return!1;if(Xt(e)&&!e.includes(a))return!1;var o=!1;if(r){var{sessionId:s,windowId:u}=r.checkAndGetSessionAndWindowId(!0);i.set(Vs,s),i.set(zs,u),o=!0}var l=(e=>er(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(i.set(Zs,l),o=!0),o};nn.__PosthogExtensions__=nn.__PosthogExtensions__||{};var eu={_patchFetch:(e,t,n)=>fn(Kr,"fetch",(i=>function(a,o){var s=arguments.length>1?[a,o]:[a],u=s;try{var l=Ks(a);if(l)if(Js(a)){var c=new Request(a,o);Xs(e,t,n,c.url,c.headers),u=[c]}else{var d=new Headers(Ys(o)?o.headers:void 0);if(Xs(e,t,n,l,d)){var h=((e,t)=>{if(rr(e)||ir(e))return{headers:t};if(Ys(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(n);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>Gs(e,t)?Reflect.get(e,t):Reflect.get(n,t,n),has:(e,t)=>Gs(e,t)||t in n,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach((e=>t.add(e))),Qs.forEach((e=>{e in n&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&Qs.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,t,n)}};var a=Reflect.getOwnPropertyDescriptor(n,t);return a?r({},a,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})}})(o,d);h&&(u=[a,h])}}}catch(e){u=s}return i.apply(this,u)})),_patchXHR:(e,t,r)=>fn(Kr.XMLHttpRequest.prototype,"open",(n=>function(i,a,o,s,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=Ks(a);d&&Xs(e,t,r,d,c);var h=n.call(l,i,a,o,s,u);return $s.forEach((e=>{var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),h}))};nn.__PosthogExtensions__.tracingHeadersPatchFns=eu,nn.postHogTracingHeadersPatchFns=eu;var tu=-1,ru=e=>{addEventListener("pageshow",(t=>{t.persisted&&(tu=t.timeStamp,e(t))}),!0)},nu=(e,t,r,n)=>{var i,a;return o=>{t.value>=0&&(o||n)&&((a=t.value-(null!=i?i:0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},iu=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},au=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ou=()=>{var e,t;return null!==(e=null==(t=au())?void 0:t.activationStart)&&void 0!==e?e:0},su=function(e,t){void 0===t&&(t=-1);var r=au(),n="navigate";return 0>tu?r&&(document.prerendering||ou()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))):n="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},uu=new WeakMap;function lu(e,t){var r=uu.get(t);return r||(r=new WeakMap,uu.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class cu{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&1e3>e.startTime-n.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var du,hu=function(e,t,n){void 0===n&&(n={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(r({type:e,buffered:!0},n)),i}}catch(e){}},vu=e=>{var t=!1;return()=>{t||(e(),t=!0)}},fu=-1,pu=new Set,mu=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,yu=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of pu)t();isFinite(fu)||(fu="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",yu,!0))}},gu=()=>{if(0>fu){var e,t=ou(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;fu=null!=r?r:mu(),addEventListener("visibilitychange",yu,!0),addEventListener("prerenderingchange",yu,!0),ru((()=>{setTimeout((()=>{fu=mu()}))}))}return{get firstHiddenTime(){return fu},onHidden(e){pu.add(e)}}},bu=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},wu=[1800,3e3],ku=function(e,t){void 0===t&&(t={}),bu((()=>{var r,n=gu(),i=su("FCP"),a=hu("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),n.firstHiddenTime>t.startTime&&(i.value=Math.max(t.startTime-ou(),0),i.entries.push(t),r(!0)))}));a&&(r=nu(e,i,wu,t.reportAllChanges),ru((n=>{i=su("FCP"),r=nu(e,i,wu,t.reportAllChanges),iu((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},xu=[.1,.25],Su=0,Cu=1/0,Iu=0,Mu=e=>{for(var t of e)t.interactionId&&(Cu=Math.min(Cu,t.interactionId),Iu=Math.max(Iu,t.interactionId),Su=Iu?(Iu-Cu)/7+1:0)},Tu=()=>{var e;return du?Su:null!==(e=performance.interactionCount)&&void 0!==e?e:0},_u=0;class Ru{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){_u=Tu(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((Tu()-_u)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),n=this.u.get(e.interactionId);if(n||10>this.l.length||e.duration>r.L){var i;if(n?e.duration>n.L?(n.entries=[e],n.L=e.duration):e.duration===n.L&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(this.u.set((n={id:e.interactionId,entries:[e],L:e.duration}).id,n),this.l.push(n)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(i=this.p)||i.call(this,n)}}}}var Lu=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=vu(e),i=-1,a=()=>{r(i),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),i=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}))}},Ou=[200,500];class Eu{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Nu=[2500,4e3],qu={onLCP(e,t){void 0===t&&(t={}),bu((()=>{var r,n=gu(),i=su("LCP"),a=lu(t,Eu),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),n.firstHiddenTime>o.startTime&&(i.value=Math.max(o.startTime-ou(),0),i.entries=[o],r())},s=hu("largest-contentful-paint",o);if(s){r=nu(e,i,Nu,t.reportAllChanges);var u=vu((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Lu(u),removeEventListener(e.type,l,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,l,{capture:!0});ru((n=>{i=su("LCP"),r=nu(e,i,Nu,t.reportAllChanges),iu((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=gu();ku(vu((()=>{var n,i=su("CLS",0),a=lu(t,cu),o=e=>{for(var t of e)a.h(t);a.i>i.value&&(i.value=a.i,i.entries=a.o,n())},s=hu("layout-shift",o);s&&(n=nu(e,i,xu,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),ru((()=>{a.i=0,i=su("CLS",0),n=nu(e,i,xu,t.reportAllChanges),iu(n)})),setTimeout(n))})))},onFCP:ku,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=gu();bu((()=>{var n;"interactionCount"in performance||du||(du=hu("event",Mu,{durationThreshold:0}));var i,a=su("INP"),o=lu(t,Ru),s=e=>{Lu((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,i())}))},u=hu("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=nu(e,a,Ou,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),i(!0)})),ru((()=>{o.v(),a=su("INP"),i=nu(e,a,Ou,t.reportAllChanges)})))}))}}};function Pu(e,t){return t.length>e?t.slice(0,e)+"...":t}function Au(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!bn(t));return t}function Du(e,t){var n,i,{e:a,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:u,disableCaptureUrlHashes:l}=t;if(!bn(e))return{props:{}};for(var c=[e],d=e;d.parentNode&&!wn(d,"body");)if(kn(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!bn(d.parentNode))break;c.push(d.parentNode),d=d.parentNode}var h,v,f,p,m=[],y={},g=!1,b=!1;if(ln(c,(e=>{var t=Ln(e);if(wn(e,"a")){var r=e.getAttribute("href");g=!!(t&&r&&Fn(r))&&(l?Er(r):r)}Qt(Sn(e),"ph-no-capture")&&(b=!0),m.push(function(e,t,r,n,i){void 0===i&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};In.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?Pu(1024,Bn(e)):Pu(1024,Cn(e)));var s=Sn(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),ln(e.attributes,(function(r){var a;if((!On(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==n||!n.includes(r.name))&&!t&&Fn(r.value)&&(!nr(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=xn(s).join(" ")),o["attr__"+r.name]=Pu(1024,"href"===r.name&&i?Er(s):s)}}));for(var u=1,l=1,c=e;c=Au(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var n=function(e){if(!Ln(e))return{};var t={};return ln(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&Fn(n)&&(t[r]=n)}})),t}(e);cn(y,n)})),b)return{props:{},explicitNoCapture:b};if(s||(m[0].$el_text=wn(e,"a")||wn(e,"button")?Bn(e):Cn(e)),g){var w,k;m[0].attr__href=g;var x=null==(v=g,f=null==tn?void 0:tn.createElement("a"),w=rr(f)?null:(f.href=v,f))?void 0:w.host,S=null==Kr||null==(k=Kr.location)?void 0:k.host;x&&S&&x!==S&&(h=g)}return{props:cn({$event_type:a.type,$ce_version:1},{$elements:m},{$elements_chain:(p=m,function(e){var t=e.map((e=>{var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var a of(e.attr_class.sort(),e.attr_class))i+="."+a.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),s={};return dn(o).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return s[jn(t.toString())]=jn(r.toString())})),(i+=":")+dn(s).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Un(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return dn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(p)))},null!=(n=m[0])&&n.$el_text?{$el_text:null==(i=m[0])?void 0:i.$el_text}:{},h&&"click"===a.type?{$external_click_url:h}:{},y)}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.postHogWebVitalsCallbacks=qu,nn.postHogWebVitalsCallbacks=qu,nn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>qu,un("[AutoCapture]");var Fu={};function Bu(e){return function(e,t){var r=Fu[e];if(r)return r;var n,i=t[e];if(er(n=i)&&-1!==n.toString().indexOf("[native code]")&&!Kr.Zone)return Fu[e]=i.bind(t);var a=t.document;if(a&&er(a.createElement))try{var o=a.createElement("iframe");o.hidden=!0,a.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(i=s[e]),a.head.removeChild(o)}catch(t){sn.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&er(i)?Fu[e]=i.bind(t):i}("MutationObserver",e)}function Hu(e,t){return or(e)&&e>=t}class ju{ce(e){var t,r,n,i,a,o=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:o.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(e,t){this.ve=[],this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.fe=e=>{var t=function(e){var t=function(e){return rr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);ir(t)||this.pe(t)||this.ve.push(t),this.ve.length&&rr(this.me)&&(this.me=nn.setTimeout((()=>{this.ye()}),1e3))},this.ge=()=>{var e=Date.now();e%50==0&&this.ve.forEach((t=>{rr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.be=()=>{this.we=Date.now()},this.ke=()=>{"visible"===(null==tn?void 0:tn.visibilityState)&&(this.xe=Date.now())},this.instance=e,this.Se=this.ce(t),this._onCapture=this.Se.__onCapture}start(e){this.Ce(),this.Ie(),this.Me(),this.Te(),this._e(e)}_e(e){if(!this.Re){var t=Bu(nn);this.Re=new t((e=>{this.Le(e)})),this.Re.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Re)||e.disconnect(),this.Re=void 0,nn.removeEventListener("click",this.fe),nn.removeEventListener("scroll",this.ge,{capture:!0}),nn.removeEventListener("selectionchange",this.be),null==tn||tn.removeEventListener("visibilitychange",this.ke)}Le(e){this.Oe=Date.now()}Ce(){hn(nn,"click",this.fe)}Ie(){hn(nn,"scroll",this.ge,{capture:!0})}Me(){hn(nn,"selectionchange",this.be)}Te(){hn(tn,"visibilitychange",this.ke)}pe(e){if(!e)return!0;if(!this.Se.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t,r;if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var n=this.ve.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!n&&!wn(e.node,"html")&&bn(e.node)&&!function(e){if(!Kr||_n(e))return!1;var{targetElementList:t}=Rn(e);return t.some((e=>wn(e,"a")))}(e.node)&&function(e,t){var r;if(!Kr||_n(e))return!1;var n=sr(t)?Tn:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:Tn,{targetElementList:i}=Rn(e);return!function(e,t){if(rr(t))return!0;var r,n=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var i of e)if(r=n(i))return r.v;return!1}(i,n)}(e.node,{css_selector_ignorelist:this.Se.css_selector_ignorelist}))}ye(){if(this.ve.length){clearTimeout(this.me),this.me=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Oe&&this.Oe>=t.timestamp?this.Oe-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.we&&this.we>=t.timestamp?this.we-t.timestamp:void 0,t.visibilityChangedDelayMs=this.xe?Math.abs(t.timestamp-this.xe):void 0;var n=Hu(t.scrollDelayMs,this.Se.scroll_threshold_ms),i=Hu(t.selectionChangedDelayMs,this.Se.selection_change_threshold_ms),a=Hu(t.mutationDelayMs,this.Se.mutation_threshold_ms),o=Hu(t.absoluteDelayMs,1.1*this.Se.mutation_threshold_ms),s=or(t.scrollDelayMs)&&this.Se.scroll_threshold_ms>t.scrollDelayMs,u=or(t.mutationDelayMs)&&this.Se.mutation_threshold_ms>t.mutationDelayMs,l=or(t.selectionChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.selectionChangedDelayMs,c=or(t.visibilityChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(s||u||l||c)){var d=Hu(t.visibilityChangedDelayMs,this.Se.selection_change_threshold_ms);n||a||o||i||d?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Oe,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:a,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:i,$dead_click_visibility_changed_timeout:d}):this.Se.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ve.length&&rr(this.me)&&(this.me=nn.setTimeout((()=>{this.ye()}),1e3))}}he(e,t){this.instance.capture("$dead_click",r({},t,Du(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}nn.__PosthogExtensions__=nn.__PosthogExtensions__||{},nn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new ju(e,t)}();
|
|
2
2
|
//# sourceMappingURL=all-external-dependencies.js.map
|