posthog-js 1.174.2 → 1.174.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/all-external-dependencies.js +1 -15
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +2 -16
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +2 -16
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +2 -2
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +2 -2
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/main.js +2 -2
  14. package/dist/main.js.map +1 -1
  15. package/dist/module.d.ts +1 -0
  16. package/dist/module.full.d.ts +1 -0
  17. package/dist/module.full.js +2 -16
  18. package/dist/module.full.js.map +1 -1
  19. package/dist/module.full.no-external.d.ts +1 -0
  20. package/dist/module.full.no-external.js +2 -16
  21. package/dist/module.full.no-external.js.map +1 -1
  22. package/dist/module.js +2 -2
  23. package/dist/module.js.map +1 -1
  24. package/dist/module.no-external.d.ts +1 -0
  25. package/dist/module.no-external.js +2 -2
  26. package/dist/module.no-external.js.map +1 -1
  27. package/dist/recorder-v2.js +1 -15
  28. package/dist/recorder-v2.js.map +1 -1
  29. package/dist/recorder.js +1 -15
  30. package/dist/recorder.js.map +1 -1
  31. package/dist/src/entrypoints/recorder.d.ts +2 -2
  32. package/dist/src/sessionid.d.ts +1 -0
  33. package/lib/package.json +6 -5
  34. package/lib/src/entrypoints/recorder.d.ts +2 -2
  35. package/lib/src/entrypoints/recorder.js +6 -5
  36. package/lib/src/entrypoints/recorder.js.map +1 -1
  37. package/lib/src/sessionid.d.ts +1 -0
  38. package/lib/src/sessionid.js +1 -0
  39. package/lib/src/sessionid.js.map +1 -1
  40. package/package.json +6 -5
@@ -1,18 +1,4 @@
1
- !function(){"use strict";var e,t="2.0.0-alpha.13";function n(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function i(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function r(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n).map(s).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function s(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=r(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}!function(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||(e={}));class o{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function a(e){let{element:t,maskInputOptions:n,tagName:i,type:r,value:s,maskInputFn:o}=e,a=s||"";const c=r&&l(r);return(n[i.toLowerCase()]||c&&n[c])&&(a=o?o(a,t):"*".repeat(a.length)),a}function l(e){return e.toLowerCase()}const c="__rrweb_original__";function u(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?l(t):null}function d(e,t){var n;let i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==r?void 0:r[1])&&void 0!==n?n:null}let h=1;const p=new RegExp("[^a-z0-9-_:]"),g=-2;function f(){return h++}let m,v;const _=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,y=/^(?:[a-z+]+:)?\/\//i,b=/^www\..*/i,C=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(_,((e,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return e;if(y.test(a)||b.test(a))return`url(${l}${a}${l})`;if(C.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const I=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function k(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function x(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function E(){const e=document.createElement("a");return e.href="",e.href}function T(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?k(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function i(e){let i;const r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(S),!(n>=t.length);){let s=i(I);if(","===s.slice(-1))s=k(e,s.substring(0,s.length-1)),r.push(s);else{let i="";s=k(e,s);let o=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((s+i).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,r.push((s+i).trim());break}"("===e&&(o=!0)}i+=e,n+=1}}}return r.join(", ")}(e,i):"style"===n?w(i,E()):"object"===t&&"data"===n?k(e,i):i:k(e,i):i}function A(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t||"video"===e&&"src"===t&&n&&n.startsWith("blob:http")}function M(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&M(e.parentNode,t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&M(e.parentNode,t,n)}function R(e,t,n,i){try{const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(i){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(M(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(e){}return!1}function F(t,n){const{doc:i,mirror:s,blockClass:o,blockSelector:d,needsMask:h,inlineStylesheet:g,maskInputOptions:f={},maskTextFn:_,maskInputFn:y,dataURLOptions:b={},inlineImages:C,recordCanvas:I,keepIframeSrcFn:S,newlyAddedElement:k=!1}=n,M=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(i,s);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,n){const{doc:i,blockClass:s,blockSelector:o,inlineStylesheet:d,maskInputOptions:h={},maskInputFn:g,dataURLOptions:f={},inlineImages:_,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:C=!1,rootId:I}=n,S=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,s,o),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=l(e.tagName);return p.test(t)?"div":t}(t);let M={};const R=t.attributes.length;for(let e=0;e<R;e++){const n=t.attributes[e];A(k,n.name,n.value)||(M[n.name]=T(i,k,l(n.name),n.value))}if("link"===k&&d){const e=t.href;let n=Array.from(i.styleSheets).find((t=>t.href===e));if(!n&&e.includes(".css")){const t=window.location.origin+"/"+e.replace(window.location.href,"");n=Array.from(i.styleSheets).find((e=>e.href===t))}let s=null;n&&(s=r(n)),s&&(delete M.rel,delete M.href,M._cssText=w(s,n.href))}if("style"===k&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=r(t.sheet);e&&(M._cssText=w(e,E()))}if("input"===k||"textarea"===k||"select"===k){const e=t.value,n=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&e?M.value=a({element:t,type:u(t),tagName:k,value:e,maskInputOptions:h,maskInputFn:g}):n&&(M.checked=n)}"option"===k&&(t.selected&&!h.select?M.selected=!0:delete M.selected);if("canvas"===k&&y)if("2d"===t.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let i=0;i<e.height;i+=50){const r=t.getImageData,s=c in r?r[c]:r;if(new Uint32Array(s.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){const e=t.toDataURL(f.type,f.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(f.type,f.quality)&&(M.rr_dataURL=e)}if("img"===k&&_){m||(m=i.createElement("canvas"),v=m.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const r=()=>{e.removeEventListener("load",r);try{m.width=e.naturalWidth,m.height=e.naturalHeight,v.drawImage(e,0,0),M.rr_dataURL=m.toDataURL(f.type,f.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?M.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?r():e.addEventListener("load",r)}if("audio"===k||"video"===k){const e=M;e.rr_mediaState=t.paused?"paused":"played",e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}C||(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop));if(S){const{width:e,height:n}=t.getBoundingClientRect();M={class:M.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==k||b(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src);let F;try{customElements.get(k)&&(F=!0)}catch(e){}return{type:e.Element,tagName:k,attributes:M,childNodes:[],isSVG:x(t)||void 0,needBlock:S,rootId:I,isCustom:F}}(t,{doc:i,blockClass:o,blockSelector:d,inlineStylesheet:g,maskInputOptions:f,maskInputFn:y,dataURLOptions:b,inlineImages:C,recordCanvas:I,keepIframeSrcFn:S,newlyAddedElement:k,rootId:M});case t.TEXT_NODE:return function(t,n){var i;const{needsMask:s,maskTextFn:o,rootId:a}=n,l=t.parentNode&&t.parentNode.tagName;let c=t.textContent;const u="STYLE"===l||void 0,d="SCRIPT"===l||void 0;if(u&&c){try{t.nextSibling||t.previousSibling||(null===(i=t.parentNode.sheet)||void 0===i?void 0:i.cssRules)&&(c=r(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}c=w(c,E())}d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&s&&(c=o?o(c,t.parentElement):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:u,rootId:a}}(t,{needsMask:h,maskTextFn:_,rootId:M});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:M};default:return!1}}function N(e){return null==e?"":e.toLowerCase()}function O(t,r){const{doc:s,mirror:o,blockClass:a,blockSelector:l,maskTextClass:c,maskTextSelector:u,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskTextFn:v,maskInputFn:_,slimDOMOptions:y,dataURLOptions:b={},inlineImages:C=!1,recordCanvas:w=!1,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:T=(()=>!1),newlyAddedElement:A=!1}=r;let{needsMask:M}=r,{preserveWhiteSpace:P=!0}=r;if(!M&&t.childNodes){M=R(t,c,u,void 0===M)}const L=F(t,{doc:s,mirror:o,blockClass:a,blockSelector:l,needsMask:M,inlineStylesheet:p,maskInputOptions:m,maskTextFn:v,maskInputFn:_,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:T,newlyAddedElement:A});if(!L)return console.warn(t,"not serialized"),null;let D;D=o.hasNode(t)?o.getId(t):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===d(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(N(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(t.attributes.name)||"icon"===N(t.attributes.rel)||"apple-touch-icon"===N(t.attributes.rel)||"shortcut icon"===N(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&N(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(N(t.attributes.property).match(/^(og|twitter|fb):/)||N(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===N(t.attributes.name)||"googlebot"===N(t.attributes.name)||"bingbot"===N(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===N(t.attributes.name)||"generator"===N(t.attributes.name)||"framework"===N(t.attributes.name)||"publisher"===N(t.attributes.name)||"progid"===N(t.attributes.name)||N(t.attributes.property).match(/^article:/)||N(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===N(t.attributes.name)||"yandex-verification"===N(t.attributes.name)||"csrf-token"===N(t.attributes.name)||"p:domain_verify"===N(t.attributes.name)||"verify-v1"===N(t.attributes.name)||"verification"===N(t.attributes.name)||"shopify-checkout-api-token"===N(t.attributes.name)))return!0}}return!1}(L,y)&&(P||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?f():g;const $=Object.assign(L,{id:D});if(o.add(t,$),D===g)return null;I&&I(t);let q=!h;if($.type===e.Element){q=q&&!$.needBlock,delete $.needBlock;const e=t.shadowRoot;e&&i(e)&&($.isShadowHost=!0)}if(($.type===e.Document||$.type===e.Element)&&q){y.headWhitespace&&$.type===e.Element&&"head"===$.tagName&&(P=!1);const n={doc:s,mirror:o,blockClass:a,blockSelector:l,needsMask:M,maskTextClass:c,maskTextSelector:u,skipChild:h,inlineStylesheet:p,maskInputOptions:m,maskTextFn:v,maskInputFn:_,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:T};if($.type===e.Element&&"textarea"===$.tagName&&void 0!==$.attributes.value);else for(const e of Array.from(t.childNodes)){const t=O(e,n);t&&$.childNodes.push(t)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const r=O(e,n);r&&(i(t.shadowRoot)&&(r.isShadow=!0),$.childNodes.push(r))}}return t.parentNode&&n(t.parentNode)&&i(t.parentNode)&&($.isShadow=!0),$.type===e.Element&&"iframe"===$.tagName&&function(e,t,n){const i=e.contentWindow;if(!i)return;let r,s=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){const i=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(i),s=!0,t()}))}const o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&S){const n=O(e,{doc:e,mirror:o,blockClass:a,blockSelector:l,needsMask:M,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:v,maskInputFn:_,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:T});n&&S(t,n)}}),k),$.type===e.Element&&"link"===$.tagName&&"string"==typeof $.attributes.rel&&("stylesheet"===$.attributes.rel||"preload"===$.attributes.rel&&"string"==typeof $.attributes.href&&"css"===d($.attributes.href))&&function(e,t,n){let i,r=!1;try{i=e.sheet}catch(e){return}if(i)return;const s=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),r=!0,t()}))}(t,(()=>{if(x){const e=O(t,{doc:s,mirror:o,blockClass:a,blockSelector:l,needsMask:M,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:v,maskInputFn:_,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:T});e&&x(t,e)}}),E),$}function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}const L="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let D={map:{},getId:()=>(console.error(L),-1),getNode:()=>(console.error(L),null),removeNodeFromMap(){console.error(L)},has:()=>(console.error(L),!1),reset(){console.error(L)}};function $(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,o)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,o)}),c))}}function q(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>q(e,t,s||{},!0)}function B(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(D=new Proxy(D,{get:(e,t,n)=>("map"===t&&console.error(L),Reflect.get(e,t,n))}));let H=Date.now;function W(e){var t,n,i,r,s,o;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(i=null==a?void 0:a.body)||void 0===i?void 0:i.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(s=null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.parentElement)||void 0===s?void 0:s.scrollTop)||(null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.scrollTop)||0}}function U(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function V(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function G(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function Z(e,t,n,i){if(!e)return!1;const r=G(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(M(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function j(e,t){return t.getId(e)===g}function z(e,t){if(n(e))return!1;const i=t.getId(e);return!t.has(i)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||z(e.parentNode,t))}function Q(e){return Boolean(e.changedTouches)}function K(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Y(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function J(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(H=()=>(new Date).getTime());class X{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ee(e){var t,n;let i=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(i=e.getRootNode().host),i}function te(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ee(n);)n=t;return n}(e);return t.contains(n)}function ne(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||te(e))}var ie=(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))(ie||{}),re=(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))(re||{}),se=(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))(se||{}),oe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(oe||{}),ae=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ae||{});function le(e){return"__ln"in e}class ce{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&le(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&le(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ue=(e,t)=>`${e}@${t}`;class de{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,i=new ce,r=e=>{let t=e,n=g;for(;n===g;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},s=s=>{if(!s.parentNode||!ne(s)||"TEXTAREA"===s.parentNode.tagName)return;const o=n(s.parentNode)?this.mirror.getId(ee(s)):this.mirror.getId(s.parentNode),a=r(s);if(-1===o||-1===a)return i.addNode(s);const l=O(s,{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=>{K(e,this.mirror)&&this.iframeManager.addIframe(e),Y(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),J(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)pe(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||s(e);for(const e of this.addedSet)fe(this.droppedSet,e)||pe(this.removes,e,this.mirror)?fe(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let o=null;for(;i.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=i.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=t.parentNode.host;if(-1!==this.mirror.getId(i)){e=n;break}}}}}}if(!e){for(;i.head;)i.removeNode(i.head.value);break}o=e.previous,i.removeNode(e.value),s(e.value)}const a={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!j(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Z(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:R(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,G(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){const e=u(t);i=a({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(Z(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let r=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(t.contentDocument)return;n="rr_src"}if(r||(r={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(e.target,r)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!A(t.tagName,n,i)&&(r.attributes[n]=T(this.doc,l(t.tagName),l(n),i),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const i=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);i!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?r.styleDiff[e]=""===s?i:[i,s]:r._unchangedStyles[e]=[i,s]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}break}case"childList":if(Z(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),s=n(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Z(e.target,this.blockClass,this.blockSelector,!1)||j(t,this.mirror)||!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||z(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ue(r,s)]?he(this.movedSet,t):this.removes.push({parentId:s,id:r,isShadow:!(!n(e.target)||!i(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(j(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ue(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Z(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),J(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function he(e,t){e.delete(t),t.childNodes.forEach((t=>he(e,t)))}function pe(e,t,n){return 0!==e.length&&ge(e,t,n)}function ge(e,t,n){const{parentNode:i}=t;if(!i)return!1;const r=n.getId(i);return!!e.some((e=>e.id===r))||ge(e,i,n)}function fe(e,t){return 0!==e.size&&me(e,t)}function me(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||me(e,n))}let ve;function _e(e){ve=e}function ye(){ve=void 0}const be=e=>{if(!ve)return e;return function(){try{return e(...arguments)}catch(e){if(ve&&!0===ve(e))return;throw e}}},Ce=[];function we(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ie(e,t){var n,i;const r=new de;Ce.push(r),r.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const o=null===(i=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===i?void 0:i.call(n,"MutationObserver");o&&window[o]&&(s=window[o]);const a=new s(be(r.processMutations.bind(r)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Se(e){let{mouseInteractionCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,sampling:o}=e;if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];let u=null;return Object.keys(se).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let o=l(e);const a=(e=>n=>{const o=we(n);if(Z(o,r,s,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=oe.Mouse;break;case"touch":a=oe.Touch;break;case"pen":a=oe.Pen}a===oe.Touch?se[e]===se.MouseDown?l="TouchStart":se[e]===se.MouseUp&&(l="TouchEnd"):oe.Pen}else Q(n)&&(a=oe.Touch);null!==a?(u=a,(l.startsWith("Touch")&&a===oe.Touch||l.startsWith("Mouse")&&a===oe.Mouse)&&(a=null)):se[e]===se.Click&&(a=u,u=null);const c=Q(n)?n.changedTouches[0]:n;if(!c)return;const d=i.getId(o),{clientX:h,clientY:p}=c;be(t)(Object.assign({type:se[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(e);if(window.PointerEvent)switch(se[e]){case se.MouseDown:case se.MouseUp:o=o.replace("mouse","pointer");break;case se.TouchStart:case se.TouchEnd:return}c.push(P(o,a,n))})),be((()=>{c.forEach((e=>e()))}))}function ke(e){let{scrollCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,sampling:o}=e;return P("scroll",be($(be((e=>{const o=we(e);if(!o||Z(o,r,s,!0))return;const a=i.getId(o);if(o===n&&n.defaultView){const e=W(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})})),o.scroll||100)),n)}const xe=["INPUT","TEXTAREA","SELECT"],Ee=new WeakMap;function Te(e){return function(e,t){if(Fe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Fe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Fe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Fe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ae(e,t,n){let i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function Me(e,t){let{mirror:n,stylesheetManager:i}=e;var r,s,o;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null===(r=t.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(s=t.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===o?void 0:o.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var t;const n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==a&&-1!==a)try{i.adoptStyleSheets(e,a)}catch(e){}return n}}),be((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let i;!function(e,t){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),r(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(i=Ie(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:i,mirror:r}=e;if(!1===n.mousemove)return()=>{};const s="number"==typeof n.mousemove?n.mousemove:50,o="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=$(be((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),o),u=be($(be((e=>{const t=we(e),{clientX:n,clientY:i}=Q(e)?e.changedTouches[0]:e;a||(a=H()),l.push({x:n,y:i,id:r.getId(t),timeOffset:H()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?re.Drag:e instanceof MouseEvent?re.MouseMove:re.TouchMove)})),s,{trailing:!1})),d=[P("mousemove",u,i),P("touchmove",u,i),P("drag",u,i)];return be((()=>{d.forEach((e=>e()))}))}(e),s=Se(e),o=ke(e),l=function(e,t){let{viewportResizeCb:n}=e,{win:i}=t,r=-1,s=-1;return P("resize",be($(be((()=>{const e=U(),t=V();r===e&&s===t||(n({width:Number(t),height:Number(e)}),r=e,s=t)})),200)),i)}(e,{win:n}),c=function(e){let{inputCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:l,maskInputOptions:c,maskInputFn:d,sampling:h,userTriggeredOnInput:p}=e;function g(e){let t=we(e);const i=e.isTrusted,h=t&&t.tagName;if(t&&"OPTION"===h&&(t=t.parentElement),!t||!h||xe.indexOf(h)<0||Z(t,r,s,!0))return;if(t.classList.contains(o)||l&&t.matches(l))return;let g=t.value,m=!1;const v=u(t)||"";"radio"===v||"checkbox"===v?m=t.checked:(c[h.toLowerCase()]||c[v])&&(g=a({element:t,maskInputOptions:c,tagName:h,type:v,value:g,maskInputFn:d})),f(t,p?{text:g,isChecked:m,userTriggered:i}:{text:g,isChecked:m});const _=t.name;"radio"===v&&_&&m&&n.querySelectorAll(`input[type="radio"][name="${_}"]`).forEach((e=>{if(e!==t){const t=e.value;f(e,p?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function f(e,n){const r=Ee.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){Ee.set(e,n);const r=i.getId(e);be(t)(Object.assign(Object.assign({},n),{id:r}))}}const m=("last"===h.input?["change"]:["input","change"]).map((e=>P(e,be(g),n))),v=n.defaultView;if(!v)return()=>{m.forEach((e=>e()))};const _=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return _&&_.set&&m.push(...y.map((e=>q(e[0],e[1],{set(){be(g)({target:this,isTrusted:!1})}},!1,v)))),be((()=>{m.forEach((e=>e()))}))}(e),d=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:i,mirror:r,sampling:s,doc:o}=e;const a=be((e=>$(be((s=>{const o=we(s);if(!o||Z(o,n,i,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=o;t({type:e,id:r.getId(o),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),s.media||500))),l=[P("play",a(0),o),P("pause",a(1),o),P("seeked",a(2),o),P("volumechange",a(3),o),P("ratechange",a(4),o)];return be((()=>{l.forEach((e=>e()))}))}(e);let h=()=>{},p=()=>{},g=()=>{},f=()=>{};e.recordDOM&&(h=function(e,t){let{styleSheetRuleCb:n,mirror:i,stylesheetManager:r}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:be(((e,t,s)=>{const[o,a]=s,{id:l,styleId:c}=Ae(t,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:o,index:a}]}),e.apply(t,s)}))});const a=s.CSSStyleSheet.prototype.deleteRule;let l,c;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:be(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Ae(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:be(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Ae(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(c=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:be(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Ae(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));const u={};Ne("CSSGroupingRule")?u.CSSGroupingRule=s.CSSGroupingRule:(Ne("CSSMediaRule")&&(u.CSSMediaRule=s.CSSMediaRule),Ne("CSSConditionRule")&&(u.CSSConditionRule=s.CSSConditionRule),Ne("CSSSupportsRule")&&(u.CSSSupportsRule=s.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:be(((e,t,s)=>{const[o,a]=s,{id:l,styleId:c}=Ae(t.parentStyleSheet,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:o,index:[...Te(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:be(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Ae(t.parentStyleSheet,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Te(t),o]}]}),e.apply(t,s)}))})})),be((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=a,l&&(s.CSSStyleSheet.prototype.replace=l),c&&(s.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),p=Me(e,e.doc),g=function(e,t){let{styleDeclarationCb:n,mirror:i,ignoreCSSAttributes:r,stylesheetManager:s}=e,{win:o}=t;const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:be(((e,t,o)=>{var l;const[c,u,d]=o;if(r.has(c))return a.apply(t,[c,u,d]);const{id:h,styleId:p}=Ae(null===(l=t.parentRule)||void 0===l?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:Te(t.parentRule)}),e.apply(t,o)}))});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:be(((e,t,o)=>{var a;const[c]=o;if(r.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Ae(null===(a=t.parentRule)||void 0===a?void 0:a.parentStyleSheet,i,s.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Te(t.parentRule)}),e.apply(t,o)}))}),be((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){let{fontCb:t,doc:n}=e;const i=n.defaultView;if(!i)return()=>{};const r=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,n){const i=new o(e,t,n);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};const a=B(n.fonts,"add",(function(e){return function(n){return setTimeout(be((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{i.FontFace=o})),r.push(a),be((()=>{r.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=e;let o=!0;const a=be((()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=s;Z(o,i,r,!0)||Z(c,i,r,!0)||a.push({start:n.getId(o),startOffset:l,end:n.getId(c),endOffset:u})}s({ranges:a})}));return a(),P("selectionchange",a)}(e),v=function(e){let{doc:t,customElementCb:n}=e;const i=t.defaultView;return i&&i.customElements?B(i.customElements,"define",(function(e){return function(t,i,r){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,i,r])}})):()=>{}}(e),_=[];for(const t of e.plugins)_.push(t.observer(t.callback,n,t.options));return be((()=>{Ce.forEach((e=>e.reset())),null==i||i.disconnect(),r(),s(),o(),l(),c(),d(),h(),p(),g(),f(),m(),v(),_.forEach((e=>e()))}))}function Fe(e){return void 0!==window[e]}function Ne(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Oe{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,i){const r=n||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e);let o=r.get(t);return o||(o=this.generateIdFn(),r.set(t,o),s.set(o,t)),o}getIds(e,t){const n=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,i)))}getRemoteId(e,t,n){const i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=i.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Pe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Oe(f),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Oe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ie.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ie.IncrementalSnapshot,data:{source:re.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ie.Meta:case ie.Load:case ie.DomContentLoaded:return!1;case ie.Plugin:return t;case ie.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ie.IncrementalSnapshot:switch(t.data.source){case re.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case re.Drag:case re.TouchMove:case re.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case re.ViewportResize:return!1;case re.MediaInteraction:case re.MouseInteraction:case re.Scroll:case re.CanvasMutation:case re.Input:return this.replaceIds(t.data,e,["id"]),t;case re.StyleSheetRule:case re.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case re.Font:return t;case re.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case re.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,i){for(const r of i)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(t,n){t.type===e.Document||t.rootId||(t.rootId=n),"childNodes"in t&&t.childNodes.forEach((e=>{this.patchRootIdOnNode(e,n)}))}}class Le{constructor(e){this.shadowDoms=new WeakSet,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(!i(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Ie(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(ke(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Me({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(B(e.prototype,"attachShadow",(function(e){return function(i){const r=e.call(this,i);return this.shadowRoot&&ne(this)&&n.addShadowRoot(this.shadowRoot,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function De(e,t,n,i){return new(n||(n=Promise))((function(t,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function o(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(s,o)}a((i=i.apply(e,[])).next())}))}for(var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Be=0;Be<64;Be++)qe[$e.charCodeAt(Be)]=Be;const He=new Map;const We=(e,t,n)=>{if(!e||!Ge(e,t)&&"object"!=typeof e)return;const i=function(e,t){let n=He.get(e);return n||(n=new Map,He.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r};function Ue(e,t,n){if(e instanceof Array)return e.map((e=>Ue(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),i=n.length,r="";for(t=0;t<i;t+=3)r+=$e[n[t]>>2],r+=$e[(3&n[t])<<4|n[t+1]>>4],r+=$e[(15&n[t+1])<<2|n[t+2]>>6],r+=$e[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}}if(Ge(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:We(e,t,n)}}return e}const Ve=(e,t,n)=>e.map((e=>Ue(e,t,n))),Ge=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Ze(e,t,n,i){const r=[];try{const s=B(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!Z(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),i&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[r,...o])}}));r.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function je(e,t,n,i,r,s,o){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=B(e,s,(function(e){return function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];const u=e.apply(this,l);if(We(u,o,this),"tagName"in this.canvas&&!Z(this.canvas,i,r,!0)){const e=Ve(l,o,this),i={type:t,property:s,args:e};n(this.canvas,i)}return u}}));a.push(l)}catch(i){const r=q(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(r)}return a}function ze(e,t,n){var i=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var i=new Uint8Array(n.length),r=0,s=n.length;r<s;++r)i[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return n}(e,void 0!==n&&n),s=r.indexOf("\n",10)+1,o=r.substring(s)+(i?"//# sourceMappingURL="+i:""),a=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(a)}var Qe,Ke,Ye,Je,Xe=(Qe="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ke=null,Ye=!1,function(e){return Je=Je||ze(Qe,Ke,Ye),new Worker(Je,e)});class et{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:i,blockSelector:r,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,i,r),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,i,r,{dataURLOptions:o})}initCanvasFPSObserver(e,t,n,i,r){const s=Ze(t,n,i,!0),o=new Map,a=new Xe;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:r,height:s}=e.data;this.mutationCb({id:t,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],r=t=>{t.querySelectorAll("canvas").forEach((t=>{Z(t,n,i,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&r(e.shadowRoot)}))};return r(t.document),e})().forEach((e=>De(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(o.get(n))return;if(0===e.width||0===e.height)return;if(o.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=e.clientWidth||e.width,s=e.clientHeight||e.height,l=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:s});a.postMessage({id:n,bitmap:l,width:i,height:s,dataURLOptions:r.dataURLOptions},[l])}))))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Ze(e,t,n,!1),r=function(e,t,n,i){const r=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const s=B(t.CanvasRenderingContext2D.prototype,o,(function(r){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Z(this.canvas,n,i,!0)||setTimeout((()=>{const n=Ve(a,t,this);e(this.canvas,{type:ae["2D"],property:o,args:n})}),0),r.apply(this,a)}}));r.push(s)}catch(n){const i=q(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:ae["2D"],property:o,args:[t],setter:!0})}});r.push(i)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,i,r){const s=[];return s.push(...je(t.WebGLRenderingContext.prototype,ae.WebGL,e,n,i,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...je(t.WebGL2RenderingContext.prototype,ae.WebGL2,e,n,i,0,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{i(),r(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const t=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["type"]);return t})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}class tt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new X,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:s(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class nt{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function it(e){return Object.assign(Object.assign({},e),{timestamp:H()})}let rt,st,ot,at=!1;const lt=new o;function ct(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:f,maskTextFn:m,hooks:v,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:I=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:T=!1,plugins:A,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=e;_e(F);const N=!S||window.parent===window;let L=!1;if(!N)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(N&&!t)throw new Error("emit function is required");void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),lt.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},$=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let q;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];let r=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===r)return!0}while(r=r&&r.parentNode);return!1})}();let B=0;const H=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!L&&(e=_(e)),e};rt=(e,r)=>{var s;if(!(null===(s=Ce[0])||void 0===s?void 0:s.isFrozen())||e.type===ie.FullSnapshot||e.type===ie.IncrementalSnapshot&&e.data.source===re.Mutation||Ce.forEach((e=>e.unfreeze())),N)null==t||t(H(e),r);else if(L){const t={type:"rrweb",event:H(e),origin:window.location.origin,isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===ie.FullSnapshot)q=e,B=0;else if(e.type===ie.IncrementalSnapshot){if(e.data.source===re.Mutation&&e.data.isAttachIframe)return;B++;const t=i&&B>=i,r=n&&e.timestamp-q.timestamp>n;(t||r)&&st(!0)}};const G=e=>{rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.Mutation},e)}))},Z=e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.Scroll},e)})),j=e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.CanvasMutation},e)})),z=new tt({mutationCb:G,adoptedStyleSheetCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.AdoptedStyleSheet},e)}))}),Q=new Pe({mirror:lt,mutationCb:G,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:rt});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:lt,crossOriginIframeMirror:Q.crossOriginIframeMirror,crossOriginIframeStyleMirror:Q.crossOriginIframeStyleMirror});const X=new nt;ot=new et({recordCanvas:I,mutationCb:j,win:window,blockClass:r,blockSelector:s,mirror:lt,sampling:y.canvas,dataURLOptions:b});const ee=new Le({mutationCb:G,scrollCb:Z,bypassOptions:{blockClass:r,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:I,inlineImages:T,sampling:y,slimDOMOptions:$,iframeManager:Q,stylesheetManager:z,canvasManager:ot,keepIframeSrcFn:M,processedNodeManager:X},mirror:lt});st=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!w)return;rt(it({type:ie.Meta,data:{href:window.location.href,width:V(),height:U()}}),e),z.reset(),ee.init(),Ce.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new o,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:u=!1,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:p,slimDOM:g=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w=(()=>!1)}=t||{};return O(e,{doc:e,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:f,inlineImages:c,recordCanvas:u,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:lt,blockClass:r,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:m,slimDOM:$,dataURLOptions:b,recordCanvas:I,inlineImages:T,onSerialize:e=>{K(e,lt)&&Q.addIframe(e),Y(e,lt)&&z.trackLinkElement(e),J(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Q.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:M});if(!t)return console.warn("Failed to snapshot the document");rt(it({type:ie.FullSnapshot,data:{node:t,initialOffset:W(window)}}),e),Ce.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,lt.getId(document))};try{const e=[],t=e=>{var t;return be(Re)({mutationCb:G,mousemoveCb:(e,t)=>rt(it({type:ie.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.MouseInteraction},e)})),scrollCb:Z,viewportResizeCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.ViewportResize},e)})),inputCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.Input},e)})),mediaInteractionCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.MediaInteraction},e)})),styleSheetRuleCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.StyleSheetRule},e)})),styleDeclarationCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.Font},e)})),selectionCb:e=>{rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.Selection},e)}))},customElementCb:e=>{rt(it({type:ie.IncrementalSnapshot,data:Object.assign({source:re.CustomElement},e)}))},blockClass:r,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:w,recordCanvas:I,inlineImages:T,userTriggeredOnInput:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:$,dataURLOptions:b,mirror:lt,iframeManager:Q,stylesheetManager:z,shadowDomManager:ee,processedNodeManager:X,canvasManager:ot,ignoreCSSAttributes:R,plugins:(null===(t=null==A?void 0:A.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>rt(it({type:ie.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},v)};Q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{st(),e.push(t(document)),at=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(P("DOMContentLoaded",(()=>{rt(it({type:ie.DomContentLoaded,data:{}})),"DOMContentLoaded"===k&&n()}))),e.push(P("load",(()=>{rt(it({type:ie.Load,data:{}})),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),X.destroy(),at=!1,ye()}}catch(e){console.warn(e)}}ct.addCustomEvent=(e,t)=>{if(!at)throw new Error("please add custom event after start recording");rt(it({type:ie.Custom,data:{tag:e,payload:t}}))},ct.freezePage=()=>{Ce.forEach((e=>e.freeze()))},ct.takeFullSnapshot=e=>{if(!at)throw new Error("please take full snapshot after start recording");st(e)},ct.mirror=lt;class ut{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const dt=/(^|@)\S+:\d+/,ht=/^\s*at .*(\S+:\d+|\(native\))/m,pt=/^(eval@)?(\[native code])?$/,gt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(ht)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(ht)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const i=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new ut({functionName:s,fileName:o,lineNumber:r[1],columnNumber:r[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(pt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new ut({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new ut({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new ut({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new ut({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(dt)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ut({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function ft(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(let e=0;e<i.children.length;e++){const t=i.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=i}return t}function mt(e){return"[object Object]"===Object.prototype.toString.call(e)}function vt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const i of n)if(mt(e[i])&&vt(e[i],t-1))return!0;return!1}function _t(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const i=[],r=[];return JSON.stringify(e,(function(e,t){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(mt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(mt(e)&&vt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const i=t[n];Array.isArray(i)?e[n]=ft(i.length?i[0]:null):e[n]=i}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const yt={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 bt(e,t,n){const i=n?Object.assign({},yt,n):yt,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?t[r]:r;let o=0,a=!1;const l=[];if(i.level.includes("error")){const n=t=>{const n=t.message,r=t.error,s=gt.parse(r).map((e=>e.toString())),o=[_t(n,i.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const r=t=>{let n,r;t.reason instanceof Error?(n=t.reason,r=[_t(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[_t("Uncaught (in promise)",i.stringifyOptions),_t(t.reason,i.stringifyOptions)]);const s=gt.parse(n).map((e=>e.toString()));e({level:"error",trace:s,payload:r})};t.addEventListener("unhandledrejection",r),l.push((()=>{t.removeEventListener("unhandledrejection",r)}))}for(const e of i.level)l.push(c(s,e));return()=>{l.forEach((e=>e()))};function c(t,n){var r=this;return t[n]?B(t,n,(t=>function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];if(t.apply(r,l),!a){a=!0;try{const t=gt.parse(new Error).map((e=>e.toString())).splice(1),r=l.map((e=>_t(e,i.stringifyOptions)));o++,o<i.lengthThreshold?e({level:n,trace:t,payload:r}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[_t("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const Ct=e=>({name:"rrweb/console@1",observer:bt,options:e}),wt=Array.isArray,It=Object.prototype,St=It.hasOwnProperty,kt=It.toString,xt=wt||function(e){return"[object Array]"===kt.call(e)},Et=function(e){return"function"==typeof e},Tt=function(e){return e===Object(e)&&!xt(e)},At=function(e){if(Tt(e)){for(const t in e)if(St.call(e,t))return!1;return!0}return!1},Mt=function(e){return void 0===e},Rt=function(e){return"[object String]"==kt.call(e)},Ft=function(e){return Rt(e)&&0===e.trim().length},Nt=function(e){return null===e},Ot=function(e){return Mt(e)||Nt(e)},Pt=function(e){return"[object Number]"==kt.call(e)},Lt=function(e){return"[object Boolean]"===kt.call(e)},Dt=e=>e instanceof Document,$t=e=>e instanceof FormData;const qt={DEBUG:!1,LIB_VERSION:"1.174.2"},Bt="undefined"!=typeof window?window:void 0,Ht="undefined"!=typeof globalThis?globalThis:Bt,Wt=Array.prototype,Ut=Wt.forEach,Vt=Wt.indexOf,Gt=null==Ht?void 0:Ht.navigator,Zt=null==Ht?void 0:Ht.document,jt=null==Ht?void 0:Ht.location,zt=null==Ht?void 0:Ht.fetch,Qt=null!=Ht&&Ht.XMLHttpRequest&&"withCredentials"in new Ht.XMLHttpRequest?Ht.XMLHttpRequest:void 0,Kt=null==Ht?void 0:Ht.AbortController,Yt=null==Gt?void 0:Gt.userAgent,Jt=null!=Bt?Bt:{},Xt="[PostHog.js]",en={_log:function(e){if(Bt&&(qt.DEBUG||Jt.POSTHOG_DEBUG)&&!Mt(Bt.console)&&Bt.console){const r="__rrweb_original__"in Bt.console[e]?Bt.console[e].__rrweb_original__:Bt.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(Xt,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];en._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];en._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];en._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(Xt,...t)},uninitializedWarning:e=>{en.error(`You must initialize PostHog before calling ${e}`)}},tn={},nn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function rn(e,t,n){if(xt(e))if(Ut&&e.forEach===Ut)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===tn)return}function sn(e,t,n){if(!Ot(e)){if(xt(e))return rn(e,t,n);if($t(e)){for(const i of e.entries())if(t.call(n,i[1],i[0])===tn)return}else for(const i in e)if(St.call(e,i)&&t.call(n,e[i],i)===tn)return}}const on=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return rn(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function an(e,t){return-1!==e.indexOf(t)}function ln(e){const t=Object.keys(e);let n=t.length;const i=new Array(n);for(;n--;)i[n]=[t[n],e[t[n]]];return i}const cn=function(e){try{return e()}catch{return}},un=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){en.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),en.critical(e)}}},dn=function(e){const t={};return sn(e,(function(e,n){Rt(e)&&e.length>0&&(t[n]=e)})),t},hn=function(e){return e.replace(/^\$/,"")};function pn(e,t){return function(e,t){const n=new Set;return function e(i,r){if(i!==Object(i))return t?t(i,r):i;if(n.has(i))return;let s;return n.add(i),xt(i)?(s=[],rn(i,(t=>{s.push(e(t))}))):(s={},sn(i,((t,i)=>{n.has(t)||(s[i]=e(t,i))}))),s}(e)}(e,(e=>Rt(e)&&!Nt(t)?e.slice(0,t):e))}const gn=function(e){let t,n,i,r="",s=0;for(t=n=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<s;i++){const s=e.charCodeAt(i);let o=null;s<128?n++:o=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Nt(o)||(n>t&&(r+=e.substring(t,n)),r+=o,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},fn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,s){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!s);else{const r="on"+n,s=t[r];t[r]=function(t,n,i){return function(r){if(!(r=r||e(null==Bt?void 0:Bt.event)))return;let s,o=!0;Et(i)&&(s=i(r));const a=n.call(t,r);return!1!==s&&!1!==a||(o=!1),o}}(t,i,s)}else en.error("No valid element provided to register_event")}}();function mn(e){const t=null==e?void 0:e.hostname;return!!Rt(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}function vn(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}const _n=["localhost","127.0.0.1"],yn=e=>{const t=null==Zt?void 0:Zt.createElement("a");return Mt(t)?null:(t.href=e,t)},bn=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},Cn=function(e){let t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const r=[];return sn(e,(function(e,i){Mt(e)||Mt(i)||"undefined"===i||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},wn=function(e,t){const n=((e.split("#")[0]||"").split("?")[1]||"").split("&");let i;for(let e=0;e<n.length;e++){const r=n[e].split("=");if(r[0]===t){i=r;break}}if(!xt(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{en.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},In=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Sn(e){return e?nn(e).split(/\s+/):[]}function kn(e){const t=null==Bt?void 0:Bt.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function xn(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Sn(t)}function En(e){return Ot(e)?null:nn(e).split(/(\s+)/).filter((e=>Gn(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Tn(e){let t="";return Dn(e)&&!$n(e)&&e.childNodes&&e.childNodes.length&&sn(e.childNodes,(function(e){var n;Fn(e)&&e.textContent&&(t+=null!==(n=En(e.textContent))&&void 0!==n?n:"")})),nn(t)}function An(e){return Mt(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}function Mn(e){return!!e&&1===e.nodeType}function Rn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Fn(e){return!!e&&3===e.nodeType}function Nn(e){return!!e&&11===e.nodeType}const On=["a","button","form","input","select","textarea","label"];function Pn(e){const t=e.parentNode;return!(!t||!Mn(t))&&t}function Ln(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Bt||!e||Rn(e,"html")||!Mn(e))return!1;if(null!=n&&n.url_allowlist&&!kn(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&kn(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){const e=n.dom_event_allowlist;if(e&&!e.some((e=>t.type===e)))return!1}let s=!1;const o=[e];let a=!0,l=e;for(;l.parentNode&&!Rn(l,"body");)if(Nn(l.parentNode))o.push(l.parentNode.host),l=l.parentNode.host;else{if(a=Pn(l),!a)break;if(i||On.indexOf(a.tagName.toLowerCase())>-1)s=!0;else{const e=Bt.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(s=!0)}o.push(a),l=a}if(!function(e,t){const n=null==t?void 0:t.element_allowlist;if(Mt(n))return!0;for(const t of e)if(n.some((e=>t.tagName.toLowerCase()===e)))return!0;return!1}(o,n))return!1;if(!function(e,t){const n=null==t?void 0:t.css_selector_allowlist;if(Mt(n))return!0;for(const t of e)if(n.some((e=>t.matches(e))))return!0;return!1}(o,n))return!1;const c=Bt.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return s?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(On.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function Dn(e){for(let t=e;t.parentNode&&!Rn(t,"body");t=t.parentNode){const e=xn(t);if(an(e,"ph-sensitive")||an(e,"ph-no-capture"))return!1}if(an(xn(e),"ph-include"))return!0;const t=e.type||"";if(Rt(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(Rt(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function $n(e){return!!(Rn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Rn(e,"select")||Rn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const qn="(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})",Bn=new RegExp(`^(?:${qn})$`),Hn=new RegExp(qn),Wn="\\d{3}-?\\d{2}-?\\d{4}",Un=new RegExp(`^(${Wn})$`),Vn=new RegExp(`(${Wn})`);function Gn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ot(e))return!1;if(Rt(e)){e=nn(e);if((t?Bn:Hn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Un:Vn).test(e))return!1}return!0}function Zn(e){let t=Tn(e);return t=`${t} ${jn(e)}`.trim(),Gn(t)?t:""}function jn(e){let t="";return e&&e.childNodes&&e.childNodes.length&&sn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Tn(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${jn(e)}`.trim())}catch(e){en.error(e)}})),t}function zn(e){return function(e){const t=e.map((e=>{var t,n;let i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)i+=`.${t.replace(/"/g,"")}`}const r={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},s={};return ln(r).sort(((e,t)=>{let[n]=e,[i]=t;return n.localeCompare(i)})).forEach((e=>{let[t,n]=e;return s[Qn(t.toString())]=Qn(n.toString())})),i+=":",i+=ln(r).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),i}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Kn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ln(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return i.attributes[t]=n})),i}))}(e))}function Qn(e){return e.replace(/"|\\"/g,'\\"')}function Kn(e){const t=e.attr__class;return t?xt(t)?t:Sn(t):void 0}const Yn="[SessionRecording]",Jn="redacted",Xn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},ei=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ti=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ni=["/s/","/e/","/i/"];function ii(e,t,n,i){if(Ot(e))return e;let r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Rt(r)&&(r=parseInt(r)),r>n?Yn+` ${i} body too large to record (${r} bytes)`:e}function ri(e,t){if(Ot(e))return e;let n=e;return Gn(n,!1)||(n=Yn+" "+t+" body "+Jn),sn(ti,(e=>{var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Yn+" "+t+" body "+Jn+" as might contain: "+e)})),n}const si=(e,t)=>{const n={payloadSizeLimitBytes:Xn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Xn.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Xn.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,r=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,o=(e=>{var t;const n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=ii(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=ii(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>o((e=>{const t=yn(e.name);if(!(t&&t.pathname&&ni.some((e=>0===t.pathname.indexOf(e)))))return e})((e=>{const t=e.requestHeaders;return Ot(t)||sn(Object.keys(null!=t?t:{}),(e=>{ei.includes(e.toLowerCase())&&(t[e]=Jn)})),e})(e))),l=Et(e.session_recording.maskNetworkRequestFn);return l&&Et(e.session_recording.maskCapturedNetworkRequestFn)&&en.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{const n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=Et(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,i,r;const s=a(t);return s&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,s))&&void 0!==n?n:void 0}:e=>function(e){if(!Mt(e))return e.requestBody=ri(e.requestBody,"Request"),e.responseBody=ri(e.responseBody,"Response"),e}(a(e)),{...Xn,...n,recordHeaders:i,recordBody:r,recordPerformance:s,recordInitialRequests:s}};function oi(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return Et(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}function ai(e,t){var n;const i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),r={hostname:i,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==i||!i.trim().length)return r;for(const e of t.payloadHostDenyList)if(i.endsWith(e))return{hostname:i,isHostDenied:!0};return r}const li=e=>"navigation"===e.entryType,ci=e=>"resource"===e.entryType;function ui(e,t,n){if(n.recordInitialRequests){const i=t.performance.getEntries().filter((e=>li(e)||ci(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>mi({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const i=new t.PerformanceObserver((t=>{const i=t.getEntries().filter((e=>li(e)||ci(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>mi({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),r=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:r}),()=>{i.disconnect()}}function di(e,t){return!!t&&(Lt(t)||t[e])}function hi(e){let{type:t,recordBody:n,headers:i}=e;function r(e){const t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),n=t&&i[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Lt(n))return!0;if(xt(n))return r(n);const s=n[t];return Lt(s)?s:r(s)}async function pi(e,t,n,i,r){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(s>10)return en.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const o=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>ci(e)&&e.initiatorType===t&&(Mt(i)||e.startTime>=i)&&(Mt(r)||e.startTime<=r)));return o||(await new Promise((e=>setTimeout(e,50*s))),pi(e,t,n,i,r,s+1))}function gi(e){let{body:t,options:n,url:i}=e;if(Ot(t))return null;const{hostname:r,isHostDenied:s}=ai(i,n);if(s)return r+" is in deny list";if(Rt(t))return t;if(Dt(t))return t.textContent;if($t(t))return Cn(t);if(Tt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const fi=e=>!Nt(e)&&("navigation"===e.entryType||"resource"===e.entryType);function mi(e){let{entry:t,method:n,status:i,networkRequest:r,isInitial:s,start:o,end:a,url:l,initiatorType:c}=e;o=t?t.startTime:o,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(o||0)),h=[{...t?t.toJSON():{name:l},startTime:Mt(o)?void 0:Math.round(o),endTime:Mt(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:s}];if(fi(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const vi=["video/","audio/"];function _i(e){return new Promise(((t,n)=>{const i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(i)))}catch{clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}async function yi(e){let{r:t,options:n,url:i}=e;const r=function(e){var t;let{r:n,options:i,url:r}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const s=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),o=vi.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return`Content-Type ${s} is not supported`;const{hostname:a,isHostDenied:l}=ai(r,i);return l?a+" is in deny list":null}({r:t,options:n,url:i});return Nt(r)?_i(t):Promise.resolve(r)}function bi(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=di("request",n.recordHeaders),r=di("response",n.recordHeaders),s=oi(t,"fetch",(s=>async function(o,a){const l=new Request(o,a);let c;const u={};let d,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),i&&(u.requestHeaders=e),hi({type:"request",headers:e,url:o,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:i}=e;const{hostname:r,isHostDenied:s}=ai(i,n);return s?Promise.resolve(r+" is in deny list"):_i(t)}({r:l,options:n,url:o})),d=t.performance.now(),c=await s(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),r&&(u.responseHeaders=a),hi({type:"response",headers:a,url:o,recordBody:n.recordBody})&&(u.responseBody=await yi({r:c,options:n,url:o})),c}finally{pi(t,"fetch",l.url,d,h).then((t=>{var n;const i=mi({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:h,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return()=>{s()}}let Ci=null;function wi(e,t,n){if(!("performance"in t))return()=>{};if(Ci)return en.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Xn,n):Xn,r=t=>{const n=[];t.requests.forEach((e=>{const t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},s=ui(r,t,i);let o=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=di("request",n.recordHeaders),r=di("response",n.recordHeaders),s=oi(t.XMLHttpRequest.prototype,"open",(s=>function(o,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,h=new Request(a),p={};let g,f;const m={},v=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,v(e,t)),i&&(p.requestHeaders=m);const _=d.send.bind(d);d.send=e=>(hi({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(p.requestBody=gi({body:e,options:n,url:a})),g=t.performance.now(),_(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;f=t.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");n&&(i[n]=r)})),r&&(p.responseHeaders=i),hi({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(p.responseBody=gi({body:d.response,options:n,url:a})),pi(t,"xmlhttprequest",h.url,g,f).then((t=>{const n=mi({entry:t,method:h.method,status:null==d?void 0:d.status,networkRequest:p,start:g,end:f,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),s.call(d,o,a,l,c,u)}));return()=>{s()}}(r,t,i),a=bi(r,t,i)),Ci=()=>{s(),o(),a()},Ci}const Ii=e=>({name:"rrweb/network@1",observer:wi,options:e});let Si,ki,xi;Jt.__PosthogExtensions__=Jt.__PosthogExtensions__||{},Jt.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ct,getRecordNetworkPlugin:Ii},Jt.__PosthogExtensions__.rrweb={record:ct,version:"v2",rrwebVersion:t},Jt.rrweb={record:ct,version:"v2",rrwebVersion:t},Jt.rrwebConsoleRecord={getRecordConsolePlugin:Ct},Jt.getRecordNetworkPlugin=Ii,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Si||(Si={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(ki||(ki={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(xi||(xi={}));var Ei,Ti,Ai,Mi,Ri,Fi,Ni,Oi,Pi={},Li=[],Di=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$i=Array.isArray;function qi(e,t){for(var n in t)e[n]=t[n];return e}function Bi(e){var t=e.parentNode;t&&t.removeChild(e)}function Hi(e,t,n){var i,r,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ei.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Wi(e,o,i,r,null)}function Wi(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++Ai:r,__i:-1,__u:0};return null==r&&null!=Ti.vnode&&Ti.vnode(s),s}function Ui(e){return e.children}function Vi(e,t){this.props=e,this.context=t}function Gi(e,t){if(null==t)return e.__?Gi(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Gi(e):null}function Zi(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Zi(e)}}function ji(e){(!e.__d&&(e.__d=!0)&&Mi.push(e)&&!zi.__r++||Ri!==Ti.debounceRendering)&&((Ri=Ti.debounceRendering)||Fi)(zi)}function zi(){var e,t,n,i,r,s,o,a,l;for(Mi.sort(Ni);e=Mi.shift();)e.__d&&(t=Mi.length,i=void 0,s=(r=(n=e).__v).__e,a=[],l=[],(o=n.__P)&&((i=qi({},r)).__v=r.__v+1,Ti.vnode&&Ti.vnode(i),nr(o,i,r,n.__n,void 0!==o.ownerSVGElement,32&r.__u?[s]:null,a,null==s?Gi(r):s,!!(32&r.__u),l),i.__.__k[i.__i]=i,ir(a,i,l),i.__e!=s&&Zi(i)),Mi.length>t&&Mi.sort(Ni));zi.__r=0}function Qi(e,t,n,i,r,s,o,a,l,c,u){var d,h,p,g,f,m=i&&i.__k||Li,v=t.length;for(n.__d=l,function(e,t,n){var i,r,s,o,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],i=0;i<l;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?Wi(null,r,null,null,r):$i(r)?Wi(Ui,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?Wi(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Yi(r,n,o=i+d,u),r.__i=a,s=null,-1!==a&&(u--,(s=n[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==o&&(a===o+1?d++:a>o?u>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==i+d&&(r.__u|=65536))):(s=n[i])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=Gi(s)),sr(s,s,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(s=n[i])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=Gi(s)),sr(s,s))}(n,t,m),l=n.__d,d=0;d<v;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Pi:m[p.__i]||Pi,p.__i=d,nr(e,p,h,r,s,o,a,l,c,u),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&rr(h.ref,null,p),u.push(p.ref,p.__c||g,p)),null==f&&null!=g&&(f=g),65536&p.__u||h.__k===p.__k?l=Ki(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=f}function Ki(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Ki(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Yi(e,t,n,i){var r=e.key,s=e.type,o=n-1,a=n+1,l=t[n];if(null===l||l&&r==l.key&&s===l.type)return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&r==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&r==l.key&&s===l.type)return a;a++}}return-1}function Ji(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Di.test(t)?n:n+"px"}function Xi(e,t,n,i,r){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Ji(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Ji(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,s?tr:er,s)):e.removeEventListener(t,s?tr:er,s);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function er(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Ti.event?Ti.event(e):e)}function tr(e){return this.l[e.type+!0](Ti.event?Ti.event(e):e)}function nr(e,t,n,i,r,s,o,a,l,c){var u,d,h,p,g,f,m,v,_,y,b,C,w,I,S,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[a=t.__e=n.__e]),(u=Ti.__b)&&u(t);e:if("function"==typeof k)try{if(v=t.props,_=(u=k.contextType)&&i[u.__c],y=u?_?_.props.value:u.__:i,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(v,y):(t.__c=d=new Vi(v,y),d.constructor=k,d.render=or),_&&_.sub(d),d.props=v,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=qi({},d.__s)),qi(d.__s,k.getDerivedStateFromProps(v,d.__s))),p=d.props,g=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&v!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(v,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(v,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(v,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,f)}))}if(d.context=y,d.props=v,d.__P=e,d.__e=!1,C=Ti.__r,w=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,C&&C(t),u=d.render(d.props,d.state,d.context),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[]}else do{d.__d=!1,C&&C(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(i=qi(qi({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(p,g)),Qi(e,$i(S=null!=u&&u.type===Ui&&null==u.key?u.props.children:u)?S:[S],t,n,i,r,s,o,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=s?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Ti.__e(e,t,n)}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,s,o,a,l){var c,u,d,h,p,g,f,m=n.props,v=t.props,_=t.type;if("svg"===_&&(r=!0),null!=s)for(c=0;c<s.length;c++)if((p=s[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,s[c]=null;break}if(null==e){if(null===_)return document.createTextNode(v);e=r?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,v.is&&v),s=null,a=!1}if(null===_)m===v||a&&e.data===v||(e.data=v);else{if(s=s&&Ei.call(e.childNodes),m=n.props||Pi,!a&&null!=s)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)p=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in v||Xi(e,c,null,p,r));for(c in v)p=v[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?g=p:"checked"==c?f=p:"key"===c||a&&"function"!=typeof p||m[c]===p||Xi(e,c,p,m[c],r);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Qi(e,$i(h)?h:[h],t,n,i,r&&"foreignObject"!==_,s,o,s?s[0]:n.__k&&Gi(n,0),a,l),null!=s)for(c=s.length;c--;)null!=s[c]&&Bi(s[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===_&&!g||"option"===_&&g!==m[c])&&Xi(e,c,g,m[c],!1),c="checked",void 0!==f&&f!==e[c]&&Xi(e,c,f,m[c],!1))}return e}(n.__e,t,n,i,r,s,o,l,c);(u=Ti.diffed)&&u(t)}function ir(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)rr(n[i],n[++i],n[++i]);Ti.__c&&Ti.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Ti.__e(e,t.__v)}}))}function rr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Ti.__e(e,n)}}function sr(e,t,n){var i,r;if(Ti.unmount&&Ti.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||rr(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Ti.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&sr(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Bi(e.__e),e.__=e.__e=e.__d=void 0}function or(e,t,n){return this.constructor(e,n)}function ar(e,t,n){var i,r,s,o;Ti.__&&Ti.__(e,t),r=(i="function"==typeof n)?null:t.__k,s=[],o=[],nr(t,e=(!i&&n||t).__k=Hi(Ui,null,[e]),r||Pi,Pi,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Ei.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i,o),ir(s,e,o)}function lr(e,t,n){var i,r,s,o,a=qi({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=void 0===t[s]&&void 0!==o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ei.call(arguments,2):n),Wi(e.type,a,i||e.key,r||e.ref,null)}Ei=Li.slice,Ti={__e:function(e,t,n,i){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},Ai=0,Vi.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=qi({},this.state),"function"==typeof e&&(e=e(qi({},n),this.props)),e&&qi(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ji(this))},Vi.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ji(this))},Vi.prototype.render=Ui,Mi=[],Fi="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ni=function(e,t){return e.__v.__b-t.__v.__b},zi.__r=0,Oi=0;const cr=Bt,ur=Zt,dr=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${pr((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function hr(e){if("#"===e[0]){const t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function pr(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;"#"===t[0]&&(e=hr(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=hr(n)),!e)return"black";const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const gr={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},fr="#eeeded",mr=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(wr(n),"true"),i.capture("survey sent",{$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i),...t,$set:{[Ir(n,"responded")]:!0}}),cr.dispatchEvent(new Event("PHSurveySent")))},vr=(e,t,n)=>{var i;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:{[Ir(e,"dismissed")]:!0}}),localStorage.setItem(wr(e),"true"),cr.dispatchEvent(new Event("PHSurveyClosed")))},_r=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),yr=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,br=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?yr(e.questions,_r(e.questions)):e.questions),Cr=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,i,r,s,o;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0})(e))},wr=e=>{let t=`seenSurvey_${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`seenSurvey_${e.id}_${e.current_iteration}`),t},Ir=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},Sr=function(e,t){var n={__c:t="__cC"+Oi++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,ji(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),kr=e=>{let{component:t,children:n,renderAsHtml:i,style:r}=e;return lr(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},xr=Zt;var Er,Tr,Ar,Mr,Rr=0,Fr=[],Nr=[],Or=Ti.__b,Pr=Ti.__r,Lr=Ti.diffed,Dr=Ti.__c,$r=Ti.unmount;function qr(e,t){Ti.__h&&Ti.__h(Tr,e,Rr||t),Rr=0;var n=Tr.__H||(Tr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Nr}),n.__[e]}function Br(e){return Rr=1,function(e,t,n){var i=qr(Er++,2);if(i.t=e,!i.__c&&(i.__=[Yr(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Tr,!Tr.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};Tr.u=!0;var s=Tr.shouldComponentUpdate,o=Tr.componentWillUpdate;Tr.componentWillUpdate=function(e,t,n){if(this.__e){var i=s;s=void 0,r(e,t,n),s=i}o&&o.call(this,e,t,n)},Tr.shouldComponentUpdate=r}return i.__N||i.__}(Yr,e)}function Hr(e,t){var n=qr(Er++,3);!Ti.__s&&Kr(n.__H,t)&&(n.__=e,n.i=t,Tr.__H.__h.push(n))}function Wr(e){return Rr=5,Ur((function(){return{current:e}}),[])}function Ur(e,t){var n=qr(Er++,7);return Kr(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Vr(e){var t=Tr.context[e.__c],n=qr(Er++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Tr)),t.props.value):e.__}function Gr(){for(var e;e=Fr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(zr),e.__H.__h.forEach(Qr),e.__H.__h=[]}catch(t){e.__H.__h=[],Ti.__e(t,e.__v)}}Ti.__b=function(e){Tr=null,Or&&Or(e)},Ti.__r=function(e){Pr&&Pr(e),Er=0;var t=(Tr=e.__c).__H;t&&(Ar===Tr?(t.__h=[],Tr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Nr,e.__N=e.i=void 0}))):(t.__h.forEach(zr),t.__h.forEach(Qr),t.__h=[],Er=0)),Ar=Tr},Ti.diffed=function(e){Lr&&Lr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Fr.push(t)&&Mr===Ti.requestAnimationFrame||((Mr=Ti.requestAnimationFrame)||jr)(Gr)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Nr&&(e.__=e.__V),e.i=void 0,e.__V=Nr}))),Ar=Tr=null},Ti.__c=function(e,t){t.some((function(e){try{e.__h.forEach(zr),e.__h=e.__h.filter((function(e){return!e.__||Qr(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ti.__e(n,e.__v)}})),Dr&&Dr(e,t)},Ti.unmount=function(e){$r&&$r(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{zr(e)}catch(e){t=e}})),n.__H=void 0,t&&Ti.__e(t,n.__v))};var Zr="function"==typeof requestAnimationFrame;function jr(e){var t,n=function(){clearTimeout(i),Zr&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);Zr&&(t=requestAnimationFrame(n))}function zr(e){var t=Tr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Tr=t}function Qr(e){var t=Tr;e.__c=e.__(),Tr=t}function Kr(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Yr(e,t){return"function"==typeof t?t(e):t}var Jr=0;function Xr(e,t,n,i,r,s){var o,a,l={};for(a in t)"ref"==a?o=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Jr,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ti.vnode&&Ti.vnode(c),c}const es=Xr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Xr("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"})}),ts=Xr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Xr("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"})}),ns=Xr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Xr("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"})}),is=Xr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Xr("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"})}),rs=Xr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Xr("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"})}),ss=Xr("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Xr("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),os=Xr("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Xr("g",{"clip-path":"url(#clip0_2415_6911)",children:[Xr("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Xr("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Xr("g",{mask:"url(#mask0_2415_6911)",children:[Xr("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"}),Xr("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"}),Xr("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"}),Xr("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"}),Xr("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"}),Xr("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"})]})]}),Xr("defs",{children:Xr("clipPath",{id:"clip0_2415_6911",children:Xr("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),as=Xr("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Xr("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function ls(){return Xr("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",os]})}function cs(e){let{text:t,submitDisabled:n,appearance:i,onSubmit:r,link:s}=e;const{isPreviewMode:o,isPopup:a}=Vr(Sr),l=i.submitButtonTextColor||pr(i.submitButtonColor||gr.submitButtonColor);return Xr("div",{className:"bottom-section",children:[Xr("div",{className:"buttons",children:Xr("button",{className:"form-submit",disabled:n&&!o,type:"button",style:a?{color:l}:{},onClick:()=>{o||(s&&(null==Bt||Bt.open(s)),r())},children:t})}),!i.whiteLabel&&Xr(ls,{})]})}function us(e){let{question:t,description:n,descriptionContentType:i,backgroundColor:r,forceDisableHtml:s}=e;const{isPopup:o}=Vr(Sr);return Xr("div",{style:o?{backgroundColor:r||gr.backgroundColor}:{},children:[Xr("div",{className:"survey-question",children:t}),n&&kr({component:Hi("div",{className:"survey-question-description"}),children:n,renderAsHtml:!s&&"text"!==i})]})}function ds(e){let{onClick:t}=e;const{isPreviewMode:n}=Vr(Sr);return Xr("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:Xr("button",{className:"form-cancel",onClick:t,disabled:n,children:ss})})}function hs(e){let{header:t,description:n,contentType:i,forceDisableHtml:r,appearance:s,onClose:o,styleOverrides:a}=e;const l=pr(s.backgroundColor||gr.backgroundColor),{isPopup:c}=Vr(Sr);return Xr(Ui,{children:Xr("div",{className:"thank-you-message",style:{...a},children:Xr("div",{className:"thank-you-message-container",children:[c&&Xr(ds,{onClick:()=>o()}),Xr("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&kr({component:Hi("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:l}}),c&&Xr(cs,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})})})}function ps(e){var t;const n=Wr(null),[i,r]=Br(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return Hr((()=>{if(n.current){const e=function(e){const t=cr.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const i=parseInt(n[1]),r=parseInt(n[2]),s=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+s*s*.114)>127.5?"black":"white"}(n.current);r(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function gs(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;const s=Wr(null),[o,a]=Br("");return Xr("div",{ref:s,children:[Xr(us,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),Xr("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>a(e.currentTarget.value)}),Xr(cs,{text:t.buttonText||"Submit",submitDisabled:!o&&!t.optional,appearance:i,onSubmit:()=>r(o)})]})}function fs(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;return Xr(Ui,{children:[Xr(us,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Xr(cs,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>r("link clicked")})]})}function ms(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o=t.scale,a=10===t.scale?0:1,[l,c]=Br(null);return Xr(Ui,{children:[Xr(us,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Xr("div",{className:"rating-section",children:[Xr("div",{className:"rating-options",children:["emoji"===t.display&&Xr("div",{className:"rating-options-emoji",children:(3===t.scale?ys:bs).map(((e,t)=>{const n=t+1===l;return Xr("button",{className:`ratings-emoji question-${i}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&Xr("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${o-a+1}, minmax(0, 1fr))`},children:Ss(t.scale).map(((e,t)=>Xr(vs,{displayQuestionIndex:i,active:l===e,appearance:r,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),Xr("div",{className:"rating-text",children:[Xr("div",{children:t.lowerBoundLabel}),Xr("div",{children:t.upperBoundLabel})]})]}),Xr(cs,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:Nt(l)&&!t.optional,appearance:r,onSubmit:()=>s(l)})]})}function vs(e){let{num:t,active:n,displayQuestionIndex:i,appearance:r,setActiveNumber:s}=e;const{textColor:o,ref:a}=ps({appearance:r,defaultTextColor:"black",forceUpdate:n});return Xr("button",{ref:a,className:`ratings-number question-${i}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{s(t)},style:{color:o,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function _s(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o=Wr(null),a=Ur((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const i=yr(t,_r(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i})(t)),[t]),[l,c]=Br(t.type===ki.MultipleChoice?[]:null),[u,d]=Br(!1),[h,p]=Br(""),g=t.type===ki.SingleChoice?"radio":"checkbox";return Xr("div",{ref:o,children:[Xr(us,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Xr("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let r="choice-option";const s=e,o=e;return t.hasOpenChoice&&n===t.choices.length-1&&(r+=" choice-option-open"),Xr("div",{className:r,children:[Xr("input",{type:g,id:`surveyQuestion${i}Choice${n}`,name:`question${i}`,value:s,disabled:!s,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===ki.SingleChoice?c(s):t.type===ki.MultipleChoice&&xt(l)?l.includes(s)?c(l.filter((e=>e!==s))):c([...l,s]):void 0}),Xr("label",{htmlFor:`surveyQuestion${i}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?Xr(Ui,{children:[Xr("span",{children:[o,":"]}),Xr("input",{type:"text",id:`surveyQuestion${i}Choice${n}Open`,name:`question${i}`,onInput:e=>{const n=e.currentTarget.value;return t.type===ki.SingleChoice?c(n):t.type===ki.MultipleChoice&&xt(l)?p(n):void 0}})]}):o}),Xr("span",{className:"choice-check",style:{color:"black"},children:as})]})}))}),Xr(cs,{text:t.buttonText||"Submit",submitDisabled:(Nt(l)||xt(l)&&!u&&0===l.length||xt(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:r,onSubmit:()=>{u&&t.type===ki.MultipleChoice?xt(l)&&s([...l,h]):s(l)}})]})}const ys=[ns,ts,es],bs=[is,ns,ts,es,rs],Cs=[1,2,3,4,5],ws=[1,2,3,4,5,6,7],Is=[0,1,2,3,4,5,6,7,8,9,10];function Ss(e){switch(e){case 5:default:return Cs;case 7:return ws;case 10:return Is}}const ks=Bt,xs=Zt;class Es{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=xs.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,i=localStorage.getItem("lastSeenSurveyDate");if(n&&i){const e=new Date,t=Math.abs(e.getTime()-new Date(i).getTime());if(Math.ceil(t/864e5)<n)return}const r=(e=>!!localStorage.getItem(wr(e))&&!Cr(e))(e);if(!r){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const i=ur.createElement("div");i.className=`PostHogSurvey${t}`;const r=i.attachShadow({mode:"open"});if(e){const t=Object.assign(ur.createElement("style"),{innerText:e});r.appendChild(t)}return ur.body.appendChild(i),r})(dr(null==e?void 0:e.appearance),e.id);ar(Xr(Ms,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=xr.createElement("div");n.className=`PostHogWidget${e.id}`;const i=n.attachShadow({mode:"open"}),r=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return i.append(Object.assign(xr.createElement("style"),{innerText:r})),xr.body.appendChild(n),i}(e),n=dr(e.appearance);t.appendChild(Object.assign(xs.createElement("style"),{innerText:n})),ar(Xr(Fs,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&xs.querySelector(e.appearance.widgetSelector);if(n)if(0===xs.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===xs.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var i,r;const t=null===(i=xs.querySelector(`.PostHogWidget${e.id}`))||void 0===i||null===(r=i.shadowRoot)||void 0===r?void 0:r.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,i;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=Si.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{ar(Xr(Ms,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(Nt(e.surveyInFocus)){var n,i,r;if(t.type===Si.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===xs.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)&&null!==(r=t.appearance)&&void 0!==r&&r.widgetSelector&&e.handleWidgetSelector(t);t.type===Si.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{Nt(this.surveyInFocus)||en.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&en.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function Ts(e){if(!xs||!ks)return;const t=new Es(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function As(e,t,n,i,r){const[s,o]=Br(i||0===n),[a,l]=Br(!1);return Hr((()=>{if(i||!t)return;const s=()=>{r(e.id),o(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{o(!1)}),5e3)):(r(e.id),o(!1))},c=()=>{var n;o(!0),ks.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return ks.addEventListener("PHSurveyClosed",s),ks.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),ks.removeEventListener("PHSurveyClosed",s),ks.removeEventListener("PHSurveySent",a)}})():(c(),()=>{ks.removeEventListener("PHSurveyClosed",s),ks.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:s,isSurveySent:a,setIsPopupVisible:o}}function Ms(e){var t,n,i,r,s,o;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:h,isPopup:p}=e;const g=Number.isInteger(d),f=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:v,setIsPopupVisible:_}=As(a,c,f,g,h),y=v||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&Pt(null===(i=u)||void 0===i?void 0:i.left)?{left:u.left-40}:{};return g&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?Xr(Sr.Provider,{value:{isPreviewMode:g,previewPageIndex:d,handleCloseSurveyPopup:()=>vr(a,c,g),isPopup:p||!1},children:y?Xr(hs,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescriptionContentType,appearance:a.appearance||gr,styleOverrides:{...u,...b},onClose:()=>_(!1)}):Xr(Rs,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):Xr(Ui,{})}function Rs(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:s,styleOverrides:o}=e;const a=pr((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||gr.backgroundColor),[l,c]=Br({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:h,isPopup:p}=Vr(Sr),[g,f]=Br(d||0),m=Ur((()=>br(i)),[i]);Hr((()=>{f(null!=d?d:0)}),[d]);return Xr("form",{className:"survey-form",style:p?{color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor,...o}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:o}=e;return(u?g===o:g===t)&&Xr("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||gr.backgroundColor}:{},children:[p&&Xr(ds,{onClick:()=>h()}),Ns({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||gr,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:r}=e;if(!s)return;const o=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[o]:t}),!s.getNextSurveyStep)return void(r===i.questions.length-1?mr({...l,[o]:t},i,s):f(r+1));const a=s.getNextSurveyStep(i,r,t);a===xi.End?mr({...l,[o]:t},i,s):f(a)})({res:e,originalQuestionIndex:o,displayQuestionIndex:t})})]})}))})}function Fs(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:s,readOnly:o,removeSurveyFromFocus:a}=e;const[l,c]=Br(!1),[u,d]=Br({}),h=Wr(null);return Hr((()=>{var e,t;if(!o&&s){if("tab"===(null===(e=i.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n;const e=h.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=i.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)){const e=xs.querySelector(i.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),Xr(Ui,{children:["tab"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)&&Xr("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!o&&c(!l),style:{color:pr(i.appearance.widgetColor)},children:[Xr("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=i.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&Xr(Ms,{posthog:s,survey:i,forceDisableHtml:r,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const Ns=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o={[ki.Open]:gs,[ki.Link]:fs,[ki.Rating]:ms,[ki.SingleChoice]:_s,[ki.MultipleChoice]:_s},a={question:t,forceDisableHtml:n,appearance:r,onSubmit:s},l={[ki.Open]:{},[ki.Link]:{},[ki.Rating]:{displayQuestionIndex:i},[ki.SingleChoice]:{displayQuestionIndex:i},[ki.MultipleChoice]:{displayQuestionIndex:i}};return Xr(o[t.type],{...{...a,...l[t.type]}})};function Os(e){return!Mt(Event)&&Ps(e,Event)}function Ps(e,t){try{return e instanceof t}catch{return!1}}function Ls(e){return Nt(e)||!Tt(e)&&!Et(e)}function Ds(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function $s(e){return Ds(e,"DOMError")}Jt.__PosthogExtensions__=Jt.__PosthogExtensions__||{},Jt.__PosthogExtensions__.canActivateRepeatedly=Cr,Jt.__PosthogExtensions__.generateSurveys=Ts,Jt.extendPostHogWithSurveys=Ts;const qs=/\(error: (.*)\)/,Bs=50,Hs="?";function Ws(e,t,n,i){const r={filename:e,function:"<anonymous>"===t?Hs:t,in_app:!0};return Mt(n)||(r.lineno=n),Mt(i)||(r.colno=i),r}const Us=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Vs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Gs=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,js=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zs=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],r=e.split("\n");for(let e=t;e<r.length;e++){const t=r[e];if(t.length>1024)continue;const s=qs.test(t)?t.replace(qs,"$1"):t;if(!s.match(/\S*Error: /)){for(const e of i){const t=e(s);if(t){n.push(t);break}}if(n.length>=Bs)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,Bs).map((e=>({...e,filename:e.filename||Qs(t).filename,function:e.function||Hs})))}(n)}}(...[[30,e=>{const t=Us.exec(e);if(t){const[,e,n,i]=t;return Ws(e,Hs,+n,+i)}const n=Vs.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=Gs.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Ks(n[1]||Hs,n[2]);return Ws(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=Zs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=js.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Hs;return[n,e]=Ks(n,e),Ws(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Qs(e){return e[e.length-1]||{}}const Ks=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:Hs,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Ys;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Ys||(Ys={}));const Js=["fatal","error","warning","log","info","debug"],Xs=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function eo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",i=function(e){if(e&&to.test(e.message))return 1;return 0}(e);try{const e=zs(n,i);return e.slice(0,e.length-t)}catch{}return[]}const to=/Minified React error #\d+;/i;function no(e,t){var n,i;const r=eo(e),s=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:r},mechanism:{handled:s,synthetic:o}}],$exception_level:"error"}}function io(e,t){var n,i,r;const s=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:s,synthetic:o}};if(null!=t&&t.syntheticException){const e=eo(t.syntheticException,1);e.length&&(a.stacktrace={frames:e})}return{$exception_list:[a],$exception_level:"error"}}function ro(e){return Rt(e)&&!Ft(e)&&Js.indexOf(e)>=0}function so(e,t){var n,i;const r=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,o=null!=t&&t.overrideExceptionType?t.overrideExceptionType:Os(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}(e)}`,l={type:o,value:a,mechanism:{handled:r,synthetic:s}};if(null!=t&&t.syntheticException){const e=eo(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e})}return{$exception_list:[l],$exception_level:ro(e.level)?e.level:"error"}}function oo(e,t){let[n,i,r,s,o]=e,a={$exception_list:[]};const l=o||n;if($s(l)||function(e){return Ds(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=no(l,t);else{const n=e.name||($s(e)?"DOMError":"DOMException"),i=e.message?`${n}: ${e.message}`:n,r=$s(e)?"DOMError":"DOMException";a=io(i,{...t,overrideExceptionType:r,defaultExceptionMessage:i})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return Ds(e,"ErrorEvent")}(l)&&l.error)return no(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Ps(e,Error)}}(l))return no(l,t);if(function(e){return Ds(e,"Object")}(l)||Os(l)){return so(l,t)}if(Mt(o)&&Rt(n)){let e="Error",i=n;const r=n.match(Xs);return r&&(e=r[1],i=r[2]),io(i,{...t,overrideExceptionType:e,defaultExceptionMessage:i})}return io(l,t)}function ao(e){let[t]=e;const n=function(e){if(Ls(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return Ls(n)?io(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):oo([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const lo={wrapOnError:e=>{const t=Bt;t||en.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];const o=oo(r);return e(o),null!==(t=null==n?void 0:n(...r))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=Bt;t||en.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];const a=ao(s);return e(a),null!==(i=null==n?void 0:n.apply(t,s))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};Jt.__PosthogExtensions__=Jt.__PosthogExtensions__||{},Jt.__PosthogExtensions__.errorWrappingFunctions=lo,Jt.__PosthogExtensions__.parseErrorAsProperties=oo,Jt.posthogErrorWrappingFunctions=lo,Jt.parseErrorAsProperties=oo;const co=(e,t)=>{const{sessionId:n,windowId:i}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",i)};Jt.__PosthogExtensions__=Jt.__PosthogExtensions__||{};const uo={_patchFetch:e=>oi(Bt,"fetch",(t=>async function(n,i){const r=new Request(n,i);return co(e,r),t(r)})),_patchXHR:e=>oi(Bt.XMLHttpRequest.prototype,"open",(t=>function(n,i){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const a=new Request(i);return co(e,a),t.call(this,n,a.url,r,s,o)}))};Jt.__PosthogExtensions__.tracingHeadersPatchFns=uo,Jt.postHogTracingHeadersPatchFns=uo;var ho,po,go,fo=-1,mo=function(e){addEventListener("pageshow",(function(t){t.persisted&&(fo=t.timeStamp,e(t))}),!0)},vo=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},_o=function(){var e=vo();return e&&e.activationStart||0},yo=function(e,t){var n=vo(),i="navigate";return fo>=0?i="back-forward-cache":n&&(document.prerendering||_o()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},bo=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Co=function(e,t,n,i){var r,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},wo=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Io=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},So=function(e){var t=!1;return function(){t||(e(),t=!0)}},ko=-1,xo=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Eo=function(e){"hidden"===document.visibilityState&&ko>-1&&(ko="visibilitychange"===e.type?e.timeStamp:0,Ao())},To=function(){addEventListener("visibilitychange",Eo,!0),addEventListener("prerenderingchange",Eo,!0)},Ao=function(){removeEventListener("visibilitychange",Eo,!0),removeEventListener("prerenderingchange",Eo,!0)},Mo=function(){return ko<0&&(ko=xo(),To(),mo((function(){setTimeout((function(){ko=xo(),To()}),0)}))),{get firstHiddenTime(){return ko}}},Ro=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Fo=[1800,3e3],No=function(e,t){t=t||{},Ro((function(){var n,i=Mo(),r=yo("FCP"),s=bo("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-_o(),0),r.entries.push(e),n(!0)))}))}));s&&(n=Co(e,r,Fo,t.reportAllChanges),mo((function(i){r=yo("FCP"),n=Co(e,r,Fo,t.reportAllChanges),wo((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Oo=[.1,.25],Po=[2500,4e3],Lo={},Do=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$o=function(e){if("loading"===document.readyState)return"loading";var t=Do();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},qo=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Bo=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:qo(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},Ho=-1,Wo=function(e,t){var n=Do(),i="navigate";return Ho>=0?i="back-forward-cache":n&&(document.prerendering||function(){var e=Do();return e&&e.activationStart||0}()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Uo=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Vo=function(e,t,n,i){var r,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Go=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Zo=0,jo=1/0,zo=0,Qo=function(e){e.forEach((function(e){e.interactionId&&(jo=Math.min(jo,e.interactionId),zo=Math.max(zo,e.interactionId),Zo=zo?(zo-jo)/7+1:0)}))},Ko=function(){"interactionCount"in performance||ho||(ho=Uo("event",Qo,{type:"event",buffered:!0,durationThreshold:0}))},Yo=[],Jo=new Map,Xo=0,ea=function(){return(ho?Zo:performance.interactionCount||0)-Xo},ta=[],na=function(e){if(ta.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Yo[Yo.length-1],n=Jo.get(e.interactionId);if(n||Yo.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Jo.set(i.id,i),Yo.push(i)}Yo.sort((function(e,t){return t.latency-e.latency})),Yo.length>10&&Yo.splice(10).forEach((function(e){return Jo.delete(e.id)}))}}},ia=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Go(e)),n},ra=[200,500],sa=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;Ko();var i,r=Wo("INP"),s=function(e){ia((function(){e.forEach(na);var t,n=(t=Math.min(Yo.length-1,Math.floor(ea()/50)),Yo[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())}))},o=Uo("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Vo(e,r,ra,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Go((function(){s(o.takeRecords()),i(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ho=t.timeStamp,e(t))}),!0)}((function(){Xo=0,Yo.length=0,Jo.clear(),r=Wo("INP"),i=Vo(e,r,ra,t.reportAllChanges)})))})))},oa=[],aa=[],la=new WeakMap,ca=new Map,ua=-1,da=function(e){oa=oa.concat(e),ha()},ha=function(){ua<0&&(ua=ia(pa))},pa=function(){ca.size>10&&ca.forEach((function(e,t){Jo.has(t)||ca.delete(t)}));var e=Yo.map((function(e){return la.get(e.entries[0])})),t=aa.length-50;aa=aa.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<aa.length;i++){var r=aa[i];ga(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}for(var s=0;s<50;s++){var o=oa[oa.length-1-s];if(!o||o.startTime<go)break;n.add(o)}oa=Array.from(n),ua=-1};ta.push((function(e){e.interactionId&&e.target&&!ca.has(e.interactionId)&&ca.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;go=Math.max(go,e.processingEnd);for(var i=aa.length-1;i>=0;i--){var r=aa[i];if(Math.abs(n-r.renderTime)<=8){(t=r).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},aa.push(t)),(e.interactionId||"first-input"===e.entryType)&&la.set(e,t),ha()}));var ga=function(e,t){for(var n,i=[],r=0;n=oa[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i};const fa={onLCP:function(e,t){t=t||{},Ro((function(){var n,i=Mo(),r=yo("LCP"),s=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-_o(),0),r.entries=[e],n())}))},o=bo("largest-contentful-paint",s);if(o){n=Co(e,r,Po,t.reportAllChanges);var a=So((function(){Lo[r.id]||(s(o.takeRecords()),o.disconnect(),Lo[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=So(e),"hidden"===document.visibilityState?e():(n=t(e),Io(e)),n}(a)}),!0)})),Io(a),mo((function(i){r=yo("LCP"),n=Co(e,r,Po,t.reportAllChanges),wo((function(){r.value=performance.now()-i.timeStamp,Lo[r.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},No(So((function(){var n,i=yo("CLS",0),r=0,s=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],n=s[s.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,s.push(e)):(r=e.value,s=[e])}})),r>i.value&&(i.value=r,i.entries=s,n())},a=bo("layout-shift",o);a&&(n=Co(e,i,Oo,t.reportAllChanges),Io((function(){o(a.takeRecords()),n(!0)})),mo((function(){r=0,i=yo("CLS",0),n=Co(e,i,Oo,t.reportAllChanges),wo((function(){return n()}))})),setTimeout(n,0))})))},onFCP:No,onINP:function(e,t){po||(po=Uo("long-animation-frame",da)),sa((function(t){var n=function(e){var t=e.entries[0],n=la.get(t),i=t.processingStart,r=n.processingEnd,s=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=ga(t.startTime,r),a=e.entries.find((function(e){return e.target})),l=a&&a.target||ca.get(t.interactionId),c=[t.startTime+t.duration,r].concat(o.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Bo(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(u-r,0),loadState:$o(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};Jt.__PosthogExtensions__=Jt.__PosthogExtensions__||{},Jt.__PosthogExtensions__.postHogWebVitalsCallbacks=fa,Jt.postHogWebVitalsCallbacks=fa;const ma="$people_distinct_id",va="__alias",_a="__timers",ya="$autocapture_disabled_server_side",ba="$heatmaps_enabled_server_side",Ca="$exception_capture_enabled_server_side",wa="$exception_capture_endpoint_suffix",Ia="$web_vitals_enabled_server_side",Sa="$web_vitals_allowed_metrics",ka="$session_recording_enabled_server_side",xa="$console_log_recording_enabled_server_side",Ea="$session_recording_network_payload_capture",Ta="$session_recording_canvas_recording",Aa="$replay_sample_rate",Ma="$replay_minimum_duration",Ra="$sesid",Fa="$session_is_sampled",Na="$session_recording_url_trigger_activated_session",Oa="$session_recording_url_trigger_status",Pa="$enabled_feature_flags",La="$early_access_features",Da="$stored_person_properties",$a="$stored_group_properties",qa="$surveys",Ba="$surveys_activated",Ha="$flag_call_reported",Wa="$user_state",Ua="$client_session_props",Va="$capture_rate_limit",Ga="$initial_campaign_params",Za="$initial_referrer_info",ja="$initial_person_info",za="$epp",Qa="__POSTHOG_TOOLBAR__",Ka=[ma,va,"__cmpns",_a,ka,ba,Ra,Pa,Wa,La,$a,Da,qa,Ha,Ua,Va,Ga,Za,za],Ya="$active_feature_flags",Ja="$override_feature_flags",Xa="$feature_flag_payloads",el=e=>{const t={};for(const[n,i]of ln(e||{}))i&&(t[n]=i);return t};class tl{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){const e=this.instance.get_property(Pa),t=this.instance.get_property(Ja);if(!t)return e||{};const n=on({},e),i=Object.keys(t);for(let e=0;e<i.length;e++)n[i[e]]=t[i[e]];return this._override_warning||(en.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(Xa)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);const e=this.instance.config.token,t=this.instance.get_property(Da),n=this.instance.get_property($a),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:Ys.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void en.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");const n=this.getFlagVariants()[e],i=`${n}`,r=this.instance.get_property(Ha)||{};var s;!t.send_event&&"send_event"in t||(e in r&&r[e].includes(i)||(xt(r[e])?r[e].push(i):r[e]=[i],null===(s=this.instance.persistence)||void 0===s||s.register({[Ha]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})));return n}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);en.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;const n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=e.featureFlags,s=e.featureFlagPayloads;if(!r)return;if(xt(r)){const e={};if(r)for(let t=0;t<r.length;t++)e[r[t]]=!0;return void(t&&t.register({[Ya]:r,[Pa]:e}))}let o=r,a=s;e.errorsWhileComputingFlags&&(o={...n,...o},a={...i,...a}),t&&t.register({[Ya]:Object.keys(el(o)),[Pa]:o||{},[Xa]:a||{}})}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return en.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Ja);else if(xt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[Ja]:t})}else this.instance.persistence.register({[Ja]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;const i={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);const r={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[Ya]:Object.keys(el(r)),[Pa]:r}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.instance.get_property(La);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;const i=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[La]:i}),e(i)}})}_prepareFeatureFlagsForCallbacks(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(Da)||{};this.instance.register({[Da]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Da)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property($a)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((t=>{n[t]={...n[t],...e[t]},delete e[t]})),this.instance.register({[$a]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.instance.get_property($a)||{};this.instance.register({[$a]:{...t,[e]:{}}})}else this.instance.unregister($a)}}
1
+ !function(){"use strict";var e,t=Object.defineProperty,n=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i),i=Object.defineProperty,r=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),s=(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))(s||{});function o(e){return e.nodeType===e.ELEMENT_NODE}function a(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function l(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function c(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,u).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function u(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=c(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}function d(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let h=class{constructor(){r(this,"idNodeMap",new Map),r(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function p(e){let{element:t,maskInputOptions:n,tagName:i,type:r,value:s,maskInputFn:o}=e,a=s||"";const l=r&&g(r);return(n[i.toLowerCase()]||l&&n[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function g(e){return e.toLowerCase()}const f="__rrweb_original__";function m(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?g(t):null}function v(e,t){var n;let i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==r?void 0:r[1])&&void 0!==n?n:null}let _=1;const y=new RegExp("[^a-z0-9-_:]"),b=-2;function w(){return _++}let I,S;const C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?:[a-z+]+:)?\/\//i,x=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function T(e,t){return(e||"").replace(C,((e,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return e;if(k.test(a)||x.test(a))return`url(${l}${a}${l})`;if(E.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const M=/^[^ \t\n\r\u000c]+/,A=/^[, \t\n\r\u000c]+/;const R=new WeakMap;function F(e,t){return t&&""!==t.trim()?L(e,t):t}function N(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function L(e,t){let n=R.get(e);if(n||(n=e.createElement("a"),R.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function P(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?F(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function i(e){let i;const r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(A),!(n>=t.length);){let s=i(M);if(","===s.slice(-1))s=F(e,s.substring(0,s.length-1)),r.push(s);else{let i="";s=F(e,s);let o=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((s+i).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,r.push((s+i).trim());break}"("===e&&(o=!0)}i+=e,n+=1}}}return r.join(", ")}(e,i):"style"===n?T(i,L(e)):"object"===t&&"data"===n?F(e,i):i:F(e,i):i}function O(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function D(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&D(e.parentNode,t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&D(e.parentNode,t,n)}function $(e,t,n,i){let r;if(o(e)){if(r=e,!r.childNodes.length)return!1}else{if(null===e.parentElement)return!1;r=e.parentElement}try{if("string"==typeof t){if(i){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(D(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(e){}return!1}function H(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:h,maskInputFn:v,dataURLOptions:_={},inlineImages:b,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:k=!1}=t,x=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:s.Document,childNodes:[],compatMode:e.compatMode}:{type:s.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:s.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:_,newlyAddedElement:b=!1,rootId:w}=t,C=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,r),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=g(e.tagName);return y.test(t)?"div":t}(e);let x={};const E=e.attributes.length;for(let t=0;t<E;t++){const i=e.attributes[t];O(k,i.name,i.value)||(x[i.name]=P(n,k,g(i.name),i.value))}if("link"===k&&o){const t=e.href;let i=d(n,t);if(!i&&t.includes(".css")){i=d(n,window.location.origin+"/"+t.replace(window.location.href,""))}let r=null;i&&(r=c(i)),r&&(delete x.rel,delete x.href,x._cssText=T(r,i.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=c(e.sheet);t&&(x._cssText=T(t,L(n)))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&t?x.value=p({element:e,type:m(e),tagName:k,value:t,maskInputOptions:a,maskInputFn:l}):n&&(x.checked=n)}"option"===k&&(e.selected&&!a.select?x.selected=!0:delete x.selected);if("canvas"===k&&v)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let i=0;i<e.height;i+=50){const r=t.getImageData,s=f in r?r[f]:r;if(new Uint32Array(s.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),i=n.createElement("canvas");i.width=e.width,i.height=e.height;t!==i.toDataURL(u.type,u.quality)&&(x.rr_dataURL=t)}if("img"===k&&h){I||(I=n.createElement("canvas"),S=I.getContext("2d"));const t=e,i=t.currentSrc||t.getAttribute("src")||"<unknown-src>",r=t.crossOrigin,s=()=>{t.removeEventListener("load",s);try{I.width=t.naturalWidth,I.height=t.naturalHeight,S.drawImage(t,0,0),x.rr_dataURL=I.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s));console.warn(`Cannot inline img src=${i}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(r?x.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s)}if("audio"===k||"video"===k){const t=x;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}b||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop));if(C){const{width:t,height:n}=e.getBoundingClientRect();x={class:x.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||_(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);let M;try{customElements.get(k)&&(M=!0)}catch(e){}return{type:s.Element,tagName:k,attributes:x,childNodes:[],isSVG:N(e)||void 0,needBlock:C,rootId:w,isCustom:M}}(e,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:v,dataURLOptions:_,inlineImages:b,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:k,rootId:x});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:i,maskTextFn:r,rootId:o}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(n=e.parentNode.sheet)?void 0:n.cssRules)&&(l=c(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}l=T(l,L(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&i&&(l=r?r(l,e.parentElement):l.replace(/[\S]/g,"*"));return{type:s.Text,textContent:l||"",isStyle:u,rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:h,rootId:x});case e.CDATA_SECTION_NODE:return{type:s.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:s.Comment,textContent:e.textContent||"",rootId:x};default:return!1}}function B(e){return null==e?"":e.toLowerCase()}function q(e,t){const{doc:n,mirror:i,blockClass:r,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:g={},maskTextFn:f,maskInputFn:m,slimDOMOptions:_,dataURLOptions:y={},inlineImages:I=!1,recordCanvas:S=!1,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:x=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:M=(()=>!1),newlyAddedElement:A=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:F=!0}=t;if(!R){R=$(e,u,d,void 0===R)}const N=H(e,{doc:n,mirror:i,blockClass:r,blockSelector:c,needsMask:R,inlineStylesheet:p,maskInputOptions:g,maskTextFn:f,maskInputFn:m,dataURLOptions:y,inlineImages:I,recordCanvas:S,keepIframeSrcFn:M,newlyAddedElement:A});if(!N)return console.warn(e,"not serialized"),null;let L;L=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===s.Comment)return!0;if(e.type===s.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===v(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(e.attributes.name)||"icon"===B(e.attributes.rel)||"apple-touch-icon"===B(e.attributes.rel)||"shortcut icon"===B(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===B(e.attributes.name)||"googlebot"===B(e.attributes.name)||"bingbot"===B(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===B(e.attributes.name)||"generator"===B(e.attributes.name)||"framework"===B(e.attributes.name)||"publisher"===B(e.attributes.name)||"progid"===B(e.attributes.name)||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===B(e.attributes.name)||"yandex-verification"===B(e.attributes.name)||"csrf-token"===B(e.attributes.name)||"p:domain_verify"===B(e.attributes.name)||"verify-v1"===B(e.attributes.name)||"verification"===B(e.attributes.name)||"shopify-checkout-api-token"===B(e.attributes.name)))return!0}}return!1}(N,_)&&(F||N.type!==s.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?w():b;const P=Object.assign(N,{id:L});if(i.add(e,P),L===b)return null;C&&C(e);let O=!h;if(P.type===s.Element){O=O&&!P.needBlock,delete P.needBlock;const t=e.shadowRoot;t&&l(t)&&(P.isShadowHost=!0)}if((P.type===s.Document||P.type===s.Element)&&O){_.headWhitespace&&P.type===s.Element&&"head"===P.tagName&&(F=!1);const t={doc:n,mirror:i,blockClass:r,blockSelector:c,needsMask:R,maskTextClass:u,maskTextSelector:d,skipChild:h,inlineStylesheet:p,maskInputOptions:g,maskTextFn:f,maskInputFn:m,slimDOMOptions:_,dataURLOptions:y,inlineImages:I,recordCanvas:S,preserveWhiteSpace:F,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M};if(P.type===s.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(e.childNodes)){const e=q(n,t);e&&P.childNodes.push(e)}if(o(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const i=q(n,t);i&&(l(e.shadowRoot)&&(i.isShadow=!0),P.childNodes.push(i))}}return e.parentNode&&a(e.parentNode)&&l(e.parentNode)&&(P.isShadow=!0),P.type===s.Element&&"iframe"===P.tagName&&function(e,t,n){const i=e.contentWindow;if(!i)return;let r,s=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){const i=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(i),s=!0,t()}))}const o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=q(t,{doc:t,mirror:i,blockClass:r,blockSelector:c,needsMask:R,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:f,maskInputFn:m,slimDOMOptions:_,dataURLOptions:y,inlineImages:I,recordCanvas:S,preserveWhiteSpace:F,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M});n&&k(e,n)}}),x),P.type===s.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===v(P.attributes.href))&&function(e,t,n){let i,r=!1;try{i=e.sheet}catch(e){return}if(i)return;const s=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),r=!0,t()}))}(e,(()=>{if(E){const t=q(e,{doc:n,mirror:i,blockClass:r,blockSelector:c,needsMask:R,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:f,maskInputFn:m,slimDOMOptions:_,dataURLOptions:y,inlineImages:I,recordCanvas:S,preserveWhiteSpace:F,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:M});t&&E(e,t)}}),T),P}function W(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}const G="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let V={map:{},getId:()=>(console.error(G),-1),getNode:()=>(console.error(G),null),removeNodeFromMap(){console.error(G)},has:()=>(console.error(G),!1),reset(){console.error(G)}};function Z(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,o)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,o)}),c))}}function U(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>U(e,t,s||{},!0)}function z(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(V=new Proxy(V,{get:(e,t,n)=>("map"===t&&console.error(G),Reflect.get(e,t,n))}));let Y=Date.now;function j(e){var t,n,i,r,s,o;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(s=null==(r=null==a?void 0:a.body)?void 0:r.parentElement)?void 0:s.scrollTop)||(null==(o=null==a?void 0:a.body)?void 0:o.scrollTop)||0}}function X(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function J(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function K(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function Q(e,t,n,i){if(!e)return!1;const r=K(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(D(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function ee(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===b}function te(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||te(e.parentNode,t))}function ne(e){return Boolean(e.changedTouches)}function ie(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 se(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Y=()=>(new Date).getTime());let oe=class{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ae(e){var t,n;let i=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(i=e.getRootNode().host),i}function le(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=ae(n);)n=t;return n}(e);return t.contains(n)}function ce(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||le(e))}var ue=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ue||{}),de=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(de||{}),he=(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))(he||{}),pe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(pe||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),fe=(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))(fe||{});function me(e){return"__ln"in e}class ve{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&me(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&me(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const _e=(e,t)=>`${e}@${t}`;class ye{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),n(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new ve,i=e=>{let t=e,n=b;for(;n===b;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{if(!r.parentNode||!ce(r)||"TEXTAREA"===r.parentNode.tagName)return;const s=a(r.parentNode)?this.mirror.getId(ae(r)):this.mirror.getId(r.parentNode),o=i(r);if(-1===s||-1===o)return n.addNode(r);const l=q(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{ie(e,this.mirror)&&this.iframeManager.addIframe(e),re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),se(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:o,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)we(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of this.addedSet)Ie(this.droppedSet,e)||we(this.removes,e,this.mirror)?Ie(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let s=null;for(;n.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=i(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===i(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=t.parentNode.host;if(-1!==this.mirror.getId(i)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),r(e.value)}const o={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))})),n(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")})),n(this,"processMutation",(e=>{if(!ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=e.target.textContent;Q(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:$(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,K(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){const e=m(t);i=p({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let r=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(t.contentDocument)return;n="rr_src"}if(r||(r={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(e.target,r)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!O(t.tagName,n)&&(r.attributes[n]=P(this.doc,g(t.tagName),g(n),i),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const i=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);i!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?r.styleDiff[e]=""===s?i:[i,s]:r._unchangedStyles[e]=[i,s]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r.styleDiff[e]=!1)}break}case"childList":if(Q(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),i=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(be(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[_e(n,i)]?be(this.movedSet,t):this.removes.push({parentId:i,id:n,isShadow:!(!a(e.target)||!l(e.target))||void 0})),this.mapRemoves.push(t))}))}})),n(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[_e(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),se(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function be(e,t){e.delete(t),t.childNodes.forEach((t=>be(e,t)))}function we(e,t,n){return 0!==e.length&&function(e,t,n){let i=t.parentNode;for(;i;){const t=n.getId(i);if(e.some((e=>e.id===t)))return!0;i=i.parentNode}return!1}(e,t,n)}function Ie(e,t){return 0!==e.size&&Se(e,t)}function Se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Se(e,n))}let Ce;const ke=e=>{if(!Ce)return e;return function(){try{return e(...arguments)}catch(e){if(Ce&&!0===Ce(e))return;throw e}}},xe=[];function Ee(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Te(e,t){var n,i;const r=new ye;xe.push(r),r.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const o=null==(i=null==(n=null==window?void 0:window.Zone)?void 0:n.__symbol__)?void 0:i.call(n,"MutationObserver");o&&window[o]&&(s=window[o]);const a=new s(ke(r.processMutations.bind(r)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Me(e){let{mouseInteractionCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,sampling:o}=e;if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[];let c=null;return Object.keys(he).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let o=g(e);const a=(e=>n=>{const o=Ee(n);if(Q(o,r,s,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=pe.Mouse;break;case"touch":a=pe.Touch;break;case"pen":a=pe.Pen}a===pe.Touch?he[e]===he.MouseDown?l="TouchStart":he[e]===he.MouseUp&&(l="TouchEnd"):pe.Pen}else ne(n)&&(a=pe.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===pe.Touch||l.startsWith("Mouse")&&a===pe.Mouse)&&(a=null)):he[e]===he.Click&&(a=c,c=null);const u=ne(n)?n.changedTouches[0]:n;if(!u)return;const d=i.getId(o),{clientX:h,clientY:p}=u;ke(t)({type:he[l],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(he[e]){case he.MouseDown:case he.MouseUp:o=o.replace("mouse","pointer");break;case he.TouchStart:case he.TouchEnd:return}l.push(W(o,a,n))})),ke((()=>{l.forEach((e=>e()))}))}function Ae(e){let{scrollCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,sampling:o}=e;return W("scroll",ke(Z(ke((e=>{const o=Ee(e);if(!o||Q(o,r,s,!0))return;const a=i.getId(o);if(o===n&&n.defaultView){const e=j(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})})),o.scroll||100)),n)}const Re=["INPUT","TEXTAREA","SELECT"],Fe=new WeakMap;function Ne(e){return function(e,t){if(De("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||De("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||De("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||De("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Le(e,t,n){let i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function Pe(e,t){let{mirror:n,stylesheetManager:i}=e;var r,s,o;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(o=null==(s=t.ownerDocument)?void 0:s.defaultView)?void 0:o.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{i.adoptStyleSheets(e,a)}catch(e){}return n}}),ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Oe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let i;!function(e,t){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),r(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(i=Te(e,e.doc));const r=function(e){let{mousemoveCb:t,sampling:n,doc:i,mirror:r}=e;if(!1===n.mousemove)return()=>{};const s="number"==typeof n.mousemove?n.mousemove:50,o="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=Z(ke((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),o),u=ke(Z(ke((e=>{const t=Ee(e),{clientX:n,clientY:i}=ne(e)?e.changedTouches[0]:e;a||(a=Y()),l.push({x:n,y:i,id:r.getId(t),timeOffset:Y()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?de.Drag:e instanceof MouseEvent?de.MouseMove:de.TouchMove)})),s,{trailing:!1})),d=[W("mousemove",u,i),W("touchmove",u,i),W("drag",u,i)];return ke((()=>{d.forEach((e=>e()))}))}(e),s=Me(e),o=Ae(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:i}=t,r=-1,s=-1;return W("resize",ke(Z(ke((()=>{const e=X(),t=J();r===e&&s===t||(n({width:Number(t),height:Number(e)}),r=e,s=t)})),200)),i)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:i,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d}=e;function h(e){let t=Ee(e);const i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=t.parentElement),!t||!u||Re.indexOf(u)<0||Q(t,r,s,!0))return;if(t.classList.contains(o)||a&&t.matches(a))return;let h=t.value,f=!1;const v=m(t)||"";"radio"===v||"checkbox"===v?f=t.checked:(l[u.toLowerCase()]||l[v])&&(h=p({element:t,maskInputOptions:l,tagName:u,type:v,value:h,maskInputFn:c})),g(t,d?{text:h,isChecked:f,userTriggered:i}:{text:h,isChecked:f});const _=t.name;"radio"===v&&_&&f&&n.querySelectorAll(`input[type="radio"][name="${_}"]`).forEach((e=>{if(e!==t){const t=e.value;g(e,d?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function g(e,n){const r=Fe.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){Fe.set(e,n);const r=i.getId(e);ke(t)({...n,id:r})}}const f=("last"===u.input?["change"]:["input","change"]).map((e=>W(e,ke(h),n))),v=n.defaultView;if(!v)return()=>{f.forEach((e=>e()))};const _=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return _&&_.set&&f.push(...y.map((e=>U(e[0],e[1],{set(){ke(h)({target:this,isTrusted:!1})}},!1,v)))),ke((()=>{f.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:i,mirror:r,sampling:s,doc:o}=e;const a=ke((e=>Z(ke((s=>{const o=Ee(s);if(!o||Q(o,n,i,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=o;t({type:e,id:r.getId(o),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})})),s.media||500))),l=[W("play",a(fe.Play),o),W("pause",a(fe.Pause),o),W("seeked",a(fe.Seeked),o),W("volumechange",a(fe.VolumeChange),o),W("ratechange",a(fe.RateChange),o)];return ke((()=>{l.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},g=()=>{};e.recordDOM&&(u=function(e,t){let{styleSheetRuleCb:n,mirror:i,stylesheetManager:r}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:ke(((e,t,s)=>{const[o,a]=s,{id:l,styleId:c}=Le(t,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:o,index:a}]}),e.apply(t,s)}))});const a=s.CSSStyleSheet.prototype.deleteRule;let l,c;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:ke(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Le(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:ke(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Le(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(c=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ke(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Le(t,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));const u={};$e("CSSGroupingRule")?u.CSSGroupingRule=s.CSSGroupingRule:($e("CSSMediaRule")&&(u.CSSMediaRule=s.CSSMediaRule),$e("CSSConditionRule")&&(u.CSSConditionRule=s.CSSConditionRule),$e("CSSSupportsRule")&&(u.CSSSupportsRule=s.CSSSupportsRule));const d={};return Object.entries(u).forEach((e=>{let[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:ke(((e,t,s)=>{const[o,a]=s,{id:l,styleId:c}=Le(t.parentStyleSheet,i,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:o,index:[...Ne(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:ke(((e,t,s)=>{const[o]=s,{id:a,styleId:l}=Le(t.parentStyleSheet,i,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Ne(t),o]}]}),e.apply(t,s)}))})})),ke((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=a,l&&(s.CSSStyleSheet.prototype.replace=l),c&&(s.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach((e=>{let[t,n]=e;n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),d=Pe(e,e.doc),h=function(e,t){let{styleDeclarationCb:n,mirror:i,ignoreCSSAttributes:r,stylesheetManager:s}=e,{win:o}=t;const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:ke(((e,t,o)=>{var l;const[c,u,d]=o;if(r.has(c))return a.apply(t,[c,u,d]);const{id:h,styleId:p}=Le(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:Ne(t.parentRule)}),e.apply(t,o)}))});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ke(((e,t,o)=>{var a;const[c]=o;if(r.has(c))return l.apply(t,[c]);const{id:u,styleId:d}=Le(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,remove:{property:c},index:Ne(t.parentRule)}),e.apply(t,o)}))}),ke((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(g=function(e){let{fontCb:t,doc:n}=e;const i=n.defaultView;if(!i)return()=>{};const r=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,n){const i=new o(e,t,n);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};const a=z(n.fonts,"add",(function(e){return function(n){return setTimeout(ke((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{i.FontFace=o})),r.push(a),ke((()=>{r.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=e;let o=!0;const a=ke((()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=s;Q(o,i,r,!0)||Q(c,i,r,!0)||a.push({start:n.getId(o),startOffset:l,end:n.getId(c),endOffset:u})}s({ranges:a})}));return a(),W("selectionchange",a)}(e),v=function(e){let{doc:t,customElementCb:n}=e;const i=t.defaultView;return i&&i.customElements?z(i.customElements,"define",(function(e){return function(t,i,r){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,i,r])}})):()=>{}}(e),_=[];for(const t of e.plugins)_.push(t.observer(t.callback,n,t.options));return ke((()=>{xe.forEach((e=>e.reset())),null==i||i.disconnect(),r(),s(),o(),a(),l(),c(),u(),d(),h(),g(),f(),v(),_.forEach((e=>e()))}))}function De(e){return void 0!==window[e]}function $e(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class He{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,i){const r=n||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e);let o=r.get(t);return o||(o=this.generateIdFn(),r.set(t,o),s.set(o,t)),o}getIds(e,t){const n=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,i)))}getRemoteId(e,t,n){const i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=i.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Be{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new He(w)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new He(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ue.IncrementalSnapshot,data:{source:de.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return t;case ue.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ue.IncrementalSnapshot:switch(t.data.source){case de.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.Drag:case de.TouchMove:case de.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case de.ViewportResize:return!1;case de.MediaInteraction:case de.MouseInteraction:case de.Scroll:case de.CanvasMutation:case de.Input:return this.replaceIds(t.data,e,["id"]),t;case de.StyleSheetRule:case de.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case de.Font:return t;case de.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case de.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,i){for(const r of i)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===s.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class qe{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!l(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Te({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ae({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Pe({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(z(e.prototype,"attachShadow",(function(e){return function(i){const r=e.call(this,i);return this.shadowRoot&&ce(this)&&n.addShadowRoot(this.shadowRoot,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ge="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;Ve<64;Ve++)Ge[We.charCodeAt(Ve)]=Ve;const Ze=new Map;const Ue=(e,t,n)=>{if(!e||!je(e,t)&&"object"!=typeof e)return;const i=function(e,t){let n=Ze.get(e);return n||(n=new Map,Ze.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r};function ze(e,t,n){if(e instanceof Array)return e.map((e=>ze(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),i=n.length,r="";for(t=0;t<i;t+=3)r+=We[n[t]>>2],r+=We[(3&n[t])<<4|n[t+1]>>4],r+=We[(15&n[t+1])<<2|n[t+2]>>6],r+=We[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ze(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ze(e.data,t,n),e.width,e.height]}}if(je(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ue(e,t,n)}}return e}const Ye=(e,t,n)=>e.map((e=>ze(e,t,n))),je=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Xe(e,t,n,i){const r=[];try{const s=z(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!Q(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),i&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[r,...o])}}));r.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function Je(e,t,n,i,r,s){const o=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=z(e,l,(function(e){return function(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];const u=e.apply(this,a);if(Ue(u,s,this),"tagName"in this.canvas&&!Q(this.canvas,i,r,!0)){const e=Ye(a,s,this),i={type:t,property:l,args:e};n(this.canvas,i)}return u}}));o.push(a)}catch{const i=U(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(i)}return o}const Ke="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Qe="undefined"!=typeof window&&window.Blob&&new Blob([(et=Ke,Uint8Array.from(atob(et),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var et;function tt(e){let t;try{if(t=Qe&&(window.URL||window.webkitURL).createObjectURL(Qe),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+Ke,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class nt{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:i,blockClass:r,blockSelector:s,recordCanvas:o,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(i,r,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,i,r,s,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,i,r){const s=Xe(t,n,i,!0),o=new Map,a=new tt;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:r,height:s}=e.data;this.mutationCb({id:t,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[],r=t=>{t.querySelectorAll("canvas").forEach((t=>{Q(t,n,i,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&r(e.shadowRoot)}))};return r(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(o.get(n))return;if(0===e.width||0===e.height)return;if(o.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=e.clientWidth||e.width,s=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:i,resizeHeight:s});a.postMessage({id:n,bitmap:l,width:i,height:s,dataURLOptions:r.dataURLOptions},[l])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Xe(e,t,n,!1),r=function(e,t,n,i){const r=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const s=z(t.CanvasRenderingContext2D.prototype,o,(function(r){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Q(this.canvas,n,i,!0)||setTimeout((()=>{const n=Ye(a,t,this);e(this.canvas,{type:ge["2D"],property:o,args:n})}),0),r.apply(this,a)}}));r.push(s)}catch{const n=U(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:ge["2D"],property:o,args:[t],setter:!0})}});r.push(n)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,i){const r=[];return r.push(...Je(t.WebGLRenderingContext.prototype,ge.WebGL,e,n,i,t)),void 0!==t.WebGL2RenderingContext&&r.push(...Je(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,n,i,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{i(),r(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const{type:t,...n}=e;return n})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}class it{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new oe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:u(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class rt{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let st,ot,at,lt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}const ct=new h;function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:s=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:g,maskInputFn:f,maskTextFn:m,hooks:v,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=e;Ce=F;const N=!C||window.parent===window;let L=!1;if(!N)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!L)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),ct.reset();const P=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},O=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g,headTitleMutations:"all"===g}:g||{};let D;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];let r=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===r)return!0}while(r=r&&r.parentNode);return!1})}();let $=0;const H=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!L&&(e=_(e)),e};st=(e,r)=>{var s;const o=e;if(o.timestamp=Y(),!(null==(s=xe[0])?void 0:s.isFrozen())||o.type===ue.FullSnapshot||o.type===ue.IncrementalSnapshot&&o.data.source===de.Mutation||xe.forEach((e=>e.unfreeze())),N)null==t||t(H(o),r);else if(L){const e={type:"rrweb",event:H(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(e,"*")}if(o.type===ue.FullSnapshot)D=o,$=0;else if(o.type===ue.IncrementalSnapshot){if(o.data.source===de.Mutation&&o.data.isAttachIframe)return;$++;const e=i&&$>=i,t=n&&o.timestamp-D.timestamp>n;(e||t)&&ot(!0)}};const B=e=>{st({type:ue.IncrementalSnapshot,data:{source:de.Mutation,...e}})},G=e=>st({type:ue.IncrementalSnapshot,data:{source:de.Scroll,...e}}),V=e=>st({type:ue.IncrementalSnapshot,data:{source:de.CanvasMutation,...e}}),Z=new it({mutationCb:B,adoptedStyleSheetCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.AdoptedStyleSheet,...e}})}),U=new Be({mirror:ct,mutationCb:B,stylesheetManager:Z,recordCrossOriginIframes:C,wrappedEmit:st});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:ct,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});const z=new rt;at=new nt({recordCanvas:S,mutationCb:V,win:window,blockClass:r,blockSelector:s,mirror:ct,sampling:y.canvas,dataURLOptions:b});const K=new qe({mutationCb:B,scrollCb:G,bypassOptions:{blockClass:r,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:P,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:O,iframeManager:U,stylesheetManager:Z,canvasManager:at,keepIframeSrcFn:A,processedNodeManager:z},mirror:ct});ot=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I)return;st({type:ue.Meta,data:{href:window.location.href,width:J(),height:X()}},e),Z.reset(),K.init(),xe.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new h,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:g=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:I=(()=>!1)}=t||{};return q(e,{doc:e,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ct,blockClass:r,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:P,maskTextFn:m,maskInputFn:f,slimDOM:O,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:e=>{ie(e,ct)&&U.addIframe(e),re(e,ct)&&Z.trackLinkElement(e),se(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");st({type:ue.FullSnapshot,data:{node:t,initialOffset:j(window)}},e),xe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,ct.getId(document))};try{const e=[],t=e=>{var t;return ke(Oe)({mutationCb:B,mousemoveCb:(e,t)=>st({type:ue.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.MouseInteraction,...e}}),scrollCb:G,viewportResizeCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.ViewportResize,...e}}),inputCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.Input,...e}}),mediaInteractionCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.MediaInteraction,...e}}),styleSheetRuleCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.StyleSheetRule,...e}}),styleDeclarationCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>st({type:ue.IncrementalSnapshot,data:{source:de.Font,...e}}),selectionCb:e=>{st({type:ue.IncrementalSnapshot,data:{source:de.Selection,...e}})},customElementCb:e=>{st({type:ue.IncrementalSnapshot,data:{source:de.CustomElement,...e}})},blockClass:r,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:P,inlineStylesheet:u,sampling:y,recordDOM:I,recordCanvas:S,inlineImages:T,userTriggeredOnInput:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:O,dataURLOptions:b,mirror:ct,iframeManager:U,stylesheetManager:Z,shadowDomManager:K,processedNodeManager:z,canvasManager:at,ignoreCSSAttributes:R,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>st({type:ue.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},v)};U.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{ot(),e.push(t(document)),lt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(W("DOMContentLoaded",(()=>{st({type:ue.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(W("load",(()=>{st({type:ue.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),z.destroy(),lt=!1,Ce=void 0}}catch(e){console.warn(e)}}var dt,ht;ut.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");st({type:ue.Custom,data:{tag:e,payload:t}})},ut.freezePage=()=>{xe.forEach((e=>e.freeze()))},ut.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");ot(e)},ut.mirror=ct,(ht=dt||(dt={}))[ht.NotStarted=0]="NotStarted",ht[ht.Running=1]="Running",ht[ht.Stopped=2]="Stopped";const pt="2.0.0-alpha.16";var gt,ft=Object.defineProperty,mt=(e,t,n)=>(((e,t,n)=>{t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),vt=Object.defineProperty,_t=(e,t,n)=>(((e,t,n)=>{t in e?vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),yt=Object.defineProperty,bt=(e,t,n)=>(((e,t,n)=>{t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class wt{constructor(){bt(this,"idNodeMap",new Map),bt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function It(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&It(e.parentNode,t,n);for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return!!n&&It(e.parentNode,t,n)}const St="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ct={map:{},getId:()=>(console.error(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ct=new Proxy(Ct,{get:(e,t,n)=>("map"===t&&console.error(St),Reflect.get(e,t,n))}));let kt=Date.now;function xt(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}/[1-9][0-9]{12}/.test(Date.now().toString())||(kt=()=>(new Date).getTime());function Et(e){var t,n;let i=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(i=e.getRootNode().host),i}function Tt(e){let t,n=e;for(;t=Et(n);)n=t;return n}function Mt(e){const t=e.ownerDocument;if(!t)return!1;const n=Tt(e);return t.contains(n)}const At=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){_t(this,"id",1),_t(this,"styleIDMap",new WeakMap),_t(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return Ct},closestElementOfNode:xt,getBaseDimension:function e(t,n){var i,r;const s=null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.frameElement;if(!s||s===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=s.getBoundingClientRect(),a=e(s,n),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const i=t[n[0]];return 1===n.length?i:e(i.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:Tt,getShadowHost:Et,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,i,r,s,o;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.scrollLeft)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==(s=null==(r=null==a?void 0:a.body)?void 0:r.parentElement)?void 0:s.scrollTop)||(null==(o=null==a?void 0:a.body)?void 0:o.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return Boolean(null==e?void 0:e.shadowRoot)},hookSetter:function e(t,n,i,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const o=s.Object.getOwnPropertyDescriptor(t,n);return s.Object.defineProperty(t,n,r?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,n,o||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Mt(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}(t))return!1;const i=n.getId(t);return!n.has(i)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))},isBlocked:function(e,t,n,i){if(!e)return!1;const r=xt(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(It(r,t,i))return!0}catch(e){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let i=t.children.length-1;i>=0;i--)e(t.children[i],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return kt},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const i={capture:!0,passive:!0};return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}},polyfill:function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];let r=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===r)return!0}while(r=r&&r.parentNode);return!1})},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const r of e){const{nextId:e,parentId:s}=r;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(r,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(r,null))}}else if(s in t){const e=t[s];e.children.push(n(r,e))}else i.push(n(r,null))}return i},shadowHostInDom:Mt,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null,r=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=Date.now();r||!1!==n.leading||(r=l);const c=t-(l-r),u=this;c<=0||c>t?(i&&(clearTimeout(i),i=null),r=l,e.apply(u,o)):i||!1===n.trailing||(i=setTimeout((()=>{r=!1===n.leading?0:Date.now(),i=null,e.apply(u,o)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let i=e.length;i--;){const r=e[i];t.has(r.id)||(n.push(r),t.add(r.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Nt=0;Nt<64;Nt++)Ft[Rt.charCodeAt(Nt)]=Nt;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(gt=e.contentWindow)?void 0:gt.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt;new wt,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Lt||(Lt={}));class Pt{constructor(e){mt(this,"fileName"),mt(this,"functionName"),mt(this,"lineNumber"),mt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ot=/(^|@)\S+:\d+/,Dt=/^\s*at .*(\S+:\d+|\(native\))/m,$t=/^(eval@)?(\[native code])?$/,Ht={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Dt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Dt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const i=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new Pt({functionName:s,fileName:o,lineNumber:r[1],columnNumber:r[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match($t)}),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 Pt({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new Pt({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new Pt({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&i.push(new Pt({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ot)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Pt({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Bt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(let e=0;e<i.children.length;e++){const t=i.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=i}return t}function qt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Wt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const i of n)if(qt(e[i])&&Wt(e[i],t-1))return!0;return!1}function Gt(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const i=[],r=[];return JSON.stringify(e,(function(e,t){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(qt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(qt(e)&&Wt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const i=t[n];Array.isArray(i)?e[n]=Bt(i.length?i[0]:null):e[n]=i}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const 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,n){const i=n?Object.assign({},Vt,n):Vt,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?t[r]:r;let o=0,a=!1;const l=[];if(i.level.includes("error")){const n=t=>{const n=t.message,r=t.error,s=Ht.parse(r).map((e=>e.toString())),o=[Gt(n,i.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const r=t=>{let n,r;t.reason instanceof Error?(n=t.reason,r=[Gt(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Gt("Uncaught (in promise)",i.stringifyOptions),Gt(t.reason,i.stringifyOptions)]);const s=Ht.parse(n).map((e=>e.toString()));e({level:"error",trace:s,payload:r})};t.addEventListener("unhandledrejection",r),l.push((()=>{t.removeEventListener("unhandledrejection",r)}))}for(const e of i.level)l.push(c(s,e));return()=>{l.forEach((e=>e()))};function c(t,n){var r=this;return t[n]?At.patch(t,n,(t=>function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];if(t.apply(r,l),!a){a=!0;try{const t=Ht.parse(new Error).map((e=>e.toString())).splice(1),r=l.map((e=>Gt(e,i.stringifyOptions)));o++,o<i.lengthThreshold?e({level:n,trace:t,payload:r}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Gt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const Ut=e=>({name:"rrweb/console@1",observer:Zt,options:e}),zt=Array.isArray,Yt=Object.prototype,jt=Yt.hasOwnProperty,Xt=Yt.toString,Jt=zt||function(e){return"[object Array]"===Xt.call(e)},Kt=function(e){return"function"==typeof e},Qt=function(e){return e===Object(e)&&!Jt(e)},en=function(e){if(Qt(e)){for(const t in e)if(jt.call(e,t))return!1;return!0}return!1},tn=function(e){return void 0===e},nn=function(e){return"[object String]"==Xt.call(e)},rn=function(e){return nn(e)&&0===e.trim().length},sn=function(e){return null===e},on=function(e){return tn(e)||sn(e)},an=function(e){return"[object Number]"==Xt.call(e)},ln=function(e){return"[object Boolean]"===Xt.call(e)},cn=e=>e instanceof Document,un=e=>e instanceof FormData;const dn={DEBUG:!1,LIB_VERSION:"1.174.4"},hn="undefined"!=typeof window?window:void 0,pn="undefined"!=typeof globalThis?globalThis:hn,gn=Array.prototype,fn=gn.forEach,mn=gn.indexOf,vn=null==pn?void 0:pn.navigator,_n=null==pn?void 0:pn.document,yn=null==pn?void 0:pn.location,bn=null==pn?void 0:pn.fetch,wn=null!=pn&&pn.XMLHttpRequest&&"withCredentials"in new pn.XMLHttpRequest?pn.XMLHttpRequest:void 0,In=null==pn?void 0:pn.AbortController,Sn=null==vn?void 0:vn.userAgent,Cn=null!=hn?hn:{},kn="[PostHog.js]",xn={_log:function(e){if(hn&&(dn.DEBUG||Cn.POSTHOG_DEBUG)&&!tn(hn.console)&&hn.console){const r="__rrweb_original__"in hn.console[e]?hn.console[e].__rrweb_original__:hn.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(kn,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];xn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];xn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];xn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(kn,...t)},uninitializedWarning:e=>{xn.error(`You must initialize PostHog before calling ${e}`)}},En={},Tn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Mn(e,t,n){if(Jt(e))if(fn&&e.forEach===fn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===En)return}function An(e,t,n){if(!on(e)){if(Jt(e))return Mn(e,t,n);if(un(e)){for(const i of e.entries())if(t.call(n,i[1],i[0])===En)return}else for(const i in e)if(jt.call(e,i)&&t.call(n,e[i],i)===En)return}}const Rn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Mn(n,(function(t){for(const n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function Fn(e,t){return-1!==e.indexOf(t)}function Nn(e){const t=Object.keys(e);let n=t.length;const i=new Array(n);for(;n--;)i[n]=[t[n],e[t[n]]];return i}const Ln=function(e){try{return e()}catch{return}},Pn=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){xn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xn.critical(e)}}},On=function(e){const t={};return An(e,(function(e,n){nn(e)&&e.length>0&&(t[n]=e)})),t},Dn=function(e){return e.replace(/^\$/,"")};function $n(e,t){return function(e,t){const n=new Set;return function e(i,r){if(i!==Object(i))return t?t(i,r):i;if(n.has(i))return;let s;return n.add(i),Jt(i)?(s=[],Mn(i,(t=>{s.push(e(t))}))):(s={},An(i,((t,i)=>{n.has(t)||(s[i]=e(t,i))}))),s}(e)}(e,(e=>nn(e)&&!sn(t)?e.slice(0,t):e))}const Hn=function(e){let t,n,i,r="",s=0;for(t=n=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<s;i++){const s=e.charCodeAt(i);let o=null;s<128?n++:o=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),sn(o)||(n>t&&(r+=e.substring(t,n)),r+=o,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},Bn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,s){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!s);else{const r="on"+n,s=t[r];t[r]=function(t,n,i){return function(r){if(!(r=r||e(null==hn?void 0:hn.event)))return;let s,o=!0;Kt(i)&&(s=i(r));const a=n.call(t,r);return!1!==s&&!1!==a||(o=!1),o}}(t,i,s)}else xn.error("No valid element provided to register_event")}}();function qn(e){const t=null==e?void 0:e.hostname;return!!nn(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}function Wn(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}const Gn=["localhost","127.0.0.1"],Vn=e=>{const t=null==_n?void 0:_n.createElement("a");return tn(t)?null:(t.href=e,t)},Zn=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},Un=function(e){let t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const r=[];return An(e,(function(e,i){tn(e)||tn(i)||"undefined"===i||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},zn=function(e,t){const n=((e.split("#")[0]||"").split("?")[1]||"").split("&");let i;for(let e=0;e<n.length;e++){const r=n[e].split("=");if(r[0]===t){i=r;break}}if(!Jt(i)||i.length<2)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch{xn.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},Yn=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function jn(e){return e?Tn(e).split(/\s+/):[]}function Xn(e){const t=null==hn?void 0:hn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Jn(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return jn(t)}function Kn(e){return on(e)?null:Tn(e).split(/(\s+)/).filter((e=>mi(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Qn(e){let t="";return li(e)&&!ci(e)&&e.childNodes&&e.childNodes.length&&An(e.childNodes,(function(e){var n;ii(e)&&e.textContent&&(t+=null!==(n=Kn(e.textContent))&&void 0!==n?n:"")})),Tn(t)}function ei(e){return tn(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}function ti(e){return!!e&&1===e.nodeType}function ni(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ii(e){return!!e&&3===e.nodeType}function ri(e){return!!e&&11===e.nodeType}const si=["a","button","form","input","select","textarea","label"];function oi(e){const t=e.parentNode;return!(!t||!ti(t))&&t}function ai(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!hn||!e||ni(e,"html")||!ti(e))return!1;if(null!=n&&n.url_allowlist&&!Xn(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Xn(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){const e=n.dom_event_allowlist;if(e&&!e.some((e=>t.type===e)))return!1}let s=!1;const o=[e];let a=!0,l=e;for(;l.parentNode&&!ni(l,"body");)if(ri(l.parentNode))o.push(l.parentNode.host),l=l.parentNode.host;else{if(a=oi(l),!a)break;if(i||si.indexOf(a.tagName.toLowerCase())>-1)s=!0;else{const e=hn.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(s=!0)}o.push(a),l=a}if(!function(e,t){const n=null==t?void 0:t.element_allowlist;if(tn(n))return!0;for(const t of e)if(n.some((e=>t.tagName.toLowerCase()===e)))return!0;return!1}(o,n))return!1;if(!function(e,t){const n=null==t?void 0:t.css_selector_allowlist;if(tn(n))return!0;for(const t of e)if(n.some((e=>t.matches(e))))return!0;return!1}(o,n))return!1;const c=hn.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0;const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return s?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(si.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}function li(e){for(let t=e;t.parentNode&&!ni(t,"body");t=t.parentNode){const e=Jn(t);if(Fn(e,"ph-sensitive")||Fn(e,"ph-no-capture"))return!1}if(Fn(Jn(e),"ph-include"))return!0;const t=e.type||"";if(nn(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";if(nn(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function ci(e){return!!(ni(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ni(e,"select")||ni(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const ui="(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})",di=new RegExp(`^(?:${ui})$`),hi=new RegExp(ui),pi="\\d{3}-?\\d{2}-?\\d{4}",gi=new RegExp(`^(${pi})$`),fi=new RegExp(`(${pi})`);function mi(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(on(e))return!1;if(nn(e)){e=Tn(e);if((t?di:hi).test((e||"").replace(/[- ]/g,"")))return!1;if((t?gi:fi).test(e))return!1}return!0}function vi(e){let t=Qn(e);return t=`${t} ${_i(e)}`.trim(),mi(t)?t:""}function _i(e){let t="";return e&&e.childNodes&&e.childNodes.length&&An(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Qn(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${_i(e)}`.trim())}catch(e){xn.error(e)}})),t}function yi(e){return function(e){const t=e.map((e=>{var t,n;let i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)i+=`.${t.replace(/"/g,"")}`}const r={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},s={};return Nn(r).sort(((e,t)=>{let[n]=e,[i]=t;return n.localeCompare(i)})).forEach((e=>{let[t,n]=e;return s[bi(t.toString())]=bi(n.toString())})),i+=":",i+=Nn(r).map((e=>{let[t,n]=e;return`${t}="${n}"`})).join(""),i}));return t.join(";")}(function(e){return e.map((e=>{var t,n;const i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:wi(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Nn(e).filter((e=>{let[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{let[t,n]=e;return i.attributes[t]=n})),i}))}(e))}function bi(e){return e.replace(/"|\\"/g,'\\"')}function wi(e){const t=e.attr__class;return t?Jt(t)?t:jn(t):void 0}const Ii="[SessionRecording]",Si="redacted",Ci={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},ki=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],xi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ei=["/s/","/e/","/i/"];function Ti(e,t,n,i){if(on(e))return e;let r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return nn(r)&&(r=parseInt(r)),r>n?Ii+` ${i} body too large to record (${r} bytes)`:e}function Mi(e,t){if(on(e))return e;let n=e;return mi(n,!1)||(n=Ii+" "+t+" body "+Si),An(xi,(e=>{var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=Ii+" "+t+" body "+Si+" as might contain: "+e)})),n}const Ai=(e,t)=>{const n={payloadSizeLimitBytes:Ci.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ci.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Ci.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,r=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,o=(e=>{var t;const n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=Ti(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=Ti(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>o((e=>{const t=Vn(e.name);if(!(t&&t.pathname&&Ei.some((e=>0===t.pathname.indexOf(e)))))return e})((e=>{const t=e.requestHeaders;return on(t)||An(Object.keys(null!=t?t:{}),(e=>{ki.includes(e.toLowerCase())&&(t[e]=Si)})),e})(e))),l=Kt(e.session_recording.maskNetworkRequestFn);return l&&Kt(e.session_recording.maskCapturedNetworkRequestFn)&&xn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{const n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=Kt(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,i,r;const s=a(t);return s&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,s))&&void 0!==n?n:void 0}:e=>function(e){if(!tn(e))return e.requestBody=Mi(e.requestBody,"Request"),e.responseBody=Mi(e.responseBody,"Response"),e}(a(e)),{...Ci,...n,recordHeaders:i,recordBody:r,recordPerformance:s,recordInitialRequests:s}};function Ri(e,t,n){try{if(!(t in e))return()=>{};const i=e[t],r=n(i);return Kt(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=i}}catch{return()=>{}}}function Fi(e,t){var n;const i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),r={hostname:i,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==i||!i.trim().length)return r;for(const e of t.payloadHostDenyList)if(i.endsWith(e))return{hostname:i,isHostDenied:!0};return r}const Ni=e=>"navigation"===e.entryType,Li=e=>"resource"===e.entryType;function Pi(e,t,n){if(n.recordInitialRequests){const i=t.performance.getEntries().filter((e=>Ni(e)||Li(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>qi({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const i=new t.PerformanceObserver((t=>{const i=t.getEntries().filter((e=>Ni(e)||Li(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>qi({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),r=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:r}),()=>{i.disconnect()}}function Oi(e,t){return!!t&&(ln(t)||t[e])}function Di(e){let{type:t,recordBody:n,headers:i}=e;function r(e){const t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),n=t&&i[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(ln(n))return!0;if(Jt(n))return r(n);const s=n[t];return ln(s)?s:r(s)}async function $i(e,t,n,i,r){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(s>10)return xn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const o=function(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}(e.performance.getEntriesByName(n),(e=>Li(e)&&e.initiatorType===t&&(tn(i)||e.startTime>=i)&&(tn(r)||e.startTime<=r)));return o||(await new Promise((e=>setTimeout(e,50*s))),$i(e,t,n,i,r,s+1))}function Hi(e){let{body:t,options:n,url:i}=e;if(on(t))return null;const{hostname:r,isHostDenied:s}=Fi(i,n);if(s)return r+" is in deny list";if(nn(t))return t;if(cn(t))return t.textContent;if(un(t))return Un(t);if(Qt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Bi=e=>!sn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function qi(e){let{entry:t,method:n,status:i,networkRequest:r,isInitial:s,start:o,end:a,url:l,initiatorType:c}=e;o=t?t.startTime:o,a=t?t.responseEnd:a;const u=Math.floor(Date.now()-performance.now()),d=Math.floor(u+(o||0)),h=[{...t?t.toJSON():{name:l},startTime:tn(o)?void 0:Math.round(o),endTime:tn(a)?void 0:Math.round(a),timeOrigin:u,timestamp:d,method:n,initiatorType:t?t.initiatorType:c,status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:s}];if(Bi(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const Wi=["video/","audio/"];function Gi(e){return new Promise(((t,n)=>{const i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(i)))}catch{clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}async function Vi(e){let{r:t,options:n,url:i}=e;const r=function(e){var t;let{r:n,options:i,url:r}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const s=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),o=Wi.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return`Content-Type ${s} is not supported`;const{hostname:a,isHostDenied:l}=Fi(r,i);return l?a+" is in deny list":null}({r:t,options:n,url:i});return sn(r)?Gi(t):Promise.resolve(r)}function Zi(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Oi("request",n.recordHeaders),r=Oi("response",n.recordHeaders),s=Ri(t,"fetch",(s=>async function(o,a){const l=new Request(o,a);let c;const u={};let d,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),i&&(u.requestHeaders=e),Di({type:"request",headers:e,url:o,recordBody:n.recordBody})&&(u.requestBody=await async function(e){let{r:t,options:n,url:i}=e;const{hostname:r,isHostDenied:s}=Fi(i,n);return s?Promise.resolve(r+" is in deny list"):Gi(t)}({r:l,options:n,url:o})),d=t.performance.now(),c=await s(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),r&&(u.responseHeaders=a),Di({type:"response",headers:a,url:o,recordBody:n.recordBody})&&(u.responseBody=await Vi({r:c,options:n,url:o})),c}finally{$i(t,"fetch",l.url,d,h).then((t=>{var n;const i=qi({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:u,start:d,end:h,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return()=>{s()}}let Ui=null;function zi(e,t,n){if(!("performance"in t))return()=>{};if(Ui)return xn.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ci,n):Ci,r=t=>{const n=[];t.requests.forEach((e=>{const t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},s=Pi(r,t,i);let o=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Oi("request",n.recordHeaders),r=Oi("response",n.recordHeaders),s=Ri(t.XMLHttpRequest.prototype,"open",(s=>function(o,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;const d=this,h=new Request(a),p={};let g,f;const m={},v=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(m[e]=t,v(e,t)),i&&(p.requestHeaders=m);const _=d.send.bind(d);d.send=e=>(Di({type:"request",headers:m,url:a,recordBody:n.recordBody})&&(p.requestBody=Hi({body:e,options:n,url:a})),g=t.performance.now(),_(e)),d.addEventListener("readystatechange",(()=>{if(d.readyState!==d.DONE)return;f=t.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");n&&(i[n]=r)})),r&&(p.responseHeaders=i),Di({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(p.responseBody=Hi({body:d.response,options:n,url:a})),$i(t,"xmlhttprequest",h.url,g,f).then((t=>{const n=qi({entry:t,method:h.method,status:null==d?void 0:d.status,networkRequest:p,start:g,end:f,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),s.call(d,o,a,l,c,u)}));return()=>{s()}}(r,t,i),a=Zi(r,t,i)),Ui=()=>{s(),o(),a()},Ui}const Yi=e=>({name:"rrweb/network@1",observer:zi,options:e});let ji,Xi,Ji;Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ut,getRecordNetworkPlugin:Yi},Cn.__PosthogExtensions__.rrweb={record:ut,version:"v2",rrwebVersion:pt},Cn.rrweb={record:ut,version:"v2",rrwebVersion:pt},Cn.rrwebConsoleRecord={getRecordConsolePlugin:Ut},Cn.getRecordNetworkPlugin=Yi,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(ji||(ji={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Xi||(Xi={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Ji||(Ji={}));var Ki,Qi,er,tr,nr,ir,rr,sr,or={},ar=[],lr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,cr=Array.isArray;function ur(e,t){for(var n in t)e[n]=t[n];return e}function dr(e){var t=e.parentNode;t&&t.removeChild(e)}function hr(e,t,n){var i,r,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ki.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return pr(e,o,i,r,null)}function pr(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++er:r,__i:-1,__u:0};return null==r&&null!=Qi.vnode&&Qi.vnode(s),s}function gr(e){return e.children}function fr(e,t){this.props=e,this.context=t}function mr(e,t){if(null==t)return e.__?mr(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?mr(e):null}function vr(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return vr(e)}}function _r(e){(!e.__d&&(e.__d=!0)&&tr.push(e)&&!yr.__r++||nr!==Qi.debounceRendering)&&((nr=Qi.debounceRendering)||ir)(yr)}function yr(){var e,t,n,i,r,s,o,a,l;for(tr.sort(rr);e=tr.shift();)e.__d&&(t=tr.length,i=void 0,s=(r=(n=e).__v).__e,a=[],l=[],(o=n.__P)&&((i=ur({},r)).__v=r.__v+1,Qi.vnode&&Qi.vnode(i),Er(o,i,r,n.__n,void 0!==o.ownerSVGElement,32&r.__u?[s]:null,a,null==s?mr(r):s,!!(32&r.__u),l),i.__.__k[i.__i]=i,Tr(a,i,l),i.__e!=s&&vr(i)),tr.length>t&&tr.sort(rr));yr.__r=0}function br(e,t,n,i,r,s,o,a,l,c,u){var d,h,p,g,f,m=i&&i.__k||ar,v=t.length;for(n.__d=l,function(e,t,n){var i,r,s,o,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],i=0;i<l;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?pr(null,r,null,null,r):cr(r)?pr(gr,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?pr(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Ir(r,n,o=i+d,u),r.__i=a,s=null,-1!==a&&(u--,(s=n[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==o&&(a===o+1?d++:a>o?u>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==i+d&&(r.__u|=65536))):(s=n[i])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=mr(s)),Ar(s,s,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(s=n[i])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=mr(s)),Ar(s,s))}(n,t,m),l=n.__d,d=0;d<v;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?or:m[p.__i]||or,p.__i=d,Er(e,p,h,r,s,o,a,l,c,u),g=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Mr(h.ref,null,p),u.push(p.ref,p.__c||g,p)),null==f&&null!=g&&(f=g),65536&p.__u||h.__k===p.__k?l=wr(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=f}function wr(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=wr(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Ir(e,t,n,i){var r=e.key,s=e.type,o=n-1,a=n+1,l=t[n];if(null===l||l&&r==l.key&&s===l.type)return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&r==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&r==l.key&&s===l.type)return a;a++}}return-1}function Sr(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||lr.test(t)?n:n+"px"}function Cr(e,t,n,i,r){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Sr(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Sr(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,s?xr:kr,s)):e.removeEventListener(t,s?xr:kr,s);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function kr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Qi.event?Qi.event(e):e)}function xr(e){return this.l[e.type+!0](Qi.event?Qi.event(e):e)}function Er(e,t,n,i,r,s,o,a,l,c){var u,d,h,p,g,f,m,v,_,y,b,w,I,S,C,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[a=t.__e=n.__e]),(u=Qi.__b)&&u(t);e:if("function"==typeof k)try{if(v=t.props,_=(u=k.contextType)&&i[u.__c],y=u?_?_.props.value:u.__:i,n.__c?m=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(v,y):(t.__c=d=new fr(v,y),d.constructor=k,d.render=Rr),_&&_.sub(d),d.props=v,d.state||(d.state={}),d.context=y,d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ur({},d.__s)),ur(d.__s,k.getDerivedStateFromProps(v,d.__s))),p=d.props,g=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&v!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(v,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(v,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(v,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,g,f)}))}if(d.context=y,d.props=v,d.__P=e,d.__e=!1,w=Qi.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(i=ur(ur({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(p,g)),br(e,cr(C=null!=u&&u.type===gr&&null==u.key?u.props.children:u)?C:[C],t,n,i,r,s,o,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=s?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Qi.__e(e,t,n)}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,s,o,a,l){var c,u,d,h,p,g,f,m=n.props,v=t.props,_=t.type;if("svg"===_&&(r=!0),null!=s)for(c=0;c<s.length;c++)if((p=s[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,s[c]=null;break}if(null==e){if(null===_)return document.createTextNode(v);e=r?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,v.is&&v),s=null,a=!1}if(null===_)m===v||a&&e.data===v||(e.data=v);else{if(s=s&&Ki.call(e.childNodes),m=n.props||or,!a&&null!=s)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)p=m[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in v||Cr(e,c,null,p,r));for(c in v)p=v[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?g=p:"checked"==c?f=p:"key"===c||a&&"function"!=typeof p||m[c]===p||Cr(e,c,p,m[c],r);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),br(e,cr(h)?h:[h],t,n,i,r&&"foreignObject"!==_,s,o,s?s[0]:n.__k&&mr(n,0),a,l),null!=s)for(c=s.length;c--;)null!=s[c]&&dr(s[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===_&&!g||"option"===_&&g!==m[c])&&Cr(e,c,g,m[c],!1),c="checked",void 0!==f&&f!==e[c]&&Cr(e,c,f,m[c],!1))}return e}(n.__e,t,n,i,r,s,o,l,c);(u=Qi.diffed)&&u(t)}function Tr(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)Mr(n[i],n[++i],n[++i]);Qi.__c&&Qi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Qi.__e(e,t.__v)}}))}function Mr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Qi.__e(e,n)}}function Ar(e,t,n){var i,r;if(Qi.unmount&&Qi.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Mr(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Qi.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Ar(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||dr(e.__e),e.__=e.__e=e.__d=void 0}function Rr(e,t,n){return this.constructor(e,n)}function Fr(e,t,n){var i,r,s,o;Qi.__&&Qi.__(e,t),r=(i="function"==typeof n)?null:t.__k,s=[],o=[],Er(t,e=(!i&&n||t).__k=hr(gr,null,[e]),r||or,or,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Ki.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i,o),Tr(s,e,o)}function Nr(e,t,n){var i,r,s,o,a=ur({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=void 0===t[s]&&void 0!==o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ki.call(arguments,2):n),pr(e.type,a,i||e.key,r||e.ref,null)}Ki=ar.slice,Qi={__e:function(e,t,n,i){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},er=0,fr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ur({},this.state),"function"==typeof e&&(e=e(ur({},n),this.props)),e&&ur(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_r(this))},fr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_r(this))},fr.prototype.render=gr,tr=[],ir="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rr=function(e,t){return e.__v.__b-t.__v.__b},yr.__r=0,sr=0;const Lr=hn,Pr=_n,Or=e=>{const t={left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "};return`\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ${parseInt((null==e?void 0:e.maxWidth)||"300")}px;\n width: 100%;\n z-index: ${parseInt((null==e?void 0:e.zIndex)||"99999")};\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n border-bottom: 0px;\n ${t[(null==e?void 0:e.position)||"right"]||"right: 30px;"}\n flex-direction: column;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ${(null==e?void 0:e.submitButtonColor)||"black"} !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n text-decoration: none;\n backgroundColor: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n color: ${$r((null==e?void 0:e.backgroundColor)||"#eeeded")};\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ${(null==e?void 0:e.borderColor)||"#c9c6c6"};\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ${(null==e?void 0:e.ratingButtonActiveColor)||"black"};\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ${(null==e?void 0:e.backgroundColor)||"#eeeded"};\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n `};function Dr(e){if("#"===e[0]){const t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function $r(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Br;"#"===t[0]&&(e=Dr(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=Dr(n)),!e)return"black";const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)>127.5?"black":"white"}return"black"}const Hr={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Br="#eeeded",qr=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(zr(n),"true"),i.capture("survey sent",{$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i),...t,$set:{[Yr(n,"responded")]:!0}}),Lr.dispatchEvent(new Event("PHSurveySent")))},Wr=(e,t,n)=>{var i;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:{[Yr(e,"dismissed")]:!0}}),localStorage.setItem(zr(e),"true"),Lr.dispatchEvent(new Event("PHSurveyClosed")))},Gr=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Vr=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]))?t.reverse():t,Zr=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Vr(e.questions,Gr(e.questions)):e.questions),Ur=e=>{var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!(e=>{var t,n,i,r,s,o;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0})(e))},zr=e=>{let t=`seenSurvey_${e.id}`;return e.current_iteration&&e.current_iteration>0&&(t=`seenSurvey_${e.id}_${e.current_iteration}`),t},Yr=(e,t)=>{let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n},jr=function(e,t){var n={__c:t="__cC"+sr++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,_r(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0}),Xr=e=>{let{component:t,children:n,renderAsHtml:i,style:r}=e;return Nr(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},Jr=_n;var Kr,Qr,es,ts,ns=0,is=[],rs=[],ss=Qi.__b,os=Qi.__r,as=Qi.diffed,ls=Qi.__c,cs=Qi.unmount;function us(e,t){Qi.__h&&Qi.__h(Qr,e,ns||t),ns=0;var n=Qr.__H||(Qr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:rs}),n.__[e]}function ds(e){return ns=1,function(e,t,n){var i=us(Kr++,2);if(i.t=e,!i.__c&&(i.__=[Is(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Qr,!Qr.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};Qr.u=!0;var s=Qr.shouldComponentUpdate,o=Qr.componentWillUpdate;Qr.componentWillUpdate=function(e,t,n){if(this.__e){var i=s;s=void 0,r(e,t,n),s=i}o&&o.call(this,e,t,n)},Qr.shouldComponentUpdate=r}return i.__N||i.__}(Is,e)}function hs(e,t){var n=us(Kr++,3);!Qi.__s&&ws(n.__H,t)&&(n.__=e,n.i=t,Qr.__H.__h.push(n))}function ps(e){return ns=5,gs((function(){return{current:e}}),[])}function gs(e,t){var n=us(Kr++,7);return ws(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fs(e){var t=Qr.context[e.__c],n=us(Kr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Qr)),t.props.value):e.__}function ms(){for(var e;e=is.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ys),e.__H.__h.forEach(bs),e.__H.__h=[]}catch(t){e.__H.__h=[],Qi.__e(t,e.__v)}}Qi.__b=function(e){Qr=null,ss&&ss(e)},Qi.__r=function(e){os&&os(e),Kr=0;var t=(Qr=e.__c).__H;t&&(es===Qr?(t.__h=[],Qr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=rs,e.__N=e.i=void 0}))):(t.__h.forEach(ys),t.__h.forEach(bs),t.__h=[],Kr=0)),es=Qr},Qi.diffed=function(e){as&&as(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==is.push(t)&&ts===Qi.requestAnimationFrame||((ts=Qi.requestAnimationFrame)||_s)(ms)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==rs&&(e.__=e.__V),e.i=void 0,e.__V=rs}))),es=Qr=null},Qi.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ys),e.__h=e.__h.filter((function(e){return!e.__||bs(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Qi.__e(n,e.__v)}})),ls&&ls(e,t)},Qi.unmount=function(e){cs&&cs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{ys(e)}catch(e){t=e}})),n.__H=void 0,t&&Qi.__e(t,n.__v))};var vs="function"==typeof requestAnimationFrame;function _s(e){var t,n=function(){clearTimeout(i),vs&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);vs&&(t=requestAnimationFrame(n))}function ys(e){var t=Qr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Qr=t}function bs(e){var t=Qr;e.__c=e.__(),Qr=t}function ws(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Is(e,t){return"function"==typeof t?t(e):t}var Ss=0;function Cs(e,t,n,i,r,s){var o,a,l={};for(a in t)"ref"==a?o=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ss,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Qi.vnode&&Qi.vnode(c),c}const ks=Cs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Cs("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"})}),xs=Cs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Cs("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"})}),Es=Cs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Cs("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"})}),Ts=Cs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Cs("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"})}),Ms=Cs("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Cs("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"})}),As=Cs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Cs("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),Rs=Cs("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Cs("g",{"clip-path":"url(#clip0_2415_6911)",children:[Cs("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Cs("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Cs("g",{mask:"url(#mask0_2415_6911)",children:[Cs("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"}),Cs("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"}),Cs("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"}),Cs("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"}),Cs("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"}),Cs("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"})]})]}),Cs("defs",{children:Cs("clipPath",{id:"clip0_2415_6911",children:Cs("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Fs=Cs("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Cs("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Ns(){return Cs("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Rs]})}function Ls(e){let{text:t,submitDisabled:n,appearance:i,onSubmit:r,link:s}=e;const{isPreviewMode:o,isPopup:a}=fs(jr),l=i.submitButtonTextColor||$r(i.submitButtonColor||Hr.submitButtonColor);return Cs("div",{className:"bottom-section",children:[Cs("div",{className:"buttons",children:Cs("button",{className:"form-submit",disabled:n&&!o,type:"button",style:a?{color:l}:{},onClick:()=>{o||(s&&(null==hn||hn.open(s)),r())},children:t})}),!i.whiteLabel&&Cs(Ns,{})]})}function Ps(e){let{question:t,description:n,descriptionContentType:i,backgroundColor:r,forceDisableHtml:s}=e;const{isPopup:o}=fs(jr);return Cs("div",{style:o?{backgroundColor:r||Hr.backgroundColor}:{},children:[Cs("div",{className:"survey-question",children:t}),n&&Xr({component:hr("div",{className:"survey-question-description"}),children:n,renderAsHtml:!s&&"text"!==i})]})}function Os(e){let{onClick:t}=e;const{isPreviewMode:n}=fs(jr);return Cs("div",{className:"cancel-btn-wrapper",onClick:t,disabled:n,children:Cs("button",{className:"form-cancel",onClick:t,disabled:n,children:As})})}function Ds(e){let{header:t,description:n,contentType:i,forceDisableHtml:r,appearance:s,onClose:o,styleOverrides:a}=e;const l=$r(s.backgroundColor||Hr.backgroundColor),{isPopup:c}=fs(jr);return Cs(gr,{children:Cs("div",{className:"thank-you-message",style:{...a},children:Cs("div",{className:"thank-you-message-container",children:[c&&Cs(Os,{onClick:()=>o()}),Cs("h3",{className:"thank-you-message-header",style:{color:l},children:t}),n&&Xr({component:hr("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:l}}),c&&Cs(Ls,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})})})}function $s(e){var t;const n=ps(null),[i,r]=ds(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return hs((()=>{if(n.current){const e=function(e){const t=Lr.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";const n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";const i=parseInt(n[1]),r=parseInt(n[2]),s=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+s*s*.114)>127.5?"black":"white"}(n.current);r(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function Hs(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;const s=ps(null),[o,a]=ds("");return Cs("div",{ref:s,children:[Cs(Ps,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),Cs("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:e=>a(e.currentTarget.value)}),Cs(Ls,{text:t.buttonText||"Submit",submitDisabled:!o&&!t.optional,appearance:i,onSubmit:()=>r(o)})]})}function Bs(e){let{question:t,forceDisableHtml:n,appearance:i,onSubmit:r}=e;return Cs(gr,{children:[Cs(Ps,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Cs(Ls,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>r("link clicked")})]})}function qs(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o=t.scale,a=10===t.scale?0:1,[l,c]=ds(null);return Cs(gr,{children:[Cs(Ps,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Cs("div",{className:"rating-section",children:[Cs("div",{className:"rating-options",children:["emoji"===t.display&&Cs("div",{className:"rating-options-emoji",children:(3===t.scale?Vs:Zs).map(((e,t)=>{const n=t+1===l;return Cs("button",{className:`ratings-emoji question-${i}-rating-${t} ${n?"rating-active":null}`,value:t+1,type:"button",onClick:()=>{c(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&Cs("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${o-a+1}, minmax(0, 1fr))`},children:js(t.scale).map(((e,t)=>Cs(Ws,{displayQuestionIndex:i,active:l===e,appearance:r,num:e,setActiveNumber:e=>{c(e)}},t)))})]}),Cs("div",{className:"rating-text",children:[Cs("div",{children:t.lowerBoundLabel}),Cs("div",{children:t.upperBoundLabel})]})]}),Cs(Ls,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:sn(l)&&!t.optional,appearance:r,onSubmit:()=>s(l)})]})}function Ws(e){let{num:t,active:n,displayQuestionIndex:i,appearance:r,setActiveNumber:s}=e;const{textColor:o,ref:a}=$s({appearance:r,defaultTextColor:"black",forceUpdate:n});return Cs("button",{ref:a,className:`ratings-number question-${i}-rating-${t} ${n?"rating-active":null}`,type:"button",onClick:()=>{s(t)},style:{color:o,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function Gs(e){let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o=ps(null),a=gs((()=>(e=>{if(!e.shuffleOptions)return e.choices;const t=e.choices;let n="";e.hasOpenChoice&&(n=t.pop());const i=Vr(t,Gr(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i})(t)),[t]),[l,c]=ds(t.type===Xi.MultipleChoice?[]:null),[u,d]=ds(!1),[h,p]=ds(""),g=t.type===Xi.SingleChoice?"radio":"checkbox";return Cs("div",{ref:o,children:[Cs(Ps,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),Cs("div",{className:"multiple-choice-options",children:a.map(((e,n)=>{let r="choice-option";const s=e,o=e;return t.hasOpenChoice&&n===t.choices.length-1&&(r+=" choice-option-open"),Cs("div",{className:r,children:[Cs("input",{type:g,id:`surveyQuestion${i}Choice${n}`,name:`question${i}`,value:s,disabled:!s,onInput:()=>t.hasOpenChoice&&n===t.choices.length-1?d(!u):t.type===Xi.SingleChoice?c(s):t.type===Xi.MultipleChoice&&Jt(l)?l.includes(s)?c(l.filter((e=>e!==s))):c([...l,s]):void 0}),Cs("label",{htmlFor:`surveyQuestion${i}Choice${n}`,style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?Cs(gr,{children:[Cs("span",{children:[o,":"]}),Cs("input",{type:"text",id:`surveyQuestion${i}Choice${n}Open`,name:`question${i}`,onInput:e=>{const n=e.currentTarget.value;return t.type===Xi.SingleChoice?c(n):t.type===Xi.MultipleChoice&&Jt(l)?p(n):void 0}})]}):o}),Cs("span",{className:"choice-check",style:{color:"black"},children:Fs})]})}))}),Cs(Ls,{text:t.buttonText||"Submit",submitDisabled:(sn(l)||Jt(l)&&!u&&0===l.length||Jt(l)&&u&&!h&&0===l.length&&!t.optional)&&!t.optional,appearance:r,onSubmit:()=>{u&&t.type===Xi.MultipleChoice?Jt(l)&&s([...l,h]):s(l)}})]})}const Vs=[Es,xs,ks],Zs=[Ts,Es,xs,ks,Ms],Us=[1,2,3,4,5],zs=[1,2,3,4,5,6,7],Ys=[0,1,2,3,4,5,6,7,8,9,10];function js(e){switch(e){case 5:default:return Us;case 7:return zs;case 10:return Ys}}const Xs=hn,Js=_n;class Ks{constructor(e){this.posthog=e,this.surveyInFocus=null}canShowNextEventBasedSurvey=()=>{const e=Js.querySelectorAll("div[class^=PostHogSurvey]");var t;return!(e.length>0)||1===(null===(t=e[e.length-1].shadowRoot)||void 0===t?void 0:t.childElementCount)};handlePopoverSurvey=e=>{var t;const n=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,i=localStorage.getItem("lastSeenSurveyDate");if(n&&i){const e=new Date,t=Math.abs(e.getTime()-new Date(i).getTime());if(Math.ceil(t/864e5)<n)return}const r=(e=>!!localStorage.getItem(zr(e))&&!Ur(e))(e);if(!r){this.addSurveyToFocus(e.id);const t=((e,t,n)=>{const i=Pr.createElement("div");i.className=`PostHogSurvey${t}`;const r=i.attachShadow({mode:"open"});if(e){const t=Object.assign(Pr.createElement("style"),{innerText:e});r.appendChild(t)}return Pr.body.appendChild(i),r})(Or(null==e?void 0:e.appearance),e.id);Fr(Cs(to,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),t)}};handleWidget=e=>{const t=function(e){var t;const n=Jr.createElement("div");n.className=`PostHogWidget${e.id}`;const i=n.attachShadow({mode:"open"}),r=`\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ${(null===(t=e.appearance)||void 0===t?void 0:t.widgetColor)||"#e0a045"};\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n `;return i.append(Object.assign(Jr.createElement("style"),{innerText:r})),Jr.body.appendChild(n),i}(e),n=Or(e.appearance);t.appendChild(Object.assign(Js.createElement("style"),{innerText:n})),Fr(Cs(io,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)};handleWidgetSelector=e=>{var t;const n=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Js.querySelector(e.appearance.widgetSelector);if(n)if(0===Js.querySelectorAll(`.PostHogWidget${e.id}`).length)this.handleWidget(e);else if(1===Js.querySelectorAll(`.PostHogWidget${e.id}`).length&&!n.getAttribute("PHWidgetSurveyClickListener")){var i,r;const t=null===(i=Js.querySelector(`.PostHogWidget${e.id}`))||void 0===i||null===(r=i.shadowRoot)||void 0===r?void 0:r.querySelector(".survey-form");n.addEventListener("click",(()=>{t&&(t.style.display="none"===t.style.display?"block":"none",t.addEventListener("PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),t.style.display="none"})))})),n.setAttribute("PHWidgetSurveyClickListener","true")}};sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var n,i;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)}))}canRenderSurvey=e=>{const t={visible:!1};if(e.end_date)return t.disabledReason=`survey was completed on ${e.end_date}`,t;if(e.type!=ji.Popover)return t.disabledReason="Only Popover survey types can be rendered",t;if(!(!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)))return t.disabledReason=`linked feature flag ${e.linked_flag_key} is false`,t;if(!(!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)))return t.disabledReason=`targeting feature flag ${e.targeting_flag_key} is false`,t;return!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason=`internal targeting feature flag ${e.internal_targeting_flag_key} is false`,t)};renderSurvey=(e,t)=>{Fr(Cs(to,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)};callSurveysAndEvaluateDisplayLogic=(()=>{var e=this;return function(){var t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=e.posthog)||void 0===t||t.getActiveMatchingSurveys((t=>{const n=t.filter((e=>"api"!==e.type));e.sortSurveysByAppearanceDelay(n).forEach((t=>{if(sn(e.surveyInFocus)){var n,i,r;if(t.type===ji.Widget)"tab"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&0===Js.querySelectorAll(`.PostHogWidget${t.id}`).length&&e.handleWidget(t),"selector"===(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)&&null!==(r=t.appearance)&&void 0!==r&&r.widgetSelector&&e.handleWidgetSelector(t);t.type===ji.Popover&&e.canShowNextEventBasedSurvey()&&e.handlePopoverSurvey(t)}}))}),n)}})();addSurveyToFocus=e=>{sn(this.surveyInFocus)||xn.error(`Survey ${[...this.surveyInFocus]} already in focus. Cannot add survey ${e}.`),this.surveyInFocus=e};removeSurveyFromFocus=e=>{this.surveyInFocus!==e&&xn.error(`Survey ${e} is not in focus. Cannot remove survey ${e}.`),this.surveyInFocus=null};getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function Qs(e){if(!Js||!Xs)return;const t=new Ks(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}function eo(e,t,n,i,r){const[s,o]=ds(i||0===n),[a,l]=ds(!1);return hs((()=>{if(i||!t)return;const s=()=>{r(e.id),o(!1)},a=()=>{var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((()=>{o(!1)}),5e3)):(r(e.id),o(!1))},c=()=>{var n;o(!0),Xs.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Xs.addEventListener("PHSurveyClosed",s),Xs.addEventListener("PHSurveySent",a),n>0?(()=>{const e=setTimeout((()=>{c()}),n);return()=>{clearTimeout(e),Xs.removeEventListener("PHSurveyClosed",s),Xs.removeEventListener("PHSurveySent",a)}})():(c(),()=>{Xs.removeEventListener("PHSurveyClosed",s),Xs.removeEventListener("PHSurveySent",a)})}),[]),{isPopupVisible:s,isSurveySent:a,setIsPopupVisible:o}}function to(e){var t,n,i,r,s,o;let{survey:a,forceDisableHtml:l,posthog:c,style:u,previewPageIndex:d,removeSurveyFromFocus:h,isPopup:p}=e;const g=Number.isInteger(d),f=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:m,isSurveySent:v,setIsPopupVisible:_}=eo(a,c,f,g,h),y=v||d===a.questions.length,b=null!==(n=u)&&void 0!==n&&n.left&&an(null===(i=u)||void 0===i?void 0:i.left)?{left:u.left-40}:{};return g&&(u=u||{},u.left="unset",u.right="unset",u.transform="unset"),m?Cs(jr.Provider,{value:{isPreviewMode:g,previewPageIndex:d,handleCloseSurveyPopup:()=>Wr(a,c,g),isPopup:p||!1},children:y?Cs(Ds,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescriptionContentType,appearance:a.appearance||Hr,styleOverrides:{...u,...b},onClose:()=>_(!1)}):Cs(no,{survey:a,forceDisableHtml:!!l,posthog:c,styleOverrides:u})}):Cs(gr,{})}function no(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:s,styleOverrides:o}=e;const a=$r((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||Hr.backgroundColor),[l,c]=ds({}),{isPreviewMode:u,previewPageIndex:d,handleCloseSurveyPopup:h,isPopup:p}=fs(jr),[g,f]=ds(d||0),m=gs((()=>Zr(i)),[i]);hs((()=>{f(null!=d?d:0)}),[d]);return Cs("form",{className:"survey-form",style:p?{color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor,...o}:{},children:m.map(((e,t)=>{var n;const{originalQuestionIndex:o}=e;return(u?g===o:g===t)&&Cs("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Hr.backgroundColor}:{},children:[p&&Cs(Os,{onClick:()=>h()}),ro({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||Hr,onSubmit:e=>(e=>{let{res:t,originalQuestionIndex:n,displayQuestionIndex:r}=e;if(!s)return;const o=0===n?"$survey_response":`$survey_response_${n}`;if(c({...l,[o]:t}),!s.getNextSurveyStep)return void(r===i.questions.length-1?qr({...l,[o]:t},i,s):f(r+1));const a=s.getNextSurveyStep(i,r,t);a===Ji.End?qr({...l,[o]:t},i,s):f(a)})({res:e,originalQuestionIndex:o,displayQuestionIndex:t})})]})}))})}function io(e){var t,n;let{survey:i,forceDisableHtml:r,posthog:s,readOnly:o,removeSurveyFromFocus:a}=e;const[l,c]=ds(!1),[u,d]=ds({}),h=ps(null);return hs((()=>{var e,t;if(!o&&s){if("tab"===(null===(e=i.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var n;const e=h.current.getBoundingClientRect(),t={top:"50%",left:parseInt(""+(e.right-360)),bottom:"auto",borderRadius:10,borderBottom:`1.5px solid ${(null===(n=i.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6"}`};d(t)}if("selector"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)){const e=Js.querySelector(i.appearance.widgetSelector||"");null==e||e.addEventListener("click",(()=>{c(!l)})),null==e||e.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),Cs(gr,{children:["tab"===(null===(t=i.appearance)||void 0===t?void 0:t.widgetType)&&Cs("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!o&&c(!l),style:{color:$r(i.appearance.widgetColor)},children:[Cs("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=i.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&Cs(to,{posthog:s,survey:i,forceDisableHtml:r,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}const ro=e=>{let{question:t,forceDisableHtml:n,displayQuestionIndex:i,appearance:r,onSubmit:s}=e;const o={[Xi.Open]:Hs,[Xi.Link]:Bs,[Xi.Rating]:qs,[Xi.SingleChoice]:Gs,[Xi.MultipleChoice]:Gs},a={question:t,forceDisableHtml:n,appearance:r,onSubmit:s},l={[Xi.Open]:{},[Xi.Link]:{},[Xi.Rating]:{displayQuestionIndex:i},[Xi.SingleChoice]:{displayQuestionIndex:i},[Xi.MultipleChoice]:{displayQuestionIndex:i}};return Cs(o[t.type],{...{...a,...l[t.type]}})};function so(e){return!tn(Event)&&oo(e,Event)}function oo(e,t){try{return e instanceof t}catch{return!1}}function ao(e){return sn(e)||!Qt(e)&&!Kt(e)}function lo(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function co(e){return lo(e,"DOMError")}Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.canActivateRepeatedly=Ur,Cn.__PosthogExtensions__.generateSurveys=Qs,Cn.extendPostHogWithSurveys=Qs;const uo=/\(error: (.*)\)/,ho=50,po="?";function go(e,t,n,i){const r={filename:e,function:"<anonymous>"===t?po:t,in_app:!0};return tn(n)||(r.lineno=n),tn(i)||(r.colno=i),r}const fo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vo=/\((\S*)(?::(\d+))(?::(\d+))\)/,_o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bo=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],r=e.split("\n");for(let e=t;e<r.length;e++){const t=r[e];if(t.length>1024)continue;const s=uo.test(t)?t.replace(uo,"$1"):t;if(!s.match(/\S*Error: /)){for(const e of i){const t=e(s);if(t){n.push(t);break}}if(n.length>=ho)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,ho).map((e=>({...e,filename:e.filename||wo(t).filename,function:e.function||po})))}(n)}}(...[[30,e=>{const t=fo.exec(e);if(t){const[,e,n,i]=t;return go(e,po,+n,+i)}const n=mo.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=vo.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Io(n[1]||po,n[2]);return go(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=_o.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=yo.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||po;return[n,e]=Io(n,e),go(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function wo(e){return e[e.length-1]||{}}const Io=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:po,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let So;!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(So||(So={}));const Co=["fatal","error","warning","log","info","debug"],ko=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function xo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.stacktrace||e.stack||"",i=function(e){if(e&&Eo.test(e.message))return 1;return 0}(e);try{const e=bo(n,i);return e.slice(0,e.length-t)}catch{}return[]}const Eo=/Minified React error #\d+;/i;function To(e,t){var n,i;const r=xo(e),s=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){const t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:r},mechanism:{handled:s,synthetic:o}}],$exception_level:"error"}}function Mo(e,t){var n,i,r;const s=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:s,synthetic:o}};if(null!=t&&t.syntheticException){const e=xo(t.syntheticException,1);e.length&&(a.stacktrace={frames:e})}return{$exception_list:[a],$exception_level:"error"}}function Ao(e){return nn(e)&&!rn(e)&&Co.indexOf(e)>=0}function Ro(e,t){var n,i;const r=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,o=null!=t&&t.overrideExceptionType?t.overrideExceptionType:so(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:`Non-Error exception captured with keys: ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let e=n.length;e>0;e--){const i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}(e)}`,l={type:o,value:a,mechanism:{handled:r,synthetic:s}};if(null!=t&&t.syntheticException){const e=xo(null==t?void 0:t.syntheticException,1);e.length&&(l.stacktrace={frames:e})}return{$exception_list:[l],$exception_level:Ao(e.level)?e.level:"error"}}function Fo(e,t){let[n,i,r,s,o]=e,a={$exception_list:[]};const l=o||n;if(co(l)||function(e){return lo(e,"DOMException")}(l)){const e=l;if(function(e){return"stack"in e}(l))a=To(l,t);else{const n=e.name||(co(e)?"DOMError":"DOMException"),i=e.message?`${n}: ${e.message}`:n,r=co(e)?"DOMError":"DOMException";a=Mo(i,{...t,overrideExceptionType:r,defaultExceptionMessage:i})}return"code"in e&&(a.$exception_DOMException_code=`${e.code}`),a}if(function(e){return lo(e,"ErrorEvent")}(l)&&l.error)return To(l.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return oo(e,Error)}}(l))return To(l,t);if(function(e){return lo(e,"Object")}(l)||so(l)){return Ro(l,t)}if(tn(o)&&nn(n)){let e="Error",i=n;const r=n.match(ko);return r&&(e=r[1],i=r[2]),Mo(i,{...t,overrideExceptionType:e,defaultExceptionMessage:i})}return Mo(l,t)}function No(e){let[t]=e;const n=function(e){if(ao(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t);return ao(n)?Mo(`Non-Error promise rejection captured with value: ${String(n)}`,{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Fo([n],{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(n)})}const Lo={wrapOnError:e=>{const t=hn;t||xn.info("window not available, cannot wrap onerror");const n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];const o=Fo(r);return e(o),null!==(t=null==n?void 0:n(...r))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:e=>{const t=hn;t||xn.info("window not available, cannot wrap onUnhandledRejection");const n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];const a=No(s);return e(a),null!==(i=null==n?void 0:n.apply(t,s))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.errorWrappingFunctions=Lo,Cn.__PosthogExtensions__.parseErrorAsProperties=Fo,Cn.posthogErrorWrappingFunctions=Lo,Cn.parseErrorAsProperties=Fo;const Po=(e,t)=>{const{sessionId:n,windowId:i}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",n),t.headers.set("X-POSTHOG-WINDOW-ID",i)};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{};const Oo={_patchFetch:e=>Ri(hn,"fetch",(t=>async function(n,i){const r=new Request(n,i);return Po(e,r),t(r)})),_patchXHR:e=>Ri(hn.XMLHttpRequest.prototype,"open",(t=>function(n,i){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const a=new Request(i);return Po(e,a),t.call(this,n,a.url,r,s,o)}))};Cn.__PosthogExtensions__.tracingHeadersPatchFns=Oo,Cn.postHogTracingHeadersPatchFns=Oo;var Do,$o,Ho,Bo=-1,qo=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Bo=t.timeStamp,e(t))}),!0)},Wo=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Go=function(){var e=Wo();return e&&e.activationStart||0},Vo=function(e,t){var n=Wo(),i="navigate";return Bo>=0?i="back-forward-cache":n&&(document.prerendering||Go()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Zo=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Uo=function(e,t,n,i){var r,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},zo=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Yo=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},jo=function(e){var t=!1;return function(){t||(e(),t=!0)}},Xo=-1,Jo=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ko=function(e){"hidden"===document.visibilityState&&Xo>-1&&(Xo="visibilitychange"===e.type?e.timeStamp:0,ea())},Qo=function(){addEventListener("visibilitychange",Ko,!0),addEventListener("prerenderingchange",Ko,!0)},ea=function(){removeEventListener("visibilitychange",Ko,!0),removeEventListener("prerenderingchange",Ko,!0)},ta=function(){return Xo<0&&(Xo=Jo(),Qo(),qo((function(){setTimeout((function(){Xo=Jo(),Qo()}),0)}))),{get firstHiddenTime(){return Xo}}},na=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},ia=[1800,3e3],ra=function(e,t){t=t||{},na((function(){var n,i=ta(),r=Vo("FCP"),s=Zo("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Go(),0),r.entries.push(e),n(!0)))}))}));s&&(n=Uo(e,r,ia,t.reportAllChanges),qo((function(i){r=Vo("FCP"),n=Uo(e,r,ia,t.reportAllChanges),zo((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},sa=[.1,.25],oa=[2500,4e3],aa={},la=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ca=function(e){if("loading"===document.readyState)return"loading";var t=la();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},ua=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},da=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:ua(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},ha=-1,pa=function(e,t){var n=la(),i="navigate";return ha>=0?i="back-forward-cache":n&&(document.prerendering||function(){var e=la();return e&&e.activationStart||0}()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},ga=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},fa=function(e,t,n,i){var r,s;return function(o){t.value>=0&&(o||i)&&((s=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ma=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},va=0,_a=1/0,ya=0,ba=function(e){e.forEach((function(e){e.interactionId&&(_a=Math.min(_a,e.interactionId),ya=Math.max(ya,e.interactionId),va=ya?(ya-_a)/7+1:0)}))},wa=function(){"interactionCount"in performance||Do||(Do=ga("event",ba,{type:"event",buffered:!0,durationThreshold:0}))},Ia=[],Sa=new Map,Ca=0,ka=function(){return(Do?va:performance.interactionCount||0)-Ca},xa=[],Ea=function(e){if(xa.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ia[Ia.length-1],n=Sa.get(e.interactionId);if(n||Ia.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Sa.set(i.id,i),Ia.push(i)}Ia.sort((function(e,t){return t.latency-e.latency})),Ia.length>10&&Ia.splice(10).forEach((function(e){return Sa.delete(e.id)}))}}},Ta=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),ma(e)),n},Ma=[200,500],Aa=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;wa();var i,r=pa("INP"),s=function(e){Ta((function(){e.forEach(Ea);var t,n=(t=Math.min(Ia.length-1,Math.floor(ka()/50)),Ia[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())}))},o=ga("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=fa(e,r,Ma,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),ma((function(){s(o.takeRecords()),i(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(ha=t.timeStamp,e(t))}),!0)}((function(){Ca=0,Ia.length=0,Sa.clear(),r=pa("INP"),i=fa(e,r,Ma,t.reportAllChanges)})))})))},Ra=[],Fa=[],Na=new WeakMap,La=new Map,Pa=-1,Oa=function(e){Ra=Ra.concat(e),Da()},Da=function(){Pa<0&&(Pa=Ta($a))},$a=function(){La.size>10&&La.forEach((function(e,t){Sa.has(t)||La.delete(t)}));var e=Ia.map((function(e){return Na.get(e.entries[0])})),t=Fa.length-50;Fa=Fa.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<Fa.length;i++){var r=Fa[i];Ha(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}for(var s=0;s<50;s++){var o=Ra[Ra.length-1-s];if(!o||o.startTime<Ho)break;n.add(o)}Ra=Array.from(n),Pa=-1};xa.push((function(e){e.interactionId&&e.target&&!La.has(e.interactionId)&&La.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Ho=Math.max(Ho,e.processingEnd);for(var i=Fa.length-1;i>=0;i--){var r=Fa[i];if(Math.abs(n-r.renderTime)<=8){(t=r).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Fa.push(t)),(e.interactionId||"first-input"===e.entryType)&&Na.set(e,t),Da()}));var Ha=function(e,t){for(var n,i=[],r=0;n=Ra[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i};const Ba={onLCP:function(e,t){t=t||{},na((function(){var n,i=ta(),r=Vo("LCP"),s=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Go(),0),r.entries=[e],n())}))},o=Zo("largest-contentful-paint",s);if(o){n=Uo(e,r,oa,t.reportAllChanges);var a=jo((function(){aa[r.id]||(s(o.takeRecords()),o.disconnect(),aa[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=jo(e),"hidden"===document.visibilityState?e():(n=t(e),Yo(e)),n}(a)}),!0)})),Yo(a),qo((function(i){r=Vo("LCP"),n=Uo(e,r,oa,t.reportAllChanges),zo((function(){r.value=performance.now()-i.timeStamp,aa[r.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},ra(jo((function(){var n,i=Vo("CLS",0),r=0,s=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],n=s[s.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,s.push(e)):(r=e.value,s=[e])}})),r>i.value&&(i.value=r,i.entries=s,n())},a=Zo("layout-shift",o);a&&(n=Uo(e,i,sa,t.reportAllChanges),Yo((function(){o(a.takeRecords()),n(!0)})),qo((function(){r=0,i=Vo("CLS",0),n=Uo(e,i,sa,t.reportAllChanges),zo((function(){return n()}))})),setTimeout(n,0))})))},onFCP:ra,onINP:function(e,t){$o||($o=ga("long-animation-frame",Oa)),Aa((function(t){var n=function(e){var t=e.entries[0],n=Na.get(t),i=t.processingStart,r=n.processingEnd,s=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=Ha(t.startTime,r),a=e.entries.find((function(e){return e.target})),l=a&&a.target||La.get(t.interactionId),c=[t.startTime+t.duration,r].concat(o.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:da(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(u-r,0),loadState:ca(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.postHogWebVitalsCallbacks=Ba,Cn.postHogWebVitalsCallbacks=Ba;const qa="$people_distinct_id",Wa="__alias",Ga="__timers",Va="$autocapture_disabled_server_side",Za="$heatmaps_enabled_server_side",Ua="$exception_capture_enabled_server_side",za="$exception_capture_endpoint_suffix",Ya="$web_vitals_enabled_server_side",ja="$web_vitals_allowed_metrics",Xa="$session_recording_enabled_server_side",Ja="$console_log_recording_enabled_server_side",Ka="$session_recording_network_payload_capture",Qa="$session_recording_canvas_recording",el="$replay_sample_rate",tl="$replay_minimum_duration",nl="$sesid",il="$session_is_sampled",rl="$session_recording_url_trigger_activated_session",sl="$session_recording_url_trigger_status",ol="$enabled_feature_flags",al="$early_access_features",ll="$stored_person_properties",cl="$stored_group_properties",ul="$surveys",dl="$surveys_activated",hl="$flag_call_reported",pl="$user_state",gl="$client_session_props",fl="$capture_rate_limit",ml="$initial_campaign_params",vl="$initial_referrer_info",_l="$initial_person_info",yl="$epp",bl="__POSTHOG_TOOLBAR__",wl=[qa,Wa,"__cmpns",Ga,Xa,Za,nl,ol,pl,al,cl,ll,ul,hl,gl,fl,ml,vl,yl],Il="$active_feature_flags",Sl="$override_feature_flags",Cl="$feature_flag_payloads",kl=e=>{const t={};for(const[n,i]of Nn(e||{}))i&&(t[n]=i);return t};class xl{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){const e=this.instance.get_property(ol),t=this.instance.get_property(Sl);if(!t)return e||{};const n=Rn({},e),i=Object.keys(t);for(let e=0;e<i.length;e++)n[i[e]]=t[i[e]];return this._override_warning||(xn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(Cl)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())}),5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);const e=this.instance.config.token,t=this.instance.get_property(ll),n=this.instance.get_property(cl),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:So.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void xn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");const n=this.getFlagVariants()[e],i=`${n}`,r=this.instance.get_property(hl)||{};var s;!t.send_event&&"send_event"in t||(e in r&&r[e].includes(i)||(Jt(r[e])?r[e].push(i):r[e]=[i],null===(s=this.instance.persistence)||void 0===s||s.register({[hl]:r}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})));return n}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);xn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;const n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=e.featureFlags,s=e.featureFlagPayloads;if(!r)return;if(Jt(r)){const e={};if(r)for(let t=0;t<r.length;t++)e[r[t]]=!0;return void(t&&t.register({[Il]:r,[ol]:e}))}let o=r,a=s;e.errorsWhileComputingFlags&&(o={...n,...o},a={...i,...a}),t&&t.register({[Il]:Object.keys(kl(o)),[ol]:o||{},[Cl]:a||{}})}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return xn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Sl);else if(Jt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[Sl]:t})}else this.instance.persistence.register({[Sl]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;const i={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);const r={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[Il]:Object.keys(kl(r)),[ol]:r}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.instance.get_property(al);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;const i=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[al]:i}),e(i)}})}_prepareFeatureFlagsForCallbacks(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_fireFeatureFlagsCallbacks(e){const{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(ll)||{};this.instance.register({[ll]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ll)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.instance.get_property(cl)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((t=>{n[t]={...n[t],...e[t]},delete e[t]})),this.instance.register({[cl]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.instance.get_property(cl)||{};this.instance.register({[cl]:{...t,[e]:{}}})}else this.instance.unregister(cl)}}
16
2
  /**
17
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
18
4
  *
@@ -21,5 +7,5 @@
21
7
  * @packageDocumentation
22
8
  *
23
9
  * from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts
24
- */Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Pt(e)&&isFinite(e)&&Math.floor(e)===e});const nl="0123456789abcdef";class il{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||e<0||t<0||n<0||i<0||e>0xffffffffffff||t>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|n>>>24,r[9]=n>>>16,r[10]=n>>>8,r[11]=n,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i,new il(r)}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e=e+nl.charAt(this.bytes[t]>>>4)+nl.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new il(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){const n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class rl{timestamp=0;counter=0;random=new al;generate(){const e=this.generateOrAbort();if(Mt(e)){this.timestamp=0;const e=this.generateOrAbort();if(Mt(e))throw new Error("Could not generate UUID after timestamp reset");return e}return e}generateOrAbort(){const e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return il.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}let sl,ol=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Bt&&!Mt(Bt.crypto)&&crypto.getRandomValues&&(ol=e=>crypto.getRandomValues(e));class al{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(ol(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}const ll=()=>cl().toString(),cl=()=>(sl||(sl=new rl)).generate(),ul="Thu, 01 Jan 1970 00:00:00 GMT";let dl="";const hl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function pl(e,t){if(t){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt;if(dl)return dl;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";const n=e.split(".");let i=Math.min(n.length,8);const r="dmn_chk_"+ll(),s=new RegExp("(^|;)\\s*"+r+"=1");for(;!dl&&i--;){const e=n.slice(i).join("."),o=r+"=1;domain=."+e;t.cookie=o,s.test(t.cookie)&&(t.cookie=o+";expires="+ul,dl=e)}return dl}(e);if(!t){const n=(e=>{const t=e.match(hl);return t?t[0]:""})(e);n!==t&&en.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}const gl={is_supported:()=>!!Zt,error:function(e){en.error("cookieStore error: "+e)},get:function(e){if(Zt){try{const t=e+"=",n=Zt.cookie.split(";").filter((e=>e.length));for(let e=0;e<n.length;e++){let i=n[e];for(;" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){let t;try{t=JSON.parse(gl.get(e))||{}}catch{}return t},set:function(e,t,n,i,r){if(Zt)try{let s="",o="";const a=pl(Zt.location.hostname,i);if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),s="; expires="+e.toUTCString()}r&&(o="; secure");const l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&en.warn("cookieStore warning: large cookie, len="+l.length),Zt.cookie=l,l}catch{return}},remove:function(e,t){try{gl.set(e,"",-1,t)}catch{return}}};let fl=null;const ml={is_supported:function(){if(!Nt(fl))return fl;let e=!0;if(Mt(Bt))e=!1;else try{const t="__mplssupport__",n="xyz";ml.set(t,n),'"xyz"'!==ml.get(t)&&(e=!1),ml.remove(t)}catch{e=!1}return e||en.error("localStorage unsupported; falling back to cookie store"),fl=e,e},error:function(e){en.error("localStorage error: "+e)},get:function(e){try{return null==Bt?void 0:Bt.localStorage.getItem(e)}catch(e){ml.error(e)}return null},parse:function(e){try{return JSON.parse(ml.get(e))||{}}catch{}return null},set:function(e,t){try{null==Bt||Bt.localStorage.setItem(e,JSON.stringify(t))}catch(e){ml.error(e)}},remove:function(e){try{null==Bt||Bt.localStorage.removeItem(e)}catch(e){ml.error(e)}}},vl=["distinct_id",Ra,Fa,za],_l={...ml,parse:function(e){try{let t={};try{t=gl.parse(e)||{}}catch{}const n=on(t,JSON.parse(ml.get(e)||"{}"));return ml.set(e,n),n}catch{}return null},set:function(e,t,n,i,r,s){try{ml.set(e,t,void 0,void 0,s);const o={};vl.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&gl.set(e,o,n,i,r,s)}catch(e){ml.error(e)}},remove:function(e,t){try{null==Bt||Bt.localStorage.removeItem(e),gl.remove(e,t)}catch(e){ml.error(e)}}},yl={},bl={is_supported:function(){return!0},error:function(e){en.error("memoryStorage error: "+e)},get:function(e){return yl[e]||null},parse:function(e){return yl[e]||null},set:function(e,t){yl[e]=t},remove:function(e){delete yl[e]}};let Cl=null;const wl={is_supported:function(){if(!Nt(Cl))return Cl;if(Cl=!0,Mt(Bt))Cl=!1;else try{const e="__support__",t="xyz";wl.set(e,t),'"xyz"'!==wl.get(e)&&(Cl=!1),wl.remove(e)}catch{Cl=!1}return Cl},error:function(e){en.error("sessionStorage error: ",e)},get:function(e){try{return null==Bt?void 0:Bt.sessionStorage.getItem(e)}catch(e){wl.error(e)}return null},parse:function(e){try{return JSON.parse(wl.get(e))||null}catch{}return null},set:function(e,t){try{null==Bt||Bt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){wl.error(e)}},remove:function(e){try{null==Bt||Bt.sessionStorage.removeItem(e)}catch(e){wl.error(e)}}},Il="Mobile",Sl="iOS",kl="Android",xl="Tablet",El=kl+" "+xl,Tl="iPad",Al="Apple",Ml=Al+" Watch",Rl="Safari",Fl="BlackBerry",Nl="Samsung",Ol=Nl+"Browser",Pl=Nl+" Internet",Ll="Chrome",Dl=Ll+" OS",$l=Ll+" "+Sl,ql="Internet Explorer",Bl=ql+" "+Il,Hl="Opera",Wl=Hl+" Mini",Ul="Edge",Vl="Microsoft "+Ul,Gl="Firefox",Zl=Gl+" "+Sl,jl="Nintendo",zl="PlayStation",Ql="Xbox",Kl=kl+" "+Il,Yl=Il+" "+Rl,Jl="Windows",Xl=Jl+" Phone",ec="Nokia",tc="Ouya",nc="Generic",ic=nc+" "+Il.toLowerCase(),rc=nc+" "+xl.toLowerCase(),sc="Konqueror",oc="(\\d+(\\.\\d+)?)",ac=new RegExp("Version/"+oc),lc=new RegExp(Ql,"i"),cc=new RegExp(zl+" \\w+","i"),uc=new RegExp(jl+" \\w+","i"),dc=new RegExp(Fl+"|PlayBook|BB10","i"),hc={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};const pc=(e,t)=>t&&an(t,Al)||function(e){return an(e,Rl)&&!an(e,Ll)&&!an(e,kl)}(e),gc=function(e,t){return t=t||"",an(e," OPR/")&&an(e,"Mini")?Wl:an(e," OPR/")?Hl:dc.test(e)?Fl:an(e,"IE"+Il)||an(e,"WPDesktop")?Bl:an(e,Ol)?Pl:an(e,Ul)||an(e,"Edg/")?Vl:an(e,"FBIOS")?"Facebook "+Il:an(e,"UCWEB")||an(e,"UCBrowser")?"UC Browser":an(e,"CriOS")?$l:an(e,"CrMo")?Ll:an(e,kl)&&an(e,Rl)?Kl:an(e,Ll)?Ll:an(e,"FxiOS")?Zl:an(e.toLowerCase(),sc.toLowerCase())?sc:pc(e,t)?an(e,Il)?Yl:Rl:an(e,Gl)?Gl:an(e,"MSIE")||an(e,"Trident/")?ql:an(e,"Gecko")?Gl:""},fc={[Bl]:[new RegExp("rv:"+oc)],[Vl]:[new RegExp(Ul+"?\\/"+oc)],[Ll]:[new RegExp("("+Ll+"|CrMo)\\/"+oc)],[$l]:[new RegExp("CriOS\\/"+oc)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+oc)],[Rl]:[ac],[Yl]:[ac],[Hl]:[new RegExp("(Opera|OPR)\\/"+oc)],[Gl]:[new RegExp(Gl+"\\/"+oc)],[Zl]:[new RegExp("FxiOS\\/"+oc)],[sc]:[new RegExp("Konqueror[:/]?"+oc,"i")],[Fl]:[new RegExp(Fl+" "+oc),ac],[Kl]:[new RegExp("android\\s"+oc,"i")],[Pl]:[new RegExp(Ol+"\\/"+oc)],[ql]:[new RegExp("(rv:|MSIE )"+oc)],Mozilla:[new RegExp("rv:"+oc)]},mc=[[new RegExp(Ql+"; "+Ql+" (.*?)[);]","i"),e=>[Ql,e&&e[1]||""]],[new RegExp(jl,"i"),[jl,""]],[new RegExp(zl,"i"),[zl,""]],[dc,[Fl,""]],[new RegExp(Jl,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Xl,""];if(new RegExp(Il).test(t)&&!/IEMobile\b/.test(t))return[Jl+" "+Il,""];const n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){const e=n[1];let i=hc[e]||"";return/arm/i.test(t)&&(i="RT"),[Jl,i]}return[Jl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){const t=[e[3],e[4],e[5]||"0"];return[Sl,t.join(".")]}return[Sl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=Mt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+kl+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+kl+")","i"),e=>{if(e&&e[2]){const t=[e[2],e[3],e[4]||"0"];return[kl,t.join(".")]}return[kl,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];if(e&&e[1]){const n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Dl,""]],[/Linux|debian/i,["Linux",""]]],vc=function(e){return uc.test(e)?jl:cc.test(e)?zl:lc.test(e)?Ql:new RegExp(tc,"i").test(e)?tc:new RegExp("("+Xl+"|WPDesktop)","i").test(e)?Xl:/iPad/.test(e)?Tl:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ml:dc.test(e)?Fl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ec,"i").test(e)?ec:/(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(Il).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)?kl:El:kl:new RegExp("(pda|"+Il+")","i").test(e)?ic:new RegExp(xl,"i").test(e)&&!new RegExp(xl+" pc","i").test(e)?rc:""},_c="https?://(.*)",yc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],bc={campaignParams:function(e){return Zt?this._campaignParamsFromUrl(Zt.URL,e):{}},_campaignParamsFromUrl:function(e,t){const n=yc.concat(t||[]),i={};return sn(n,(function(t){const n=wn(e,t);i[t]=n||null})),i},_searchEngine:function(e){return e?0===e.search(_c+"google.([^/?]*)")?"google":0===e.search(_c+"bing.com")?"bing":0===e.search(_c+"yahoo.com")?"yahoo":0===e.search(_c+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){const t=bc._searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(!Nt(t)){i.$search_engine=t;const e=Zt?wn(Zt.referrer,n):"";e.length&&(i.ph_keyword=e)}return i},searchInfo:function(){const e=null==Zt?void 0:Zt.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:gc,browserVersion:function(e,t){const n=gc(e,t),i=fc[n];if(Mt(i))return null;for(let t=0;t<i.length;t++){const n=i[t],r=e.match(n);if(r)return parseFloat(r[r.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(let t=0;t<mc.length;t++){const[n,i]=mc[t],r=n.exec(e),s=r&&(Et(i)?i(r,e):i);if(s)return s}return["",""]},device:vc,deviceType:function(e){const t=vc(e);return t===Tl||t===El||"Kobo"===t||"Kindle Fire"===t||t===rc?xl:t===jl||t===Ql||t===zl||t===tc?"Console":t===Ml?"Wearable":t?Il:"Desktop"},referrer:function(){return(null==Zt?void 0:Zt.referrer)||"$direct"},referringDomain:function(){var e;return null!=Zt&&Zt.referrer&&(null===(e=yn(Zt.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==jt?void 0:jt.href}},initialPersonPropsFromInfo:function(e){var t;const{r:n,u:i}=e,r={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=yn(n))||void 0===t?void 0:t.host};if(i){r.$initial_current_url=i;const e=yn(i);r.$initial_host=null==e?void 0:e.host,r.$initial_pathname=null==e?void 0:e.pathname;sn(this._campaignParamsFromUrl(i),(function(e,t){r["$initial_"+hn(t)]=e}))}if(n){sn(this._searchInfoFromReferrer(n),(function(e,t){r["$initial_"+hn(t)]=e}))}return r},properties:function(){if(!Yt)return{};const[e,t]=bc.os(Yt);return on(dn({$os:e,$os_version:t,$browser:bc.browser(Yt,navigator.vendor),$device:bc.device(Yt),$device_type:bc.deviceType(Yt)}),{$current_url:null==jt?void 0:jt.href,$host:null==jt?void 0:jt.host,$pathname:null==jt?void 0:jt.pathname,$raw_user_agent:Yt.length>1e3?Yt.substring(0,997)+"...":Yt,$browser_version:bc.browserVersion(Yt,navigator.vendor),$browser_language:bc.browserLanguage(),$screen_height:null==Bt?void 0:Bt.screen.height,$screen_width:null==Bt?void 0:Bt.screen.width,$viewport_height:null==Bt?void 0:Bt.innerHeight,$viewport_width:null==Bt?void 0:Bt.innerWidth,$lib:"web",$lib_version:qt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Yt)return{};const[e,t]=bc.os(Yt);return on(dn({$os:e,$os_version:t,$browser:bc.browser(Yt,navigator.vendor)}),{$browser_version:bc.browserVersion(Yt,navigator.vendor)})}},Cc=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class wc{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&en.info("Persistence loaded",e.persistence,{...this.props}),this.update_config(e,e),this.save()}buildStorage(e){let t;-1===Cc.indexOf(e.persistence.toLowerCase())&&(en.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const n=e.persistence.toLowerCase();return t="localstorage"===n&&ml.is_supported()?ml:"localstorage+cookie"===n&&_l.is_supported()?_l:"sessionstorage"===n&&wl.is_supported()?wl:"memory"===n?bl:"cookie"===n?gl:_l.is_supported()?_l:gl,t}properties(){const e={};return sn(this.props,(function(t,n){if(n===Pa&&Tt(t)){const n=Object.keys(t);for(let i=0;i<n.length;i++)e[`$feature/${n[i]}`]=t[n[i]]}else(function(e,t){let n=!1;return Nt(e)?n:Vt&&e.indexOf===Vt?-1!=e.indexOf(t):(sn(e,(function(e){if(n||(n=e===t))return tn})),n)})(Ka,n)||(e[n]=t)})),e}load(){if(this.disabled)return;const e=this.storage.parse(this.name);e&&(this.props=on({},e))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Tt(e)){Mt(t)&&(t="None"),this.expire_days=Mt(n)?this.default_expiry:n;let i=!1;if(sn(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Tt(e)){this.expire_days=Mt(t)?this.default_expiry:t;let n=!1;if(sn(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){this.campaign_params_saved||(this.register(bc.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}update_search_keyword(){this.register(bc.searchInfo())}update_referrer_info(){this.register_once(bc.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ga]||this.props[Za]||this.register_once({[ja]:bc.initialPersonInfo()},void 0)}get_referrer_info(){return dn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){const e={};sn([Za,Ga],(t=>{const n=this.props[t];n&&sn(n,(function(t,n){e["$initial_"+hn(n)]=t}))}));const t=this.props[ja];if(t){const n=bc.initialPersonPropsFromInfo(t);on(e,n)}return e}safe_merge(e){return sn(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){const t=this.buildStorage(e),n=this.props;this.clear(),this.storage=t,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){const n=this.props[_a]||{};n[e]=t,this.props[_a]=n,this.save()}remove_event_timer(e){const t=(this.props[_a]||{})[e];return Mt(t)||(delete this.props[_a][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function Ic(e){var t;return(null===(t=JSON.stringify(e,function(){const e=[];return function(t,n){if(Tt(n)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}return n}}()))||void 0===t?void 0:t.length)||0}function Sc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){const t=Math.floor(e.data.length/2),n=e.data.slice(0,t),i=e.data.slice(t);return[Sc({size:Ic(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),Sc({size:Ic(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var kc=(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))(kc||{}),xc=(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))(xc||{});class Ec{bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=e,this.options=i,this.refillRate=null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,this.bucketSize=null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,setInterval((()=>{this.refillBuckets()}),1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))};getNodeOrRelevantParent=e=>{const t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){const e=t.closest("svg");if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]};numberOfChanges=e=>{var t,n,i,r,s,o,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=e.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)};throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;const t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t;const[n,i]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[n])return!1;var r,s;(this.mutationBuckets[n]=null!==(t=this.mutationBuckets[n])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),0===this.mutationBuckets[n])&&(this.loggedTracker[n]||(this.loggedTracker[n]=!0,null===(r=(s=this.options).onBlockedNode)||void 0===r||r.call(s,n,i)));return e})));const i=this.numberOfChanges(t);return 0!==i||n===i?e:void 0}}var Tc=Uint8Array,Ac=Uint16Array,Mc=Uint32Array,Rc=new Tc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Fc=new Tc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Nc=new Tc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oc=function(e,t){for(var n=new Ac(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new Mc(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)r[s]=s-n[i]<<5|i;return[n,r]},Pc=Oc(Rc,2),Lc=Pc[0],Dc=Pc[1];Lc[28]=258,Dc[258]=28;for(var $c=Oc(Fc,0)[1],qc=new Ac(32768),Bc=0;Bc<32768;++Bc){var Hc=(43690&Bc)>>>1|(21845&Bc)<<1;Hc=(61680&(Hc=(52428&Hc)>>>2|(13107&Hc)<<2))>>>4|(3855&Hc)<<4,qc[Bc]=((65280&Hc)>>>8|(255&Hc)<<8)>>>1}var Wc=function(e,t,n){for(var i=e.length,r=0,s=new Ac(t);r<i;++r)++s[e[r]-1];var o,a=new Ac(t);for(r=0;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new Ac(1<<t);var l=15-t;for(r=0;r<i;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[qc[d]>>>l]=c}else for(o=new Ac(i),r=0;r<i;++r)o[r]=qc[a[e[r]-1]++]>>>15-e[r];return o},Uc=new Tc(288);for(Bc=0;Bc<144;++Bc)Uc[Bc]=8;for(Bc=144;Bc<256;++Bc)Uc[Bc]=9;for(Bc=256;Bc<280;++Bc)Uc[Bc]=7;for(Bc=280;Bc<288;++Bc)Uc[Bc]=8;var Vc=new Tc(32);for(Bc=0;Bc<32;++Bc)Vc[Bc]=5;var Gc=Wc(Uc,9,0),Zc=Wc(Vc,5,0),jc=function(e){return(e/8>>0)+(7&e&&1)},zc=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Ac?Ac:e instanceof Mc?Mc:Tc)(n-t);return i.set(e.subarray(t,n)),i},Qc=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},Kc=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},Yc=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,s=n.slice();if(!r)return[new Tc(0),0];if(1==r){var o=new Tc(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<r;++i)s[i].s>h&&(h=s[i].s);var p=new Ac(h+1),g=Jc(n[u-1],p,0);if(g>t){i=0;var f=0,m=g-t,v=1<<m;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<r;++i){var _=s[i].s;if(!(p[_]>t))break;f+=v-(1<<g-p[_]),p[_]=t}for(f>>>=m;f>0;){var y=s[i].s;p[y]<t?f-=1<<t-p[y]++-1:++i}for(;i>=0&&f;--i){var b=s[i].s;p[b]==t&&(--p[b],++f)}g=t}return[new Tc(p),g]},Jc=function(e,t,n){return-1==e.s?Math.max(Jc(e.l,t,n+1),Jc(e.r,t,n+1)):t[e.s]=n},Xc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ac(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},eu=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},tu=function(e,t,n){var i=n.length,r=jc(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;s<i;++s)e[r+s+4]=n[s];return 8*(r+4+i)},nu=function(e,t,n,i,r,s,o,a,l,c,u){Qc(t,u++,n),++r[256];for(var d=Yc(r,15),h=d[0],p=d[1],g=Yc(s,15),f=g[0],m=g[1],v=Xc(h),_=v[0],y=v[1],b=Xc(f),C=b[0],w=b[1],I=new Ac(19),S=0;S<_.length;++S)I[31&_[S]]++;for(S=0;S<C.length;++S)I[31&C[S]]++;for(var k=Yc(I,7),x=k[0],E=k[1],T=19;T>4&&!x[Nc[T-1]];--T);var A,M,R,F,N=c+5<<3,O=eu(r,Uc)+eu(s,Vc)+o,P=eu(r,h)+eu(s,f)+o+14+3*T+eu(I,x)+(2*I[16]+3*I[17]+7*I[18]);if(N<=O&&N<=P)return tu(t,u,e.subarray(l,l+c));if(Qc(t,u,1+(P<O)),u+=2,P<O){A=Wc(h,p,0),M=h,R=Wc(f,m,0),F=f;var L=Wc(x,E,0);Qc(t,u,y-257),Qc(t,u+5,w-1),Qc(t,u+10,T-4),u+=14;for(S=0;S<T;++S)Qc(t,u+3*S,x[Nc[S]]);u+=3*T;for(var D=[_,C],$=0;$<2;++$){var q=D[$];for(S=0;S<q.length;++S){var B=31&q[S];Qc(t,u,L[B]),u+=x[B],B>15&&(Qc(t,u,q[S]>>>5&127),u+=q[S]>>>12)}}}else A=Gc,M=Uc,R=Zc,F=Vc;for(S=0;S<a;++S)if(i[S]>255){B=i[S]>>>18&31;Kc(t,u,A[B+257]),u+=M[B+257],B>7&&(Qc(t,u,i[S]>>>23&31),u+=Rc[B]);var H=31&i[S];Kc(t,u,R[H]),u+=F[H],H>3&&(Kc(t,u,i[S]>>>5&8191),u+=Fc[H])}else Kc(t,u,A[i[S]]),u+=M[i[S]];return Kc(t,u,A[256]),u+M[256]},iu=new Mc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ru=function(){for(var e=new Mc(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),su=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=ru[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ou=function(e,t,n,i,r){return function(e,t,n,i,r,s){var o=e.length,a=new Tc(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?c=tu(l,c,e.subarray(u,d)):(l[u]=s,c=tu(l,c,e.subarray(u,o)))}else{for(var h=iu[t-1],p=h>>>13,g=8191&h,f=(1<<n)-1,m=new Ac(32768),v=new Ac(f+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&f},C=new Mc(25e3),w=new Ac(288),I=new Ac(32),S=0,k=0,x=(u=0,0),E=0,T=0;u<o;++u){var A=b(u),M=32767&u,R=v[A];if(m[M]=R,v[A]=M,E<=u){var F=o-u;if((S>7e3||x>24576)&&F>423){c=nu(e,l,0,C,w,I,k,x,T,u-T,c),x=S=k=0,T=u;for(var N=0;N<286;++N)w[N]=0;for(N=0;N<30;++N)I[N]=0}var O=2,P=0,L=g,D=M-R&32767;if(F>2&&A==b(u-D))for(var $=Math.min(p,F)-1,q=Math.min(32767,u),B=Math.min(258,F);D<=q&&--L&&M!=R;){if(e[u+O]==e[u+O-D]){for(var H=0;H<B&&e[u+H]==e[u+H-D];++H);if(H>O){if(O=H,P=D,H>$)break;var W=Math.min(D,H-2),U=0;for(N=0;N<W;++N){var V=u-D+N+32768&32767,G=V-m[V]+32768&32767;G>U&&(U=G,R=V)}}}D+=(M=R)-(R=m[M])+32768&32767}if(P){C[x++]=268435456|Dc[O]<<18|$c[P];var Z=31&Dc[O],j=31&$c[P];k+=Rc[Z]+Fc[j],++w[257+Z],++I[j],E=u+O,++S}else C[x++]=e[u],++w[e[u]]}}c=nu(e,l,s,C,w,I,k,x,T,u-T,c)}return zc(a,0,i+jc(c)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!r)},au=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},lu=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&au(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},cu=function(e){return 10+(e.filename&&e.filename.length+1||0)};function uu(e,t){void 0===t&&(t={});var n=su(),i=e.length;n.p(e);var r=ou(e,t,cu(t),8),s=r.length;return lu(r,t),au(r,s-8,n.d()),au(r,s-4,i),r}function du(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Tc(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},o=0;o<n;++o){if(r+5>i.length){var a=new Tc(r+8+(n-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return zc(i,0,r)}const hu=3e5,pu=[xc.MouseMove,xc.MouseInteraction,xc.Scroll,xc.ViewportResize,xc.Input,xc.TouchMove,xc.MediaInteraction,xc.Drag],gu=["trigger_activated","trigger_pending","trigger_disabled"],fu=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),mu="[SessionRecording]";function vu(e){return function(e,t){for(var n="",i=0;i<e.length;){var r=e[i++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[i++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[i++])<<6|63&e[i++]):(r=((15&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}(uu(du(JSON.stringify(e))),!0)}function _u(e){return e.type===kc.Custom&&"sessionIdle"===e.data.tag}class yu{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==Jt||null===(e=Jt.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(mu+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.urlTriggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:hu}get isSampled(){const e=this.instance.get_property(Fa);return Lt(e)?e:null}get sessionDuration(){var e,t;const n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-i:null}get isRecordingEnabled(){const e=!!this.instance.get_property(ka),t=!this.instance.config.disable_session_recording;return Bt&&e&&t}get isConsoleLogCaptureEnabled(){const e=!!this.instance.get_property(xa),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){const e=this.instance.get_property(Ta);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}get networkPayloadCapture(){var e,t;const n=this.instance.get_property(Ea),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),o=Tt(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Lt(o)?o:null==n?void 0:n.capturePerformance);return r||s||a?{recordHeaders:r,recordBody:s,recordPerformance:a}:void 0}get sampleRate(){const e=this.instance.get_property(Aa);return Pt(e)?e:null}get minimumDuration(){const e=this.instance.get_property(Ma);return Pt(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?Ot(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.urlTriggerStatus?"buffering":Lt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e,t;if(this.receivedDecide&&0===this._urlTriggers.length)return"trigger_disabled";const n=null===(e=this.instance)||void 0===e?void 0:e.get_property(Oa);var i,r,s,o;return(null===(t=this.instance)||void 0===t?void 0:t.get_property(Na))!==this.sessionId?(null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r||r.unregister(Na),null===(s=this.instance)||void 0===s||null===(o=s.persistence)||void 0===o||o.unregister(Oa),"trigger_pending"):gu.includes(n)?n:"trigger_pending"}set urlTriggerStatus(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[Na]:this.sessionId,[Oa]:e})}constructor(e){if(this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw en.error(mu+" started without valid sessionManager"),new Error(mu+" started without valid sessionManager. This is a bug.");const{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&en.warn(mu+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=Zt&&Zt.visibilityState){const e="window "+Zt.visibilityState;this._tryAddCustomEvent(e,{})}};startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==Bt||Bt.addEventListener("beforeunload",this._onBeforeUnload),null==Bt||Bt.addEventListener("offline",this._onOffline),null==Bt||Bt.addEventListener("online",this._onOnline),null==Bt||Bt.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),Ot(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook((e=>{try{if("$pageview"===e){const e=Bt?this._maskUrl(Bt.location.href):"";if(!e)return;this._tryAddCustomEvent("$pageview",{href:e})}}catch(e){en.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var i,r,s,o;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r||r.unregister(Na),null===(s=this.instance)||void 0===s||null===(o=s.persistence)||void 0===o||o.unregister(Oa))})))):this.stopRecording()}stopRecording(){var e,t,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==Bt||Bt.removeEventListener("beforeunload",this._onBeforeUnload),null==Bt||Bt.removeEventListener("offline",this._onOffline),null==Bt||Bt.removeEventListener("online",this._onOnline),null==Bt||Bt.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._onSessionIdListener)||void 0===t||t.call(this),this._onSessionIdListener=void 0,null===(n=this._samplingSessionListener)||void 0===n||n.call(this),this._samplingSessionListener=void 0,en.info(mu+" stopped"))}makeSamplingDecision(e){var t;const n=this.sessionId!==e,i=this.sampleRate;var r;if(!Pt(i))return void(null===(r=this.instance.persistence)||void 0===r||r.register({[Fa]:null}));const s=this.isSampled;let o;const a=n||!Lt(s);if(a){o=Math.random()<i}else o=s;a&&(o?this._reportStarted("sampling"):en.warn(mu+` Sample rate (${i}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:o})),null===(t=this.instance.persistence)||void 0===t||t.register({[Fa]:o})}afterDecideResponse(e){var t,n,i,r;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!Ot(this._linkedFlag)&&!this._linkedFlagSeen){const e=Rt(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,t=Rt(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((n,i)=>{const r=Tt(i)&&e in i,s=t?i[e]===t:r;if(s){const n={linkedFlag:e,linkedVariant:t},i="linked flag matched";en.info(mu+" "+i,n),this._tryAddCustomEvent(i,n),this._reportStarted("linked_flag_match")}this._linkedFlagSeen=s}))}null!==(i=e.sessionRecording)&&void 0!==i&&i.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Pt(this.sampleRate)&&Ot(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistDecideResponse(e){if(this.instance.persistence){var t;const n=this.instance.persistence,i=()=>{var t,i,r,s,o,a,l;const c=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate,u=Ot(c)?null:parseFloat(c),d=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[ka]:!!e.sessionRecording,[xa]:null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled,[Ea]:{capturePerformance:e.capturePerformance,...null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture},[Ta]:{enabled:null===(o=e.sessionRecording)||void 0===o?void 0:o.recordCanvas,fps:null===(a=e.sessionRecording)||void 0===a?void 0:a.canvasFps,quality:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasQuality},[Aa]:u,[Ma]:Mt(d)?null:d})};i(),null===(t=this._persistDecideOnSessionListener)||void 0===t||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!Mt(Object.assign)&&!Mt(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=Jt.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"recorder",(e=>{if(e)return en.error(mu+" could not load recorder",e);this._onScriptLoaded()}));en.info(mu+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==pu.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){const t=this.isInteractiveEvent(e);if(!t&&!this.isIdle){e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer())}let n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),this.isIdle)return;const{windowId:i,sessionId:r}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.sessionId!==r,o=this.windowId!==i;this.windowId=i,this.sessionId=r,s||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):en.warn(mu+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(fu((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(fu((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e;const t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording;for(const[e,i]of Object.entries(n||{}))e in t&&("maskInputOptions"===e?t.maskInputOptions={password:!0,...i}:t[e]=i);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void en.error(mu+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Ec(this.rrwebRecord,{onBlockedNode:(e,t)=>{const n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;en.info(n,{node:t}),this.log(mu+" "+n,"warn")}});const i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:e=>{this.onRRwebEmit(e)},plugins:i,...t}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:i.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;const e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}_gatherRRWebPlugins(){var e,t,n,i;const r=[],s=null===(e=Jt.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;s&&this.isConsoleLogCaptureEnabled&&r.push(s());const o=null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.rrwebPlugins)||void 0===i?void 0:i.getRecordNetworkPlugin;if(this.networkPayloadCapture&&Et(o)){!_n.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(o(si(this.instance.config,this.networkPayloadCapture))):en.info(mu+" NetworkCapture not started because we are on localhost.")}return r}onRRwebEmit(e){var t;if(this._processQueuedEvents(),!e||!Tt(e))return;if(e.type===kc.Meta){const t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();this._checkUrlTrigger(),e.type===kc.FullSnapshot&&this._scheduleFullSnapshot(),e.type===kc.FullSnapshot&&"trigger_pending"===this.urlTriggerStatus&&this.clearBuffer();const n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(!n)return;const i=function(e){const t=e;if(t&&Tt(t)&&6===t.type&&Tt(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));const n=[];for(let e=0;e<t.data.payload.payload.length;e++)t.data.payload.payload[e]&&t.data.payload.payload[e].length>2e3?n.push(t.data.payload.payload[e].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[e]);return t.data.payload.payload=n,e}return e}(n);if(this._updateWindowAndSessionIds(i),this.isIdle&&!_u(i))return;if(_u(i)){const e=i.data.payload;if(e){const t=e.lastActivityTimestamp,n=e.threshold;i.timestamp=t+n}}const r=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Ic(e)<1024)return e;try{if(e.type===kc.FullSnapshot)return{...e,data:vu(e.data),cv:"2024-10"};if(e.type===kc.IncrementalSnapshot&&e.data.source===xc.Mutation)return{...e,cv:"2024-10",data:{...e.data,texts:vu(e.data.texts),attributes:vu(e.data.attributes),removes:vu(e.data.removes),adds:vu(e.data.adds)}};if(e.type===kc.IncrementalSnapshot&&e.data.source===xc.StyleSheetRule)return{...e,cv:"2024-10",data:{...e.data,adds:vu(e.data.adds),removes:vu(e.data.removes)}}}catch(e){en.error(mu+" could not compress event - will use uncompressed event",e)}return e}(i):i,s={$snapshot_bytes:Ic(r),$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(s):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!Bt)return;const e=this._maskUrl(Bt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){const e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){const t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n;let i={url:e};return i=t.maskNetworkRequestFn(i),null===(n=i)||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);const e=this.minimumDuration,t=this.sessionDuration,n=Pt(t)&&t>=0,i=Pt(e)&&n&&t<e;if("buffering"===this.status||i)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;if(this.buffer.data.length>0){Sc(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}))}return this.clearBuffer()}_captureSnapshotBuffered(e){var t;const n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTrigger(){if(void 0===Bt||!Bt.location.href)return;const e=Bt.location.href;this._urlTriggers.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))&&this._activateUrlTrigger()}_activateUrlTrigger(){"trigger_pending"===this.urlTriggerStatus&&(this.urlTriggerStatus="trigger_activated",this._tryAddCustomEvent("url trigger activated",{}),this._flushBuffer(),en.info(mu+" recording triggered by URL pattern match"))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_override")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[Fa]:!0}),this._reportStarted("sampling_override")}_reportStarted(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0)()&&this.instance.register_for_session({$session_recording_start_reason:e})}}class bu{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){const e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Da),group_properties:this.instance.get_property($a),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:Ys.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();const t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},t),t)en.error("Failed to fetch feature flags from PostHog.");else{if(!Zt||!Zt.body)return en.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps)for(const{id:t,url:s}of e.siteApps){var n,i,r;Jt[`__$$ph_site_app_${t}`]=this.instance,null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=(r=n).loadSiteApp)||void 0===i||i.call(r,this.instance,s,(e=>{if(e)return en.error(`Error while initializing PostHog app with config id ${t}`,e)}))}else e.siteApps.length>0&&en.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}const Cu=null!=Bt&&Bt.location?In(Bt.location.hash,"__posthog")||In(location.hash,"state"):null,wu="_postHogToolbarParams";var Iu;!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Iu||(Iu={}));class Su{constructor(e){this.instance=e}setToolbarState(e){Jt.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=Jt.ph_toolbar_state)&&void 0!==e?e:Iu.UNINITIALIZED}maybeLoadToolbar(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Bt||!Zt)return!1;n=null!==(e=n)&&void 0!==e?e:Bt.location,r=null!==(t=r)&&void 0!==t?t:Bt.history;try{if(!i){try{Bt.localStorage.setItem("test","test"),Bt.localStorage.removeItem("test")}catch{return!1}i=null==Bt?void 0:Bt.localStorage}const e=Cu||In(n.hash,"__posthog")||In(n.hash,"state");let t;const s=e?cn((()=>JSON.parse(atob(decodeURIComponent(e)))))||cn((()=>JSON.parse(decodeURIComponent(e)))):null;return s&&"ph_authorize"===s.action?(t=s,t.source="url",t&&Object.keys(t).length>0&&(s.desiredHash?n.hash=s.desiredHash:r?r.replaceState(r.state,"",n.pathname+n.search):n.hash="")):(t=JSON.parse(i.getItem(wu)||"{}"),t.source="localstorage",delete t.userIntent),!(!t.token||this.instance.config.token!==t.token)&&(this.loadToolbar(t),!0)}catch{return!1}}_callLoadToolbar(e){(Jt.ph_load_toolbar||Jt.ph_load_editor)(e,this.instance)}loadToolbar(e){const t=!(null==Zt||!Zt.getElementById(Qa));if(!Bt||t)return!1;const n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i={token:this.instance.config.token,...e,apiURL:this.instance.requestRouter.endpointFor("ui"),...n?{instrument:!1}:{}};if(Bt.localStorage.setItem(wu,JSON.stringify({...i,source:void 0})),this.getToolbarState()===Iu.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Iu.UNINITIALIZED){var r,s;this.setToolbarState(Iu.LOADING),null===(r=Jt.__PosthogExtensions__)||void 0===r||null===(s=r.loadExternalDependency)||void 0===s||s.call(r,this.instance,"toolbar",(e=>{if(e)return en.error("Failed to load toolbar",e),void this.setToolbarState(Iu.UNINITIALIZED);this.setToolbarState(Iu.LOADED),this._callLoadToolbar(i)})),fn(Bt,"turbolinks:load",(()=>{this.setToolbarState(Iu.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class ku{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(e){this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();const e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),n=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];n.map((e=>{this.sendRequest({...e,transport:"sendBeacon"})}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){const e=this.formatQueue();for(const t in e){const n=e[t],i=(new Date).getTime();n.data&&xt(n.data)&&sn(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),this.sendRequest(n)}}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){const e={};return sn(this.queue,(t=>{var n;const i=t,r=(i?i.batchKey:null)||i.url;Mt(e[r])&&(e[r]={...i,data:[]}),null===(n=e[r].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}const xu=!!Qt||!!zt,Eu="text/plain",Tu=(e,t)=>{const[n,i]=e.split("?"),r={...t};null==i||i.split("&").forEach((e=>{const[t]=e.split("=");delete r[t]}));let s=Cn(r);return s=s?(i?i+"&":"")+s:i,`${n}?${s}`},Au=e=>{let{data:t,compression:n}=e;if(!t)return;if(n===Ys.GZipJS){const e=uu(du(JSON.stringify(t)),{mtime:0}),n=new Blob([e],{type:Eu});return{contentType:Eu,body:n,estimatedSize:n.size}}if(n===Ys.Base64){const e=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n,i,r,s,o,a,l,c,u=0,d=0,h="";const p=[];if(!e)return e;e=gn(e);do{n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),c=n<<16|i<<8|r,s=c>>18&63,o=c>>12&63,a=c>>6&63,l=63&c,p[d++]=t.charAt(s)+t.charAt(o)+t.charAt(a)+t.charAt(l)}while(u<e.length);switch(h=p.join(""),e.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}(JSON.stringify(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)))(e);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}const i=JSON.stringify(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},Mu=e=>{var t;const n=new Qt;n.open(e.method||"GET",e.url,!0);const{contentType:i,body:r}=null!==(t=Au(e))&&void 0!==t?t:{};sn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t;const i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch{}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.send(r)},Ru=e=>{var t,n;const{contentType:i,body:r,estimatedSize:s}=null!==(t=Au(e))&&void 0!==t?t:{},o=new Headers;sn(e.headers,(function(e,t){o.append(t,e)})),i&&o.append("Content-Type",i);const a=e.url;let l=null;if(Kt){const t=new Kt;l={signal:t.signal,timeout:setTimeout((()=>t.abort()),e.timeout)}}zt(a,{method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(s||0)<65536,body:r,signal:null===(n=l)||void 0===n?void 0:n.signal}).then((t=>t.text().then((n=>{var i;const r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){en.error(e)}null===(i=e.callback)||void 0===i||i.call(e,r)})))).catch((t=>{var n;en.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>l?clearTimeout(l.timeout):null))},Fu=e=>{const t=Tu(e.url,{beacon:"1"});try{var n;const{contentType:i,body:r}=null!==(n=Au(e))&&void 0!==n?n:{},s="string"==typeof r?new Blob([r],{type:i}):r;Gt.sendBeacon(t,s)}catch{}},Nu=[];Qt&&Nu.push({transport:"XHR",method:Mu}),zt&&Nu.push({transport:"fetch",method:Ru}),null!=Gt&&Gt.sendBeacon&&Nu.push({transport:"sendBeacon",method:Fu});class Ou{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(e){this.instance=e,this.queue=[],this.areWeOnline=!0,!Mt(Bt)&&"onLine"in Bt.navigator&&(this.areWeOnline=Bt.navigator.onLine,Bt.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),Bt.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){let{retriesPerformedSoFar:t,...n}=e;Pt(t)&&t>0&&(n.url=Tu(n.url,{retry_count:t})),this.instance._send_request({...n,callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue({retriesPerformedSoFar:t,...n}):null===(i=n.callback)||void 0===i||i.call(n,e)}})}enqueue(e){const t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;const n=function(e){const t=3e3*2**e,n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});let r=`Enqueued failed request for retry in ${n}`;navigator.onLine||(r+=" (Browser is offline)"),en.warn(r),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){const e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(const{requestOptions:e}of n)this.retriableRequest(e)}unload(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);for(const{requestOptions:e}of this.queue)try{this.instance._send_request({...e,transport:"sendBeacon"})}catch(e){en.error(e)}this.queue=[]}}const Pu=1800;class Lu{_sessionIdChangedHandlers=[];constructor(e,t,n,i){var r;this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||ll,this._windowIdGenerator=i||ll;const s=e.persistence_name||e.token;let o=e.session_idle_timeout_seconds||Pu;if(Pt(o)?o>Pu?en.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):o<60&&en.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(en.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=Pu),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,60),Pu),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){const e=wl.parse(this._window_id_storage_key),t=wl.parse(this._primary_window_exists_storage_key);e&&!t?this._windowId=e:wl.remove(this._window_id_storage_key),wl.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{const e=(e=>{const t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),e)}catch(e){en.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Mt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&wl.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&wl.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?wl.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[Ra]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];const e=this.persistence.props[Ra];return xt(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==Bt||Bt.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&wl.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime();let[n,i,r]=this._getSessionId(),s=this._getWindowId();const o=Pt(r)&&r>0&&Math.abs(t-r)>864e5;let a=!1;const l=!i,c=!e&&Math.abs(t-n)>this.sessionTimeoutMs;l||c||o?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),en.info("[SessionId] new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}}),r=t,a=!0):s||(s=this._windowIdGenerator(),a=!0);const u=0===n||!e||o?t:n,d=0===r?(new Date).getTime():r;return this._setWindowId(s),this._setSessionId(i,u,d),a&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}:void 0}}}let Du;!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Du||(Du={}));const $u="i.posthog.com";class qu{_regionCache={};constructor(e){this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e;let t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${$u}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Du.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Du.EU:this._regionCache[this.apiHost]=Du.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.uiHost+t;if(this.region===Du.CUSTOM)return this.apiHost+t;const n=$u+t;switch(e){case"assets":return`https://${this.region}-assets.${n}`;case"api":return`https://${this.region}.${n}`}}}const Bu="posthog-js";function Hu(e){let{organization:t,projectId:n,prefix:i,severityAllowList:r=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=>{var o,a,l,c,u;if(!("*"===r||r.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});const d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);s.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const h=(null===(o=s.exception)||void 0===o?void 0:o.values)||[],p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||s.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:s.level,$exception_list:h,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||s.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:s.tags,$level:s.level};return t&&n&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(p),s}}class Wu{constructor(e,t,n,i,r){this.name=Bu,this.setupOnce=function(s){s(Hu(e,{organization:t,projectId:n,prefix:i,severityAllowList:r}))}}}function Uu(e,t){const n=e.config.segment;if(!n)return t();!function(e,t){const n=e.config.segment;if(!n)return t();const i=n=>{const i=()=>n.anonymousId()||ll();e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(Wa,"identified")),t()},r=n.user();"then"in r&&Et(r.then)?r.then((e=>i(e))):i(r)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||en.warn("This browser does not have Promise support, and can not use the segment integration");const t=(t,n)=>{var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(en.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(en.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));const r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class Vu{constructor(e){this._instance=e}doPageView(e){var t;const n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==Bt?void 0:Bt.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){const t=this._currentPath,n=this._prevPageviewTimestamp,i=this._instance.scrollManager.getContext();if(!n)return{};let r={};if(i){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:n,maxContentHeight:s,lastContentY:o,maxContentY:a}=i;if(!(Mt(e)||Mt(t)||Mt(n)||Mt(s)||Mt(o)||Mt(a))){e=Math.ceil(e),t=Math.ceil(t),n=Math.ceil(n),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a);r={$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:e<=1?1:Gu(t/e,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:e<=1?1:Gu(n/e,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:s<=1?1:Gu(o/s,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:s<=1?1:Gu(a/s,0,1)}}}return t&&(r.$prev_pageview_pathname=t),n&&(r.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),r}}function Gu(e,t,n){return Math.max(t,Math.min(e,n))}class Zu{events={};constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(const n of this.events[e]||[])n(t);for(const n of this.events["*"]||[])n(e,t)}}class ju{_debugEventEmitter=new Zu;constructor(e){this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!Mt(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;const e=(e,t)=>{this.on(e,t)};null===(t=this.instance)||void 0===t||t._addCaptureHook(e)}}register(e){var t,n;if(!Mt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var i;const t=new Set;e.forEach((e=>{var n;null===(n=e.steps)||void 0===n||n.forEach((e=>{null!=e&&e.selector&&t.add(null==e?void 0:e.selector)}))})),null===(i=this.instance)||void 0===i||i.autocapture.setElementSelectors(t)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(const n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStep=(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t);checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event);checkStepUrl(e,t){if(null!=t&&t.url){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!i||"string"!=typeof i)return!1;if(!ju.matchString(i,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!Bt&&bn(e,t);case"exact":return t===e;case"contains":const n=ju.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return bn(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if(null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text){if(!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!ju.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!ju.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!ju.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1}if(null!=t&&t.selector){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!i)return!1;if(!i.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class zu{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;Mt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){const t=e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new ju(this.instance),this.actionMatcher.init();const e=e=>{this.onAction(e)};this.actionMatcher._addActionHook(e)}t.forEach((e=>{var t,n,i,r,s,o,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(i=n.actions)&&void 0!==i&&i.values&&(null===(r=e.conditions)||void 0===r||null===(s=r.actions)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){const n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0===e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length)return;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,i;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i||i.forEach((t=>{if(t&&t.name){const n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}onEvent(e,t){var n,i;const r=(null===(n=this.instance)||void 0===n||null===(i=n.persistence)||void 0===i?void 0:i.props[Ba])||[];if(zu.SURVEY_SHOWN_EVENT_NAME==e&&t&&r.length>0){var s;const e=null==t||null===(s=t.properties)||void 0===s?void 0:s.$survey_id;if(e){const t=r.indexOf(e);t>=0&&(r.splice(t,1),this._updateActivatedSurveys(r))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n;const i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Ba])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[Ba]:[...new Set(e)]})}getSurveys(){var e,t;const n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ba];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}const Qu="[Surveys]",Ku={icontains:e=>!!Bt&&Bt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!Bt&&-1===Bt.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!Bt&&bn(Bt.location.href,e),not_regex:e=>!!Bt&&!bn(Bt.location.href,e),exact:e=>(null==Bt?void 0:Bt.location.href)===e,is_not:e=>(null==Bt?void 0:Bt.location.href)!==e};class Yu{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}loadIfEnabled(){var e;const t=null==Jt||null===(e=Jt.__PosthogExtensions__)||void 0===e?void 0:e.generateSurveys;var n,i;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new zu(this.instance)),null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"surveys",(e=>{var t,n;if(e)return en.error(Qu,"Could not load surveys script",e);this._surveyManager=null===(t=Jt.__PosthogExtensions__)||void 0===t||null===(n=t.generateSurveys)||void 0===n?void 0:n.call(t,this.instance)})))}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new zu(this.instance));const n=this.instance.get_property(qa);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{var n;if(200!==t.statusCode||!t.json)return e([]);const i=t.json.surveys||[],r=i.filter((e=>{var t,n,i,r,s,o,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));var s;r.length>0&&(null===(s=this._surveyEventReceiver)||void 0===s||s.register(r));return null===(n=this.instance.persistence)||void 0===n||n.register({[qa]:i}),e(i)}})}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n;const i=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t,n,i,r;if(!e.conditions)return!0;const s=null===(t=e.conditions)||void 0===t||!t.url||Ku[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),o=null===(r=e.conditions)||void 0===r||!r.selector||(null==Zt?void 0:Zt.querySelector(e.conditions.selector));return s&&o})),r=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),s=i.filter((e=>{var t,n,i,s,o,a,l,c,u,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;const h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(s=e.conditions)||void 0===s||null===(o=s.events)||void 0===o?void 0:o.values.length)>0,f=(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.values.length)>0,m=!g&&!f||(null==r?void 0:r.includes(e.id)),v=this._canActivateRepeatedly(e),_=!(e.internal_targeting_flag_key&&!v)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&p&&_&&m}));return e(s)}),t)}getNextSurveyStep(e,t,n){var i;const r=e.questions[t],s=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?xi.End:s;if(r.branching.type===xi.End)return xi.End;if(r.branching.type===xi.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===xi.ResponseBased){if(r.type===ki.SingleChoice){var o,a;const e=r.choices.indexOf(`${n}`);if(null!==(o=r.branching)&&void 0!==o&&null!==(a=o.responseValues)&&void 0!==a&&a.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===xi.End?xi.End:s}}else if(r.type===ki.Rating){var l,c;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,r.scale);if(null!==(l=r.branching)&&void 0!==l&&null!==(c=l.responseValues)&&void 0!==c&&c.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===xi.End?xi.End:s}}return s}return en.warn(Qu,"Falling back to next question index due to unexpected branching type"),s}_canActivateRepeatedly(e){var t;return Ot(null===(t=Jt.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(en.warn(Qu,"canActivateRepeatedly is not defined, must init before calling"),!1):Jt.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Ot(this._surveyManager)?en.warn(Qu,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((t=>{const n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){Ot(this._surveyManager)?en.warn(Qu,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((n=>{const i=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(i,null==Zt?void 0:Zt.querySelector(t))}))}}class Ju{serverLimits={};lastEventRateLimited=!1;constructor(e){var t,n;this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const r=(new Date).getTime(),s=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Va))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};s.tokens+=(r-s.last)/1e3*this.captureEventsPerSecond,s.last=r,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);const o=s.tokens<1;return o||i||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null===(n=this.instance.persistence)||void 0===n||n.set_property(Va,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}checkForLimiting=e=>{const t=e.text;if(t&&t.length)try{const e=JSON.parse(t);(e.quota_limited||[]).forEach((e=>{en.info(`[RateLimiter] ${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void en.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}}}const Xu=()=>({initialPathName:(null==jt?void 0:jt.pathname)||"",referringDomain:bc.referringDomain(),...bc.campaignParams()});class ed{constructor(e,t,n){this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=n||Xu,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Ua]}_onSessionIdCallback=e=>{const t=this._getStoredProps();if(t&&t.sessionId===e)return;const n={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[Ua]:n})};getSessionProps(){var e;const t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}const td=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],nd=function(e,t){if(!e)return!1;const n=e.toLowerCase();return td.concat(t||[]).some((e=>{const t=e.toLowerCase();return-1!==n.indexOf(t)}))},id=function(e,t){if(!e)return!1;const n=e.userAgent;if(n&&nd(n,t))return!0;try{const n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>nd(null==e?void 0:e.brand,t))))return!0}catch{}return!!e.webdriver};class rd{constructor(){this.clicks=[]}isRageClick(e,t,n){const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}function sd(e){var t;return e.id===Qa||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+Qa))}class od{rageclicks=new rd;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ba]),null==Bt||Bt.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){let e=5e3;return Tt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Mt(this.instance.config.capture_heatmaps)?Mt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;en.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}afterDecideResponse(e){const t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ba]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){const e=this.buffer;return this.buffer=void 0,e}_setupListeners(){Bt&&Zt&&(fn(Zt,"click",(e=>this._onClick(e||(null==Bt?void 0:Bt.event))),!1,!0),fn(Zt,"mousemove",(e=>this._onMouseMove(e||(null==Bt?void 0:Bt.event))),!1,!0),this._initialized=!0)}_getProperties(e,t){const n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,n){let i=e;for(;i&&Mn(i)&&!Rn(i,"body");){if(i===n)return!1;if(an(t,null==Bt?void 0:Bt.getComputedStyle(i).position))return!0;i=Pn(i)}return!1}(An(e),["fixed","sticky"],r);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:t}}_onClick(e){var t;if(sd(e.target))return;const n=this._getProperties(e,"click");null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture({...n,type:"rageclick"}),this._capture(n)}_onMouseMove(e){sd(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(!Bt)return;const t=Bt.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}flush(){this.buffer&&!At(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class ad{constructor(e){this.instance=e}getContext(){return this.context}resetContext(){const e=this.context;return setTimeout(this._updateScrollData,0),e}_updateScrollData=()=>{var e,t,n,i;this.context||(this.context={});const r=this.scrollElement(),s=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=s+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.context.lastScrollY=Math.ceil(s),this.context.maxScrollY=Math.max(s,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(o,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(i=this.context.maxContentHeight)&&void 0!==i?i:0)};startMeasuringScrollPosition(){null==Bt||Bt.addEventListener("scroll",this._updateScrollData,!0),null==Bt||Bt.addEventListener("scrollend",this._updateScrollData,!0),null==Bt||Bt.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==Bt?void 0:Bt.document.documentElement;{const e=xt(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(const t of e){const e=null==Bt?void 0:Bt.document.querySelector(t);if(e)return e}}}scrollY(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollTop||0}return Bt&&(Bt.scrollY||Bt.pageYOffset||Bt.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollLeft||0}return Bt&&(Bt.scrollX||Bt.pageXOffset||Bt.document.documentElement.scrollLeft)||0}}const ld="$copy_autocapture";function cd(e,t){return t.length>e?t.slice(0,e)+"...":t}class ud{_initialized=!1;_isDisabledServerSide=null;rageclicks=new rd;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;const n=Tt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void en.info("Disabling Automatic Event Collection because this browser is not supported");if(!Bt||!Zt)return;const e=e=>{e=e||(null==Bt?void 0:Bt.event);try{this._captureEvent(e)}catch(e){en.error("Failed to capture event",e)}},t=e=>{e=e||(null==Bt?void 0:Bt.event),this._captureEvent(e,ld)};fn(Zt,"submit",e,!1,!0),fn(Zt,"change",e,!1,!0),fn(Zt,"click",e,!1,!0),this.config.capture_copied_text&&(fn(Zt,"copy",t,!1,!0),fn(Zt,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ya]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;const n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{const i=null==Zt?void 0:Zt.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&n.push(t)}))})),n}get isEnabled(){var e,t;const n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ya],i=this._isDisabledServerSide;if(Nt(i)&&!Lt(n)&&!this.instance.config.advanced_disable_decide)return!1;const r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_previousElementSibling(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!Mn(t));return t}_getAugmentPropertiesFromElement(e){if(!Dn(e))return{};const t={};return sn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&Gn(i)&&(t[n]=i)}})),t}_getPropertiesFromElement(e,t,n){var i;const r=e.tagName.toLowerCase(),s={tag_name:r};On.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?s.$el_text=cd(1024,Zn(e)):s.$el_text=cd(1024,Tn(e)));const o=xn(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e})));const a=null===(i=this.config)||void 0===i?void 0:i.element_attribute_ignorelist;sn(e.attributes,(function(n){var i;if((!$n(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==a||!a.includes(n.name))&&!t&&Gn(n.value)&&(i=n.name,!Rt(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){let e=n.value;"class"===n.name&&(e=Sn(e).join(" ")),s["attr__"+n.name]=cd(1024,e)}}));let l=1,c=1,u=e;for(;u=this._previousElementSibling(u);)l++,u.tagName===e.tagName&&c++;return s.nth_child=l,s.nth_of_type=c,s}_getDefaultProperties(e){return{$event_type:e,$ce_version:1}}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=An(e);var i;(Fn(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)&&(this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick"));const r=t===ld;if(n&&Ln(n,e,this.config,r,r?["copy","cut"]:void 0)){var s,o;const i=[n];let r=n;for(;r.parentNode&&!Rn(r,"body");)Nn(r.parentNode)?(i.push(r.parentNode.host),r=r.parentNode.host):(i.push(r.parentNode),r=r.parentNode);const u=[],d={};let h,p,g=!1;if(sn(i,(e=>{const t=Dn(e);"a"===e.tagName.toLowerCase()&&(h=e.getAttribute("href"),h=t&&Gn(h)&&h);an(xn(e),"ph-no-capture")&&(g=!0),u.push(this._getPropertiesFromElement(e,this.instance.config.mask_all_element_attributes,this.instance.config.mask_all_text));const n=this._getAugmentPropertiesFromElement(e);on(d,n)})),this.instance.config.mask_all_text||("a"===n.tagName.toLowerCase()||"button"===n.tagName.toLowerCase()?u[0].$el_text=Zn(n):u[0].$el_text=Tn(n)),h){var a,l;u[0].attr__href=h;const e=null===(a=yn(h))||void 0===a?void 0:a.host,t=null==Bt||null===(l=Bt.location)||void 0===l?void 0:l.host;e&&t&&e!==t&&(p=h)}if(g)return!1;const f=on(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:zn(u)}:{$elements:u},null!==(s=u[0])&&void 0!==s&&s.$el_text?{$el_text:null===(o=u[0])||void 0===o?void 0:o.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},d),m=this.getElementSelectors(n);if(m&&m.length>0&&(f.$element_selectors=m),t===ld){var c;const t=En(null==Bt||null===(c=Bt.getSelection())||void 0===c?void 0:c.toString()),n=e.type||"clipboard";if(!t)return!1;f.$selected_content=t,f.$copy_type=n}return this.instance.capture(t,f),!0}}isBrowserSupported(){return Et(null==Zt?void 0:Zt.querySelectorAll)}}class dd{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(e){this.instance=e}_loadScript(e){var t,n,i;null!==(t=Jt.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"tracing-headers",(t=>{if(t)return en.error("[TRACING-HEADERS] failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var e,t,n,i;Mt(this._restoreXHRPatch)&&(null===(e=Jt.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));Mt(this._restoreFetchPatch)&&(null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.tracingHeadersPatchFns)||void 0===i||i._patchFetch(this.instance.sessionManager))}}let hd;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(hd||(hd={}));class pd{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?hd.DENIED:this.storedConsent}isOptedOut(){return this.consent===hd.DENIED||this.consent===hd.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){const{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){const e=this.storage.get(this.storageKey);return"1"===e?hd.GRANTED:"0"===e?hd.DENIED:hd.PENDING}get storage(){if(!this._storage){const e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?ml:gl;const t="localStorage"===e?gl:ml;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!vn([null==Gt?void 0:Gt.doNotTrack,null==Gt?void 0:Gt.msDoNotTrack,Jt.doNotTrack],(e=>an([!0,1,"1","yes"],e)))}}const gd="[Exception Autocapture]";class fd{originalOnUnhandledRejectionHandler=void 0;constructor(e){var t;this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Ca]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==Bt||null===(e=Bt.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(en.info(gd+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=Jt.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return en.error(gd+" failed to load script",t);e()}))}startCapturing=()=>{var e,t,n,i;if(!Bt||!this.isEnabled||this.hasHandlers||this.isCapturing)return;const r=null===(e=Jt.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,s=null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.errorWrappingFunctions)||void 0===i?void 0:i.wrapUnhandledRejection;if(r&&s)try{this.unwrapOnError=r(this.captureException.bind(this)),this.unwrapUnhandledRejection=s(this.captureException.bind(this))}catch(e){en.error(gd+" failed to start",e),this.stopCapturing()}else en.error(gd+" failed to load error wrapping functions - cannot start")};stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}afterDecideResponse(e){const t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Ca]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){const t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=`${t}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}}const md=9e5,vd="[Web Vitals]";class _d{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Ia]),this.startIfEnabled()}get allowedMetrics(){var e,t;const n=Tt(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return Mt(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[Sa])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Tt(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){const e=Tt(this.instance.config.capture_performance)&&Pt(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:md;return 0<e&&e<=6e4?md:e}get isEnabled(){const e=Tt(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Lt(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(en.info(vd+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){const t=Tt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Tt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Ia]:t}),this.instance.persistence.register({[Sa]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,i;null!==(t=Jt.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=Jt.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"web-vitals",(t=>{t?en.error(vd+" failed to load script",t):e()}))}_currentURL(){const e=Bt?Bt.location.href:void 0;return e||en.error(vd+"Could not determine current URL"),e}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,t)=>({...e,[`$web_vitals_${t.name}_event`]:{...t},[`$web_vitals_${t.name}_value`]:t.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=e=>{var t;const n=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(Mt(n))return void en.error(vd+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};const i=this._currentURL();if(Mt(i))return;if(Ot(null==e?void 0:e.name)||Ot(null==e?void 0:e.value))return void en.error(vd+"Invalid metric received",e);if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)return void en.error(vd+"Ignoring metric with value >= "+this._maxAllowedValue,e);this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Mt(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=Mt(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...e,$current_url:i,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()};_startCapturing=()=>{let e,t,n,i;const r=Jt.__PosthogExtensions__;Mt(r)||Mt(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:i}=r.postHogWebVitalsCallbacks),e&&t&&n&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):en.error(vd+"web vitals callbacks not loaded - not starting")}}const yd={icontains:(e,t)=>!!Bt&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Bt&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Bt&&bn(t.href,e),not_regex:(e,t)=>!!Bt&&!bn(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class bd{constructor(e){this.instance=e;const t=e=>{this.applyFeatureFlagChanges(e)};this.instance.onFeatureFlags&&this.instance.onFeatureFlags(t),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){Ot(this._flagToExperiments)||this.instance.config.disable_web_experiments||(bd.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n;const t=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);t&&null!=i&&i.variants[t]&&this.applyTransforms(i.name,t,i.variants[t].transforms)}})))}afterDecideResponse(e){this._is_bot()?bd.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){const e=bd.getWindowLocation();if(null!=e&&e.search){const t=wn(null==e?void 0:e.search,"__experiment_id"),n=wn(null==e?void 0:e.search,"__experiment_variant");t&&n&&(bd.logInfo(`previewing web experiments ${t} && ${n}`),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getWebExperiments((t=>{bd.logInfo("retrieved web experiments from the server"),e._flagToExperiments=new Map,t.forEach((t=>{if(t.feature_flag_key&&e._featureFlags&&e._featureFlags[t.feature_flag_key]){var n;if(e._flagToExperiments)bd.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(n=e._flagToExperiments)||void 0===n||n.set(t.feature_flag_key,t);const i=e._featureFlags[t.feature_flag_key];i&&t.variants[i]&&e.applyTransforms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(const n in t.variants){const i=t.variants[n];bd.matchesTestVariant(i)&&e.applyTransforms(t.name,n,i.transforms)}}))}),t)}})();getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);const i=this.instance.get_property("$web_experiments");if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);const n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){const i=n.filter((t=>t.id===e));i&&i.length>0&&(bd.logInfo(`Previewing web experiment [${i[0].name}] with variant [${t}]`),this.applyTransforms(i[0].name,t,i[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!Ot(e.conditions)&&(bd.matchUrlConditions(e)&&bd.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(Ot(e.conditions)||Ot(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;const n=bd.getWindowLocation();if(n){var i,r,s;return null===(i=e.conditions)||void 0===i||!i.url||yd[null!==(r=null===(s=e.conditions)||void 0===s?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,n)}return!1}static getWindowLocation(){return null==Bt?void 0:Bt.location}static matchUTMConditions(e){var t;if(Ot(e.conditions)||Ot(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;const n=bc.campaignParams();if(n.utm_source){var i,r,s,o,a,l,c,u,d,h,p,g,f,m,v,_;const t=null===(i=e.conditions)||void 0===i||null===(r=i.utm)||void 0===r||!r.utm_campaign||(null===(s=e.conditions)||void 0===s||null===(o=s.utm)||void 0===o?void 0:o.utm_campaign)==n.utm_campaign,y=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,b=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(g=p.utm)||void 0===g?void 0:g.utm_medium)==n.utm_medium,C=null===(f=e.conditions)||void 0===f||null===(m=f.utm)||void 0===m||!m.utm_term||(null===(v=e.conditions)||void 0===v||null===(_=v.utm)||void 0===_?void 0:_.utm_term)==n.utm_term;return t&&b&&C&&y}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];en.info(`[WebExperiments] ${e}`,n)}applyTransforms(e,t,n,i){var r;this._is_bot()?bd.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var r;bd.logInfo(`applying transform of variant ${t} for experiment ${e} `,n);let o=0;const a=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);var s;if(null==a||a.forEach((e=>{const t=e;o+=1,n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})),this.instance&&this.instance.capture)this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:i,$web_experiment_document_url:null===(s=bd.getWindowLocation())||void 0===s?void 0:s.href,$web_experiment_elements_modified:o})}})):(bd.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:i,$web_experiment_variant:t,$web_experiment_document_url:null===(r=bd.getWindowLocation())||void 0===r?void 0:r.href,$web_experiment_elements_modified:0}))}_is_bot(){return Gt&&this.instance?id(Gt,this.instance.config.custom_blocked_useragents):void 0}}const Cd="/e/";class wd{constructor(e){var t;this.instance=e,this._endpointSuffix=(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[wa])||Cd}get endpoint(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}afterDecideResponse(e){const t=e.autocaptureExceptions;this._endpointSuffix=Tt(t)&&t.endpoint||Cd,this.instance.persistence&&this.instance.persistence.register({[wa]:this._endpointSuffix})}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}const Id={},Sd=()=>{},kd="posthog";let xd=!xu&&-1===(null==Yt?void 0:Yt.indexOf("MSIE"))&&-1===(null==Yt?void 0:Yt.indexOf("Mozilla"));const Ed=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:mn(null==Zt?void 0:Zt.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Sd,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:jt&&Rt(null==jt?void 0:jt.search)&&-1!==jt.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Bt||null===(e=Bt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{const t="Bad HTTP status: "+e.statusCode+" "+e.text;en.error(t)},get_device_id:e=>e,_onCapture:Sd,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1}},Td=e=>{const t={};Mt(e.process_person)||(t.person_profiles=e.process_person),Mt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Mt(e.cookie_name)||(t.persistence_name=e.cookie_name),Mt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);const n=on({},t,e);return xt(e.property_blacklist)&&(Mt(e.property_denylist)?n.property_denylist=e.property_blacklist:xt(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:en.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Ad{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){en.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}__forceAllowLocalhost=!1}class Md{webPerformance=new Ad;version=qt.LIB_VERSION;_internalEventEmitter=new Zu;constructor(){this.config=Ed(),this.decideEndpointWasHit=!1,this.SentryIntegration=Wu,this.sentryIntegration=e=>function(e,t){const n=Hu(e,t);return{name:Bu,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new tl(this),this.toolbar=new Su(this),this.scrollManager=new ad(this),this.pageViewManager=new Vu(this),this.surveys=new Yu(this),this.experiments=new bd(this),this.exceptions=new wd(this),this.rateLimiter=new Ju(this),this.requestRouter=new qu(this),this.consent=new pd(this),this.people={set:(e,t,n)=>{const i=Rt(e)?{[e]:t}:e;this.setPersonProperties(i),null==n||n({})},set_once:(e,t,n)=>{const i=Rt(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==n||n({})}},this.on("eventCaptured",(e=>en.info(`send "${null==e?void 0:e.event}"`,e)))}init(e,t,n){if(n&&n!==kd){var i;const r=null!==(i=Id[n])&&void 0!==i?i:new Md;return r._init(e,t,n),Id[n]=r,Id[kd][n]=r,r}return this._init(e,t,n)}_init(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(Mt(e)||Ft(e))return en.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return en.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(on({},Ed(),Td(i),{name:r,token:e})),this.config.on_xhr_error&&en.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Ys.GZipJS,this.persistence=new wc(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new wc({...this.config,persistence:"sessionStorage"});const s={...this.persistence.props},o={...this.sessionPersistence.props};if(this._requestQueue=new ku((e=>this._send_retriable_request(e))),this._retryQueue=new Ou(this),this.__request_queue=[],this.sessionManager=new Lu(this.config,this.persistence),this.sessionPropsManager=new ed(this.sessionManager,this.persistence),new dd(this).startIfEnabledOrStop(),this.sessionRecording=new yu(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new ud(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new od(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new _d(this),this.exceptionObserver=new fd(this),this.exceptionObserver.startIfEnabled(),qt.DEBUG=qt.DEBUG||this.config.debug,qt.DEBUG&&en.info("Starting in debug mode",{this:this,config:i,thisC:{...this.config},p:s,s:o}),this._sync_opt_out_with_persistence(),void 0!==(null===(t=i.bootstrap)||void 0===t?void 0:t.distinctID)){var a,l;const e=this.config.get_device_id(ll()),t=null!==(a=i.bootstrap)&&void 0!==a&&a.isIdentifiedID?e:i.bootstrap.distinctID;this.persistence.set_property(Wa,null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:t})}if(this._hasBootstrappedFeatureFlags()){var c,u;const e=Object.keys((null===(c=i.bootstrap)||void 0===c?void 0:c.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),t=Object.keys((null===(u=i.bootstrap)||void 0===u?void 0:u.featureFlagPayloads)||{}).filter((t=>e[t])).reduce(((e,t)=>{var n,r,s,o;null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(s=i.bootstrap)||void 0===s||null===(o=s.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:e,featureFlagPayloads:t})}if(!this.get_distinct_id()){const e=this.config.get_device_id(ll());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(Wa,"anonymous")}return null==Bt||null===(n=Bt.addEventListener)||void 0===n||n.call(Bt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),i.segment?Uu(this,(()=>this._loaded())):this._loaded(),Et(this.config._onCapture)&&this.on("eventCaptured",(e=>this.config._onCapture(e.event,e))),this}_afterDecideResponse(e){var t,n,i,r,s,o,a,l,c;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=an(e.supportedCompression,Ys.GZipJS)?Ys.GZipJS:an(e.supportedCompression,Ys.Base64)?Ys.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(i=this.autocapture)||void 0===i||i.afterDecideResponse(e),null===(r=this.heatmaps)||void 0===r||r.afterDecideResponse(e),null===(s=this.experiments)||void 0===s||s.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(l=this.exceptions)||void 0===l||l.afterDecideResponse(e),null===(c=this.exceptionObserver)||void 0===c||c.afterDecideResponse(e)}_loaded(){const e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){en.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),e||(new bu(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||rn(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(xd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Tu(e.url,{ip:this.config.ip?1:0}),e.headers={...this.config.request_headers},e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var t,n,i;const r={...e};r.timeout=r.timeout||6e4,r.url=Tu(r.url,{_:(new Date).getTime().toString(),ver:qt.LIB_VERSION,compression:r.compression});const s=null!==(t=r.transport)&&void 0!==t?t:"XHR",o=null!==(n=null===(i=vn(Nu,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:Nu[0].method;if(!o)throw new Error("No available transport method");o(r)})({...e,callback:t=>{var n,i,r;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(r=this.config).on_request_error)||void 0===i||i.call(r,t));null===(n=e.callback)||void 0===n||n.call(e,t)}})))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){let t;const n=[],i=[],r=[];rn(e,(e=>{e&&(t=e[0],xt(t)?r.push(e):Et(e)?e.call(this):xt(e)&&"alias"===t?n.push(e):xt(e)&&-1!==t.indexOf("capture")&&Et(this[t])?r.push(e):i.push(e))}));const s=function(e,t){rn(e,(function(e){if(xt(e[0])){let n=t;sn(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(n,this),s(i,this),s(r,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void en.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(Mt(e)||!Rt(e))return void en.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;const r=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=r&&r.isRateLimited)return void en.critical("This capture call is ignored due to client rate limiting.");this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();const s=new Date,o=(null==n?void 0:n.timestamp)||s;let a={uuid:ll(),event:e,properties:this._calculate_event_properties(e,t||{},o)};r&&(a.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens);(null==n?void 0:n.$set)&&(a.$set=null==n?void 0:n.$set);const l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(a.$set_once=l),a=pn(a,null!=n&&n._noTruncate?null:this.config.properties_string_max_length),a.timestamp=o,Mt(null==n?void 0:n.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=s);const c={...a.properties.$set,...a.$set};At(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",a);const u={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(u):this._requestQueue.enqueue(u),a}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,t,n){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;const i=this.persistence.remove_event_timer(e);let r={...t};if(r.token=this.config.token,"$snapshot"===e){const e={...this.persistence.properties(),...this.sessionPersistence.properties()};return r.distinct_id=e.distinct_id,(!Rt(r.distinct_id)&&!Pt(r.distinct_id)||Ft(r.distinct_id))&&en.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),r}const s=bc.properties();if(this.sessionManager){const{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId();r.$session_id=e,r.$window_id=t}if(this.requestRouter.region===Du.CUSTOM&&(r.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){const e=this.sessionPropsManager.getSessionProps();r=on(r,e)}if(!this.config.disable_scroll_properties){let t={};"$pageview"===e?t=this.pageViewManager.doPageView(n):"$pageleave"===e&&(t=this.pageViewManager.doPageLeave(n)),r=on(r,t)}if("$pageview"===e&&Zt&&(r.title=Zt.title),!Mt(i)){const e=n.getTime()-i;r.$duration=parseFloat((e/1e3).toFixed(3))}Yt&&this.config.opt_out_useragent_filter&&(r.$browser_type=this._is_bot()?"bot":"browser"),r=on({},s,this.persistence.properties(),this.sessionPersistence.properties(),r),r.$is_identified=this._isIdentified(),xt(this.config.property_denylist)?sn(this.config.property_denylist,(function(e){delete r[e]})):en.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const o=this.config.sanitize_properties;o&&(r=o(r,e));const a=this._hasPersonProcessing();return r.$process_person_profile=a,a&&this._requirePersonProcessing("_calculate_event_properties"),r}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;let t=on({},this.persistence.get_initial_props(),e||{});const n=this.config.sanitize_properties;return n&&(t=n(t,"$set_once")),At(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var i;null===(i=this.persistence)||void 0===i||i.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){const t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return en.uninitializedWarning("posthog.identify");if(Pt(e)&&(e=e.toString(),en.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!e)return void en.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(e.toLowerCase()))return void en.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;const i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){const e=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:e},"")}e!==i&&e!==this.get_property(va)&&(this.unregister(va),this.register({distinct_id:e}));const r="anonymous"===(this.persistence.get_property(Wa)||"anonymous");e!==i&&r?(this.persistence.set_property(Wa,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ha))}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,n){if(!e||!t)return void en.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;const i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:{...i,[e]:t}}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===t||n||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,i,r;if(en.info("reset"),!this.__loaded)return en.uninitializedWarning("posthog.reset");const s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(i=this.persistence)||void 0===i||i.set_property(Wa,"anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId();const o=this.config.get_device_id(ll());this.register_once({distinct_id:o,$device_id:e?o:s},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let i=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if(null!=e&&e.withTimestamp&&n){var r;const t=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!n)return i;i+=`?t=${Math.max(Math.floor(((new Date).getTime()-n)/1e3)-t,0)}`}return i}alias(e,t){return e===this.get_property(ma)?(en.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Mt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(va,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(en.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const t={...this.config};var n,i,r,s;Tt(e)&&(on(this.config,Td(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,t),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new wc({...this.config,persistence:"sessionStorage"}),ml.is_supported()&&"true"===ml.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(qt.DEBUG=!0,en.info("set_config",{config:e,oldConfig:t,newConfig:{...this.config}})),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(s=this.heatmaps)||void 0===s||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){const t=Lt(e)&&e;if(t||null!=e&&e.sampling||null!=e&&e.linked_flag){var n;const s=null===(n=this.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId();var i,r;if(t||null!=e&&e.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling(),en.info("Session recording started with sampling override for session: ",null==s?void 0:s.sessionId);if(t||null!=e&&e.linked_flag)null===(r=this.sessionRecording)||void 0===r||r.overrideLinkedFlag(),en.info("Session recording started with linked_flags override")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,t){var n;const i=new Error("PostHog syntheticException"),r=Et(null===(n=Jt.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?Jt.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i}):{$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}],...t};this.exceptions.sendExceptionEvent(r)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e;let t=null!==(e=this.config.name)&&void 0!==e?e:kd;return t!==kd&&(t=kd+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Wa))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Wa))}_hasPersonProcessing(){var e,t,n,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&At(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[va])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[za]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(en.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(za,!0),!0)}_sync_opt_out_with_persistence(){var e,t;const n=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default,r=this.config.disable_persistence||n&&!!i;var s,o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==r&&(null===(s=this.persistence)||void 0===s||s.set_disabled(r));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==r&&(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),Mt(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Gt?id(Gt,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Zt&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Zt.title},{send_instantly:!0}))}debug(e){!1===e?(null==Bt||Bt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Bt||Bt.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}!function(e,t){for(let n=0;n<t.length;n++)e.prototype[t[n]]=un(e.prototype[t[n]])}(Md,["identify"]);!function(){const e=Id[kd]=new Md,t=Jt.posthog;t&&sn(t._i,(function(n){if(n&&xt(n)){const i=e.init(n[0],n[1],n[2]),r=t[n[2]]||t;i&&(i._execute_array.call(i.people,r.people),i._execute_array(r))}})),Jt.posthog=e,function(){function e(){e.done||(e.done=!0,xd=!1,sn(Id,(function(e){e._dom_loaded()})))}null!=Zt&&Zt.addEventListener&&("complete"===Zt.readyState?e():Zt.addEventListener("DOMContentLoaded",e,!1)),Bt&&fn(Bt,"load",e,!0)}()}()}();
10
+ */Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return an(e)&&isFinite(e)&&Math.floor(e)===e});const El="0123456789abcdef";class Tl{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||e<0||t<0||n<0||i<0||e>0xffffffffffff||t>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|n>>>24,r[9]=n>>>16,r[10]=n>>>8,r[11]=n,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i,new Tl(r)}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e=e+El.charAt(this.bytes[t]>>>4)+El.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Tl(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){const n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Ml{timestamp=0;counter=0;random=new Fl;generate(){const e=this.generateOrAbort();if(tn(e)){this.timestamp=0;const e=this.generateOrAbort();if(tn(e))throw new Error("Could not generate UUID after timestamp reset");return e}return e}generateOrAbort(){const e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Tl.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}let Al,Rl=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};hn&&!tn(hn.crypto)&&crypto.getRandomValues&&(Rl=e=>crypto.getRandomValues(e));class Fl{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(Rl(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}const Nl=()=>Ll().toString(),Ll=()=>(Al||(Al=new Ml)).generate(),Pl="Thu, 01 Jan 1970 00:00:00 GMT";let Ol="";const Dl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function $l(e,t){if(t){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_n;if(Ol)return Ol;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";const n=e.split(".");let i=Math.min(n.length,8);const r="dmn_chk_"+Nl(),s=new RegExp("(^|;)\\s*"+r+"=1");for(;!Ol&&i--;){const e=n.slice(i).join("."),o=r+"=1;domain=."+e;t.cookie=o,s.test(t.cookie)&&(t.cookie=o+";expires="+Pl,Ol=e)}return Ol}(e);if(!t){const n=(e=>{const t=e.match(Dl);return t?t[0]:""})(e);n!==t&&xn.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}const Hl={is_supported:()=>!!_n,error:function(e){xn.error("cookieStore error: "+e)},get:function(e){if(_n){try{const t=e+"=",n=_n.cookie.split(";").filter((e=>e.length));for(let e=0;e<n.length;e++){let i=n[e];for(;" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){let t;try{t=JSON.parse(Hl.get(e))||{}}catch{}return t},set:function(e,t,n,i,r){if(_n)try{let s="",o="";const a=$l(_n.location.hostname,i);if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),s="; expires="+e.toUTCString()}r&&(o="; secure");const l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&xn.warn("cookieStore warning: large cookie, len="+l.length),_n.cookie=l,l}catch{return}},remove:function(e,t){try{Hl.set(e,"",-1,t)}catch{return}}};let Bl=null;const ql={is_supported:function(){if(!sn(Bl))return Bl;let e=!0;if(tn(hn))e=!1;else try{const t="__mplssupport__",n="xyz";ql.set(t,n),'"xyz"'!==ql.get(t)&&(e=!1),ql.remove(t)}catch{e=!1}return e||xn.error("localStorage unsupported; falling back to cookie store"),Bl=e,e},error:function(e){xn.error("localStorage error: "+e)},get:function(e){try{return null==hn?void 0:hn.localStorage.getItem(e)}catch(e){ql.error(e)}return null},parse:function(e){try{return JSON.parse(ql.get(e))||{}}catch{}return null},set:function(e,t){try{null==hn||hn.localStorage.setItem(e,JSON.stringify(t))}catch(e){ql.error(e)}},remove:function(e){try{null==hn||hn.localStorage.removeItem(e)}catch(e){ql.error(e)}}},Wl=["distinct_id",nl,il,yl],Gl={...ql,parse:function(e){try{let t={};try{t=Hl.parse(e)||{}}catch{}const n=Rn(t,JSON.parse(ql.get(e)||"{}"));return ql.set(e,n),n}catch{}return null},set:function(e,t,n,i,r,s){try{ql.set(e,t,void 0,void 0,s);const o={};Wl.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Hl.set(e,o,n,i,r,s)}catch(e){ql.error(e)}},remove:function(e,t){try{null==hn||hn.localStorage.removeItem(e),Hl.remove(e,t)}catch(e){ql.error(e)}}},Vl={},Zl={is_supported:function(){return!0},error:function(e){xn.error("memoryStorage error: "+e)},get:function(e){return Vl[e]||null},parse:function(e){return Vl[e]||null},set:function(e,t){Vl[e]=t},remove:function(e){delete Vl[e]}};let Ul=null;const zl={is_supported:function(){if(!sn(Ul))return Ul;if(Ul=!0,tn(hn))Ul=!1;else try{const e="__support__",t="xyz";zl.set(e,t),'"xyz"'!==zl.get(e)&&(Ul=!1),zl.remove(e)}catch{Ul=!1}return Ul},error:function(e){xn.error("sessionStorage error: ",e)},get:function(e){try{return null==hn?void 0:hn.sessionStorage.getItem(e)}catch(e){zl.error(e)}return null},parse:function(e){try{return JSON.parse(zl.get(e))||null}catch{}return null},set:function(e,t){try{null==hn||hn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){zl.error(e)}},remove:function(e){try{null==hn||hn.sessionStorage.removeItem(e)}catch(e){zl.error(e)}}},Yl="Mobile",jl="iOS",Xl="Android",Jl="Tablet",Kl=Xl+" "+Jl,Ql="iPad",ec="Apple",tc=ec+" Watch",nc="Safari",ic="BlackBerry",rc="Samsung",sc=rc+"Browser",oc=rc+" Internet",ac="Chrome",lc=ac+" OS",cc=ac+" "+jl,uc="Internet Explorer",dc=uc+" "+Yl,hc="Opera",pc=hc+" Mini",gc="Edge",fc="Microsoft "+gc,mc="Firefox",vc=mc+" "+jl,_c="Nintendo",yc="PlayStation",bc="Xbox",wc=Xl+" "+Yl,Ic=Yl+" "+nc,Sc="Windows",Cc=Sc+" Phone",kc="Nokia",xc="Ouya",Ec="Generic",Tc=Ec+" "+Yl.toLowerCase(),Mc=Ec+" "+Jl.toLowerCase(),Ac="Konqueror",Rc="(\\d+(\\.\\d+)?)",Fc=new RegExp("Version/"+Rc),Nc=new RegExp(bc,"i"),Lc=new RegExp(yc+" \\w+","i"),Pc=new RegExp(_c+" \\w+","i"),Oc=new RegExp(ic+"|PlayBook|BB10","i"),Dc={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};const $c=(e,t)=>t&&Fn(t,ec)||function(e){return Fn(e,nc)&&!Fn(e,ac)&&!Fn(e,Xl)}(e),Hc=function(e,t){return t=t||"",Fn(e," OPR/")&&Fn(e,"Mini")?pc:Fn(e," OPR/")?hc:Oc.test(e)?ic:Fn(e,"IE"+Yl)||Fn(e,"WPDesktop")?dc:Fn(e,sc)?oc:Fn(e,gc)||Fn(e,"Edg/")?fc:Fn(e,"FBIOS")?"Facebook "+Yl:Fn(e,"UCWEB")||Fn(e,"UCBrowser")?"UC Browser":Fn(e,"CriOS")?cc:Fn(e,"CrMo")?ac:Fn(e,Xl)&&Fn(e,nc)?wc:Fn(e,ac)?ac:Fn(e,"FxiOS")?vc:Fn(e.toLowerCase(),Ac.toLowerCase())?Ac:$c(e,t)?Fn(e,Yl)?Ic:nc:Fn(e,mc)?mc:Fn(e,"MSIE")||Fn(e,"Trident/")?uc:Fn(e,"Gecko")?mc:""},Bc={[dc]:[new RegExp("rv:"+Rc)],[fc]:[new RegExp(gc+"?\\/"+Rc)],[ac]:[new RegExp("("+ac+"|CrMo)\\/"+Rc)],[cc]:[new RegExp("CriOS\\/"+Rc)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Rc)],[nc]:[Fc],[Ic]:[Fc],[hc]:[new RegExp("(Opera|OPR)\\/"+Rc)],[mc]:[new RegExp(mc+"\\/"+Rc)],[vc]:[new RegExp("FxiOS\\/"+Rc)],[Ac]:[new RegExp("Konqueror[:/]?"+Rc,"i")],[ic]:[new RegExp(ic+" "+Rc),Fc],[wc]:[new RegExp("android\\s"+Rc,"i")],[oc]:[new RegExp(sc+"\\/"+Rc)],[uc]:[new RegExp("(rv:|MSIE )"+Rc)],Mozilla:[new RegExp("rv:"+Rc)]},qc=[[new RegExp(bc+"; "+bc+" (.*?)[);]","i"),e=>[bc,e&&e[1]||""]],[new RegExp(_c,"i"),[_c,""]],[new RegExp(yc,"i"),[yc,""]],[Oc,[ic,""]],[new RegExp(Sc,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Cc,""];if(new RegExp(Yl).test(t)&&!/IEMobile\b/.test(t))return[Sc+" "+Yl,""];const n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){const e=n[1];let i=Dc[e]||"";return/arm/i.test(t)&&(i="RT"),[Sc,i]}return[Sc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){const t=[e[3],e[4],e[5]||"0"];return[jl,t.join(".")]}return[jl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=tn(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Xl+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Xl+")","i"),e=>{if(e&&e[2]){const t=[e[2],e[3],e[4]||"0"];return[Xl,t.join(".")]}return[Xl,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];if(e&&e[1]){const n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[lc,""]],[/Linux|debian/i,["Linux",""]]],Wc=function(e){return Pc.test(e)?_c:Lc.test(e)?yc:Nc.test(e)?bc:new RegExp(xc,"i").test(e)?xc:new RegExp("("+Cc+"|WPDesktop)","i").test(e)?Cc:/iPad/.test(e)?Ql:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?tc:Oc.test(e)?ic:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(kc,"i").test(e)?kc:/(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(Yl).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)?Xl:Kl:Xl:new RegExp("(pda|"+Yl+")","i").test(e)?Tc:new RegExp(Jl,"i").test(e)&&!new RegExp(Jl+" pc","i").test(e)?Mc:""},Gc="https?://(.*)",Vc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],Zc={campaignParams:function(e){return _n?this._campaignParamsFromUrl(_n.URL,e):{}},_campaignParamsFromUrl:function(e,t){const n=Vc.concat(t||[]),i={};return An(n,(function(t){const n=zn(e,t);i[t]=n||null})),i},_searchEngine:function(e){return e?0===e.search(Gc+"google.([^/?]*)")?"google":0===e.search(Gc+"bing.com")?"bing":0===e.search(Gc+"yahoo.com")?"yahoo":0===e.search(Gc+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){const t=Zc._searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(!sn(t)){i.$search_engine=t;const e=_n?zn(_n.referrer,n):"";e.length&&(i.ph_keyword=e)}return i},searchInfo:function(){const e=null==_n?void 0:_n.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Hc,browserVersion:function(e,t){const n=Hc(e,t),i=Bc[n];if(tn(i))return null;for(let t=0;t<i.length;t++){const n=i[t],r=e.match(n);if(r)return parseFloat(r[r.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(let t=0;t<qc.length;t++){const[n,i]=qc[t],r=n.exec(e),s=r&&(Kt(i)?i(r,e):i);if(s)return s}return["",""]},device:Wc,deviceType:function(e){const t=Wc(e);return t===Ql||t===Kl||"Kobo"===t||"Kindle Fire"===t||t===Mc?Jl:t===_c||t===bc||t===yc||t===xc?"Console":t===tc?"Wearable":t?Yl:"Desktop"},referrer:function(){return(null==_n?void 0:_n.referrer)||"$direct"},referringDomain:function(){var e;return null!=_n&&_n.referrer&&(null===(e=Vn(_n.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==yn?void 0:yn.href}},initialPersonPropsFromInfo:function(e){var t;const{r:n,u:i}=e,r={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=Vn(n))||void 0===t?void 0:t.host};if(i){r.$initial_current_url=i;const e=Vn(i);r.$initial_host=null==e?void 0:e.host,r.$initial_pathname=null==e?void 0:e.pathname;An(this._campaignParamsFromUrl(i),(function(e,t){r["$initial_"+Dn(t)]=e}))}if(n){An(this._searchInfoFromReferrer(n),(function(e,t){r["$initial_"+Dn(t)]=e}))}return r},properties:function(){if(!Sn)return{};const[e,t]=Zc.os(Sn);return Rn(On({$os:e,$os_version:t,$browser:Zc.browser(Sn,navigator.vendor),$device:Zc.device(Sn),$device_type:Zc.deviceType(Sn)}),{$current_url:null==yn?void 0:yn.href,$host:null==yn?void 0:yn.host,$pathname:null==yn?void 0:yn.pathname,$raw_user_agent:Sn.length>1e3?Sn.substring(0,997)+"...":Sn,$browser_version:Zc.browserVersion(Sn,navigator.vendor),$browser_language:Zc.browserLanguage(),$screen_height:null==hn?void 0:hn.screen.height,$screen_width:null==hn?void 0:hn.screen.width,$viewport_height:null==hn?void 0:hn.innerHeight,$viewport_width:null==hn?void 0:hn.innerWidth,$lib:"web",$lib_version:dn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Sn)return{};const[e,t]=Zc.os(Sn);return Rn(On({$os:e,$os_version:t,$browser:Zc.browser(Sn,navigator.vendor)}),{$browser_version:Zc.browserVersion(Sn,navigator.vendor)})}},Uc=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class zc{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&xn.info("Persistence loaded",e.persistence,{...this.props}),this.update_config(e,e),this.save()}buildStorage(e){let t;-1===Uc.indexOf(e.persistence.toLowerCase())&&(xn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const n=e.persistence.toLowerCase();return t="localstorage"===n&&ql.is_supported()?ql:"localstorage+cookie"===n&&Gl.is_supported()?Gl:"sessionstorage"===n&&zl.is_supported()?zl:"memory"===n?Zl:"cookie"===n?Hl:Gl.is_supported()?Gl:Hl,t}properties(){const e={};return An(this.props,(function(t,n){if(n===ol&&Qt(t)){const n=Object.keys(t);for(let i=0;i<n.length;i++)e[`$feature/${n[i]}`]=t[n[i]]}else(function(e,t){let n=!1;return sn(e)?n:mn&&e.indexOf===mn?-1!=e.indexOf(t):(An(e,(function(e){if(n||(n=e===t))return En})),n)})(wl,n)||(e[n]=t)})),e}load(){if(this.disabled)return;const e=this.storage.parse(this.name);e&&(this.props=Rn({},e))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Qt(e)){tn(t)&&(t="None"),this.expire_days=tn(n)?this.default_expiry:n;let i=!1;if(An(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Qt(e)){this.expire_days=tn(t)?this.default_expiry:t;let n=!1;if(An(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){this.campaign_params_saved||(this.register(Zc.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}update_search_keyword(){this.register(Zc.searchInfo())}update_referrer_info(){this.register_once(Zc.referrerInfo(),void 0)}set_initial_person_info(){this.props[ml]||this.props[vl]||this.register_once({[_l]:Zc.initialPersonInfo()},void 0)}get_referrer_info(){return On({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){const e={};An([vl,ml],(t=>{const n=this.props[t];n&&An(n,(function(t,n){e["$initial_"+Dn(n)]=t}))}));const t=this.props[_l];if(t){const n=Zc.initialPersonPropsFromInfo(t);Rn(e,n)}return e}safe_merge(e){return An(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){const t=this.buildStorage(e),n=this.props;this.clear(),this.storage=t,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){const n=this.props[Ga]||{};n[e]=t,this.props[Ga]=n,this.save()}remove_event_timer(e){const t=(this.props[Ga]||{})[e];return tn(t)||(delete this.props[Ga][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function Yc(e){var t;return(null===(t=JSON.stringify(e,function(){const e=[];return function(t,n){if(Qt(n)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}return n}}()))||void 0===t?void 0:t.length)||0}function jc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){const t=Math.floor(e.data.length/2),n=e.data.slice(0,t),i=e.data.slice(t);return[jc({size:Yc(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),jc({size:Yc(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Xc=(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))(Xc||{}),Jc=(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))(Jc||{});class Kc{bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=e,this.options=i,this.refillRate=null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,this.bucketSize=null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,setInterval((()=>{this.refillBuckets()}),1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))};getNodeOrRelevantParent=e=>{const t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){const e=t.closest("svg");if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]};numberOfChanges=e=>{var t,n,i,r,s,o,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=e.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)};throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;const t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t;const[n,i]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[n])return!1;var r,s;(this.mutationBuckets[n]=null!==(t=this.mutationBuckets[n])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),0===this.mutationBuckets[n])&&(this.loggedTracker[n]||(this.loggedTracker[n]=!0,null===(r=(s=this.options).onBlockedNode)||void 0===r||r.call(s,n,i)));return e})));const i=this.numberOfChanges(t);return 0!==i||n===i?e:void 0}}var Qc=Uint8Array,eu=Uint16Array,tu=Uint32Array,nu=new Qc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),iu=new Qc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ru=new Qc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),su=function(e,t){for(var n=new eu(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new tu(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)r[s]=s-n[i]<<5|i;return[n,r]},ou=su(nu,2),au=ou[0],lu=ou[1];au[28]=258,lu[258]=28;for(var cu=su(iu,0)[1],uu=new eu(32768),du=0;du<32768;++du){var hu=(43690&du)>>>1|(21845&du)<<1;hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4,uu[du]=((65280&hu)>>>8|(255&hu)<<8)>>>1}var pu=function(e,t,n){for(var i=e.length,r=0,s=new eu(t);r<i;++r)++s[e[r]-1];var o,a=new eu(t);for(r=0;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new eu(1<<t);var l=15-t;for(r=0;r<i;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[uu[d]>>>l]=c}else for(o=new eu(i),r=0;r<i;++r)o[r]=uu[a[e[r]-1]++]>>>15-e[r];return o},gu=new Qc(288);for(du=0;du<144;++du)gu[du]=8;for(du=144;du<256;++du)gu[du]=9;for(du=256;du<280;++du)gu[du]=7;for(du=280;du<288;++du)gu[du]=8;var fu=new Qc(32);for(du=0;du<32;++du)fu[du]=5;var mu=pu(gu,9,0),vu=pu(fu,5,0),_u=function(e){return(e/8>>0)+(7&e&&1)},yu=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof eu?eu:e instanceof tu?tu:Qc)(n-t);return i.set(e.subarray(t,n)),i},bu=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},wu=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},Iu=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,s=n.slice();if(!r)return[new Qc(0),0];if(1==r){var o=new Qc(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<r;++i)s[i].s>h&&(h=s[i].s);var p=new eu(h+1),g=Su(n[u-1],p,0);if(g>t){i=0;var f=0,m=g-t,v=1<<m;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<r;++i){var _=s[i].s;if(!(p[_]>t))break;f+=v-(1<<g-p[_]),p[_]=t}for(f>>>=m;f>0;){var y=s[i].s;p[y]<t?f-=1<<t-p[y]++-1:++i}for(;i>=0&&f;--i){var b=s[i].s;p[b]==t&&(--p[b],++f)}g=t}return[new Qc(p),g]},Su=function(e,t,n){return-1==e.s?Math.max(Su(e.l,t,n+1),Su(e.r,t,n+1)):t[e.s]=n},Cu=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new eu(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},ku=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},xu=function(e,t,n){var i=n.length,r=_u(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;s<i;++s)e[r+s+4]=n[s];return 8*(r+4+i)},Eu=function(e,t,n,i,r,s,o,a,l,c,u){bu(t,u++,n),++r[256];for(var d=Iu(r,15),h=d[0],p=d[1],g=Iu(s,15),f=g[0],m=g[1],v=Cu(h),_=v[0],y=v[1],b=Cu(f),w=b[0],I=b[1],S=new eu(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var k=Iu(S,7),x=k[0],E=k[1],T=19;T>4&&!x[ru[T-1]];--T);var M,A,R,F,N=c+5<<3,L=ku(r,gu)+ku(s,fu)+o,P=ku(r,h)+ku(s,f)+o+14+3*T+ku(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(N<=L&&N<=P)return xu(t,u,e.subarray(l,l+c));if(bu(t,u,1+(P<L)),u+=2,P<L){M=pu(h,p,0),A=h,R=pu(f,m,0),F=f;var O=pu(x,E,0);bu(t,u,y-257),bu(t,u+5,I-1),bu(t,u+10,T-4),u+=14;for(C=0;C<T;++C)bu(t,u+3*C,x[ru[C]]);u+=3*T;for(var D=[_,w],$=0;$<2;++$){var H=D[$];for(C=0;C<H.length;++C){var B=31&H[C];bu(t,u,O[B]),u+=x[B],B>15&&(bu(t,u,H[C]>>>5&127),u+=H[C]>>>12)}}}else M=mu,A=gu,R=vu,F=fu;for(C=0;C<a;++C)if(i[C]>255){B=i[C]>>>18&31;wu(t,u,M[B+257]),u+=A[B+257],B>7&&(bu(t,u,i[C]>>>23&31),u+=nu[B]);var q=31&i[C];wu(t,u,R[q]),u+=F[q],q>3&&(wu(t,u,i[C]>>>5&8191),u+=iu[q])}else wu(t,u,M[i[C]]),u+=A[i[C]];return wu(t,u,M[256]),u+A[256]},Tu=new tu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Mu=function(){for(var e=new tu(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Au=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=Mu[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Ru=function(e,t,n,i,r){return function(e,t,n,i,r,s){var o=e.length,a=new Qc(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?c=xu(l,c,e.subarray(u,d)):(l[u]=s,c=xu(l,c,e.subarray(u,o)))}else{for(var h=Tu[t-1],p=h>>>13,g=8191&h,f=(1<<n)-1,m=new eu(32768),v=new eu(f+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&f},w=new tu(25e3),I=new eu(288),S=new eu(32),C=0,k=0,x=(u=0,0),E=0,T=0;u<o;++u){var M=b(u),A=32767&u,R=v[M];if(m[A]=R,v[M]=A,E<=u){var F=o-u;if((C>7e3||x>24576)&&F>423){c=Eu(e,l,0,w,I,S,k,x,T,u-T,c),x=C=k=0,T=u;for(var N=0;N<286;++N)I[N]=0;for(N=0;N<30;++N)S[N]=0}var L=2,P=0,O=g,D=A-R&32767;if(F>2&&M==b(u-D))for(var $=Math.min(p,F)-1,H=Math.min(32767,u),B=Math.min(258,F);D<=H&&--O&&A!=R;){if(e[u+L]==e[u+L-D]){for(var q=0;q<B&&e[u+q]==e[u+q-D];++q);if(q>L){if(L=q,P=D,q>$)break;var W=Math.min(D,q-2),G=0;for(N=0;N<W;++N){var V=u-D+N+32768&32767,Z=V-m[V]+32768&32767;Z>G&&(G=Z,R=V)}}}D+=(A=R)-(R=m[A])+32768&32767}if(P){w[x++]=268435456|lu[L]<<18|cu[P];var U=31&lu[L],z=31&cu[P];k+=nu[U]+iu[z],++I[257+U],++S[z],E=u+L,++C}else w[x++]=e[u],++I[e[u]]}}c=Eu(e,l,s,w,I,S,k,x,T,u-T,c)}return yu(a,0,i+_u(c)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!r)},Fu=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Nu=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Fu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},Lu=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Pu(e,t){void 0===t&&(t={});var n=Au(),i=e.length;n.p(e);var r=Ru(e,t,Lu(t),8),s=r.length;return Nu(r,t),Fu(r,s-8,n.d()),Fu(r,s-4,i),r}function Ou(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Qc(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},o=0;o<n;++o){if(r+5>i.length){var a=new Qc(r+8+(n-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return yu(i,0,r)}const Du=3e5,$u=[Jc.MouseMove,Jc.MouseInteraction,Jc.Scroll,Jc.ViewportResize,Jc.Input,Jc.TouchMove,Jc.MediaInteraction,Jc.Drag],Hu=["trigger_activated","trigger_pending","trigger_disabled"],Bu=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),qu="[SessionRecording]";function Wu(e){return function(e,t){for(var n="",i=0;i<e.length;){var r=e[i++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[i++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[i++])<<6|63&e[i++]):(r=((15&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}(Pu(Ou(JSON.stringify(e))),!0)}function Gu(e){return e.type===Xc.Custom&&"sessionIdle"===e.data.tag}class Vu{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==Cn||null===(e=Cn.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(qu+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.urlTriggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:Du}get isSampled(){const e=this.instance.get_property(il);return ln(e)?e:null}get sessionDuration(){var e,t;const n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-i:null}get isRecordingEnabled(){const e=!!this.instance.get_property(Xa),t=!this.instance.config.disable_session_recording;return hn&&e&&t}get isConsoleLogCaptureEnabled(){const e=!!this.instance.get_property(Ja),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){const e=this.instance.get_property(Qa);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}get networkPayloadCapture(){var e,t;const n=this.instance.get_property(Ka),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),o=Qt(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(ln(o)?o:null==n?void 0:n.capturePerformance);return r||s||a?{recordHeaders:r,recordBody:s,recordPerformance:a}:void 0}get sampleRate(){const e=this.instance.get_property(el);return an(e)?e:null}get minimumDuration(){const e=this.instance.get_property(tl);return an(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?on(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.urlTriggerStatus?"buffering":ln(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e,t;if(this.receivedDecide&&0===this._urlTriggers.length)return"trigger_disabled";const n=null===(e=this.instance)||void 0===e?void 0:e.get_property(sl);var i,r,s,o;return(null===(t=this.instance)||void 0===t?void 0:t.get_property(rl))!==this.sessionId?(null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r||r.unregister(rl),null===(s=this.instance)||void 0===s||null===(o=s.persistence)||void 0===o||o.unregister(sl),"trigger_pending"):Hu.includes(n)?n:"trigger_pending"}set urlTriggerStatus(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[rl]:this.sessionId,[sl]:e})}constructor(e){if(this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw xn.error(qu+" started without valid sessionManager"),new Error(qu+" started without valid sessionManager. This is a bug.");const{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&xn.warn(qu+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=_n&&_n.visibilityState){const e="window "+_n.visibilityState;this._tryAddCustomEvent(e,{})}};startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==hn||hn.addEventListener("beforeunload",this._onBeforeUnload),null==hn||hn.addEventListener("offline",this._onOffline),null==hn||hn.addEventListener("online",this._onOnline),null==hn||hn.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),on(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook((e=>{try{if("$pageview"===e){const e=hn?this._maskUrl(hn.location.href):"";if(!e)return;this._tryAddCustomEvent("$pageview",{href:e})}}catch(e){xn.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,n)=>{var i,r,s,o;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r||r.unregister(rl),null===(s=this.instance)||void 0===s||null===(o=s.persistence)||void 0===o||o.unregister(sl))})))):this.stopRecording()}stopRecording(){var e,t,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==hn||hn.removeEventListener("beforeunload",this._onBeforeUnload),null==hn||hn.removeEventListener("offline",this._onOffline),null==hn||hn.removeEventListener("online",this._onOnline),null==hn||hn.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._onSessionIdListener)||void 0===t||t.call(this),this._onSessionIdListener=void 0,null===(n=this._samplingSessionListener)||void 0===n||n.call(this),this._samplingSessionListener=void 0,xn.info(qu+" stopped"))}makeSamplingDecision(e){var t;const n=this.sessionId!==e,i=this.sampleRate;var r;if(!an(i))return void(null===(r=this.instance.persistence)||void 0===r||r.register({[il]:null}));const s=this.isSampled;let o;const a=n||!ln(s);if(a){o=Math.random()<i}else o=s;a&&(o?this._reportStarted("sampling"):xn.warn(qu+` Sample rate (${i}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:o})),null===(t=this.instance.persistence)||void 0===t||t.register({[il]:o})}afterDecideResponse(e){var t,n,i,r;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!on(this._linkedFlag)&&!this._linkedFlagSeen){const e=nn(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,t=nn(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((n,i)=>{const r=Qt(i)&&e in i,s=t?i[e]===t:r;if(s){const n={linkedFlag:e,linkedVariant:t},i="linked flag matched";xn.info(qu+" "+i,n),this._tryAddCustomEvent(i,n),this._reportStarted("linked_flag_match")}this._linkedFlagSeen=s}))}null!==(i=e.sessionRecording)&&void 0!==i&&i.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){an(this.sampleRate)&&on(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistDecideResponse(e){if(this.instance.persistence){var t;const n=this.instance.persistence,i=()=>{var t,i,r,s,o,a,l;const c=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate,u=on(c)?null:parseFloat(c),d=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[Xa]:!!e.sessionRecording,[Ja]:null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled,[Ka]:{capturePerformance:e.capturePerformance,...null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture},[Qa]:{enabled:null===(o=e.sessionRecording)||void 0===o?void 0:o.recordCanvas,fps:null===(a=e.sessionRecording)||void 0===a?void 0:a.canvasFps,quality:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasQuality},[el]:u,[tl]:tn(d)?null:d})};i(),null===(t=this._persistDecideOnSessionListener)||void 0===t||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!tn(Object.assign)&&!tn(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=Cn.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"recorder",(e=>{if(e)return xn.error(qu+" could not load recorder",e);this._onScriptLoaded()}));xn.info(qu+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==$u.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){const t=this.isInteractiveEvent(e);if(!t&&!this.isIdle){e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer())}let n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),this.isIdle)return;const{windowId:i,sessionId:r}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.sessionId!==r,o=this.windowId!==i;this.windowId=i,this.sessionId=r,s||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):xn.warn(qu+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Bu((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Bu((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e;const t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording;for(const[e,i]of Object.entries(n||{}))e in t&&("maskInputOptions"===e?t.maskInputOptions={password:!0,...i}:t[e]=i);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void xn.error(qu+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Kc(this.rrwebRecord,{onBlockedNode:(e,t)=>{const n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;xn.info(n,{node:t}),this.log(qu+" "+n,"warn")}});const i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:e=>{this.onRRwebEmit(e)},plugins:i,...t}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:i.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;const e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}_gatherRRWebPlugins(){var e,t,n,i;const r=[],s=null===(e=Cn.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;s&&this.isConsoleLogCaptureEnabled&&r.push(s());const o=null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.rrwebPlugins)||void 0===i?void 0:i.getRecordNetworkPlugin;if(this.networkPayloadCapture&&Kt(o)){!Gn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(o(Ai(this.instance.config,this.networkPayloadCapture))):xn.info(qu+" NetworkCapture not started because we are on localhost.")}return r}onRRwebEmit(e){var t;if(this._processQueuedEvents(),!e||!Qt(e))return;if(e.type===Xc.Meta){const t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();this._checkUrlTrigger(),e.type===Xc.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Xc.FullSnapshot&&"trigger_pending"===this.urlTriggerStatus&&this.clearBuffer();const n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(!n)return;const i=function(e){const t=e;if(t&&Qt(t)&&6===t.type&&Qt(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));const n=[];for(let e=0;e<t.data.payload.payload.length;e++)t.data.payload.payload[e]&&t.data.payload.payload[e].length>2e3?n.push(t.data.payload.payload[e].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[e]);return t.data.payload.payload=n,e}return e}(n);if(this._updateWindowAndSessionIds(i),this.isIdle&&!Gu(i))return;if(Gu(i)){const e=i.data.payload;if(e){const t=e.lastActivityTimestamp,n=e.threshold;i.timestamp=t+n}}const r=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Yc(e)<1024)return e;try{if(e.type===Xc.FullSnapshot)return{...e,data:Wu(e.data),cv:"2024-10"};if(e.type===Xc.IncrementalSnapshot&&e.data.source===Jc.Mutation)return{...e,cv:"2024-10",data:{...e.data,texts:Wu(e.data.texts),attributes:Wu(e.data.attributes),removes:Wu(e.data.removes),adds:Wu(e.data.adds)}};if(e.type===Xc.IncrementalSnapshot&&e.data.source===Jc.StyleSheetRule)return{...e,cv:"2024-10",data:{...e.data,adds:Wu(e.data.adds),removes:Wu(e.data.removes)}}}catch(e){xn.error(qu+" could not compress event - will use uncompressed event",e)}return e}(i):i,s={$snapshot_bytes:Yc(r),$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(s):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!hn)return;const e=this._maskUrl(hn.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){const e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){const t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n;let i={url:e};return i=t.maskNetworkRequestFn(i),null===(n=i)||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);const e=this.minimumDuration,t=this.sessionDuration,n=an(t)&&t>=0,i=an(e)&&n&&t<e;if("buffering"===this.status||i)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;if(this.buffer.data.length>0){jc(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}))}return this.clearBuffer()}_captureSnapshotBuffered(e){var t;const n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTrigger(){if(void 0===hn||!hn.location.href)return;const e=hn.location.href;this._urlTriggers.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))&&this._activateUrlTrigger()}_activateUrlTrigger(){"trigger_pending"===this.urlTriggerStatus&&(this.urlTriggerStatus="trigger_activated",this._tryAddCustomEvent("url trigger activated",{}),this._flushBuffer(),xn.info(qu+" recording triggered by URL pattern match"))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_override")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[il]:!0}),this._reportStarted("sampling_override")}_reportStarted(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0)()&&this.instance.register_for_session({$session_recording_start_reason:e})}}class Zu{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){const e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ll),group_properties:this.instance.get_property(cl),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:So.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();const t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},t),t)xn.error("Failed to fetch feature flags from PostHog.");else{if(!_n||!_n.body)return xn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps)for(const{id:t,url:s}of e.siteApps){var n,i,r;Cn[`__$$ph_site_app_${t}`]=this.instance,null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=(r=n).loadSiteApp)||void 0===i||i.call(r,this.instance,s,(e=>{if(e)return xn.error(`Error while initializing PostHog app with config id ${t}`,e)}))}else e.siteApps.length>0&&xn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}const Uu=null!=hn&&hn.location?Yn(hn.location.hash,"__posthog")||Yn(location.hash,"state"):null,zu="_postHogToolbarParams";var Yu;!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Yu||(Yu={}));class ju{constructor(e){this.instance=e}setToolbarState(e){Cn.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=Cn.ph_toolbar_state)&&void 0!==e?e:Yu.UNINITIALIZED}maybeLoadToolbar(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!hn||!_n)return!1;n=null!==(e=n)&&void 0!==e?e:hn.location,r=null!==(t=r)&&void 0!==t?t:hn.history;try{if(!i){try{hn.localStorage.setItem("test","test"),hn.localStorage.removeItem("test")}catch{return!1}i=null==hn?void 0:hn.localStorage}const e=Uu||Yn(n.hash,"__posthog")||Yn(n.hash,"state");let t;const s=e?Ln((()=>JSON.parse(atob(decodeURIComponent(e)))))||Ln((()=>JSON.parse(decodeURIComponent(e)))):null;return s&&"ph_authorize"===s.action?(t=s,t.source="url",t&&Object.keys(t).length>0&&(s.desiredHash?n.hash=s.desiredHash:r?r.replaceState(r.state,"",n.pathname+n.search):n.hash="")):(t=JSON.parse(i.getItem(zu)||"{}"),t.source="localstorage",delete t.userIntent),!(!t.token||this.instance.config.token!==t.token)&&(this.loadToolbar(t),!0)}catch{return!1}}_callLoadToolbar(e){(Cn.ph_load_toolbar||Cn.ph_load_editor)(e,this.instance)}loadToolbar(e){const t=!(null==_n||!_n.getElementById(bl));if(!hn||t)return!1;const n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i={token:this.instance.config.token,...e,apiURL:this.instance.requestRouter.endpointFor("ui"),...n?{instrument:!1}:{}};if(hn.localStorage.setItem(zu,JSON.stringify({...i,source:void 0})),this.getToolbarState()===Yu.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Yu.UNINITIALIZED){var r,s;this.setToolbarState(Yu.LOADING),null===(r=Cn.__PosthogExtensions__)||void 0===r||null===(s=r.loadExternalDependency)||void 0===s||s.call(r,this.instance,"toolbar",(e=>{if(e)return xn.error("Failed to load toolbar",e),void this.setToolbarState(Yu.UNINITIALIZED);this.setToolbarState(Yu.LOADED),this._callLoadToolbar(i)})),Bn(hn,"turbolinks:load",(()=>{this.setToolbarState(Yu.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class Xu{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(e){this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();const e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),n=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];n.map((e=>{this.sendRequest({...e,transport:"sendBeacon"})}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){const e=this.formatQueue();for(const t in e){const n=e[t],i=(new Date).getTime();n.data&&Jt(n.data)&&An(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),this.sendRequest(n)}}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){const e={};return An(this.queue,(t=>{var n;const i=t,r=(i?i.batchKey:null)||i.url;tn(e[r])&&(e[r]={...i,data:[]}),null===(n=e[r].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}const Ju=!!wn||!!bn,Ku="text/plain",Qu=(e,t)=>{const[n,i]=e.split("?"),r={...t};null==i||i.split("&").forEach((e=>{const[t]=e.split("=");delete r[t]}));let s=Un(r);return s=s?(i?i+"&":"")+s:i,`${n}?${s}`},ed=e=>{let{data:t,compression:n}=e;if(!t)return;if(n===So.GZipJS){const e=Pu(Ou(JSON.stringify(t)),{mtime:0}),n=new Blob([e],{type:Ku});return{contentType:Ku,body:n,estimatedSize:n.size}}if(n===So.Base64){const e=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n,i,r,s,o,a,l,c,u=0,d=0,h="";const p=[];if(!e)return e;e=Hn(e);do{n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),c=n<<16|i<<8|r,s=c>>18&63,o=c>>12&63,a=c>>6&63,l=63&c,p[d++]=t.charAt(s)+t.charAt(o)+t.charAt(a)+t.charAt(l)}while(u<e.length);switch(h=p.join(""),e.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}(JSON.stringify(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)))(e);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}const i=JSON.stringify(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},td=e=>{var t;const n=new wn;n.open(e.method||"GET",e.url,!0);const{contentType:i,body:r}=null!==(t=ed(e))&&void 0!==t?t:{};An(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t;const i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch{}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.send(r)},nd=e=>{var t,n;const{contentType:i,body:r,estimatedSize:s}=null!==(t=ed(e))&&void 0!==t?t:{},o=new Headers;An(e.headers,(function(e,t){o.append(t,e)})),i&&o.append("Content-Type",i);const a=e.url;let l=null;if(In){const t=new In;l={signal:t.signal,timeout:setTimeout((()=>t.abort()),e.timeout)}}bn(a,{method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(s||0)<65536,body:r,signal:null===(n=l)||void 0===n?void 0:n.signal}).then((t=>t.text().then((n=>{var i;const r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){xn.error(e)}null===(i=e.callback)||void 0===i||i.call(e,r)})))).catch((t=>{var n;xn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((()=>l?clearTimeout(l.timeout):null))},id=e=>{const t=Qu(e.url,{beacon:"1"});try{var n;const{contentType:i,body:r}=null!==(n=ed(e))&&void 0!==n?n:{},s="string"==typeof r?new Blob([r],{type:i}):r;vn.sendBeacon(t,s)}catch{}},rd=[];wn&&rd.push({transport:"XHR",method:td}),bn&&rd.push({transport:"fetch",method:nd}),null!=vn&&vn.sendBeacon&&rd.push({transport:"sendBeacon",method:id});class sd{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(e){this.instance=e,this.queue=[],this.areWeOnline=!0,!tn(hn)&&"onLine"in hn.navigator&&(this.areWeOnline=hn.navigator.onLine,hn.addEventListener("online",(()=>{this.areWeOnline=!0,this.flush()})),hn.addEventListener("offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){let{retriesPerformedSoFar:t,...n}=e;an(t)&&t>0&&(n.url=Qu(n.url,{retry_count:t})),this.instance._send_request({...n,callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue({retriesPerformedSoFar:t,...n}):null===(i=n.callback)||void 0===i||i.call(n,e)}})}enqueue(e){const t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;const n=function(e){const t=3e3*2**e,n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});let r=`Enqueued failed request for retry in ${n}`;navigator.onLine||(r+=" (Browser is offline)"),xn.warn(r),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){const e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(const{requestOptions:e}of n)this.retriableRequest(e)}unload(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);for(const{requestOptions:e}of this.queue)try{this.instance._send_request({...e,transport:"sendBeacon"})}catch(e){xn.error(e)}this.queue=[]}}const od=1800;class ad{_sessionIdChangedHandlers=[];constructor(e,t,n,i){var r;this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Nl,this._windowIdGenerator=i||Nl;const s=e.persistence_name||e.token;let o=e.session_idle_timeout_seconds||od;if(an(o)?o>od?xn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):o<60&&xn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(xn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=od),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,60),od),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){const e=zl.parse(this._window_id_storage_key),t=zl.parse(this._primary_window_exists_storage_key);e&&!t?this._windowId=e:zl.remove(this._window_id_storage_key),zl.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{const e=(e=>{const t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),e)}catch(e){xn.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return tn(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&zl.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&zl.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?zl.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[nl]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];const e=this.persistence.props[nl];return Jt(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==hn||hn.addEventListener("beforeunload",(()=>{this._canUseSessionStorage()&&zl.remove(this._primary_window_exists_storage_key)}))}checkAndGetSessionAndWindowId(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime();let[n,i,r]=this._getSessionId(),s=this._getWindowId();const o=an(r)&&r>0&&Math.abs(t-r)>864e5;let a=!1;const l=!i,c=!e&&Math.abs(t-n)>this.sessionTimeoutMs;l||c||o?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),xn.info("[SessionId] new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}}),r=t,a=!0):s||(s=this._windowIdGenerator(),a=!0);const u=0===n||!e||o?t:n,d=0===r?(new Date).getTime():r;return this._setWindowId(s),this._setSessionId(i,u,d),a&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:n}}}let ld;!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(ld||(ld={}));const cd="i.posthog.com";class ud{_regionCache={};constructor(e){this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e;let t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${cd}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ld.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ld.EU:this._regionCache[this.apiHost]=ld.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.uiHost+t;if(this.region===ld.CUSTOM)return this.apiHost+t;const n=cd+t;switch(e){case"assets":return`https://${this.region}-assets.${n}`;case"api":return`https://${this.region}.${n}`}}}const dd="posthog-js";function hd(e){let{organization:t,projectId:n,prefix:i,severityAllowList:r=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=>{var o,a,l,c,u;if(!("*"===r||r.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});const d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);s.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const h=(null===(o=s.exception)||void 0===o?void 0:o.values)||[],p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||s.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:s.level,$exception_list:h,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||s.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:s.tags,$level:s.level};return t&&n&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(p),s}}class pd{constructor(e,t,n,i,r){this.name=dd,this.setupOnce=function(s){s(hd(e,{organization:t,projectId:n,prefix:i,severityAllowList:r}))}}}function gd(e,t){const n=e.config.segment;if(!n)return t();!function(e,t){const n=e.config.segment;if(!n)return t();const i=n=>{const i=()=>n.anonymousId()||Nl();e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(pl,"identified")),t()},r=n.user();"then"in r&&Kt(r.then)?r.then((e=>i(e))):i(r)}(e,(()=>{n.register((e=>{Promise&&Promise.resolve||xn.warn("This browser does not have Promise support, and can not use the segment integration");const t=(t,n)=>{var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(xn.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(xn.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));const r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class fd{constructor(e){this._instance=e}doPageView(e){var t;const n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==hn?void 0:hn.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){const t=this._currentPath,n=this._prevPageviewTimestamp,i=this._instance.scrollManager.getContext();if(!n)return{};let r={};if(i){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:n,maxContentHeight:s,lastContentY:o,maxContentY:a}=i;if(!(tn(e)||tn(t)||tn(n)||tn(s)||tn(o)||tn(a))){e=Math.ceil(e),t=Math.ceil(t),n=Math.ceil(n),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a);r={$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:e<=1?1:md(t/e,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:e<=1?1:md(n/e,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:s<=1?1:md(o/s,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:s<=1?1:md(a/s,0,1)}}}return t&&(r.$prev_pageview_pathname=t),n&&(r.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),r}}function md(e,t,n){return Math.max(t,Math.min(e,n))}class vd{events={};constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(const n of this.events[e]||[])n(t);for(const n of this.events["*"]||[])n(e,t)}}class _d{_debugEventEmitter=new vd;constructor(e){this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!tn(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;const e=(e,t)=>{this.on(e,t)};null===(t=this.instance)||void 0===t||t._addCaptureHook(e)}}register(e){var t,n;if(!tn(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var i;const t=new Set;e.forEach((e=>{var n;null===(n=e.steps)||void 0===n||n.forEach((e=>{null!=e&&e.selector&&t.add(null==e?void 0:e.selector)}))})),null===(i=this.instance)||void 0===i||i.autocapture.setElementSelectors(t)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(const n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStep=(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t);checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event);checkStepUrl(e,t){if(null!=t&&t.url){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!i||"string"!=typeof i)return!1;if(!_d.matchString(i,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!hn&&Zn(e,t);case"exact":return t===e;case"contains":const n=_d.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Zn(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if(null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text){if(!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!_d.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!_d.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!_d.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1}if(null!=t&&t.selector){var n;const i=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!i)return!1;if(!i.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class yd{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;tn(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){const t=e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new _d(this.instance),this.actionMatcher.init();const e=e=>{this.onAction(e)};this.actionMatcher._addActionHook(e)}t.forEach((e=>{var t,n,i,r,s,o,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(i=n.actions)&&void 0!==i&&i.values&&(null===(r=e.conditions)||void 0===r||null===(s=r.actions)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){const n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0===e.filter((e=>{var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length)return;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,i;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i||i.forEach((t=>{if(t&&t.name){const n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))}))}onEvent(e,t){var n,i;const r=(null===(n=this.instance)||void 0===n||null===(i=n.persistence)||void 0===i?void 0:i.props[dl])||[];if(yd.SURVEY_SHOWN_EVENT_NAME==e&&t&&r.length>0){var s;const e=null==t||null===(s=t.properties)||void 0===s?void 0:s.$survey_id;if(e){const t=r.indexOf(e);t>=0&&(r.splice(t,1),this._updateActivatedSurveys(r))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n;const i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[dl])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[dl]:[...new Set(e)]})}getSurveys(){var e,t;const n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[dl];return n||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}const bd="[Surveys]",wd={icontains:e=>!!hn&&hn.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!hn&&-1===hn.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!hn&&Zn(hn.location.href,e),not_regex:e=>!!hn&&!Zn(hn.location.href,e),exact:e=>(null==hn?void 0:hn.location.href)===e,is_not:e=>(null==hn?void 0:hn.location.href)!==e};class Id{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}loadIfEnabled(){var e;const t=null==Cn||null===(e=Cn.__PosthogExtensions__)||void 0===e?void 0:e.generateSurveys;var n,i;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new yd(this.instance)),null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"surveys",(e=>{var t,n;if(e)return xn.error(bd,"Could not load surveys script",e);this._surveyManager=null===(t=Cn.__PosthogExtensions__)||void 0===t||null===(n=t.generateSurveys)||void 0===n?void 0:n.call(t,this.instance)})))}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new yd(this.instance));const n=this.instance.get_property(ul);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{var n;if(200!==t.statusCode||!t.json)return e([]);const i=t.json.surveys||[],r=i.filter((e=>{var t,n,i,r,s,o,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));var s;r.length>0&&(null===(s=this._surveyEventReceiver)||void 0===s||s.register(r));return null===(n=this.instance.persistence)||void 0===n||n.register({[ul]:i}),e(i)}})}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var n;const i=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t,n,i,r;if(!e.conditions)return!0;const s=null===(t=e.conditions)||void 0===t||!t.url||wd[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),o=null===(r=e.conditions)||void 0===r||!r.selector||(null==_n?void 0:_n.querySelector(e.conditions.selector));return s&&o})),r=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys(),s=i.filter((e=>{var t,n,i,s,o,a,l,c,u,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;const h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(s=e.conditions)||void 0===s||null===(o=s.events)||void 0===o?void 0:o.values.length)>0,f=(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.values.length)>0,m=!g&&!f||(null==r?void 0:r.includes(e.id)),v=this._canActivateRepeatedly(e),_=!(e.internal_targeting_flag_key&&!v)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&p&&_&&m}));return e(s)}),t)}getNextSurveyStep(e,t,n){var i;const r=e.questions[t],s=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?Ji.End:s;if(r.branching.type===Ji.End)return Ji.End;if(r.branching.type===Ji.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===Ji.ResponseBased){if(r.type===Xi.SingleChoice){var o,a;const e=r.choices.indexOf(`${n}`);if(null!==(o=r.branching)&&void 0!==o&&null!==(a=o.responseValues)&&void 0!==a&&a.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===Ji.End?Ji.End:s}}else if(r.type===Xi.Rating){var l,c;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,r.scale);if(null!==(l=r.branching)&&void 0!==l&&null!==(c=l.responseValues)&&void 0!==c&&c.hasOwnProperty(e)){const t=r.branching.responseValues[e];return Number.isInteger(t)?t:t===Ji.End?Ji.End:s}}return s}return xn.warn(bd,"Falling back to next question index due to unexpected branching type"),s}_canActivateRepeatedly(e){var t;return on(null===(t=Cn.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(xn.warn(bd,"canActivateRepeatedly is not defined, must init before calling"),!1):Cn.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){on(this._surveyManager)?xn.warn(bd,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((t=>{const n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){on(this._surveyManager)?xn.warn(bd,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((n=>{const i=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(i,null==_n?void 0:_n.querySelector(t))}))}}class Sd{serverLimits={};lastEventRateLimited=!1;constructor(e){var t,n;this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const r=(new Date).getTime(),s=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(fl))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};s.tokens+=(r-s.last)/1e3*this.captureEventsPerSecond,s.last=r,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);const o=s.tokens<1;return o||i||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null===(n=this.instance.persistence)||void 0===n||n.set_property(fl,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}checkForLimiting=e=>{const t=e.text;if(t&&t.length)try{const e=JSON.parse(t);(e.quota_limited||[]).forEach((e=>{xn.info(`[RateLimiter] ${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void xn.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}}}const Cd=()=>({initialPathName:(null==yn?void 0:yn.pathname)||"",referringDomain:Zc.referringDomain(),...Zc.campaignParams()});class kd{constructor(e,t,n){this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=n||Cd,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[gl]}_onSessionIdCallback=e=>{const t=this._getStoredProps();if(t&&t.sessionId===e)return;const n={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[gl]:n})};getSessionProps(){var e;const t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}const xd=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Ed=function(e,t){if(!e)return!1;const n=e.toLowerCase();return xd.concat(t||[]).some((e=>{const t=e.toLowerCase();return-1!==n.indexOf(t)}))},Td=function(e,t){if(!e)return!1;const n=e.userAgent;if(n&&Ed(n,t))return!0;try{const n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>Ed(null==e?void 0:e.brand,t))))return!0}catch{}return!!e.webdriver};class Md{constructor(){this.clicks=[]}isRageClick(e,t,n){const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}function Ad(e){var t;return e.id===bl||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+bl))}class Rd{rageclicks=new Md;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Za]),null==hn||hn.addEventListener("beforeunload",(()=>{this.flush()}))}get flushIntervalMilliseconds(){let e=5e3;return Qt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return tn(this.instance.config.capture_heatmaps)?tn(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;xn.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}afterDecideResponse(e){const t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Za]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){const e=this.buffer;return this.buffer=void 0,e}_setupListeners(){hn&&_n&&(Bn(_n,"click",(e=>this._onClick(e||(null==hn?void 0:hn.event))),!1,!0),Bn(_n,"mousemove",(e=>this._onMouseMove(e||(null==hn?void 0:hn.event))),!1,!0),this._initialized=!0)}_getProperties(e,t){const n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,n){let i=e;for(;i&&ti(i)&&!ni(i,"body");){if(i===n)return!1;if(Fn(t,null==hn?void 0:hn.getComputedStyle(i).position))return!0;i=oi(i)}return!1}(ei(e),["fixed","sticky"],r);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:t}}_onClick(e){var t;if(Ad(e.target))return;const n=this._getProperties(e,"click");null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture({...n,type:"rageclick"}),this._capture(n)}_onMouseMove(e){Ad(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(!hn)return;const t=hn.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}flush(){this.buffer&&!en(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Fd{constructor(e){this.instance=e}getContext(){return this.context}resetContext(){const e=this.context;return setTimeout(this._updateScrollData,0),e}_updateScrollData=()=>{var e,t,n,i;this.context||(this.context={});const r=this.scrollElement(),s=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=s+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.context.lastScrollY=Math.ceil(s),this.context.maxScrollY=Math.max(s,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(o,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(i=this.context.maxContentHeight)&&void 0!==i?i:0)};startMeasuringScrollPosition(){null==hn||hn.addEventListener("scroll",this._updateScrollData,!0),null==hn||hn.addEventListener("scrollend",this._updateScrollData,!0),null==hn||hn.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==hn?void 0:hn.document.documentElement;{const e=Jt(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(const t of e){const e=null==hn?void 0:hn.document.querySelector(t);if(e)return e}}}scrollY(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollTop||0}return hn&&(hn.scrollY||hn.pageYOffset||hn.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){const e=this.scrollElement();return e&&e.scrollLeft||0}return hn&&(hn.scrollX||hn.pageXOffset||hn.document.documentElement.scrollLeft)||0}}const Nd="$copy_autocapture";function Ld(e,t){return t.length>e?t.slice(0,e)+"...":t}class Pd{_initialized=!1;_isDisabledServerSide=null;rageclicks=new Md;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;const n=Qt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void xn.info("Disabling Automatic Event Collection because this browser is not supported");if(!hn||!_n)return;const e=e=>{e=e||(null==hn?void 0:hn.event);try{this._captureEvent(e)}catch(e){xn.error("Failed to capture event",e)}},t=e=>{e=e||(null==hn?void 0:hn.event),this._captureEvent(e,Nd)};Bn(_n,"submit",e,!1,!0),Bn(_n,"change",e,!1,!0),Bn(_n,"click",e,!1,!0),this.config.capture_copied_text&&(Bn(_n,"copy",t,!1,!0),Bn(_n,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Va]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;const n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{const i=null==_n?void 0:_n.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&n.push(t)}))})),n}get isEnabled(){var e,t;const n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Va],i=this._isDisabledServerSide;if(sn(i)&&!ln(n)&&!this.instance.config.advanced_disable_decide)return!1;const r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_previousElementSibling(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!ti(t));return t}_getAugmentPropertiesFromElement(e){if(!li(e))return{};const t={};return An(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&mi(i)&&(t[n]=i)}})),t}_getPropertiesFromElement(e,t,n){var i;const r=e.tagName.toLowerCase(),s={tag_name:r};si.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?s.$el_text=Ld(1024,vi(e)):s.$el_text=Ld(1024,Qn(e)));const o=Jn(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e})));const a=null===(i=this.config)||void 0===i?void 0:i.element_attribute_ignorelist;An(e.attributes,(function(n){var i;if((!ci(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==a||!a.includes(n.name))&&!t&&mi(n.value)&&(i=n.name,!nn(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){let e=n.value;"class"===n.name&&(e=jn(e).join(" ")),s["attr__"+n.name]=Ld(1024,e)}}));let l=1,c=1,u=e;for(;u=this._previousElementSibling(u);)l++,u.tagName===e.tagName&&c++;return s.nth_child=l,s.nth_of_type=c,s}_getDefaultProperties(e){return{$event_type:e,$ce_version:1}}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let n=ei(e);var i;(ii(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)&&(this.instance.config.rageclick&&null!==(i=this.rageclicks)&&void 0!==i&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick"));const r=t===Nd;if(n&&ai(n,e,this.config,r,r?["copy","cut"]:void 0)){var s,o;const i=[n];let r=n;for(;r.parentNode&&!ni(r,"body");)ri(r.parentNode)?(i.push(r.parentNode.host),r=r.parentNode.host):(i.push(r.parentNode),r=r.parentNode);const u=[],d={};let h,p,g=!1;if(An(i,(e=>{const t=li(e);"a"===e.tagName.toLowerCase()&&(h=e.getAttribute("href"),h=t&&mi(h)&&h);Fn(Jn(e),"ph-no-capture")&&(g=!0),u.push(this._getPropertiesFromElement(e,this.instance.config.mask_all_element_attributes,this.instance.config.mask_all_text));const n=this._getAugmentPropertiesFromElement(e);Rn(d,n)})),this.instance.config.mask_all_text||("a"===n.tagName.toLowerCase()||"button"===n.tagName.toLowerCase()?u[0].$el_text=vi(n):u[0].$el_text=Qn(n)),h){var a,l;u[0].attr__href=h;const e=null===(a=Vn(h))||void 0===a?void 0:a.host,t=null==hn||null===(l=hn.location)||void 0===l?void 0:l.host;e&&t&&e!==t&&(p=h)}if(g)return!1;const f=Rn(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:yi(u)}:{$elements:u},null!==(s=u[0])&&void 0!==s&&s.$el_text?{$el_text:null===(o=u[0])||void 0===o?void 0:o.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},d),m=this.getElementSelectors(n);if(m&&m.length>0&&(f.$element_selectors=m),t===Nd){var c;const t=Kn(null==hn||null===(c=hn.getSelection())||void 0===c?void 0:c.toString()),n=e.type||"clipboard";if(!t)return!1;f.$selected_content=t,f.$copy_type=n}return this.instance.capture(t,f),!0}}isBrowserSupported(){return Kt(null==_n?void 0:_n.querySelectorAll)}}class Od{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(e){this.instance=e}_loadScript(e){var t,n,i;null!==(t=Cn.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"tracing-headers",(t=>{if(t)return xn.error("[TRACING-HEADERS] failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var e,t,n,i;tn(this._restoreXHRPatch)&&(null===(e=Cn.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));tn(this._restoreFetchPatch)&&(null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.tracingHeadersPatchFns)||void 0===i||i._patchFetch(this.instance.sessionManager))}}let Dd;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Dd||(Dd={}));class $d{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Dd.DENIED:this.storedConsent}isOptedOut(){return this.consent===Dd.DENIED||this.consent===Dd.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){const{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){const e=this.storage.get(this.storageKey);return"1"===e?Dd.GRANTED:"0"===e?Dd.DENIED:Dd.PENDING}get storage(){if(!this._storage){const e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?ql:Hl;const t="localStorage"===e?Hl:ql;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Wn([null==vn?void 0:vn.doNotTrack,null==vn?void 0:vn.msDoNotTrack,Cn.doNotTrack],(e=>Fn([!0,1,"1","yes"],e)))}}const Hd="[Exception Autocapture]";class Bd{originalOnUnhandledRejectionHandler=void 0;constructor(e){var t;this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Ua]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==hn||null===(e=hn.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(xn.info(Hd+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=Cn.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",(t=>{if(t)return xn.error(Hd+" failed to load script",t);e()}))}startCapturing=()=>{var e,t,n,i;if(!hn||!this.isEnabled||this.hasHandlers||this.isCapturing)return;const r=null===(e=Cn.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,s=null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.errorWrappingFunctions)||void 0===i?void 0:i.wrapUnhandledRejection;if(r&&s)try{this.unwrapOnError=r(this.captureException.bind(this)),this.unwrapUnhandledRejection=s(this.captureException.bind(this))}catch(e){xn.error(Hd+" failed to start",e),this.stopCapturing()}else xn.error(Hd+" failed to load error wrapping functions - cannot start")};stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}afterDecideResponse(e){const t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Ua]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){const t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=`${t}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}}const qd=9e5,Wd="[Web Vitals]";class Gd{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[Ya]),this.startIfEnabled()}get allowedMetrics(){var e,t;const n=Qt(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return tn(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ja])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Qt(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){const e=Qt(this.instance.config.capture_performance)&&an(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:qd;return 0<e&&e<=6e4?qd:e}get isEnabled(){const e=Qt(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return ln(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(xn.info(Wd+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){const t=Qt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Qt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Ya]:t}),this.instance.persistence.register({[ja]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,i;null!==(t=Cn.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=Cn.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"web-vitals",(t=>{t?xn.error(Wd+" failed to load script",t):e()}))}_currentURL(){const e=hn?hn.location.href:void 0;return e||xn.error(Wd+"Could not determine current URL"),e}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,t)=>({...e,[`$web_vitals_${t.name}_event`]:{...t},[`$web_vitals_${t.name}_value`]:t.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=e=>{var t;const n=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(tn(n))return void xn.error(Wd+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};const i=this._currentURL();if(tn(i))return;if(on(null==e?void 0:e.name)||on(null==e?void 0:e.value))return void xn.error(Wd+"Invalid metric received",e);if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)return void xn.error(Wd+"Ignoring metric with value >= "+this._maxAllowedValue,e);this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),tn(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=tn(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...e,$current_url:i,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()};_startCapturing=()=>{let e,t,n,i;const r=Cn.__PosthogExtensions__;tn(r)||tn(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:i}=r.postHogWebVitalsCallbacks),e&&t&&n&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):xn.error(Wd+"web vitals callbacks not loaded - not starting")}}const Vd={icontains:(e,t)=>!!hn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!hn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!hn&&Zn(t.href,e),not_regex:(e,t)=>!!hn&&!Zn(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Zd{constructor(e){this.instance=e;const t=e=>{this.applyFeatureFlagChanges(e)};this.instance.onFeatureFlags&&this.instance.onFeatureFlags(t),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){on(this._flagToExperiments)||this.instance.config.disable_web_experiments||(Zd.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var n;const t=this.instance.getFeatureFlag(e),i=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);t&&null!=i&&i.variants[t]&&this.applyTransforms(i.name,t,i.variants[t].transforms)}})))}afterDecideResponse(e){this._is_bot()?Zd.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){const e=Zd.getWindowLocation();if(null!=e&&e.search){const t=zn(null==e?void 0:e.search,"__experiment_id"),n=zn(null==e?void 0:e.search,"__experiment_variant");t&&n&&(Zd.logInfo(`previewing web experiments ${t} && ${n}`),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),n,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getWebExperiments((t=>{Zd.logInfo("retrieved web experiments from the server"),e._flagToExperiments=new Map,t.forEach((t=>{if(t.feature_flag_key&&e._featureFlags&&e._featureFlags[t.feature_flag_key]){var n;if(e._flagToExperiments)Zd.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(n=e._flagToExperiments)||void 0===n||n.set(t.feature_flag_key,t);const i=e._featureFlags[t.feature_flag_key];i&&t.variants[i]&&e.applyTransforms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(const n in t.variants){const i=t.variants[n];Zd.matchesTestVariant(i)&&e.applyTransforms(t.name,n,i.transforms)}}))}),t)}})();getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);const i=this.instance.get_property("$web_experiments");if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);const n=t.json.experiments||[];return e(n)}})}showPreviewWebExperiment(e,t,n){const i=n.filter((t=>t.id===e));i&&i.length>0&&(Zd.logInfo(`Previewing web experiment [${i[0].name}] with variant [${t}]`),this.applyTransforms(i[0].name,t,i[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!on(e.conditions)&&(Zd.matchUrlConditions(e)&&Zd.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(on(e.conditions)||on(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;const n=Zd.getWindowLocation();if(n){var i,r,s;return null===(i=e.conditions)||void 0===i||!i.url||Vd[null!==(r=null===(s=e.conditions)||void 0===s?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,n)}return!1}static getWindowLocation(){return null==hn?void 0:hn.location}static matchUTMConditions(e){var t;if(on(e.conditions)||on(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;const n=Zc.campaignParams();if(n.utm_source){var i,r,s,o,a,l,c,u,d,h,p,g,f,m,v,_;const t=null===(i=e.conditions)||void 0===i||null===(r=i.utm)||void 0===r||!r.utm_campaign||(null===(s=e.conditions)||void 0===s||null===(o=s.utm)||void 0===o?void 0:o.utm_campaign)==n.utm_campaign,y=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==n.utm_source,b=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(g=p.utm)||void 0===g?void 0:g.utm_medium)==n.utm_medium,w=null===(f=e.conditions)||void 0===f||null===(m=f.utm)||void 0===m||!m.utm_term||(null===(v=e.conditions)||void 0===v||null===(_=v.utm)||void 0===_?void 0:_.utm_term)==n.utm_term;return t&&b&&w&&y}return!1}static logInfo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];xn.info(`[WebExperiments] ${e}`,n)}applyTransforms(e,t,n,i){var r;this._is_bot()?Zd.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach((n=>{if(n.selector){var r;Zd.logInfo(`applying transform of variant ${t} for experiment ${e} `,n);let o=0;const a=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);var s;if(null==a||a.forEach((e=>{const t=e;o+=1,n.attributes&&n.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),n.text&&(t.innerText=n.text),n.html&&(t.parentElement?t.parentElement.innerHTML=n.html:t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})),this.instance&&this.instance.capture)this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:i,$web_experiment_document_url:null===(s=Zd.getWindowLocation())||void 0===s?void 0:s.href,$web_experiment_elements_modified:o})}})):(Zd.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:i,$web_experiment_variant:t,$web_experiment_document_url:null===(r=Zd.getWindowLocation())||void 0===r?void 0:r.href,$web_experiment_elements_modified:0}))}_is_bot(){return vn&&this.instance?Td(vn,this.instance.config.custom_blocked_useragents):void 0}}const Ud="/e/";class zd{constructor(e){var t;this.instance=e,this._endpointSuffix=(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[za])||Ud}get endpoint(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}afterDecideResponse(e){const t=e.autocaptureExceptions;this._endpointSuffix=Qt(t)&&t.endpoint||Ud,this.instance.persistence&&this.instance.persistence.register({[za]:this._endpointSuffix})}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}const Yd={},jd=()=>{},Xd="posthog";let Jd=!Ju&&-1===(null==Sn?void 0:Sn.indexOf("MSIE"))&&-1===(null==Sn?void 0:Sn.indexOf("Mozilla"));const Kd=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:qn(null==_n?void 0:_n.location),persistence:"localStorage+cookie",persistence_name:"",loaded:jd,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:yn&&nn(null==yn?void 0:yn.search)&&-1!==yn.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==hn||null===(e=hn.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{const t="Bad HTTP status: "+e.statusCode+" "+e.text;xn.error(t)},get_device_id:e=>e,_onCapture:jd,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1}},Qd=e=>{const t={};tn(e.process_person)||(t.person_profiles=e.process_person),tn(e.xhr_headers)||(t.request_headers=e.xhr_headers),tn(e.cookie_name)||(t.persistence_name=e.cookie_name),tn(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);const n=Rn({},t,e);return Jt(e.property_blacklist)&&(tn(e.property_denylist)?n.property_denylist=e.property_blacklist:Jt(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:xn.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class eh{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){xn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}__forceAllowLocalhost=!1}class th{webPerformance=new eh;version=dn.LIB_VERSION;_internalEventEmitter=new vd;constructor(){this.config=Kd(),this.decideEndpointWasHit=!1,this.SentryIntegration=pd,this.sentryIntegration=e=>function(e,t){const n=hd(e,t);return{name:dd,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new xl(this),this.toolbar=new ju(this),this.scrollManager=new Fd(this),this.pageViewManager=new fd(this),this.surveys=new Id(this),this.experiments=new Zd(this),this.exceptions=new zd(this),this.rateLimiter=new Sd(this),this.requestRouter=new ud(this),this.consent=new $d(this),this.people={set:(e,t,n)=>{const i=nn(e)?{[e]:t}:e;this.setPersonProperties(i),null==n||n({})},set_once:(e,t,n)=>{const i=nn(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==n||n({})}},this.on("eventCaptured",(e=>xn.info(`send "${null==e?void 0:e.event}"`,e)))}init(e,t,n){if(n&&n!==Xd){var i;const r=null!==(i=Yd[n])&&void 0!==i?i:new th;return r._init(e,t,n),Yd[n]=r,Yd[Xd][n]=r,r}return this._init(e,t,n)}_init(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(tn(e)||rn(e))return xn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return xn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(Rn({},Kd(),Qd(i),{name:r,token:e})),this.config.on_xhr_error&&xn.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:So.GZipJS,this.persistence=new zc(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new zc({...this.config,persistence:"sessionStorage"});const s={...this.persistence.props},o={...this.sessionPersistence.props};if(this._requestQueue=new Xu((e=>this._send_retriable_request(e))),this._retryQueue=new sd(this),this.__request_queue=[],this.sessionManager=new ad(this.config,this.persistence),this.sessionPropsManager=new kd(this.sessionManager,this.persistence),new Od(this).startIfEnabledOrStop(),this.sessionRecording=new Vu(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Pd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Rd(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Gd(this),this.exceptionObserver=new Bd(this),this.exceptionObserver.startIfEnabled(),dn.DEBUG=dn.DEBUG||this.config.debug,dn.DEBUG&&xn.info("Starting in debug mode",{this:this,config:i,thisC:{...this.config},p:s,s:o}),this._sync_opt_out_with_persistence(),void 0!==(null===(t=i.bootstrap)||void 0===t?void 0:t.distinctID)){var a,l;const e=this.config.get_device_id(Nl()),t=null!==(a=i.bootstrap)&&void 0!==a&&a.isIdentifiedID?e:i.bootstrap.distinctID;this.persistence.set_property(pl,null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:t})}if(this._hasBootstrappedFeatureFlags()){var c,u;const e=Object.keys((null===(c=i.bootstrap)||void 0===c?void 0:c.featureFlags)||{}).filter((e=>{var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce(((e,t)=>{var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),t=Object.keys((null===(u=i.bootstrap)||void 0===u?void 0:u.featureFlagPayloads)||{}).filter((t=>e[t])).reduce(((e,t)=>{var n,r,s,o;null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(s=i.bootstrap)||void 0===s||null===(o=s.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:e,featureFlagPayloads:t})}if(!this.get_distinct_id()){const e=this.config.get_device_id(Nl());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(pl,"anonymous")}return null==hn||null===(n=hn.addEventListener)||void 0===n||n.call(hn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),i.segment?gd(this,(()=>this._loaded())):this._loaded(),Kt(this.config._onCapture)&&this.on("eventCaptured",(e=>this.config._onCapture(e.event,e))),this}_afterDecideResponse(e){var t,n,i,r,s,o,a,l,c;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Fn(e.supportedCompression,So.GZipJS)?So.GZipJS:Fn(e.supportedCompression,So.Base64)?So.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(i=this.autocapture)||void 0===i||i.afterDecideResponse(e),null===(r=this.heatmaps)||void 0===r||r.afterDecideResponse(e),null===(s=this.experiments)||void 0===s||s.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(l=this.exceptions)||void 0===l||l.afterDecideResponse(e),null===(c=this.exceptionObserver)||void 0===c||c.afterDecideResponse(e)}_loaded(){const e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){xn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),e||(new Zu(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Mn(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Jd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Qu(e.url,{ip:this.config.ip?1:0}),e.headers={...this.config.request_headers},e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var t,n,i;const r={...e};r.timeout=r.timeout||6e4,r.url=Qu(r.url,{_:(new Date).getTime().toString(),ver:dn.LIB_VERSION,compression:r.compression});const s=null!==(t=r.transport)&&void 0!==t?t:"XHR",o=null!==(n=null===(i=Wn(rd,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:rd[0].method;if(!o)throw new Error("No available transport method");o(r)})({...e,callback:t=>{var n,i,r;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(r=this.config).on_request_error)||void 0===i||i.call(r,t));null===(n=e.callback)||void 0===n||n.call(e,t)}})))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){let t;const n=[],i=[],r=[];Mn(e,(e=>{e&&(t=e[0],Jt(t)?r.push(e):Kt(e)?e.call(this):Jt(e)&&"alias"===t?n.push(e):Jt(e)&&-1!==t.indexOf("capture")&&Kt(this[t])?r.push(e):i.push(e))}));const s=function(e,t){Mn(e,(function(e){if(Jt(e[0])){let n=t;An(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(n,this),s(i,this),s(r,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void xn.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(tn(e)||!nn(e))return void xn.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;const r=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=r&&r.isRateLimited)return void xn.critical("This capture call is ignored due to client rate limiting.");this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();const s=new Date,o=(null==n?void 0:n.timestamp)||s;let a={uuid:Nl(),event:e,properties:this._calculate_event_properties(e,t||{},o)};r&&(a.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens);(null==n?void 0:n.$set)&&(a.$set=null==n?void 0:n.$set);const l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(a.$set_once=l),a=$n(a,null!=n&&n._noTruncate?null:this.config.properties_string_max_length),a.timestamp=o,tn(null==n?void 0:n.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=s);const c={...a.properties.$set,...a.$set};en(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",a);const u={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(u):this._requestQueue.enqueue(u),a}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,t,n){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;const i=this.persistence.remove_event_timer(e);let r={...t};if(r.token=this.config.token,"$snapshot"===e){const e={...this.persistence.properties(),...this.sessionPersistence.properties()};return r.distinct_id=e.distinct_id,(!nn(r.distinct_id)&&!an(r.distinct_id)||rn(r.distinct_id))&&xn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),r}const s=Zc.properties();if(this.sessionManager){const{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId();r.$session_id=e,r.$window_id=t}if(this.requestRouter.region===ld.CUSTOM&&(r.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){const e=this.sessionPropsManager.getSessionProps();r=Rn(r,e)}if(!this.config.disable_scroll_properties){let t={};"$pageview"===e?t=this.pageViewManager.doPageView(n):"$pageleave"===e&&(t=this.pageViewManager.doPageLeave(n)),r=Rn(r,t)}if("$pageview"===e&&_n&&(r.title=_n.title),!tn(i)){const e=n.getTime()-i;r.$duration=parseFloat((e/1e3).toFixed(3))}Sn&&this.config.opt_out_useragent_filter&&(r.$browser_type=this._is_bot()?"bot":"browser"),r=Rn({},s,this.persistence.properties(),this.sessionPersistence.properties(),r),r.$is_identified=this._isIdentified(),Jt(this.config.property_denylist)?An(this.config.property_denylist,(function(e){delete r[e]})):xn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const o=this.config.sanitize_properties;o&&(r=o(r,e));const a=this._hasPersonProcessing();return r.$process_person_profile=a,a&&this._requirePersonProcessing("_calculate_event_properties"),r}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;let t=Rn({},this.persistence.get_initial_props(),e||{});const n=this.config.sanitize_properties;return n&&(t=n(t,"$set_once")),en(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var i;null===(i=this.persistence)||void 0===i||i.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){const t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return xn.uninitializedWarning("posthog.identify");if(an(e)&&(e=e.toString(),xn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!e)return void xn.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(e.toLowerCase()))return void xn.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;const i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){const e=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:e},"")}e!==i&&e!==this.get_property(Wa)&&(this.unregister(Wa),this.register({distinct_id:e}));const r="anonymous"===(this.persistence.get_property(pl)||"anonymous");e!==i&&r?(this.persistence.set_property(pl,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(hl))}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,n){if(!e||!t)return void xn.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;const i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:{...i,[e]:t}}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===t||n||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,i,r;if(xn.info("reset"),!this.__loaded)return xn.uninitializedWarning("posthog.reset");const s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(i=this.persistence)||void 0===i||i.set_property(pl,"anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId();const o=this.config.get_device_id(Nl());this.register_once({distinct_id:o,$device_id:e?o:s},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let i=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if(null!=e&&e.withTimestamp&&n){var r;const t=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!n)return i;i+=`?t=${Math.max(Math.floor(((new Date).getTime()-n)/1e3)-t,0)}`}return i}alias(e,t){return e===this.get_property(qa)?(xn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(tn(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Wa,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(xn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const t={...this.config};var n,i,r,s;Qt(e)&&(Rn(this.config,Qd(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,t),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new zc({...this.config,persistence:"sessionStorage"}),ql.is_supported()&&"true"===ql.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(dn.DEBUG=!0,xn.info("set_config",{config:e,oldConfig:t,newConfig:{...this.config}})),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(s=this.heatmaps)||void 0===s||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){const t=ln(e)&&e;if(t||null!=e&&e.sampling||null!=e&&e.linked_flag){var n;const s=null===(n=this.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId();var i,r;if(t||null!=e&&e.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling(),xn.info("Session recording started with sampling override for session: ",null==s?void 0:s.sessionId);if(t||null!=e&&e.linked_flag)null===(r=this.sessionRecording)||void 0===r||r.overrideLinkedFlag(),xn.info("Session recording started with linked_flags override")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,t){var n;const i=new Error("PostHog syntheticException"),r=Kt(null===(n=Cn.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?Cn.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:i}):{$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}],...t};this.exceptions.sendExceptionEvent(r)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e;let t=null!==(e=this.config.name)&&void 0!==e?e:Xd;return t!==Xd&&(t=Xd+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(pl))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(pl))}_hasPersonProcessing(){var e,t,n,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&en(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Wa])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[yl]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(xn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(yl,!0),!0)}_sync_opt_out_with_persistence(){var e,t;const n=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default,r=this.config.disable_persistence||n&&!!i;var s,o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==r&&(null===(s=this.persistence)||void 0===s||s.set_disabled(r));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==r&&(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),tn(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return vn?Td(vn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){_n&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:_n.title},{send_instantly:!0}))}debug(e){!1===e?(null==hn||hn.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==hn||hn.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}!function(e,t){for(let n=0;n<t.length;n++)e.prototype[t[n]]=Pn(e.prototype[t[n]])}(th,["identify"]);!function(){const e=Yd[Xd]=new th,t=Cn.posthog;t&&An(t._i,(function(n){if(n&&Jt(n)){const i=e.init(n[0],n[1],n[2]),r=t[n[2]]||t;i&&(i._execute_array.call(i.people,r.people),i._execute_array(r))}})),Cn.posthog=e,function(){function e(){e.done||(e.done=!0,Jd=!1,An(Yd,(function(e){e._dom_loaded()})))}null!=_n&&_n.addEventListener&&("complete"===_n.readyState?e():_n.addEventListener("DOMContentLoaded",e,!1)),hn&&Bn(hn,"load",e,!0)}()}()}();
25
11
  //# sourceMappingURL=array.full.no-external.js.map