posthog-js 1.447.2 → 1.447.3

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 (55) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.js +1 -1
  5. package/dist/array.full.js.map +1 -1
  6. package/dist/array.full.no-external.js +1 -1
  7. package/dist/array.full.no-external.js.map +1 -1
  8. package/dist/array.js +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/customizations.d.ts +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/customizations.js +1 -1
  13. package/dist/default-extensions.js +1 -1
  14. package/dist/extension-bundles.js +1 -1
  15. package/dist/integrity.json +29 -29
  16. package/dist/lazy-recorder.js +1 -1
  17. package/dist/lazy-recorder.js.map +1 -1
  18. package/dist/main.d.ts +1 -1
  19. package/dist/main.js +1 -1
  20. package/dist/module.d.ts +1 -1
  21. package/dist/module.full.cjs +1 -1
  22. package/dist/module.full.d.ts +1 -1
  23. package/dist/module.full.js +1 -1
  24. package/dist/module.full.js.map +1 -1
  25. package/dist/module.full.no-external.cjs +1 -1
  26. package/dist/module.full.no-external.d.ts +1 -1
  27. package/dist/module.full.no-external.js +1 -1
  28. package/dist/module.full.no-external.js.map +1 -1
  29. package/dist/module.js +1 -1
  30. package/dist/module.mjs +1 -1
  31. package/dist/module.no-external.cjs +1 -1
  32. package/dist/module.no-external.d.ts +1 -1
  33. package/dist/module.no-external.js +1 -1
  34. package/dist/module.slim.js +1 -1
  35. package/dist/module.slim.no-external.d.ts +1 -1
  36. package/dist/module.slim.no-external.js +1 -1
  37. package/dist/posthog-recorder.d.ts +1 -1
  38. package/dist/posthog-recorder.js +1 -1
  39. package/dist/posthog-recorder.js.map +1 -1
  40. package/dist/recorder-v2.js +1 -1
  41. package/dist/recorder-v2.js.map +1 -1
  42. package/dist/recorder.d.ts +1 -1
  43. package/dist/recorder.js +1 -1
  44. package/dist/recorder.js.map +1 -1
  45. package/dist/rrweb-plugin-console-record.d.ts +1 -1
  46. package/dist/rrweb-types.d.ts +1 -1
  47. package/dist/rrweb.d.ts +1 -1
  48. package/dist/rrweb.js +1 -1
  49. package/dist/rrweb.js.map +1 -1
  50. package/dist/src/extensions/replay/types/rrweb-types.d.ts +1 -1
  51. package/dist/surveys-preview.js +1 -1
  52. package/dist/surveys.js +1 -1
  53. package/lib/package.json +1 -1
  54. package/lib/src/extensions/replay/types/rrweb-types.d.ts +1 -1
  55. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- !function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const o=null!=t?t:{},s="$stored_person_properties",a="$surveys",l="$replay_override_sampling",u="$replay_override_linked_flag",c="$replay_override_url_trigger",d="$replay_override_event_trigger",h="$session_is_sampled",f="$session_recording_url_trigger_activated_session",v="$session_recording_event_trigger_activated_session",p="$posthog_sr_group_event_trigger_",m="$posthog_sr_group_url_trigger_",g="$sess_rec_flush_size",y="$sdk_debug_replay_event_trigger_status",b="$sdk_debug_replay_linked_flag_trigger_status",w="$sdk_debug_replay_matched_recording_trigger_groups",k="$sdk_debug_replay_pending_trigger_conditions",S="$sdk_debug_replay_remote_trigger_matching_config",_="$sdk_debug_replay_trigger_groups_count",x="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",I="$session_recording_start_reason";function M(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){M(o,i,r,s,a,"next",t)}function a(t){M(o,i,r,s,a,"throw",t)}s(void 0)})}}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function E(t,e,n){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){E(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var D=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({});const P="min_length",F="max_length";function N(t,e){return-1!==t.indexOf(e)}const q=function(t){return t.trim()},j=Object.prototype,B=j.hasOwnProperty,z=j.toString,H=Array.isArray||function(t){return"[object Array]"===z.call(t)},U=t=>"function"==typeof t,W=t=>t===Object(t)&&!H(t),G=t=>void 0===t,V=t=>"[object String]"==z.call(t),Q=t=>V(t)&&0===t.trim().length,Z=t=>null===t,J=t=>G(t)||Z(t),Y=t=>"[object Number]"==z.call(t)&&t==t,K=t=>"[object Boolean]"===z.call(t),X=t=>t instanceof FormData;function tt(t){return null===t||"object"!=typeof t}function et(t,e){return{}.toString.call(t)===`[object ${e}]`}function nt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return rt(t,Error)}}function it(t){return"u">typeof Event&&rt(t,Event)}function rt(t,e){try{return t instanceof e}catch(t){return!1}}function ot(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Y(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ot(null!=r?r:n,e,n,i))}var st=class{constructor(t){this.C={},this.I=t.I,this.A=ot(t.bucketSize,0,100,t.R),this.O=ot(t.refillRate,0,this.A,t.R),this.$=ot(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};const at="Mobile",lt="Tablet",ut="Android Tablet",ct="iPad",dt="Apple Watch",ht="Nintendo",ft="PlayStation",vt="Xbox",pt="Nokia",mt="Ouya",gt="Generic tablet",yt=new RegExp(vt,"i"),bt=new RegExp("PlayStation \\w+","i"),wt=new RegExp("Nintendo \\w+","i"),kt=new RegExp("BlackBerry|PlayBook|BB10","i");function St(t){return t?t.split("#")[0]:t}function _t(t){try{return t()}catch(t){return}}let xt,Ct,Tt,It;function Mt(t){var e;const n=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!n&&!i)return;const r=n?Object.keys(n):[],o=i?Object.keys(i):[];if(It&&At(n,r,Ct)&&At(i,o,Tt))return It;Ct=n?L({},n):void 0,Tt=i?L({},i):void 0,It={},null!==(e=xt)&&void 0!==e||(xt={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==xt?void 0:xt[r];if(o){It[o]=e;continue}const s=t(r);for(let t=s.length-1;t>=0;t--){var i;const n=null===(i=s[t])||void 0===i?void 0:i.filename;if(n){It[n]=e,xt[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),It}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const Rt=/^([a-z][a-z0-9.+-]+):/i,Et=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Ot(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||Et.includes(e[1].toLowerCase())}function $t(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Ot(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Lt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return n||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Dt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ft=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=(t,e)=>{const n=Dt.exec(t);if(n){const[,t,i,r]=n;return $t(e,t,"?",+i,+r)}const i=Pt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Ft.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Lt(i[1]||"?",i[2]);return $t(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bt=(t,e)=>{const n=qt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=jt.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],i=n[1]||"?";return[i,t]=Lt(i,t),$t(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},zt=/\(error: (.*)\)/;function Ht(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Ut(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let i=!0;for(let r=0;e>r;r++)if(!Ht(t[n+r],t[n+e+r])){i=!1;break}if(i){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function Wt(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Gt(t,e){let n=e.start;for(;n>0&&Ht(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Vt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Ht(t[i],t[i-e.length]);)i++;return i-n}function Qt(t,e){const n=e[0];let i=t.length-(n?Gt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Zt(t,e,n){for(let i=0;t.length>i;i++){const r=t[(e+i)%t.length],o=t[(n+i)%t.length];if(r!==o)return o>r}return!1}const Jt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function Kt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let t=n.length;t>0;t--){const i=n.slice(0,t).join(", ");if(e>=i.length)return t===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}const Xt="NativeGzipValidationError";let te;const ee=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Xt,`Native gzip produced invalid output: ${t}`)},ne=function(){var t=A(function*(t,e){18>t.size&&ee("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&ee("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(te)return te;te=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&ee("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&ee("invalid-size")});return function(e,n){return t.apply(this,arguments)}}();function ie(t){return re.apply(this,arguments)}function re(){return re=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),s=new Response(n.readable).blob(),[a]=yield Promise.all([s,o]);return yield ne(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),re.apply(this,arguments)}function oe(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const se="0.10.7",ae={DEBUG:!1,LIB_VERSION:se,LIB_NAME:"browser-common",JS_SDK_VERSION:se},le=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ae.DEBUG||r.POSTHOG_DEBUG||e)&&!G(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>le(`${t} ${e}`,n)};return n},ue=le("[PostHog.js]"),ce=(t,e)=>ue.createLogger(t,e);function de(t,e){if(!J(t))if(H(t))t.forEach(e);else if(X(t))t.forEach((t,n)=>e(t,n));else for(const n in t)B.call(t,n)&&e(t[n],n)}const he=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function fe(t){const e=Object.keys(t);let n=e.length;const i=new Array(n);for(;n--;)i[n]=[e[n],t[e[n]]];return i}function ve(t,e,n,i){const{capture:r=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:o})}const pe=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return G(n)?null:(n.href=t,n)},me=["localhost","127.0.0.1"],ge=(t,e)=>{try{let n;return JSON.stringify(t,(t,e)=>{var i;return nt(e)?(null!==(i=n)&&void 0!==i||(n=new WeakMap),n.has(e)||n.set(e,function(t){const e=L({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch(t){}return e}(e)),n.get(e)):"bigint"==typeof e?e.toString():e},e)}catch(e){return function(t){var e;const n=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(e))return"[Circular]";n.push(e)}return e}}))&&void 0!==e?e:"null"}(t)}},ye=function(t,e="&"){let n,i;const r=[];return de(t,function(t,e){G(t)||G(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)};function be(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return G(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!U(i))return e;try{const t=i(e);return V(t)&&t?t:e}catch(t){return ue.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function we(t){return!!t&&1===t.nodeType}function ke(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Se(t){return!!t&&11===t.nodeType&&we(t.host)}function _e(t){return t?q(t).split(/\s+/):[]}function xe(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return _e(e)}function Ce(t){let e="";return De(t)&&!Pe(t)&&t.childNodes&&t.childNodes.length&&de(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return J(t)?null:q(t).split(/(\s+)/).filter(t=>Ue(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),q(e)}function Te(t){var e;return G(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const Ie=["a","button","form","input","select","textarea","label"];function Me(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch(t){return!1}}function Ae(t){const e=t.parentNode;return!(!e||!we(e))&&e}const Re=[".ph-no-deadclick",".ph-no-capture"];const Ee=["","text","search","email","password","url","tel","number"];function Oe(t){return!(!t||!we(t))&&(!!ke(t,"textarea")||(ke(t,"input")?N(Ee,(t.getAttribute("type")||"").toLowerCase()):function(t){var e;if(t.isContentEditable)return!0;const n=null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return"true"===n||""===n}(t)))}const $e=t=>!t||ke(t,"html")||!we(t),Le=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||$e(t))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[t];let o=t;for(;o.parentNode&&!ke(o,"body");){if(Se(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const t=Ae(o);if(!t)break;if(e||Ie.indexOf(t.tagName.toLowerCase())>-1)i=!0;else try{const e=n.getComputedStyle(t);e&&"pointer"===e.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(t),o=t}return{parentIsUsefulElement:i,targetElementList:r}};function De(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ke(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=xe(i);if(N(t,"ph-sensitive")||N(t,"ph-no-capture"))return!1}if(N(xe(t),"ph-include"))return!0;const i=t.type||"";if(V(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!V(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function Pe(t){return!!(ke(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ke(t,"select")||ke(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Fe=new RegExp("^(?:(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}))$"),Ne=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qe=[16,15,14,13],je=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Be=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ze=/[0-9A-Za-z_]/;function He(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}function Ue(t,e=!0){if(J(t))return!1;if(V(t)){if(t=q(t),e?Fe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Ne.lastIndex=0;e=Ne.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of qe){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Fe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?je.test(t):function(t){let e;for(Be.lastIndex=0;e=Be.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&ze.test(t)&&ze.test(n)))return!0}return!1}(t))return!1}return!0}function We(t){let e=Ce(t);return e=`${e} ${Ge(t)}`.trim(),Ue(e)?e:""}function Ge(t){let e="";return t&&t.childNodes&&t.childNodes.length&&de(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Ce(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Ge(t)}`.trim())}catch(t){ue.error("[AutoCapture]",t)}}),e}function Ve(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){const e=t.attr__class;if(e)return H(e)?e:_e(e)}const Ze=1e6;function Je(t){var e;return Math.min(Ze,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ze)}const Ye={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ze,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Ke=["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"],Xe=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],tn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],en=t=>{J(t)||de(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Ke.includes(e)||tn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},nn=["/s/","/e/","/i/"];function rn(t,e,n,i){if(J(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return V(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function on(t,e){if(J(t))return t;let n=t;return Ue(n,!1)||(n="[SessionRecording] "+e+" body redacted"),de(Xe,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const sn=new WeakSet,an="disabled",ln="sampled",un="active",cn="buffering",dn="paused",hn="rrweb_error",fn="trigger_activated",vn="trigger_pending",pn="trigger_disabled";function mn(t,e,n,i,r,o){return 0===e?pn:(null==t?void 0:t.get_property(n?i+n:r))===o?fn:vn}function gn(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function yn(t){return t.includes("trigger_activated")?fn:t.includes("trigger_pending")?vn:pn}function bn(t){const e=new Set(t);switch(e.delete(pn),e.size){case 0:return pn;case 1:return Array.from(e)[0];default:return vn}}var wn=class{constructor(t){this.j=t}triggerStatus(t){return yn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return yn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},kn=class{constructor(t){this.j=t}triggerStatus(t){return bn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return bn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Sn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return fn}stop(){}};const _n=t=>"sessionRecording"in t;var xn=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.U=new Map,this.W=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(_n(t)?W(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(_n(t)?W(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.U.clear(),this.W.clear();for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){ue.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.H)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){ue.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return mn(this._instance,this.B.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[x]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=be(this._instance);if(!t)return!1;try{return gn(t,this.H,this.W)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=be(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=gn(n,this.H,this.W);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=be(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const o=this.urlBlocked,s=gn(r,this.H,this.W);s&&!o?t():!s&&o&&e();const a=this.J(i)===fn,l=gn(r,this.B,this.U);!a&&l&&n("url",r)}stop(){this.G=""}},Cn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[b]:t}),t}triggerStatusNoSideEffects(){let t=vn;return J(this.linkedFlag)&&(t=pn),this.linkedFlagSeen&&(t=fn),t}onConfig(t,e){var n;if(this.linkedFlag=(_n(t)?W(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!J(this.linkedFlag)&&!this.linkedFlagSeen){const t=V(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=V(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(W(r)&&t in r){const e=r[t];o=K(e)?!0===e:n?e===n:!!e}const s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},Tn=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(_n(t)?W(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return mn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[y]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===fn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},In=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new xn(t,e.id),this.et=new Tn(t,e.id),this.nt=new Cn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new wn(r):new kn(r)}else this.it=new Sn}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?m+this.group.id:p+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function Mn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=!0===t.isSampled,n=new wn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ln:"trigger_activated"===n?un:"trigger_pending"===n?cn:!1===t.isSampled?an:un}function An(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=new kn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==pn,i=K(t.isSampled);return n&&"trigger_pending"===e?cn:n&&"trigger_disabled"===e||i&&!t.isSampled?an:!0===t.isSampled?ln:un}function Rn(){const t=[];return function(e,n){if(W(n)||H(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function En(t){try{const e=JSON.stringify(t,Rn());return e?new Blob([e]).size:0}catch(t){return-1}}function On(t){if(Z(t))return 4;if(G(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(H(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=G(i)||Z(i)?4:On(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];G(r)||(i||(n+=1),i=!1,n+=t.length+3+On(r))}return n}default:return 0}}function $n(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[$n({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),$n({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Ln=Uint8Array,Dn=Uint16Array,Pn=Uint32Array,Fn=new Ln([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]),Nn=new Ln([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]),qn=new Ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jn=function(t,e){for(var n=new Dn(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Pn(n[30]);for(i=1;30>i;++i)for(var o=n[i];n[i+1]>o;++o)r[o]=o-n[i]<<5|i;return[n,r]},Bn=jn(Fn,2),zn=Bn[1];Bn[0][28]=258,zn[258]=28;for(var Hn=jn(Nn,0)[1],Un=new Dn(32768),Wn=0;32768>Wn;++Wn){var Gn=(43690&Wn)>>>1|(21845&Wn)<<1;Un[Wn]=((65280&(Gn=(61680&(Gn=(52428&Gn)>>>2|(13107&Gn)<<2))>>>4|(3855&Gn)<<4))>>>8|(255&Gn)<<8)>>>1}var Vn=function(t,e,n){for(var i=t.length,r=0,o=new Dn(e);i>r;++r)++o[t[r]-1];var s,a=new Dn(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Dn(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=a[t[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)s[Un[d]>>>l]=u}else for(s=new Dn(i),r=0;i>r;++r)s[r]=Un[a[t[r]-1]++]>>>15-t[r];return s},Qn=new Ln(288);for(Wn=0;144>Wn;++Wn)Qn[Wn]=8;for(Wn=144;256>Wn;++Wn)Qn[Wn]=9;for(Wn=256;280>Wn;++Wn)Qn[Wn]=7;for(Wn=280;288>Wn;++Wn)Qn[Wn]=8;var Zn=new Ln(32);for(Wn=0;32>Wn;++Wn)Zn[Wn]=5;var Jn=Vn(Qn,9,0),Yn=Vn(Zn,5,0),Kn=function(t){return(t/8|0)+(7&t&&1)},Xn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Dn?Dn:t instanceof Pn?Pn:Ln)(n-e);return i.set(t.subarray(e,n)),i},ti=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ei=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ni=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Ln(0),0];if(1==r){var s=new Ln(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(i=1;r>i;++i)o[i].s>h&&(h=o[i].s);var f=new Dn(h+1),v=ii(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(o.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=o[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=o[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Ln(f),v]},ii=function(t,e,n){return-1==t.s?Math.max(ii(t.l,e,n+1),ii(t.r,e,n+1)):e[t.s]=n},ri=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Dn(++e),i=0,r=t[0],o=1,s=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=t[a]}return[n.subarray(0,i),e]},oi=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},si=function(t,e,n){var i=n.length,r=Kn(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;i>o;++o)t[r+o+4]=n[o];return 8*(r+4+i)},ai=function(t,e,n,i,r,o,s,a,l,u,c){ti(e,c++,n),++r[256];for(var d=ni(r,15),h=d[0],f=d[1],v=ni(o,15),p=v[0],m=v[1],g=ri(h),y=g[0],b=g[1],w=ri(p),k=w[0],S=w[1],_=new Dn(19),x=0;y.length>x;++x)_[31&y[x]]++;for(x=0;k.length>x;++x)_[31&k[x]]++;for(var C=ni(_,7),T=C[0],I=C[1],M=19;M>4&&!T[qn[M-1]];--M);var A,R,E,O,L=u+5<<3,D=oi(r,Qn)+oi(o,Zn)+s,P=oi(r,h)+oi(o,p)+s+14+3*M+oi(_,T)+(2*_[16]+3*_[17]+7*_[18]);if(D>=L&&P>=L)return si(e,c,t.subarray(l,l+u));if(ti(e,c,1+(D>P)),c+=2,D>P){A=Vn(h,f,0),R=h,E=Vn(p,m,0),O=p;var F=Vn(T,I,0);for(ti(e,c,b-257),ti(e,c+5,S-1),ti(e,c+10,M-4),c+=14,x=0;M>x;++x)ti(e,c+3*x,T[qn[x]]);c+=3*M;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ti(e,c,F[B=31&j[x]]),c+=T[B],B>15&&(ti(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else A=Jn,R=Qn,E=Yn,O=Zn;for(x=0;a>x;++x)if(i[x]>255){var B;ei(e,c,A[257+(B=i[x]>>>18&31)]),c+=R[B+257],B>7&&(ti(e,c,i[x]>>>23&31),c+=Fn[B]);var z=31&i[x];ei(e,c,E[z]),c+=O[z],z>3&&(ei(e,c,i[x]>>>5&8191),c+=Nn[z])}else ei(e,c,A[i[x]]),c+=R[i[x]];return ei(e,c,A[256]),c+R[256]},li=new Pn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ui=new Ln(0),ci=function(){for(var t=new Pn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),di=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function hi(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=ci[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,o,s,a,l,u=(r=t,o=e,s=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,n,i,r,o){var s=t.length,a=new Ln(i+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?u=si(l,u,t.subarray(c,d)):(l[c]=o,u=si(l,u,t.subarray(c,s)))}else{for(var h=li[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Dn(32768),g=new Dn(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Pn(25e3),S=new Dn(288),_=new Dn(32),x=0,C=0,T=(c=0,0),I=0,M=0;s>c;++c){var A=w(c),R=32767&c,E=g[A];if(m[R]=E,g[A]=R,c>=I){var O=s-c;if((x>7e3||T>24576)&&O>423){u=ai(t,l,0,k,S,_,C,T,M,c-M,u),T=x=C=0,M=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)_[L]=0}var D=2,P=0,F=v,N=R-E&32767;if(O>2&&A==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&R!=E;){if(t[c+D]==t[c+D-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>D){if(D=z,P=N,z>q)break;var H=Math.min(N,z-2),U=0;for(L=0;H>L;++L){var W=c-N+L+32768&32767,G=W-m[W]+32768&32767;G>U&&(U=G,E=W)}}}N+=(R=E)-(E=m[R])+32768&32767}if(P){k[T++]=268435456|zn[D]<<18|Hn[P];var V=31&zn[D],Q=31&Hn[P];C+=Fn[V]+Nn[Q],++S[257+V],++_[Q],I=c+D,++x}else k[T++]=t[c],++S[t[c]]}}u=ai(t,l,o,k,S,_,C,T,M,c-M,u),o||(u=si(l,u,ui))}return Xn(a,0,i+Kn(u)+r)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,s,a,!l)),c=u.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&di(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(u,e),di(u,c-8,n.d()),di(u,c-4,i),u}function fi(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var vi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,o,s,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=t.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.wt(e);if(0===o&&n!==o)return;if(this.St)return t;this.ct();const s=On(t);var a,l;return s>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.dt-=s,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new st({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:ue}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(o=this.rt.bytesRefillRate)&&void 0!==o?o:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const s=this.rt.resyncIntervalMs;this.Ct=Y(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}},pi=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>n||0>i||0>r||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){let t="";for(let e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(let e=0;16>e;e++){const n=this.bytes[e]-t.bytes[e];if(0!==n)return Math.sign(n)}return 0}},mi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Tt=0;const t=this.generateOrAbort();if(G(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return Y(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return pi.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.At.nextUint32())}It(){this.Mt=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.At=new bi}};const gi=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let yi;var bi=class{nextUint32(){var t;return this.Rt.length>this.Et||((null!==(t=yi)&&void 0!==t?t:yi="u">typeof window&&!G(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return gi(t)}}:gi)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let wi;const ki=()=>Si().toString(),Si=()=>(wi||(wi=new mi)).generate();let _i=null;const xi={Ot(){if(!Z(_i))return _i;if(_i=!0,G(t))_i=!1;else try{const t="__support__";xi.$t(t,"xyz"),'"xyz"'!==xi.Lt(t)&&(_i=!1),xi.Dt(t)}catch(t){_i=!1}return _i},Pt(t){ue.error("sessionStorage error: ",t)},Lt(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){xi.Pt(t)}return null},Ft(t){try{return JSON.parse(xi.Lt(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){xi.Pt(t)}return!1},Dt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){xi.Pt(t)}}};ae.DEBUG=!1,ae.LIB_VERSION="1.447.2",ae.LIB_NAME="web";var Ci=ae,Ti=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(g);return W(n=e)&&V(n.sessionId)&&Y(n.size)&&e.sessionId===t?e.size:0;var n}};function Ii(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<ot(100*e,0,100,ue)}function Mi(t){return`$survey_response_${t}`}function Ai(t,e){if(!e)return null;const n=t[Mi(e)];return H(n)?[...n]:n}function Ri({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return L(L(L(L({},!G(i)&&{$survey_submission_id:i}),"sent"===t?!G(r)&&{$survey_completed:r}:{$survey_partially_completed:Ei(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(G(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ai(t,e.id);G(o)||(i[n]=o)}),L(L({$survey_questions:e.questions.map(e=>{var i,r;return{id:e.id,question:null!==(i=null==n?void 0:n[null!==(r=e.id)&&void 0!==r?r:""])&&void 0!==i?i:e.question,response:Ai(t,e.id)}})},t),i)}(n,e,s))}function Ei(t={}){return Object.values(t).some(t=>!J(t))}function Oi(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function $i(t){return"string"==typeof t&&t.trim()?t.trim():null}function Li(t){return t.toLowerCase()}function Di(t,e,n){if(!t||!e)return null;const i=Li(e),r=Object.keys(t).find(t=>Li(t)===i);if(r)return null==n||n.debug(`Found exact translation match: ${r}`),r;if(i.includes("-")){const r=i.split("-")[0],o=Object.keys(t).find(t=>Li(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Pi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Fi(t,e,n){var i;const r=Di(t.translations,e,n),o=L({},t);let s=!1;if(r){var a;const e=null===(a=t.translations)||void 0===a?void 0:a[r];if(e)if(null==n||n.info(`Applying survey-level translation for language: ${r}`),G(e.name)||(o.name=e.name,s=!0),o.appearance){const t=L({},o.appearance);for(const n of Pi){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Pi.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Di(t.translations,e,n);if(!r)return{question:t,matchedKey:null,hasChanges:!1};const o=null===(i=t.translations)||void 0===i?void 0:i[r];if(!o)return{question:t,matchedKey:null,hasChanges:!1};const s=L({},t);let a=!1;return G(o.question)||(s.question=o.question,a=!0),G(o.description)||(s.description=o.description,a=!0),G(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!G(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!G(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!G(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return H(t.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:t,matchedKey:a?r:null,hasChanges:a}}(t,e,n)),u=l.map(t=>t.question),c=l.some(t=>t.hasChanges);let d=null;return r||(d=(null===(i=l.find(t=>t.matchedKey))||void 0===i?void 0:i.matchedKey)||null),c&&(o.questions=u,s=!0,null==n||n.info(`Applied question-level translations for language: ${e}`)),{survey:o,matchedKey:s?r||d:null}}function Ni(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}const qi=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ji=t=>t.toLowerCase(),Bi={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>qi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!qi(e,t))),icontains:(t,e)=>e.map(ji).some(e=>t.map(ji).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ji).every(e=>t.map(ji).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},zi=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Hi=new Set(["is_not","not_icontains","not_regex"]);function Ui(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],o=t.operator||"exact";if(G(r)||Z(r))return Hi.has(o);const s=Bi[o];return!!s&&!G(t.value)&&!Z(t.value)&&s(H(t.value)?t.value.map(String):[String(t.value)],H(r)?r.map(String):[String(r)])})}const Wi=ce("[SessionRecording]");function Gi(t,e){return e?t:"!"+t}function Vi(t,e){return t===e||t!=="!"+e&&null}var Qi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=o,this.zt=s,this.Ht=null,this.Ut=An}onRemoteConfig(t){this.Ht=Y(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Wt=new wn([this.et,this.tt]),this.Ut=Mn):(this.Wt=new kn([this.et,this.tt]),this.Ut=An),this._instance.register_for_session({[S]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Ut({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Y(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&J(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Wi.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!Y(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const o=this._instance.get_property(h),s=this._instance.get_property("$replay_sample_rate"),a=Vi(o,t),l=Y(s)&&s!==n,u=G(s)&&o===t,c=l||u||!K(a),d=c?Ii(t,n):a;c&&(d?this.jt("sampled"):Wi.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Gi(t,d),$replay_sample_rate:Z(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!Y(this.Ht))return;const e=this._instance.get_property(h);K(Vi(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Wt)||void 0===e?void 0:e.triggerStatus(t))===vn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},Zi=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[S]:"v2_trigger_groups",[_]:t.triggerGroups.length}),this.tt.onConfig(t)):Wi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return an;let i=!1,r=!1;for(const o of e){const e=o.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=o.group.id,e=n.get(t);G(e)?ue.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?ln:i?cn:an}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Y(t)&&(Z(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Wi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),o=this._instance.get_property(s);r.some(e=>!e.properties||0===e.properties.length||Ui(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Wi.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,o=i.sampleRate,s="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(s);let l=null,u=!1,c=!1,d=!1;if(W(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Y(n)&&n!==o,l=e===t&&Y(n)&&n===o&&K(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!K(l),f=h?Ii(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[s]:{sessionId:t,sampleRate:o,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,o;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(o=this._instance.persistence)||void 0===o||o.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Zt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[w]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Ui(n,e,this._instance.get_property(s))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new In(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const Ji=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Yi=1e5,Ki=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Xi=[],tr=()=>!1,er="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),nr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ir="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),rr="Accommodation AdministrativeArea Country Place State".split(" "),or={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:nr,publisher:ir},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Xi},Offer:{seller:ir},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ir,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ir,areaServed:rr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Xi}},sr=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),or.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),or.Event],[ir,or.Organization],[rr,or.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),or.Product]];function ar(t,e){return B.call(t,e)?t[e]:void 0}function lr(t){const e=typeof t;return Z(t)||"string"===e||"number"===e||"boolean"===e}function ur(t,e){return e&&function(t){return V(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function cr(t,e){return H(t)&&t.every(lr)?t.map(t=>ur(t,e)).filter(t=>!G(t)):lr(t)?ur(t,e):void 0}function dr(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function hr(t){if(B.call(or,t))return or[t];for(const[e,n]of sr)if(e.includes(t))return n}function fr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function vr(t,e,n,i){if(H(t)){const r=t.map(t=>vr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return pr(t,e,n,i)||void 0}function pr(t,e,n,i){if(!W(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=ar(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:H(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&Ki.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!hr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of er){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?dr(ar(t,i),e):cr(ar(t,i),n.maskUrl);G(s)||fr(a,i,s)}for(const i of s){const r=hr(i);for(const i of Object.keys(r)){const o=ar(t,i),s=r[i];if(!0===s){const t=cr(o,n.maskUrl);G(t)||fr(a,i,t)}else{const t=vr(o,e,n,s);G(t)||fr(a,i,t)}}}const l=vr(ar(t,"@graph"),e,n);return G(l)||fr(a,"@graph",l),Object.keys(a).length?a:null}function mr(t,e,n){if(!W(t))return null;const i=ar(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=pr(t,e,n);return r?L({"@context":"https://schema.org"},r):null}function gr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function yr(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function br(t,e,n){for(let i=t;i;){if(yr(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function wr(t){return gr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(gr)}function kr(t){return W(t)?t.network_timing:t}const Sr=ce("[SessionRecording]"),_r=[1,2,3,4,5,6,7,12],xr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Cr(){var t;return null==o||null===(t=o.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Tr(){var t;return null===(t=Cr())||void 0===t?void 0:t.record}function Ir(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,Rn())}}function Mr(t){return fi(hi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Ln(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},o=0;e>o;++o){if(i+5>n.length){var s=new Ln(i+8+(e-o<<1));s.set(n),n=s}var a=t.charCodeAt(o);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++o))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return Xn(n,0,i)}(Ir(t))),!0)}function Ar(t){return Rr.apply(this,arguments)}function Rr(){return(Rr=A(function*(t){const e=yield ie(Ir(t),Ci.DEBUG,{rethrow:!0});return fi(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}let Er,Or;const $r="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Lr=!1;function Dr(t){var e;return H(t)&&0===t.length?(Er=null!==(e=Er)&&void 0!==e?e:Mr([]),Er):Mr(t)}function Pr(t){return Fr.apply(this,arguments)}function Fr(){return(Fr=A(function*(t){var e;return H(t)&&0===t.length?Er||(Or=null!==(e=Or)&&void 0!==e?e:Ar([]).then(t=>(Er=t,t)).catch(t=>{throw Er=void 0,Or=void 0,t}),Or):Ar(t)})).apply(this,arguments)}function Nr(t){return $r&&!Lr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function qr(t){return{event:t,size:On(t)}}function jr(t,e){return L(L({},t),{},{data:e,cv:"2024-10"})}function Br(t,e){return L(L({},t),{},{cv:"2024-10",data:L(L({},t.data),e)})}function zr(t){try{if(2===t.type)return qr(jr(t,Mr(t.data)));if(3===t.type&&0===t.data.source)return qr(Br(t,{texts:Dr(t.data.texts),attributes:Dr(t.data.attributes),removes:Dr(t.data.removes),adds:Dr(t.data.adds)}));if(3===t.type&&8===t.data.source)return qr(Br(t,{adds:t.data.adds?Mr(t.data.adds):void 0,removes:t.data.removes?Mr(t.data.removes):void 0}))}catch(t){Sr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:En(t)}}function Hr(){return Hr=A(function*(t){try{if(2===t.type)return qr(jr(t,yield Ar(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Pr(t.data.texts),Pr(t.data.attributes),Pr(t.data.removes),Pr(t.data.adds)]);return qr(Br(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Ar(t.data.adds):void 0,t.data.removes?Ar(t.data.removes):void 0]);return qr(Br(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Xt})(e)&&(Lr=!0),Sr.warn("could not compress event asynchronously - trying synchronous compression",e),zr(t)}return{event:t,size:En(t)}}),Hr.apply(this,arguments)}function Ur(t,e){return 5===t.type&&t.data.tag===e}function Wr(t){return Ur(t,"sessionIdle")}function Gr(t){return Ur(t,"$session_ending")}function Vr(t){return Ur(t,"$session_starting")}var Qr=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return Vi(this._instance.get_property(h),this.sessionId)}get Ht(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Y(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=!1,this.ue=Date.now(),this.ce=!1,this.de=[],this.he="unknown",this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=!1,this.Te=!1,this.Ie=!1,this.Me=!1,this.Ae=void 0,this.Re=void 0,this.Ee=!1,this.Oe=[],this.$e=0,this.Le=0,this.De=!1,this.Pe=void 0,this.Gt=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=void 0,this.je=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.Be)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Be;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ue,flushed_size:null===(c=this.ze)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Cr())||void 0===r||null===(o=r.resetMaxDepthState)||void 0===o||o.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.He(),!(!1===this.he&&this.isStarted||this.Xt===t&&this.Be===e)){const e=this.Xt!==t&&!1!==this.he;this.he="unknown",this.Ue(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ue}),null===(s=this.oe)||void 0===s||s.makeSamplingDecisions(t)},this.We=!1,this.Ge=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ve=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Y(n)&&Y(i)?i-n:null},this.Qe=()=>{var t,e;const n=this.re;if(!Y(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Ze;return Y(t)&&t>=0&&n>t}if(this.Ge())return!1;const i=this.Ve();return!!Z(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Je=()=>{"buffering"!==this.status?(this.ye&&this.be&&this.Ye&&(this.Ke(void 0),this.we&&(this.we=!1,this.Bt())),this.Xe(),this.tn(!0)):this.en()},this.nn=()=>{this.Je()},this.rn=()=>{this.Vt("browser offline",{})},this.sn=()=>{this.Vt("browser online",{})},this.an=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.Ye=!0),this.Vt("window "+n.visibilityState,{}))},this.Ye=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=i,this.Be=r,this._sessionStartTimestamp=o,this.nt=new Cn(this._instance),this.tt=new xn(this._instance),this.et=new Tn(this._instance),this.Rt=this.en(),this.ln="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.te.sessionTimeoutMs>this.ee||Sr.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.ze=new Ti(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ye=!0)}get un(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},d=null!==(o=null==c?void 0:c.maskAllInputs)&&void 0!==o?o:null==u?void 0:u.maskAllInputs,h=null!==(s=null==c?void 0:c.maskTextSelector)&&void 0!==s?s:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return G(d)&&G(h)&&G(f)&&G(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}cn(){var t;if(this.Ce)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(J(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!G(i)&&i!==r});0!==i.length&&(this.Ce=!0,Sr.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get dn(){var t;return ot(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ce("canvas recording resolution scale"),1)}get hn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let d=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==l?void 0:l.quality)&&void 0!==o?o:.4;if("string"==typeof d){const t=parseFloat(d);d=isNaN(t)?.4:t}return{enabled:u,fps:ot(c,0,12,ce("canvas recording fps"),4),quality:ot(d,0,1,ce("canvas recording quality"),.4)}}get fn(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get vn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},o=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),s=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=kr(this._instance.config.capture_performance),l=kr(null==i?void 0:i.capturePerformance),u=!!(K(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}pn(){var t,e;const n=[],r=null===(t=o.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.fn&&n.push(r());const s=null===(e=o.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.vn&&U(s))if(!me.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=U(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(L(L({},((t,e,n)=>{const i={payloadSizeLimitBytes:Ye.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ye.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ye.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=Je(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=rn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=rn(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=pe(t.name);let o=0===e.indexOf("http")?null===(i=pe(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&nn.some(t=>0===s.indexOf(t))?void 0:t})((en((i=e).requestHeaders),en(i.responseHeaders),i),t.api_host,n));var i},u=U(t.session_recording.maskNetworkRequestFn);return u&&U(t.session_recording.maskCapturedNetworkRequestFn)?ue.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return L(L({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=U(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const o=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,s=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return J(s)&&o?(sn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=on(t.requestBody,"Request"),t.responseBody=on(t.responseBody,"Response"),t}(l(t)),L(L(L({},Ye),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else Sr.info("NetworkCapture not started because we are on localhost.");return n}mn(t){return this._instance.config.disable_capture_url_hashes?St(t):t}gn(t,e=!1){const n=e?St(t):this.mn(t),i=this._instance.config.mask_personal_data_properties?[...Ji,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),o=r[1],s=r[0],a=(o||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}yn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}bn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.de.length?this.de.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.bn(xr(()=>Tr().addCustomEvent(t,e)))}wn(){var t;return this.le&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.he}kn(t){if(!this.wn())return!1;try{const e=Tr();return!!e&&(e.addCustomEvent("$json_ld",t),this.wn())}catch(t){return!1}}Sn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this._n)||void 0===e?void 0:e.scan(t)})}xn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.gn(e.origin+e.pathname+e.search);this.Cn!==n&&(this.Cn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Tn(){if(this.de.length){const t=[...this.de];this.de=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.bn(t)})}}Bt(){return this.bn(xr(()=>Tr().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Y(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Mn(){if(this.An&&clearInterval(this.An),!0===this.he)return;const t=this.In;t&&(this.An=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.Rn(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.Mn()}En(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this._n)||void 0===t||t.scan(),clearInterval(this.An),Sr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}On(){var t;this.tt.urlBlocked&&(null===(t=this._n)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.Sn(),this.Mn(),this.Vt("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}$n(t,e){var n;if("event"===t&&this.Rn(),!this.ce&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ce=!0;try{var i,r;const n="url"===t?f:v;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.tn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ce=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=W(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Ln(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const o=this.ie;if(!o)return void Sr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.he&&!this.ke;this.Ke(t?"no_interaction_since_recording_started":void 0),this.ke=!1,this.be=t,this.we=!1}this.De&&(this.Dn(),this.en());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.te.checkAndGetSessionAndWindowId();this.Xt=s,this.Be=a,this._sessionStartTimestamp=h,this.Pn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.se=null==o?void 0:o.endpoint),this.oe=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Zi(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new Qi(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(o),null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.$n(t,e)),this.Ln(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Ln(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Ln(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Ln(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.oe.makeSamplingDecisions(this.sessionId),this.Fn(),this.Se||(ve(t,"beforeunload",this.Je),ve(t,"pagehide",this.nn),ve(t,"offline",this.rn),ve(t,"online",this.sn),ve(n,"visibilitychange",this.an),!this.Fe&&U(this.te.onSessionId)&&(this.Fe=this.te.onSessionId(this.je)),!this.Ne&&U(this.te.on)?this.Ne=this.te.on("forcedIdleReset",()=>{this.He(),this.he="unknown",this.stop(),this.qe=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,this.je(t,e,n)})}):U(this.te.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),J(this.Pe)&&(this.Pe=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.gn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(e||"recording_initialized"))}Nn(){var e,i,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Je),null==t||t.removeEventListener("pagehide",this.nn),null==t||t.removeEventListener("offline",this.rn),null==t||t.removeEventListener("online",this.sn),null==n||n.removeEventListener("visibilitychange",this.an),clearInterval(this.An),this.qn(),null===(e=this.Pe)||void 0===e||e.call(this),this.Pe=void 0,null===(i=this.Gt)||void 0===i||i.call(this),this.Gt=void 0,null===(r=this.Fe)||void 0===r||r.call(this),this.Fe=void 0,null===(o=this.Ne)||void 0===o||o.call(this),this.Ne=void 0,null===(s=this.qe)||void 0===s||s.call(this),this.qe=void 0,null===(a=this.oe)||void 0===a||a.stop(),this.jn(),this.Dn()}Dn(){this.Le+=1,this.Oe=[],this.$e=0,this.Bn=void 0,this.De=!1}jn(){var t,e;null===(t=this.zn)||void 0===t||t.stop(),this.de=[],null===(e=this._n)||void 0===e||e.stop(),this._n=void 0,this.le=!1;try{var n;null===(n=this.ae)||void 0===n||n.call(this)}catch(t){Sr.warn("could not stop rrweb",t)}this.ae=void 0}Hn(){if(!this.Bn||0===this.$e)return!1;if(this.De)return!0;this.De=!0,this.Un=void 0;const t=this.Le;return this.qn(),this.jn(),this.Bn.catch(()=>{}).then(()=>{t===this.Le&&(this.De=!1,this.tn(),this.en(),this.Wn(),this.Nn(),Sr.info("stopped"))}).catch(()=>{this.De=!1,this.Wn(),this.Nn(),Sr.info("stopped")}),!0}stop(){if(this.jn(),this.We)this.Xe();else if(this.Hn())return;this.tn(),this.en(),this.Wn(),this.Nn(),Sr.info("stopped")}Wn(){this.Ke(void 0,{preserveLogDedup:this.We}),this.be=!1}flushBeforeIdentityReset(){(this.isStarted||this.De)&&(this.Xe(),this.tn())}Ue(t){this.We=!0,this.ue=Date.now();try{var e,n;this.stop(),this.Gn=void 0,this.ge=0,this.ve=0,this.pe=0,this.me=0,null===(e=Cr())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.We=!1}this.Ke(t?"no_interaction_since_session_rotated":void 0),this.be=!1}Ke(t,{preserveLogDedup:e=!1}={}){if(this.ye=!G(t),this.Un=t,G(t))return void(e||(this.Vn=void 0));if(this.We)return;const n=`${this.sessionId}:${t}`;n!==this.Vn&&(this.Vn=n,Sr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Rn(){this.isStarted||(this.ke=!0),this.ye&&(this.Ke(void 0),this.be=!1,this.we&&(this.we=!1,this.Bt()),this.Qn())}discard({discardProducerEvents:t=!1}={}){this.ye=!0,t&&(this.en(),this.jn()),this.en(),this.Nn(),this.en(),this.Wn(),Sr.info("discarded")}Zn(t,e,n,i,r){if(-1===n)return this.ge+=1,void Sr.warn("could not stringify event - dropping it to keep the rest of the recording");const o={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Jn(t,i),this.Yn(o)):this.en()}Kn(){try{this.Xn()}catch(t){this.xe||(this.xe=!0,Sr.error("could not track full snapshot cost",t))}}Xn(){var t,e;const n=null===(t=Cr())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Gn&&(this.Gn=n,500>n.durationMs||Sr.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Jn(t,e){2!==t.type?3===t.type&&(G(this.Ae)||this.Ae===e||this.Re===e||(this.Re=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Ae=e}ti(t){t.counted&&t.generation===this.Le&&(this.$e=Math.max(0,this.$e-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ei(t,e,n){t.processed||t.generation!==this.Le||(t.processed=!0,this.Zn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ni(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=zr(t.event))}catch(t){Sr.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=En(t.event));try{this.ei(t,n,e)}catch(t){Sr.warn("could not capture queued compression event",t)}}finally{this.ti(t)}}Xe(){[...this.Oe].forEach(t=>{try{this.ni(t)}catch(t){Sr.warn("could not drain queued compression event",t)}})}ii(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Le,processed:!1,counted:!0};this.Oe.push(o),this.$e+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Nr(t)?yield function(t){return Hr.apply(this,arguments)}(t):zr(t):{event:t,size:En(t)};n=r.event,i=r.size}catch(e){Sr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=En(t)}r.ei(o,n,i)}finally{r.ti(o)}}),function(){return a.apply(this,arguments)});var a;this.Bn=this.Bn?this.Bn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h;if(!this._instance.sessionManager)return;if(this.Tn(),!e||!W(e))return;if(4===e.type){const t=this.gn(e.data.href);if(this.Cn=t,!t)return;e.data.href=t}else this.xn();if(null===(n=this.oe)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.On(),(t,e)=>this.$n(t,e)),this.tt.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.Kn(),Promise.resolve().then(()=>this.Kn()),this.Mn(),null===(d=this.zn)||void 0===d||d.reset(),null===(h=this._instance.persistence)||void 0===h||h.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const f=2===e.type&&(null===(i=this.oe)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ri();const v=this.zn?this.zn.throttleMutations(e):e;if(!v)return void(!0===this.he&&this.fe++);const p=function(t){const e=t;if(e&&W(e)&&6===e.type&&W(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(v),m=function(t){return Gr(t)?t.data.payload:null}(p),g=function(t){return Vr(t)?t.data.payload:null}(p),y=function(t){return Wr(t)?t.data.payload:null}(p);m||g?(null==m?void 0:m.lastActivityTimestamp)&&(p.timestamp=m.lastActivityTimestamp):(null==y?void 0:y.sessionId)||this.oi(p);const b=null!==(r=null!==(o=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==o?o:null==y?void 0:y.sessionId)&&void 0!==r?r:this.Xt,w=null!==(a=null!==(l=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==g?void 0:g.nextWindowId)&&void 0!==l?l:null==y?void 0:y.windowId)&&void 0!==a?a:this.Be;if(!0===this.he&&!function(t){return Wr(t)||Gr(t)||Vr(t)}(p))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(p)&&this.fe++);2===p.type&&(this.fe=0),y&&(p.timestamp=y.lastActivityTimestamp+y.threshold);const k=this.le;this.le=!0,f?this.Sn(!0):k||this.Sn();const S=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===p.type&&"$json_ld"===p.data.tag){let e;try{e=t?this.gn(t.location.href):void 0}catch(t){}p.data.href=e}if(this.$e>0||S&&Nr(p))return void this.ii(p,S,b,w);const{event:_,size:x}=S?zr(p):{event:p,size:En(p)};this.Zn(p,_,x,b,w)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this.Se,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):an}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.Rn(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.Rn(),this.jt("sampling_overridden")}overrideTrigger(t){this.$n(t),this.Rn()}si(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.gn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}qn(){this.ai&&(clearTimeout(this.ai),this.ai=void 0)}Qn(){this.ai||(this.ai=setTimeout(()=>{this.tn()},2e3))}li(){return this.Ae!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Gr(t)&&!Vr(t))}ui(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}ci(t){if("buffering"!==t)return G(this.di)||this._instance.register_for_session({[k]:[]}),void(this.di=void 0);const e=this.ui();if(0===e.length)return G(this.di)||this._instance.register_for_session({[k]:[]}),void(this.di=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.di&&(this.di=i,this._instance.register_for_session({[k]:e}),Sr.info(`buffering: ${n}`))}hi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.fi)&&xi.Ot()}pi(){0!==this.Rt.data.length&&this.Rt.size!==this.mi&&943718.4>=this.Rt.size&&this.hi()&&(this.mi=this.Rt.size,xi.$t(this.ln,this.Rt))}Pn(){if(this.Ee||!this.hi())return;this.Ee=!0;const t=xi.Ft(this.ln);xi.Dt(this.ln),W(t)&&H(t.data)&&0!==t.data.length&&H(t.sizes)&&t.sizes.length===t.data.length&&Y(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Be&&(this.Rt.data.length>0||(this.Rt=t))}tn(t=!1){var e;if(this.qn(),this.ye)return this.Rt;if(this.li())return this.Rt.size>943718.4?this.en():(t&&this.pi(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Qe(),r=this.status;if(this.ci(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.pi(),this.Qn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.si();$n(n).forEach(e=>{try{var n;null===(n=this.ze)||void 0===n||n.trackSize(e.sessionId,e.size),this.gi(L(L(L(L({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ci.LIB_NAME,$lib_version:Ci.LIB_VERSION,$snapshot_host:t},this.ve>0?{$sdk_debug_replay_throttled_mutations_dropped:this.ve}:{}),this.pe>0?{$sdk_debug_replay_oversized_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ge}:{}))}catch(t){Sr.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.mi)||(xi.Dt(this.ln),this.mi=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.en()}Yn(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.he&&!this.ye&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.tn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.en()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ye&&(this.we||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.we=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.he||this.ye||this.Qn())}gi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ze(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}ri(){if(!this.Rt||0===this.Rt.data.length)return this.en();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.en():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}en(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Be},this.Rt}jt(t,e){this._instance.register_for_session({[I]:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",L({reason:t},e))}yi(t){var e;return 3===t.type&&-1!==_r.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}oi(t){const e=this.yi(t);e||!0===this.he||t.timestamp-this.ue>this.ee&&(this.he=!0,clearInterval(this.An),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Be}),this.tn());const{windowId:n,sessionId:i}=this.te.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.ue=t.timestamp,this.he)){const e="unknown"===this.he;this.he=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.Be!==n;if(this.Be=n,this.Xt=i,o||s){const t=o&&!1!==this.he;t&&(this.he="unknown"),this.Ue(t)}else if(e&&this.Rn(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.oe)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.fe>0&&t&&this.Bt(),this.Sn(),this.Mn()}}He(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Un,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.ze)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this.Se,[C]:this.bi,[T]:this._e}}get bi(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Tr())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}Fn(){var e;if(this.ae)return;this._e=!0;const i={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=L({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};G(t.mousemove)||(n.mousemove=t.mousemove),G(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=L(L({},i.slimDOMOptions),{},{script:!0})),this.hn&&this.hn.enabled&&(i.recordCanvas=!0,i.sampling=L(L({},i.sampling),{},{canvas:this.hn.fps}),i.dataURLOptions={type:"image/webp",quality:this.hn.quality},i.canvasResolutionScale=this.dn,i.canvasMasking={configured:()=>{var t;return U(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(U(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.un&&(i.maskAllInputs=null===(o=this.un.maskAllInputs)||void 0===o||o,i.maskTextSelector=null!==(s=this.un.maskTextSelector)&&void 0!==s?s:void 0,i.blockSelector=null!==(a=this.un.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.un.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.Te||(this.Te=!0,Sr.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.cn();const u=Tr();if(!u)return void Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.zn=null!==(e=this.zn)&&void 0!==e?e:new vi(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Sr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.pe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.pe+=1,this.me+=t},requestFullSnapshot:()=>this.Bt()});const c=this.pn();if(this.ae=u(L(L({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Me||(this.Me=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i),{},{recordAfter:"DOMContentLoaded"})),!this.ae)return this.Se=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Se=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this._n&&(this._n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Yi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?tr:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!br(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!o||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return br(t,e.blockClass,e.blockSelector)||br(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=tr,n){if(!t||t.length>Yi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=H(i)?i.map(t=>mr(t,e,r)):mr(i,e,r);if(r.exceeded||Z(o)||H(o)&&(!o.length||o.some(Z)))return null;const s=JSON.stringify(o);return s.length>2e4?null:[o,s]}catch(t){return null}}(e.text,s,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(Z(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>o)return void(o=0);n.emit(u)&&(i.set(e,c),o-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!o||!1===r())return;const e=t=>{for(const e of wr(t))a(e)};for(const n of t)if("childList"===n.type)gr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&gr(t)&&a(t)}else"attributes"===n.type&&gr(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){o&&!1!==r()&&wr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.gn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.wn()},emit:t=>this.kn(t)}),this.tt.isCurrentUrlBlocked()&&this._n.scan()),this.ue=Date.now(),this.he=K(this.he)?this.he:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const Zr=["type"];var Jr=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),Yr=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Kr=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),Xr=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),to=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),eo=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),no=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function io(t,e){return-1!==t.indexOf(e)}Date,Date;var ro={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},oo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},so={};function ao(t){if(so[t])return so[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in ro?ro[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in oo?oo[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&s)return so[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(io(u=navigator.userAgent,"AppleWebKit")&&!io(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),so[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var lo=Object.create(null);function uo(t,e,n){var i;const r=lo[t],o=r[n];if(o)return o.call(e);const s=ao(t),a=null===(i=Object.getOwnPropertyDescriptor(s,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}lo.Node=Object.create(null),lo.ShadowRoot=Object.create(null),lo.MutationObserver=Object.create(null),lo.Element=Object.create(null);var co,ho={};function fo(t,e,n){const i=`${t}.${String(n)}`;if(ho[i])return ho[i].bind(e);const r=ao(t)[n];return"function"!=typeof r?e[n]:(ho[i]=r,r.bind(e))}function vo(){return ao("MutationObserver").constructor}function po(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},o=n(function(...t){return r.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],s=n(i);for(;s;){if(s.next===o)return void(s.next=r.next);i=s.next,s=n(i)}}}catch(t){return()=>{}}}var mo={childNodes:t=>uo("Node",t,"childNodes"),parentNode:t=>uo("Node",t,"parentNode"),parentElement:t=>uo("Node",t,"parentElement"),textContent:t=>uo("Node",t,"textContent"),previousSibling:t=>uo("Node",t,"previousSibling"),nextSibling:t=>uo("Node",t,"nextSibling"),lastChild:t=>uo("Node",t,"lastChild"),isConnected(t){if(void 0===co){var e;const t=null===(e=Object.getOwnPropertyDescriptor(ao("Node"),"isConnected"))||void 0===e?void 0:e.get;co=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==co?void 0:co.call(t)},contains:(t,e)=>fo("Node",t,"contains")(e),getRootNode:t=>fo("Node",t,"getRootNode")(),host:t=>t&&"host"in t?uo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?uo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>fo("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>fo("Element",t,"querySelectorAll")(e),mutationObserver:vo,patch:po};function go(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var yo=0;function bo(){yo+=1}function wo(){return yo}function ko(t,e){return(e!==yo||t>6e4)&&!0}var So=0,_o=0,xo=0,Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Io=null,Mo=[],Ao=0,Ro=0,Eo={slowestBatchMs:0},Oo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function $o(t){(So+=1)>1||(Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Mo=[],Ao=0,Io=(t=>t&&t>0?t:null)(t),_o=go(),xo=yo)}function Lo(){return 0===So?To||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(So-=1)>0?Co:(Co.durationMs=go()-_o,Co.deferredStylesheetCount=Ao,Oo.deferredCount+=Ao,Io=null,ko(Co.durationMs,xo)?Co:To=Co)}function Do(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const o=t[r];try{const t=o.cssRules;if(t&&t.length)i+=Do(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=Do(r,e,n+1))}}}catch(t){}}return i}function Po(t){if(0===So)return;const e=Do(t,null,0);Co.cssRuleCount+=e,Ro>0&&(Co.nonDeferrableCssRuleCount+=e)}function Fo(t){Ro+=1;try{return t()}finally{Ro-=1}}function No(t){So>0&&(Co.stylesheetMs+=t)}function qo(t){if(0===So||null===Io)return!1;const e=Co.cssRuleCount-Co.nonDeferrableCssRuleCount;return e>=Io||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Do(e,n,0)}catch(t){return 0}}(t)>Io}function jo(){const t=Mo;return Mo=[],t}function Bo(){Oo.failedCount+=1}function zo(t){t>0&&(Oo.abandonedCount+=t)}function Ho(t){return Ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ho(t)}function Uo(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ho(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ho(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wo(t){return t.nodeType===t.ELEMENT_NODE}function Go(t){const e=t&&"host"in t&&"mode"in t&&mo.host(t)||null;return Boolean(e&&"shadowRoot"in e&&mo.shadowRoot(e)===t)}function Vo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Qo(t){return t.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}function Zo(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var Jo=0;function Yo(t){const e=0===Jo,n=e?go():0;Jo+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Po(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Qo(Array.from(e,t=>Ko(t,n)).join(""))}catch(t){return null}finally{Jo-=1,e&&No(go()-n)}}function Ko(t,e){if(ts(t)){let e;try{e=Yo(t.styleSheet)||Zo(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ms(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return es(t)&&t.selectorText.includes(":")&&(n=Xo(n)),e?ms(n,e):n}}function Xo(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ts(t){return"styleSheet"in t}function es(t){return"selectorText"in t}var ns=/^-?[A-Za-z_][\w-]*$/,is=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function rs(t){const e=[];let n=!1,i=null;const r=new Map;function o(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);s(e[e.length-1],r.importRule,t)}function s(t,e,n){try{let r;try{r=n||Zo(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ms(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&ts(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const i=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(es(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ns.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ns.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":is.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?ms(i,r):i,fixColons:"sheet"===n.kind&&es(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&es(n)&&n.selectorText.includes(":")&&(i=Xo(i)),t.parts.push(t.sheetHref?ms(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Po(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!ts(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;Po(t);let o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);const s=Array.from(t);r.set(e,{sheet:i,rules:s,sheetHref:o}),n.push({sheet:i,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=go();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?Xo(n):n}else e=Qo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{No(go()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var os=class{constructor(){Uo(this,"idNodeMap",new Map),Uo(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),Wo(t)){const e=mo.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ss({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&as(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function as(t){return t.toLowerCase()}var ls=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function us({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&ls.has(as(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var cs="__rrweb_original__";function ds(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?as(e):null}catch(t){return null}}var hs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,fs=/^(?:[a-z+]+:)?\/\//i,vs=/^www\..*/i,ps=/^(data:)([^,]*),(.*)/i;function ms(t,e){return(t||"").replace(hs,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(fs.test(a)||vs.test(a))return`url(${l}${a}${l})`;if(ps.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),d=e.split("#")[0].split("/"),h=u.split("/");d.pop();for(const t of h)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${c}${l})`})}var gs,ys,bs=new Map,ws=1,ks=new RegExp("[^a-z0-9-_:]");function Ss(){return ws++}var _s=!1,xs=/^[^ \t\n\r\u000c]+/,Cs=/^[, \t\n\r\u000c]+/,Ts=new WeakMap;function Is(t,e){return e&&""!==e.trim()?Ms(t,e):e}function Ms(t,e){let n=Ts.get(t);if(n||(n=t.createElement("a"),Ts.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function As(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Rs(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=Is(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=bs.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const o=r.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>s.length?s:e;if(bs.size>=10){const t=bs.keys().next().value;void 0!==t&&bs.delete(t)}return bs.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),As(t,o)}if("image"===e)return As(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Is(t,i);return"image"===e&&n.startsWith("data:")?As(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Cs),e.length>n;){let o=i(xs);if(","===o.slice(-1))o=Is(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Is(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((o+i).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,r.push((o+i).trim());break}"("===t&&(s=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?ms(i,Ms(t)):"object"===e&&"data"===n?Is(t,i):i:Is(t,i)}function Es(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===as(e)}function Os(t){return"string"==typeof t&&as(t).split(/\s+/).includes("stylesheet")}function $s(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&$s(mo.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&$s(mo.parentNode(t),e,n)}function Ls(t,e,n,i){let r;if(Wo(t)){if(r=t,!mo.childNodes(r).length)return!1}else{if(null===mo.parentElement(t))return!1;r=mo.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if($s(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function Ds(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ps=new Map;function Fs(t={}){Ps.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),Ps.delete(n))})}function Ns(t){try{return t.sheet}catch(t){return null}}function qs(t,e,n,i,r){const o=new AbortController,s=()=>{var e;(null===(e=Ps.get(t))||void 0===e?void 0:e.controller)===o&&Ps.delete(t),o.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{s()}}};t.addEventListener("load",l,{signal:o.signal,once:!0}),t.addEventListener("error",s,{signal:o.signal,once:!0});const u=Date.now()+6e4;let c;const d=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?d(e+1):s():s()},r)};o.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),d(0),Ps.set(t,{controller:o,changedLinkBaseline:r})}var js=[100,200,400,800,1600,3200,6400,12800,25600];function Bs(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function zs(t){return null==t?"":t.toLowerCase()}var Hs=!1,Us=!1;function Ws(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S=5e3,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:I=!1,depth:M=0,maxDepth:A=50}=e;let{needsMask:R}=e,{preserveWhiteSpace:E=!0}=e;if(M>=A)return Us=!0,Hs||(Hs=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${A}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;R||(R=Ls(t,s,a,void 0===R)),So>0&&(Co.nodeCount+=1);const O=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:no.Document,childNodes:[],compatMode:t.compatMode}:{type:no.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:no.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=as(t.tagName);return ks.test(e)?"div":e}(t),b=new Set;let w={};const k=t.attributes.length;for(let e=0;k>e;e++){const i=t.attributes[e];Es(y,i.name)||(w[i.name]=Rs(n,y,as(i.name),i.value,t,c))}if("link"===y&&"string"==typeof w.href){var S;const e=null===(S=Ns(t))||void 0===S?void 0:S.href;e&&(w.href=e)}if("link"===y&&o&&!g&&Os(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=Bs(n,i),!e&&i.includes(".css"))&&(e=Bs(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(qo(e)?So>0&&(Mo.push(t),Ao+=1):i=Yo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||mo.textContent(t)||"").trim().length){const e=Fo(()=>Yo(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=ss({element:t,type:ds(t),tagName:y,value:e,maskInputOptions:s,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!s.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&h&&!(null==f?void 0:f()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,o=cs in r?r[cs]:r;let s;try{s=o.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(_=t)?void 0:_.name)?_s||(_s=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",_)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",_)}let x,C=!1;if("img"===y&&d){gs||(gs=n.createElement("canvas"),ys=gs.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>C?us({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Ds(e,"load",s);try{gs.width=e.naturalWidth,gs.height=e.naturalHeight,ys.drawImage(e,0,0);const t=gs.toDataURL(c.type,c.quality);w.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.add("rr_mediaState"),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}if(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var T,I,M;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(T=n.defaultView)||void 0===T?void 0:T.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),s&&(w.rr_position=s.position||"static",b.add("rr_position"),s.transform&&"none"!==s.transform&&(w.rr_transform=s.transform,b.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(w.rr_display=s.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=us({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));C=!0;try{customElements.get(y)&&(x=!0)}catch(t){}return{type:no.Element,tagName:y,attributes:w,childNodes:[],isSVG:(A=t,Boolean("svg"===A.tagName||A.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:x};var A}(t,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=mo.parentNode(t),s=o&&o.tagName;let a=mo.textContent(t);const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(qo(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Yo(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=ms(a,Ms(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,mo.parentElement(t)):a.replace(/[\S]/g,"*")),{type:no.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:no.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:no.Comment,textContent:mo.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:T,newlyAddedElement:I});if(!O)return console.warn(t,"not serialized"),null;let L;L=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===no.Comment)return!0;if(t.type===no.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(zs(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===zs(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(zs(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&zs(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(zs(t.attributes.property).match(/^(og|twitter|fb):/)||zs(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===zs(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(zs(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(zs(t.attributes.name))||zs(t.attributes.property).match(/^article:/)||zs(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(zs(t.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===no.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ss();const D=Object.assign(O,{id:L});if(i.add(t,D),-2===L)return null;w&&w(t);let P=!l;if(D.type===no.Element){P=P&&!D.needBlock,delete D.needBlock;const e=mo.shadowRoot(t);e&&Vo(e)&&(D.isShadowHost=!0)}if((D.type===no.Document||D.type===no.Element)&&P){p.headWhitespace&&D.type===no.Element&&"head"===D.tagName&&(E=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M+1,maxDepth:A};if(D.type===no.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(mo.childNodes(t))){const t=Ws(n,e);t&&D.childNodes.push(t)}let I=null;if(Wo(t)&&(I=mo.shadowRoot(t)))for(const t of Array.from(mo.childNodes(I))){const n=Ws(t,e);n&&(Vo(I)&&(n.isShadow=!0),D.childNodes.push(n))}}const F=mo.parentNode(t);if(F&&Go(F)&&Vo(F)&&(D.isShadow=!0),D.type===no.Element&&"iframe"===D.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let o;try{o=r.document.readyState}catch(t){return i}const s=()=>e();if("complete"!==o){let i=!1,r=null;const o=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),Ds(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return r=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?Ds(t,"load",s):(i=!0,Ds(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),Ds(t,"load",s)}}return t.addEventListener("load",s),()=>{Ds(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=Ws(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M+1,maxDepth:A});n&&k(t,n)}},S);null==_||_(t,e)}var N,q,j;return D.type===no.Element&&"link"===D.tagName&&Os(D.attributes.rel)&&(q=()=>{if(x){const e=i.getMeta(t),l=Ws(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M,maxDepth:A});l&&x(t,l,e)}},j=C,Ps.has(N=t)||Ns(N)||qs(N,q,()=>Boolean(Ns(N)),[j])),D}function Gs(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var Vs=class t{constructor(...t){Uo(this,"parentElement",null),Uo(this,"parentNode",null),Uo(this,"ownerDocument",void 0),Uo(this,"firstChild",null),Uo(this,"lastChild",null),Uo(this,"previousSibling",null),Uo(this,"nextSibling",null),Uo(this,"ELEMENT_NODE",1),Uo(this,"TEXT_NODE",3),Uo(this,"nodeType",void 0),Uo(this,"nodeName",void 0),Uo(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Qs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Zs(n,t,e,i)}function Zs(t,e,n,i){Js(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Js(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Ys(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Ks="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.",Xs={map:{},getId(){return console.warn(Ks),-1},getNode(){return console.warn(Ks),null},removeNodeFromMap(){console.warn(Ks)},has(){return console.warn(Ks),!1},reset(){console.warn(Ks)}};function ta(t,e,n={}){let i=null,r=0;return function(...o){const s=Date.now();r||!1!==n.leading||(r=s);const a=e-(s-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=s,t.apply(l,o)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,o)},a))}}function ea(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>ea(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=function(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),o=r?t[r]:void 0;"function"==typeof o&&(e=o)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),s}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xs=new Proxy(Xs,{get(t,e,n){return"map"===e&&console.warn(Ks),Reflect.get(t,e,n)}}));var na=Date.now;function ia(t){var e,n,i,r;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=mo.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=mo.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollTop)||0}}function ra(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function sa(t){return t?t.nodeType===t.ELEMENT_NODE?t:mo.parentElement(t):null}function aa(t,e,n,i){if(!t)return!1;const r=sa(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if($s(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function la(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),aa(t,i||e,n,!0))return!0;const r="getRootNode"in t?mo.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?mo.host(r):null}return!1}function ua(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ca(t,e){if(Go(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=mo.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ca(i,e))}function da(t){return Boolean(t.changedTouches)}function ha(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function fa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function va(t){return!!t&&(t instanceof Vs&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(mo.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(na=()=>(new Date).getTime());var pa=class{constructor(){Uo(this,"id",1),Uo(this,"styleIDMap",new WeakMap),Uo(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ma(t){var e;let n=null;return"getRootNode"in t&&(null===(e=mo.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&mo.host(mo.getRootNode(t))&&(n=mo.host(mo.getRootNode(t))),n}function ga(t){const e=t.ownerDocument;if(!e)return!1;if(mo.contains(e,t))return!0;const n=mo.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=ma(n);)n=e;return n}(t);return mo.contains(e,n)}(t)}var ya,ba=(t,e)=>`${t}@${e}`,wa=class{constructor(){Uo(this,"frozen",!1),Uo(this,"locked",!1),Uo(this,"takePendingRecords",void 0),Uo(this,"texts",[]),Uo(this,"attributes",[]),Uo(this,"attributeMap",new WeakMap),Uo(this,"generatedAttributes",new WeakMap),Uo(this,"removes",[]),Uo(this,"mapRemoves",new Set),Uo(this,"movedMap",{}),Uo(this,"addedSet",new Set),Uo(this,"movedSet",new Set),Uo(this,"droppedSet",new Set),Uo(this,"removesSubTreeCache",new Set),Uo(this,"mutationCb",void 0),Uo(this,"blockClass",void 0),Uo(this,"blockSelector",void 0),Uo(this,"maskTextClass",void 0),Uo(this,"maskTextSelector",void 0),Uo(this,"inlineStylesheet",void 0),Uo(this,"maskInputOptions",void 0),Uo(this,"maskTextFn",void 0),Uo(this,"maskInputFn",void 0),Uo(this,"maskAllElementAttributes",void 0),Uo(this,"maskAttributeFn",void 0),Uo(this,"keepIframeSrcFn",void 0),Uo(this,"recordCanvas",void 0),Uo(this,"canvasMaskingConfigured",void 0),Uo(this,"inlineImages",void 0),Uo(this,"slimDOMOptions",void 0),Uo(this,"dataURLOptions",void 0),Uo(this,"doc",void 0),Uo(this,"mirror",void 0),Uo(this,"iframeManager",void 0),Uo(this,"stylesheetManager",void 0),Uo(this,"shadowDomManager",void 0),Uo(this,"canvasManager",void 0),Uo(this,"processedNodeManager",void 0),Uo(this,"unattachedDoc",void 0),Uo(this,"canvasManagerReleased",!1),Uo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Uo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=go(),e=wo();try{this.processBufferedMutations()}finally{n=go()-t,i=e,So>0||ko(n,null!=i?i:yo)||n>Eo.slowestBatchMs&&(Eo.slowestBatchMs=n)}var n,i}),Uo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=t=>{let e=t,n=-2;for(;-2===n;)e=e&&mo.nextSibling(e),n=e&&this.mirror.getId(e);return n};let i;const r=r=>{var o;const s=mo.parentNode(r);if(!s||!ga(r)||"TEXTAREA"===s.tagName)return!0;if(this.isBlockedAtEmission(s))return!0;const a=Go(s)?this.mirror.getId(ma(r)):this.mirror.getId(s),l=n(r);if(-1===a||-1===l)return!1;null!==(o=i)&&void 0!==o||(i=this.buildSerializationOptions());const u=Ws(r,i);return u&&(t.push({parentId:a,nextId:l,node:u}),e.add(u.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Sa(this.removesSubTreeCache,t)&&!this.movedSet.has(mo.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=_a(this.droppedSet,t),n=Sa(this.removesSubTreeCache,t),i=this.movedSet.has(t)||_a(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const o=new Set;let s=null;const a=this.addedSet.values();let l=a.next();for(;this.addedSet.size;){let t=null;if(null!==s)for(t=mo.previousSibling(s);t&&-2===this.mirror.getId(t);)t=mo.previousSibling(t);if(t&&this.addedSet.has(t))s=t;else{for(this.addedSet.has(l.value)||(l=a.next()),s=l.value;;){const t=mo.parentNode(s),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?mo.host(t):t;if(!e||!this.addedSet.has(e))break;s=e}const t=mo.parentNode(s);if(t&&this.addedSet.has(mo.lastChild(t)))s=mo.lastChild(t);else if(t)for(;;){let t=mo.nextSibling(s);for(;t&&-2===this.mirror.getId(t);)t=mo.nextSibling(t);if(!t||!this.addedSet.has(t))break;s=t}}this.addedSet.delete(s);const e=mo.parentNode(s),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?mo.host(e):e;n&&o.has(n)?o.add(s):r(s)||o.add(s)}o.size>0&&console.warn(`[rrweb] dropped ${o.size} node(s) with unresolved parent at emit`);const u={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=mo.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=us({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t},c=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of u.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===as(n.nodeName)&&Os(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&c.push(n)}if(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},u.texts.length||u.attributes.length||u.removes.length||u.adds.length){this.mutationCb(u);for(const t of c)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:Ws(t,L(L({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}}),Uo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Uo(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(mo.childNodes(t),t=>mo.textContent(t)||"").join("");e.attributes.value=ss({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ds(t),value:n,maskInputFn:this.maskInputFn})}),Uo(this,"processMutation",t=>{if(!ua(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=mo.textContent(t.target);aa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ls(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,sa(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=as(i.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(i,o,s),l=s?i.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=i,e=ds(t);l=ss({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(aa(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Es(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Rs(this.doc,r,as(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{ga(t)||this.shadowDomManager.removeShadowRootsIn(t)}),aa(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=Go(t.target)?this.mirror.getId(mo.host(t.target)):this.mirror.getId(t.target);aa(t.target,this.blockClass,this.blockSelector,!1)||ua(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ka(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ca(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ba(n,i)]?ka(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Go(t.target)||!Vo(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),mo.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Uo(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ua(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[ba(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!aa(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=mo.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(va(t)){const e=mo.childNodes(mo.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){return la(t,this.blockClass,this.blockSelector)}recordReinsertion(t){var e;const n=mo.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ha(t,this.mirror)&&this.iframeManager.addIframe(t),fa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),va(t)&&!aa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(mo.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function ka(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=mo.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function Sa(t,e,n){return 0!==t.size&&function(t,e){const n=mo.parentNode(e);return!!n&&t.has(n)}(t,e)}function _a(t,e){if(0===t.size)return!1;let n=mo.parentNode(e);for(;n;){if(t.has(n))return!0;n=mo.parentNode(n)}return!1}function xa(t){ya=t}function Ca(){ya=void 0}var Ta=(t,e="rrweb")=>ya?(...n)=>{try{return t(...n)}catch(t){if(ya&&!0===ya(t,e))return;throw t}}:t,Ia=[];function Ma(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Aa(t,e){const n=new wa;let i;n.init(t);try{i=new(vo())(Ta(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),Ia.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ra({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=Ma(o);if(!a||aa(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ia(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=[Qs("scroll",Ta(ta(Ta(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Qs("scrollend",Ta(a),e)),()=>l.forEach(t=>t())}function Ea(t,e){for(let n=Ia.length-1;n>=0;n--){const i=Ia[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ia.splice(n,1))}}var Oa=["INPUT","TEXTAREA","SELECT"],$a=new WeakMap;function La(t){return function t(e,n){if(qa("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qa("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qa("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qa("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function Da(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Pa({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:mo.host(n));const s="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ta(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Fa=new Set;function Na(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],s=Ta(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ia.indexOf(r);-1!==t&&Ia.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Ys(o)}}),a=(t,e)=>{const n=Ta(()=>{try{return e()}catch(e){throw Fa.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Aa(t,t.doc);i=e.observer,r=e.buffer}),a("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const l=ta(Ta(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Ta(ta(Ta(t=>{const e=Ma(t),{clientX:n,clientY:r}=da(t)?t.changedTouches[0]:t;s||(s=na()),a.push({x:n,y:r,id:i.getId(e),timeOffset:na()-s}),l("drag"===t.type?Yr.Drag:"touchmove"===t.type?Yr.TouchMove:Yr.MouseMove)}),r,{trailing:!1})),c=[Qs("mousemove",u,n),Qs("touchmove",u,n),Qs("drag",u,n)];return Ta(()=>{c.forEach(t=>t())})}(t)),a("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Kr).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=as(o);const u=(e=>o=>{const s=Ma(o);if(aa(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Xr.Mouse;break;case"touch":a=Xr.Touch;break;case"pen":a=Xr.Pen}a===Xr.Touch&&(Kr[e]===Kr.MouseDown?u="TouchStart":Kr[e]===Kr.MouseUp&&(u="TouchEnd"))}else da(o)&&(a=Xr.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===Xr.Touch||u.startsWith("Mouse")&&a===Xr.Mouse)&&(a=null)):Kr[e]===Kr.Click&&(a=l,l=null);const c=da(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Ta(t)(L({type:Kr[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(Kr[o]){case Kr.MouseDown:case Kr.MouseUp:s=s.replace("mouse","pointer");break;case Kr.TouchStart:case Kr.TouchEnd:return}a.push(Qs(s,u,e))}),Ta(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ra(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Qs("resize",Ta(ta(Ta(()=>{const e=ra(),r=oa();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),a("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(t){let n=Ma(t);const u=t.isTrusted,d=e.defaultView;if(n&&d&&!(n instanceof d.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=mo.parentElement(n)),!n||!f||0>Oa.indexOf(f)||aa(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=ds(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=ss({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),h(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;h(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function h(e,i){const r=$a.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){$a.set(e,i);const r=n.getId(e);Ta(t)(L(L({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Qs(t,Ta(d),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>ea(t[0],t[1],{set(){Ta(d)({target:this,isTrusted:!1})}},!1,v))),Ta(()=>{Ys(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Ta(o=>ta(Ta(r=>{const s=Ma(r);if(!s||aa(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:i.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),r.media||500)),a=[Qs("play",s(eo.Play),o),Qs("pause",s(eo.Pause),o),Qs("seeked",s(eo.Seeked),o),Qs("volumechange",s(eo.VolumeChange),o),Qs("ratechange",s(eo.RateChange),o)];return Ta(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},o=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),o(t)):r(n)},queuePendingMutation(s,a,l){if(!i)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const v=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(v,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&r(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),a("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const o=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);try{const i=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof i)return l;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Da(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=r.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=Yo(o);null!==e&&t({id:s,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};ja("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(ja("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),ja("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),ja("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,o])=>{c[i]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Da(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...La(o),l];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Da(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...La(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ta(()=>{i.CSSStyleSheet.prototype.insertRule=o,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),a("adoptedStyleSheet",()=>Pa(t,t.doc)),a("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:o}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ta((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=Da(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=La(s.parentRule);o.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ta((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(d);const{id:h,styleId:f}=Da(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=La(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ta(()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&a("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const i=new o(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const s=po(e.fonts,"add",function(e){return function(n){return setTimeout(Ta(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=o}),i.push(s),Ta(()=>{i.forEach(t=>t())})}(t))}a("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=t;let s=!0;const a=Ta(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);aa(o,i,r,!0)||aa(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Qs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?po(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)a(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{s()}catch(t){}throw t}return s}function qa(t){return void 0!==window[t]}function ja(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function Ba(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var za=class{constructor(t){Uo(this,"generateIdFn",void 0),Uo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Uo(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t);let s=r.get(e);return void 0===s&&(s=this.generateIdFn(),r.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Ha=class{constructor(t){Uo(this,"iframes",new WeakMap),Uo(this,"crossOriginIframeMap",new WeakMap),Uo(this,"crossOriginIframeMirror",new za(Ss)),Uo(this,"crossOriginIframeStyleMirror",void 0),Uo(this,"crossOriginIframeRootIdMap",new WeakMap),Uo(this,"mirror",void 0),Uo(this,"mutationCb",void 0),Uo(this,"wrappedEmit",void 0),Uo(this,"loadListener",void 0),Uo(this,"pageHideListener",void 0),Uo(this,"stylesheetManager",void 0),Uo(this,"recordCrossOriginIframes",void 0),Uo(this,"messageHandler",void 0),Uo(this,"nestedIframeListeners",new Map),Uo(this,"attachedWindows",new WeakMap),Uo(this,"attachedDocuments",new WeakMap),Uo(this,"attachedIframes",new Map),Uo(this,"loadListenerDisposers",new WeakMap),Uo(this,"iframeElementsById",new Map),Uo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new za(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Js(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Zs(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Js(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Js(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case Jr.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Jr.IncrementalSnapshot,data:{source:Yr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Jr.Meta:case Jr.Load:case Jr.DomContentLoaded:return!1;case Jr.Plugin:return e;case Jr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Jr.IncrementalSnapshot:switch(e.data.source){case Yr.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Yr.Drag:case Yr.TouchMove:case Yr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Yr.ViewportResize:return!1;case Yr.MediaInteraction:case Yr.MouseInteraction:case Yr.Scroll:case Yr.CanvasMutation:case Yr.Input:return this.replaceIds(e.data,t,["id"]),e;case Yr.StyleSheetRule:case Yr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Yr.Font:return e;case Yr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Yr.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===no.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Zs(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Zs(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Js(()=>this.mirror.removeNodeFromMap(t))}),Js(()=>Ea(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Zs(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Zs(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Ua=class{constructor(t){Uo(this,"shadowDoms",new Map),Uo(this,"mutationCb",void 0),Uo(this,"scrollCb",void 0),Uo(this,"bypassOptions",void 0),Uo(this,"mirror",void 0),Uo(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!Vo(t))return;if(this.shadowDoms.has(t))return;const r=null!==(n=null===(i=mo.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,o={doc:r,handlers:[]};this.shadowDoms.set(t,o);const{observer:s,buffer:a}=Aa(L(L({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=Ia.indexOf(a);-1!==t&&Ia.splice(t,1)}),o.handlers.push(Ra(L(L({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(mo.host(t))),o.handlers.push(Pa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=mo.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),mo.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach(Wa)}observeAttachShadow(t){Js(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:po(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=mo.shadowRoot(this);return o&&ga(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>Wa(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach(Wa))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?Wa(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function Wa(t){try{t()}catch(t){}}var Ga="skip-frame";function Va(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Qa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ja=0;64>Ja;Ja++)Za[Qa.charCodeAt(Ja)]=Ja;var Ya=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Qa[n[e]>>2],r+=Qa[(3&n[e])<<4|n[e+1]>>4],r+=Qa[(15&n[e+1])<<2|n[e+2]>>6],r+=Qa[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Ka=!1,Xa=new Map,tl=(t,e,n)=>{if(!t||!il(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Xa.get(t);return n||(n=new Map,Xa.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function el(t,e,n,i){if(t instanceof Array)return t.map(t=>el(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Ya(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[el(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?Ka||(Ka=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[el(t.data,e,n,i),t.width,t.height]}:il(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:tl(t,e,n)}:t}var nl=(t,e,n,i)=>t.map(t=>el(t,e,n,i)),il=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},rl=["webgl","webgl2"];function ol(t){return"nodeType"in t}function sl(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return po(i.prototype,"configure",function(i){return function(r){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||ol(o)&&aa(o,e,n,!0))return i.call(this,r);ol(o)&&!("__context"in o)&&(o.__context="webgpu");const s=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==s&&r?L(L({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=po(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!aa(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&rl.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});r.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function al(t,e,n,i,r,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=po(t,u,function(t){return function(...a){const l=t.apply(this,a);if(tl(l,o,this),this.canvas&&"tagName"in this.canvas&&!aa(this.canvas,i,r,!0)){let t;try{t=nl(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=ea(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!aa(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var ll='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ul="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ll],{type:"text/javascript;charset=utf-8"});function cl(t){let e;try{if(e=ul&&(self.URL||self.webkitURL).createObjectURL(ul),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ll),{name:null==t?void 0:t.name})}}var dl="A page CSP that omits blob: from worker-src or script-src blocks it";function hl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var fl=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){Uo(this,"pendingCanvasMutations",new Map),Uo(this,"rafStamps",{latestId:0,invokeId:null}),Uo(this,"mirror",void 0),Uo(this,"mutationCb",void 0),Uo(this,"resetObservers",void 0),Uo(this,"frozen",!1),Uo(this,"locked",!1),Uo(this,"rafIdTimestamp",null),Uo(this,"rafIdFlush",null),Uo(this,"refCount",0),Uo(this,"torndown",!1),Uo(this,"resetFrameDedup",null),Uo(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,i,r,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void hl("disabled because this browser does not support OffscreenCanvas");const s="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=sl(e,n,i,!0),l=new Map;let u;try{u=new cl}catch(t){return hl(`disabled because the encode worker did not start. ${dl}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,hl(`stopped because the encode worker failed. ${dl}`,t),cancelAnimationFrame(v),null===(e=u.terminate)||void 0===e||e.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:o}=t.data;this.mutationCb({id:e,type:to["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,o]}],displayWidth:r,displayHeight:o})};let d=!1,h=!1;const f=1e3/t;let v,p=0;const m=t=>{var a;c||(p&&f>t-p||(p=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{aa(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(o*s)),h=Math.max(1,Math.round(a*s)),f=function(t,e,n,i,r,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Ga}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Va))return Ga;const a=n/r,l=i/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,o,a);if("skip-frame"===f)return d||(d=!0,hl("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void l.set(e,!1);const v=yield createImageBitmap(t,1>s?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:v,width:c,height:h,displayWidth:o,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:f},[v])}catch(t){h||(h=!0,hl("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=sl(t,e,n,!1),o=function(t,e,n,i,r){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=po(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return aa(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=nl(s,e,this,r)}catch(t){return}t(this.canvas,{type:to["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=ea(e.CanvasRenderingContext2D.prototype,a,{set(e){aa(this.canvas,n,i,!0)||t(this.canvas,{type:to["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),s=function(t,e,n,i,r){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...al(e.WebGLRenderingContext.prototype,to.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...al(e.WebGL2RenderingContext.prototype,to.WebGL2,t,n,i,e,r)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;o.length>i;i++)e.includes(n=o[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,Zr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function vl(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var pl,ml,gl,yl=class{constructor(t){var e,n,i;Uo(this,"trackedLinkElements",new WeakSet),Uo(this,"pendingDeferredSheets",new Set),Uo(this,"stopped",!1),Uo(this,"changedLinkJobs",new Map),Uo(this,"linksInlinedSinceSnapshot",new WeakSet),Uo(this,"mutationCb",void 0),Uo(this,"adoptedStyleSheetCb",void 0),Uo(this,"maskAllElementAttributes",void 0),Uo(this,"maskAttributeFn",void 0),Uo(this,"blockClass",void 0),Uo(this,"blockSelector",void 0),Uo(this,"styleMirror",new pa),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return la(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:vl({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let o=null,s=null;try{s=t.sheet,s&&(o=rs(s))}catch(t){}var a;if(!o||!s)return Bo(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=o;let u=!1;const c={sheet:s,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let d=!1;return{advance:e=>{if(d)return!0;const i=go(),o=wo();let a=!0;try{if(u)return d=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():Bo(),!0;if(!l.advance(e))return a=!1,!1;d=!0;const i=l.text();if(!t.isConnected)return!0;let o=null;try{o=t.sheet}catch(t){}return o!==s?(Bo(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(Bo(),null===(h=n.onUninlinable)||void 0===h||h.call(n),!0);var h}finally{a&&this.pendingDeferredSheets.delete(c),ko(f=go()-i,null!=(v=o)?v:yo)||(Oo.totalMs+=f,f>Oo.slowestSliceMs&&(Oo.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=Ns(t),i=Ps.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},o=()=>{const e=Ns(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};o()?e():qs(t,e,o,js,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let o=!1;const s=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,vl(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){o=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!s)return;let a=null;const l=()=>{s.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>s.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!s.advance(200)&&(l(),!o||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):Bo(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=Ba(c))};a=Ba(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),zo(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,i={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:L(L({},i),{},{_cssText:us({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=go();try{Fo(()=>{try{const t=e.rules||e.cssRules;t&&Po(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:Ko(t,e.href),index:n}))})})}finally{No(go()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),Fs()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,Fs({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},bl=class{constructor(){Uo(this,"nodeMap",new WeakMap),Uo(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},wl=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var kl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(kl=t.contentWindow)||void 0===kl?void 0:kl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Sl=new os,_l=new Set([Yr.Mutation,Yr.MediaInteraction,Yr.StyleSheetRule,Yr.CanvasMutation,Yr.Font,Yr.Log,Yr.StyleDeclaration,Yr.AdoptedStyleSheet]);function xl(t={}){let e,n=!1,i=!1;const{emit:r,checkoutEveryNms:o,checkoutEveryNth:s,blockClass:a="rr-block",blockSelector:l=null,ignoreClass:u="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,inlineStylesheetBudgetRules:v,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:g,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w=!1,maskAttributeFn:k,hooks:S,packFn:_,sampling:x={},dataURLOptions:C={},canvasResolutionScale:T,canvasMasking:I,mousemoveWait:M,recordDOM:A=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:O=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:D=!1,collectFonts:P=!1,inlineImages:F=!1,plugins:N,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:j=new Set([]),attributeFilter:B,errorHandler:z}=t;xa(z);const H=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},C),U=!E||window.parent===window;let W=!1;if(!U)try{window.parent.document&&(W=!1)}catch(t){W=!0}if(U&&!r)throw new Error("emit function is required");if(!U&&!W)return()=>{};void 0!==M&&void 0===x.mousemove&&(x.mousemove=M),Sl.reset(),Fs();const G=!0===p?{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,hidden:!0}:void 0!==m?m:{password:!0},V=Gs(void 0!==g&&g);let Q;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let Z=0;const J=new Map;let Y,K;const X=t=>{for(const e of N||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!W&&(t=_(t)),t};pl=(t,e)=>{var n;const i=t;if(i.timestamp=na(),!(null===(n=Ia[0])||void 0===n?void 0:n.isFrozen())||i.type===Jr.FullSnapshot||i.type===Jr.IncrementalSnapshot&&_l.has(i.data.source)||Ia.forEach(t=>t.unfreeze()),U)null==r||r(X(i),e);else if(W){const t={type:"rrweb",event:X(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(i.type===Jr.FullSnapshot)Q=i,Z=0;else if(i.type===Jr.IncrementalSnapshot){if(i.data.source===Yr.Mutation&&i.data.isAttachIframe)return;Z++,(s&&Z>=s||o&&i.timestamp-Q.timestamp>o)&&ml(!0)}};const tt=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=Sl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=st.getIframeElementById(t);i&&n.has(i)?st.forgetIframeId(t):(null==Y||Y(t),st.removeIframeById(t))}),null==K||K(),st.cleanupDetachedIframes()}pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Mutation},t)})},et=t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Scroll},t)}),nt=t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.CanvasMutation},t)}),it=new yl({mutationCb:tt,adoptedStyleSheetCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.AdoptedStyleSheet},t)}),maskAllElementAttributes:w,maskAttributeFn:k,blockClass:a,blockSelector:l});let rt=!1;const ot=()=>{if(!rt){rt=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;it.flushChangedLinkInlining(50-n)}finally{rt=!1}}},st=new Ha({mirror:Sl,mutationCb:tt,stylesheetManager:it,recordCrossOriginIframes:E,wrappedEmit:pl});for(const t of N||[])t.getMirror&&t.getMirror({nodeMirror:Sl,crossOriginIframeMirror:st.crossOriginIframeMirror,crossOriginIframeStyleMirror:st.crossOriginIframeStyleMirror});const at=new bl,lt=null==I?void 0:I.configured;gl=new fl({recordCanvas:R,mutationCb:nt,win:window,blockClass:a,blockSelector:l,mirror:Sl,sampling:x.canvas,dataURLOptions:H,resolutionScale:T,canvasMasking:I});const ut=new Ua({mutationCb:tt,scrollCb:et,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:G,dataURLOptions:H,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,sampling:x,slimDOMOptions:V,iframeManager:st,stylesheetManager:it,canvasManager:gl,keepIframeSrcFn:q,processedNodeManager:at,attributeFilter:B},mirror:Sl});ml=(t=!1)=>{if(A){$o(v);try{if(pl({type:Jr.Meta,data:{href:window.location.href,width:oa(),height:ra()}},t),n)return;null==e||e.cancel(),e=void 0,it.reset(),ut.init(),Ia.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new os,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:T,inlineStylesheetBudgetRules:I}=e||{},M=!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,hidden:!0}:!1===d?{password:!0}:d,A=Gs(m);$o(I);try{return Ws(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:M,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:A,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:T})}finally{Lo()}}(document,{mirror:Sl,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:G,inlineStylesheetBudgetRules:v,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,slimDOM:V,dataURLOptions:H,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,onSerialize(t){ha(t,Sl)&&st.addIframe(t),fa(t,Sl)&&it.trackLinkElement(t),va(t)&&ut.addShadowRoot(mo.shadowRoot(t),document)},onIframeLoad(t,e){st.attachIframe(t,e),ut.observeAttachShadow(t)},onIframeListenerRegistered(t,e){st.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){it.attachLinkElement(t,e,n)},keepIframeSrcFn:q})}finally{r=jo()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(pl({type:Jr.FullSnapshot,data:{node:i,initialOffset:ia(window)}},t),n)return;if(Ia.forEach(t=>t.unlock()),gl.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&Js(()=>{s=e.beginDeferredLinkInlining(n,Sl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Js(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,zo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=Ba(d):n())};return r=Ba(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);zo(e),null==s||s.discard(),s=null}return n(),e}}}(r,it,()=>{e===t&&(e=void 0)});e=t}E&&st.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&it.adoptStyleSheets(document.adoptedStyleSheets,Sl.getId(document))}finally{Lo()}}};try{const t=[];t.push(Qs("pagehide",()=>{try{ot()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Qs(e,bo,document));Y=e=>{const n=J.get(e);n&&(n.forEach(e=>{Js(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),J.delete(e))},K=()=>{for(const[t]of J){const e=Sl.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==Y||Y(t)}catch(e){null==Y||Y(t)}else null==Y||Y(t)}};const r=t=>{var e;return Ta(Na)({mutationCb:tt,mousemoveCb:(t,e)=>pl({type:Jr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.MouseInteraction},t)}),scrollCb:et,viewportResizeCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.ViewportResize},t)}),inputCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Input},t)}),mediaInteractionCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.MediaInteraction},t)}),styleSheetRuleCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.StyleSheetRule},t)}),styleDeclarationCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.StyleDeclaration},t)}),canvasMutationCb:nt,fontCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Font},t)}),selectionCb(t){pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Selection},t)})},customElementCb(t){pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:G,inlineStylesheet:f,sampling:x,recordDOM:A,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,userTriggeredOnInput:D,collectFonts:P,doc:t,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w,maskAttributeFn:k,keepIframeSrcFn:q,blockSelector:l,slimDOMOptions:V,dataURLOptions:H,mirror:Sl,iframeManager:st,stylesheetManager:it,shadowDomManager:ut,processedNodeManager:at,canvasManager:gl,ignoreCSSAttributes:j,attributeFilter:B,plugins:(null==N||null===(e=N.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>pl({type:Jr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},S)},o=new WeakMap,s=new WeakMap;st.addLoadListener(e=>{try{const n=e.contentDocument,i=Sl.getId(e);if(!n)return;const a=s.get(e);if(a){s.delete(e),Js(a);const n=t.indexOf(a);-1!==n&&t.splice(n,1)}const l=o.get(n);if(-1!==i&&l){if(l())return;null==Y||Y(i)}const u=r(n);if("function"==typeof u){let r=!1;const a=Qs("rrweb-check-iframe-observers",()=>{r=!0},n);-1!==i&&o.set(n,()=>{r=!1;const t=n.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),n.dispatchEvent(t),r});const l=()=>{o.delete(n),a(),u()};if(t.push(l),-1!==i){let t=J.get(i);t||(t=new Set,J.set(i,t)),t.add(l)}else s.set(e,l)}}catch(t){console.warn(t)}}),st.addPageHideListener(t=>{const e=Sl.getId(t);null==Y||Y(e),Ea(t)});let v=-1;const p=t=>pl({type:Jr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),m=()=>{var t,e,n,i;const r=document,o=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,s=o?Sl.getId(o):-1;s!==v&&(-1!==v&&p({id:v,enter:!1}),v=s,-1!==s&&p({id:s,enter:!0}))},g=()=>{if(n||i)return;if(i=!0,ml(),n)return;const e=r(document);n?"function"==typeof e&&Ys([e]):("function"==typeof e&&t.push(e),t.push(Qs("fullscreenchange",m)),t.push(Qs("webkitfullscreenchange",m)),t.push(Qs("mozfullscreenchange",m)),t.push(Qs("MSFullscreenChange",m)),wl=!0)};return["interactive","complete"].includes(document.readyState)?g():(t.push(Qs("DOMContentLoaded",()=>{pl({type:Jr.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&setTimeout(g,0)})),t.push(Qs("load",()=>{pl({type:Jr.Load,data:{}}),"load"===O&&g()},window))),()=>{n=!0;try{ot()}catch(t){}e=void 0,it.stop(),Ys(t),at.destroy(),st.removeLoadListener(),st.destroy(),J.clear(),ut.reset(),Sl.reset(),wl=!1,Ca()}}catch(t){console.warn(t)}}xl.addCustomEvent=(t,e)=>{if(!wl)throw new Error("please add custom event after start recording");pl({type:Jr.Custom,data:{tag:t,payload:e}})},xl.freezePage=()=>{Ia.forEach(t=>t.freeze())},xl.takeFullSnapshot=t=>{if(!wl)throw new Error("please take full snapshot after start recording");ml(t)},xl.isRecording=()=>wl,xl.mirror=Sl,Date,Date;var Cl=Object.create(null);function Tl(t){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(t)}function Il(t,e,n){return(e=function(t){var e=function(t){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Cl.Node=Object.create(null),Cl.ShadowRoot=Object.create(null),Cl.MutationObserver=Object.create(null),Cl.Element=Object.create(null);var Ml=class{constructor(t){Il(this,"fileName",void 0),Il(this,"functionName",void 0),Il(this,"lineNumber",void 0),Il(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},Al=/(^|@)\S+:\d+/,Rl=/^\s*at .*(\S+:\d+|\(native\))/m,El=/^(eval@)?(\[native code])?$/,Ol={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Rl)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(Rl)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new Ml({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(El)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ml({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new Ml({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new Ml({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new Ml({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(Al)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Ml({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function $l(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ll(t){return Array.isArray(t)}function Dl(t){return"object"==typeof t&&null!==t&&!Ll(t)}function Pl(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Dl(t[i])&&Pl(t[i],e-1))return!0;return!1}function Fl(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Dl(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Dl(o)&&Pl(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ll(i)?$l(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Nl={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 ql(t,e,n){const i=n?Object.assign({},Nl,n):Nl,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?e[r]:r;let s=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Ol.parse(e.error).map(t=>t.toString()),payload:[Fl(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Fl(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Fl("Uncaught (in promise)",i.stringifyOptions),Fl(e.reason,i.stringifyOptions)]),t({level:"error",trace:Ol.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,o){try{if(!(o in r))return()=>{};const u=r[o],c={next:u},d=(r=>(...o)=>{if(r.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=Ol.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>Fl(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Fl("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[o]=d,()=>{if(r[o]===d)return void(r[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var jl=t=>({name:"rrweb/console@1",observer:ql,options:t});const Bl=()=>{},zl=t=>{var e;if(U(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Hl(t,e,n){try{if(!(e in t))return Bl;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return U(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],o=zl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=zl(n)}}}catch(t){return Bl}}function Ul(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const Wl=ce("[Recorder]"),Gl=t=>"navigation"===t.entryType,Vl=t=>"resource"===t.entryType,Ql=()=>{};function Zl(t,e){var n;return Gl(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function Jl(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Zl(t,n)||Vl(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Zl(t,e))}(t):[]}function Yl(t,e){return!!e&&(K(e)||e[t])}function Kl(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Xl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function tu({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Kl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Xl))return!1;if(K(e))return!0;if(H(e))return r(e);const o=e[t];return K(o)?o:r(o)}function eu(t,e,n,i,r){return nu.apply(this,arguments)}function nu(){return nu=A(function*(t,e,n,i,r,o=0){if(o>10)return Wl.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Vl(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),eu(t,e,n,i,r,o+1))}),nu.apply(this,arguments)}function iu({body:t,options:e,url:n}){if(J(t))return null;const{hostname:i,isHostDenied:r}=Ul(n,e);if(r)return i+" is in deny list";if(V(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(X(t))return ye(t);if(W(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const ru=t=>!Z(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ou(t,{entry:e,method:n,status:i,networkRequest:r,isInitial:o,start:s,end:a,url:l,initiatorType:u}){s=e?e.startTime:s,a=e?e.responseEnd:a;const c=Math.floor(Date.now()-t.performance.now()),d=Math.floor(c+(s||0)),h=[L(L({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:l}),{},{startTime:G(s)?void 0:Math.round(s),endTime:G(a)?void 0:Math.round(a),timeOrigin:c,timestamp:d,method:n,initiatorType:u||(e?e.initiatorType:void 0),status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o})];if(ru(e))for(const t of e.serverTiming||[])h.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return h}const su=["video/","audio/"];function au(t){return W(t)&&U(t.getReader)&&U(t.tee)}const lu="[SessionReplay] Timeout while trying to read body",uu="[SessionReplay] Failed to read body";function cu(t){return`${uu}: ${t}`}function du(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function hu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(lu),500);try{t.clone().text().then(t=>e(t),t=>e(cu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(uu)}})}(t);const n=Je(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const o=parseInt(r,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(du(n)):function(t,e){return new Promise(n=>{let i,r=!1;function o(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function s(t){r||(r=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(lu),500);let l;try{l=t.clone()}catch(t){return void s(uu)}const u=l.body;if(!au(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(cu(t)))}catch(t){s(uu)}return}try{i=u.getReader()}catch(t){return void s(uu)}const c=[];let d=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,d)));else{if(i){if(d+i.byteLength>e)return void s(du(e));d+=i.byteLength,c.push(i)}t()}},t=>s(cu(t)))}()})}(t,n)}function fu(t){return vu.apply(this,arguments)}function vu(){return vu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Ul(n,e);return r?Promise.resolve(i+" is in deny list"):hu(t,e)}),vu.apply(this,arguments)}function pu(t){return mu.apply(this,arguments)}function mu(){return mu=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),o=su.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Ul(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Z(i)?hu(t,e):Promise.resolve(i)}),mu.apply(this,arguments)}let gu=null;function yu(t,e,n){if(!("performance"in e))return()=>{};if(gu)return Wl.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ye,n):Ye;let r=!0,o=!1;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let r;try{r=i.maskRequestFn(t)}catch(t){return o||(o=!0,Wl.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!r||(t=>!!t&&sn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(L(L({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:Jl(e,n).flatMap(t=>ou(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Wl.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!H(r))return;const o=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!o.length)return;const s=new i(i=>{t({requests:i.getEntries().filter(t=>Gl(t)||Vl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>ou(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(s,e,i),l=i.recordHeaders||i.recordBody;if(!a&&!l)return r=!1,Ql;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),i&&(l.requestHeaders=h);const v=d.send.bind(d);d.send=t=>(tu({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=iu({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{d.removeEventListener("readystatechange",m),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},m=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),tu({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=iu({body:d.response,options:n,url:a})),eu(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:ou(e,{entry:n,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",m),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){Wl.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),c=!0===i.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Wl.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(s,a))}catch(t){return new Promise((e,n)=>n(t))}}const u={};let c,d;const h=A(function*(){try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(u.requestHeaders=t),!au(null==a?void 0:a.body)&&tu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield fu({r:l,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch request for network capture",t)}})(),f=(v=A(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(u.responseHeaders=e),tu({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield pu({r:t,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch response for network capture",t)}}),function(t){return v.apply(this,arguments)});var v;try{c=e.performance.now()}catch(t){}let p;try{p=Kl(s)?o(l):o(s,a)}catch(t){p=new Promise((e,n)=>n(t))}const m=Promise.resolve(p).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t}));return A(function*(){let n;try{yield h;const t=yield m;if("rejected"===t.status)throw t.error;return n=t.response,yield f(n),n}finally{(i=n,eu(e,"fetch",l.url,c,d).then(n=>{t({requests:ou(e,{entry:n,method:l.method,status:null==i?void 0:i.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Wl.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!au(null==a?void 0:a.body)&&tu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield fu({r:l,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Kl(s)?yield o(l):yield o(s,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),tu({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield pu({r:u,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch response for network capture",t)}return u}finally{eu(e,"fetch",l.url,d,h).then(n=>{t({requests:ou(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{o()}}(s,e,i)),gu=()=>{r=!1,null==a||a(),u(),c(),gu=null},gu}const bu=t=>({name:"rrweb/network@1",observer:yu,options:t});var wu,ku,Su,_u,xu,Cu,Tu,Iu,Mu,Au,Ru,Eu,Ou,$u,Lu;o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:jl,getRecordNetworkPlugin:bu},o.__PosthogExtensions__.rrweb={record:xl,version:"v2",wasMaxDepthReached:()=>Us,resetMaxDepthState(){Us=!1,Hs=!1},getLastSnapshotCost:()=>To,getMutationCost:()=>L({},Eo),getObserverInitFailures:()=>Fa.size?Array.from(Fa):void 0,resetSnapshotCostState(){So=0,_o=0,xo=0,yo=0,Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Io=null,Mo=[],Ao=0,Ro=0,Eo={slowestBatchMs:0},Oo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},o.rrweb={record:xl,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:jl},o.getRecordNetworkPlugin=bu,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=(t,e)=>new Qr(t,e);var Du={},Pu=[],Fu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nu=Array.isArray;function qu(t,e){for(var n in e)t[n]=e[n];return t}function ju(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Bu(t,e,n){var i,r,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?wu.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return zu(t,s,i,r,null)}function zu(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++Su:r,__i:-1,__u:0};return null==r&&null!=ku.vnode&&ku.vnode(o),o}function Hu(t){return t.children}function Uu(t,e){this.props=t,this.context=e}function Wu(t,e){if(null==e)return t.__?Wu(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Wu(t):null}function Gu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=qu({},e);o.__v=e.__v+1,ku.vnode&&ku.vnode(o),nc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Wu(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,rc(i,o,r),e.__e=e.__=null,o.__e!=n&&Vu(o)}}function Vu(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),Vu(t)}function Qu(t){(!t.__d&&(t.__d=!0)&&_u.push(t)&&!Zu.__r++||xu!=ku.debounceRendering)&&((xu=ku.debounceRendering)||Cu)(Zu)}function Zu(){try{for(var t,e=1;_u.length;)_u.length>e&&_u.sort(Tu),t=_u.shift(),e=_u.length,Gu(t)}finally{_u.length=Zu.__r=0}}function Ju(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Pu,b=e.length;for(l=function(t,e,n,i,r){var o,s,a,l,u,c=n.length,d=c,h=0;for(t.__k=new Array(r),o=0;r>o;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=zu(null,s,null,null,null):Nu(s)?s=t.__k[o]=zu(Hu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=zu(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,l=o+h,s.__=t,s.__b=t.__b+1,a=null,-1!=(u=s.__i=Ku(s,n,l,d))&&(d--,(a=n[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>c?h--:c>r&&h++),"function"!=typeof s.type&&(s.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,s.__u|=4))):t.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Wu(a)),ac(a,a));return i}(n,e,y,l,b),d=0;b>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&y[f.__i]||Du,f.__i=d,m=nc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&sc(h.ref,null,f),c.push(f.ref,f.__c||v,f)),null==p&&null!=v&&(p=v),(g=!!(4&f.__u))||h.__k===f.__k?(l=Yu(f,l,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:v&&(l=v.nextSibling),f.__u&=-7);return n.__e=p,l}function Yu(t,e,n,i){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&r.length>o;o++)r[o]&&(r[o].__=t,e=Yu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Wu(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ku(t,e,n,i){var r,o,s,a=t.key,l=t.type,u=e[n],c=null!=u&&!(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return n;if(i>(c?1:0))for(r=n-1,o=n+1;r>=0||e.length>o;)if(null!=(u=e[s=0>r?o++:r--])&&!(2&u.__u)&&a==u.key&&l==u.type)return s;return-1}function Xu(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Fu.test(e)?n:n+"px"}function tc(t,e,n,i,r){var o,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Xu(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Xu(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Ru,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n[Au]=i[Au]:(n[Au]=Eu,t.addEventListener(e,o?$u:Ou,o)):t.removeEventListener(e,o?$u:Ou,o);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function ec(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[Mu])e[Mu]=Eu++;else if(n[Au]>e[Mu])return;return n(ku.event?ku.event(e):e)}}}function nc(t,e,n,i,r,o,s,a,l,u){var c,d,h,f,v,p,m,g,y,b,$,w,k,S,_,x,C=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(c=ku.__b)&&c(e);t:if("function"==typeof C){d=s.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(c=C.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?g=(h=e.__c=n.__c).__=h.__E:(b?e.__c=h=new C(y,w):(e.__c=h=new Uu(y,w),h.constructor=C,h.render=lc),$&&$.sub(h),h.state||(h.state={}),h.__n=i,f=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=qu({},h.__s)),qu(h.__s,C.getDerivedStateFromProps(y,h.__s))),v=h.props,p=h.state,h.__v=e,f)b&&null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,w),e.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,w)){e.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),Pu.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,w),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,p,m)})}if(h.context=w,h.props=y,h.__P=t,h.__e=!1,k=ku.__r,S=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Pu.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&25>++S);h.state=h.__s,null!=h.getChildContext&&(i=qu(qu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),_=null!=c&&c.type===Hu&&null==c.key?oc(c.props.children):c,a=Ju(t,Nu(_)?_:[_],e,n,i,r,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){if(s.length=d,e.__v=null,l||null!=o)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),e.__e=a}else{if(null!=o)for(x=o.length;x--;)ju(o[x]);ic(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||ic(e);ku.__e(t,e,n)}}else null==o&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=function(t,e,n,i,r,o,s,a,l){var u,c,d,h,f,v,p,m=n.props||Du,g=e.props,y=e.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(u=0;o.length>u;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:3==f.nodeType)){t=f,o[u]=null;break}if(null==t){if(null==y)return document.createTextNode(g);t=document.createElementNS(r,y,g.is&&g),a&&(ku.__m&&ku.__m(e,o),a=!1),o=null}if(null==y)m===g||a&&t.data==g||(t.data=g);else{if(o="textarea"==y&&null!=g.defaultValue?null:o&&wu.call(t.childNodes),!a&&null!=o)for(m={},u=0;t.attributes.length>u;u++)m[(f=t.attributes[u]).name]=f.value;for(u in m)f=m[u],"dangerouslySetInnerHTML"==u?d=f:"children"==u||u in g||"value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g||tc(t,u,null,f,r);for(u in g)f=g[u],"children"==u?h=f:"dangerouslySetInnerHTML"==u?c=f:"value"==u?v=f:"checked"==u?p=f:a&&"function"!=typeof f||m[u]===f||tc(t,u,f,m[u],r);if(c)a||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Ju("template"==e.type?t.content:t,Nu(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Wu(n,0),a,l),null!=o)for(u=o.length;u--;)ju(o[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==v?t.removeAttribute("value"):null!=v&&(v!==t[u]||"progress"==y&&!v||"option"==y&&v!=m[u])&&tc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&tc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=ku.diffed)&&c(e),128&e.__u?void 0:a}function ic(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ic))}function rc(t,e,n){for(var i=0;n.length>i;i++)sc(n[i],n[++i],n[++i]);ku.__c&&ku.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){ku.__e(t,e.__v)}})}function oc(t){return"object"!=typeof t||null==t||t.__b>0?t:Nu(t)?t.map(oc):void 0!==t.constructor?null:qu({},t)}function sc(t,e,n){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ku.__e(t,n)}}function ac(t,e,n){var i,r;if(ku.unmount&&ku.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||sc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ku.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&ac(i[r],e,n||"function"!=typeof t.type);n||ju(t.__e),t.__c=t.__=t.__e=void 0}function lc(t,e,n){return this.constructor(t,n)}function uc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),ku.__&&ku.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],nc(e,t=(!i&&n||e).__k=Bu(Hu,null,[t]),r||Du,Du,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?wu.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),rc(o,t,s),t.props.children=null}wu=Pu.slice,ku={__e(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},Su=0,Uu.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=qu({},this.state);"function"==typeof t&&(t=t(qu({},n),this.props)),t&&qu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Qu(this))},Uu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Qu(this))},Uu.prototype.render=Hu,_u=[],Cu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Tu=function(t,e){return t.__v.__b-e.__v.__b},Zu.__r=0,Iu=Math.random().toString(8),Mu="__d"+Iu,Au="__a"+Iu,Ru=/(PointerCapture)$|Capture$/i,Eu=0,Ou=ec(!1),$u=ec(!0),Lu=0;var cc=0;function dc(t,e,n,i,r,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--cc,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return ku.vnode&&ku.vnode(u),u}const hc="featureFlagsCommon";function fc({client:t,config:e}){var n;if(!t||!e.uiHost)return;const i=null===(n=t.session)||void 0===n?void 0:n.sessionId;return i?`${e.uiHost}/project/${t.projectToken}/replay/${i}`:void 0}var vc,pc,mc,gc,yc=0,bc=[],wc=ku,kc=wc.__b,Sc=wc.__r,_c=wc.diffed,xc=wc.__c,Cc=wc.unmount,Tc=wc.__;function Ic(t,e){wc.__h&&wc.__h(pc,t,yc||e),yc=0;var n=pc.__H||(pc.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Mc(t){return yc=1,function(t,e){var n=Ic(vc++,2);if(n.t=t,!n.__c&&(n.__=[qc(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=pc,!pc.__f)){var i=function(t,e,i){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),r){var a=r.call(this,t,e,i);return o?a||s:a}return!o||s};pc.__f=!0;var r=pc.shouldComponentUpdate,o=pc.componentWillUpdate;pc.componentWillUpdate=function(t,e,n){if(this.__e){var s=r;r=void 0,i(t,e,n),r=s}o&&o.call(this,t,e,n)},pc.shouldComponentUpdate=i}return n.__N||n.__}(qc,t)}function Ac(t,e){var n=Ic(vc++,3);!wc.__s&&Nc(n.__H,e)&&(n.__=t,n.u=e,pc.__H.__h.push(n))}function Rc(t){return yc=5,Ec(function(){return{current:t}},[])}function Ec(t,e){var n=Ic(vc++,7);return Nc(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Oc(t){var e=pc.context[t.__c],n=Ic(vc++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(pc)),e.props.value):t.__}function $c(){for(var t;t=bc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Pc),e.__h.some(Fc),e.__h=[]}catch(n){e.__h=[],wc.__e(n,t.__v)}}}wc.__b=function(t){pc=null,kc&&kc(t)},wc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Tc&&Tc(t,e)},wc.__r=function(t){Sc&&Sc(t),vc=0;var e=(pc=t.__c).__H;e&&(mc===pc?(e.__h=[],pc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&$c(),vc=0)),mc=pc},wc.diffed=function(t){_c&&_c(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==bc.push(e)&&gc===wc.requestAnimationFrame||((gc=wc.requestAnimationFrame)||Dc)($c)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),mc=pc=null},wc.__c=function(t,e){e.some(function(t){try{t.__h.some(Pc),t.__h=t.__h.filter(function(t){return!t.__||Fc(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],wc.__e(n,t.__v)}}),xc&&xc(t,e)},wc.unmount=function(t){Cc&&Cc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{Pc(t)}catch(t){e=t}}),n.__H=void 0,e&&wc.__e(e,n.__v))};var Lc="function"==typeof requestAnimationFrame;function Dc(t){var e,n=function(){clearTimeout(i),Lc&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Lc&&(e=requestAnimationFrame(n))}function Pc(t){var e=pc,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),pc=e}function Fc(t){var e=pc;t.__c=t.__(),pc=e}function Nc(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function qc(t,e){return"function"==typeof e?e(t):e}const jc="tab",Bc="left",zc="center",Hc="right",Uc="next_to_trigger",Wc="popover",Gc="widget",Vc="external_survey",Qc="open",Zc="multiple_choice",Jc="single_choice",Yc="rating",Kc="end",Xc="always",td="survey shown",ed="survey dismissed",nd="survey sent",id="$survey_id",rd="$survey_name",od="$survey_iteration",sd="$survey_iteration_start_date",ad="$survey_language",ld=ce("[Surveys]"),ud=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,cd=t=>ud("seenSurvey_",t),dd=[Wc,Gc,"api"];function hd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);e>n;n++)i[n]=t[n];return i}function fd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return hd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hd(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const vd=Object.entries,pd=Object.setPrototypeOf,md=Object.isFrozen,gd=Object.getPrototypeOf,yd=Object.getOwnPropertyDescriptor;let bd=Object.freeze,wd=Object.seal,kd=Object.create,Sd="undefined"!=typeof Reflect&&Reflect,_d=Sd.apply,xd=Sd.construct;bd||(bd=function(t){return t}),wd||(wd=function(t){return t}),_d||(_d=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return t.apply(e,i)}),xd||(xd=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return new t(...n)});const Cd=Gd([].forEach),Td=Gd([].lastIndexOf),Id=Gd([].pop),Md=Gd([].push),Ad=Gd([].splice),Rd=Array.isArray,Ed=Gd("".toLowerCase),Od=Gd("".toString),$d=Gd("".match),Ld=Gd("".replace),Dd=Gd("".indexOf),Pd=Gd("".trim),Fd=Gd((0).toString),Nd=Gd(Boolean.prototype.toString),qd="undefined"==typeof BigInt?null:Gd(BigInt.prototype.toString),jd="undefined"==typeof Symbol?null:Gd(Symbol.prototype.toString),Bd=Gd({}.hasOwnProperty),zd=Gd({}.toString),Hd=Gd(/t/.test),Ud=(Wd=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return xd(Wd,e)});var Wd;function Gd(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];return _d(t,e,i)}}function Vd(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ed;if(pd&&pd(t,null),!Rd(e))return t;let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(md(e)||(e[i]=t),r=t)}t[r]=!0}return t}function Qd(t){for(let e=0;t.length>e;e++)Bd(t,e)||(t[e]=null);return t}function Zd(t){const e=kd(null);for(const i of vd(t)){var n=fd(i,2);const r=n[0],o=n[1];Bd(t,r)&&(e[r]=Rd(o)?Qd(o):o&&"object"==typeof o&&o.constructor===Object?Zd(o):o)}return e}function Jd(t,e){for(;null!==t;){const n=yd(t,e);if(n){if(n.get)return Gd(n.get);if("function"==typeof n.value)return Gd(n.value)}t=gd(t)}return function(){return null}}const Yd=bd(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Kd=bd(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xd=bd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),th=bd(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eh=bd(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nh=bd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ih=bd(["#text"]),rh=bd(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),oh=bd(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sh=bd(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ah=bd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lh=wd(/{{[\w\W]*|^[\w\W]*}}/g),uh=wd(/<%[\w\W]*|^[\w\W]*%>/g),ch=wd(/\${[\w\W]*/g),dh=wd(/^data-[\-\w.\u00B7-\uFFFF]+$/),hh=wd(/^aria-[\-\w]+$/),fh=wd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vh=wd(/^(?:\w+script|data):/i),ph=wd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mh=wd(/^html$/i),gh=wd(/^[a-z][.\w]*(-[.\w]+)+$/i),yh=wd(/<[/\w!]/g),bh=wd(/<[/\w]/g),wh=wd(/<\/no(script|embed|frames)/i),kh=wd(/\/>/i),Sh=function(){return"undefined"==typeof window?null:window},_h=function(t,e,n,i){return Bd(t,e)&&Rd(t[e])?Vd(i.base?Zd(i.base):{},t[e],i.transform):n};var xh=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sh();const n=e=>t(e);if(n.version="3.4.13",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let i=e.document;const r=i,o=r.currentScript,s=e.HTMLTemplateElement,a=e.Node,l=e.NodeFilter,u=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=Jd(d,"cloneNode"),f=Jd(d,"remove"),v=Jd(d,"nextSibling"),p=Jd(d,"childNodes"),m=Jd(d,"parentNode"),g=Jd(d,"shadowRoot"),y=Jd(d,"attributes"),b=a&&a.prototype?Jd(a.prototype,"nodeType"):null,w=a&&a.prototype?Jd(a.prototype,"nodeName"):null,k=a&&a.prototype?Jd(a.prototype,"ownerDocument"):null;if("function"==typeof s){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let S,_,x="",C=!1,T=0;const I=function(){if(T>0)throw Ud('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(t){I(),T++;try{return S.createHTML(t)}finally{T--}},A=i.implementation,R=i.createNodeIterator,E=i.createDocumentFragment,O=i.getElementsByTagName,L=r.importNode;let D={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof vd&&"function"==typeof m&&A&&void 0!==A.createHTMLDocument;const P=lh,F=uh,N=ch,q=dh,j=hh,B=vh,z=ph,H=gh;let U=fh,W=null;const G=Vd({},[...Yd,...Kd,...Xd,...eh,...ih]);let V=null;const Q=Vd({},[...rh,...oh,...sh,...ah]);let Z=Object.seal(kd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,Y=null;const K=Object.seal(kd(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,tt=!0,et=!1,nt=!0,it=!1,rt=!0,ot=!1,st=!1,at=null,lt=null,ut=!1,ct=!1,dt=!1,ht=!1,ft=!0,vt=!1;const pt="user-content-";let mt=!0,gt=!1,yt={},bt=null;const wt=Vd({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let kt=null;const St=Vd({},["audio","video","img","source","image","track"]);let _t=null;const xt=Vd({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let Mt=It,At=!1,Rt=null;const Et=Vd({},[Ct,Tt,It],Od),Ot=bd(["mi","mo","mn","ms","mtext"]);let $t=Vd({},Ot);const Lt=bd(["annotation-xml"]);let Dt=Vd({},Lt);const Pt=Vd({},["title","style","font","a","script"]);let Ft=null;const Nt=["application/xhtml+xml","text/html"];let qt=null,jt=null;const Bt=i.createElement("form"),zt=function(t){return t instanceof RegExp||t instanceof Function},Ht=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(jt&&jt===t)return;t&&"object"==typeof t||(t={}),t=Zd(t),Ft=-1===Nt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,qt="application/xhtml+xml"===Ft?Od:Ed,W=_h(t,"ALLOWED_TAGS",G,{transform:qt}),V=_h(t,"ALLOWED_ATTR",Q,{transform:qt}),Rt=_h(t,"ALLOWED_NAMESPACES",Et,{transform:Od}),_t=_h(t,"ADD_URI_SAFE_ATTR",xt,{transform:qt,base:xt}),kt=_h(t,"ADD_DATA_URI_TAGS",St,{transform:qt,base:St}),bt=_h(t,"FORBID_CONTENTS",wt,{transform:qt}),J=_h(t,"FORBID_TAGS",Zd({}),{transform:qt}),Y=_h(t,"FORBID_ATTR",Zd({}),{transform:qt}),yt=!!Bd(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?Zd(t.USE_PROFILES):t.USE_PROFILES),X=!1!==t.ALLOW_ARIA_ATTR,tt=!1!==t.ALLOW_DATA_ATTR,et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,it=t.SAFE_FOR_TEMPLATES||!1,rt=!1!==t.SAFE_FOR_XML,ot=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,dt=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,ut=t.FORCE_BODY||!1,ft=!1!==t.SANITIZE_DOM,vt=t.SANITIZE_NAMED_PROPS||!1,mt=!1!==t.KEEP_CONTENT,gt=t.IN_PLACE||!1,U=function(t){try{return Hd(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:fh,Mt="string"==typeof t.NAMESPACE?t.NAMESPACE:It,$t=Bd(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?Zd(t.MATHML_TEXT_INTEGRATION_POINTS):Vd({},Ot),Dt=Bd(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?Zd(t.HTML_INTEGRATION_POINTS):Vd({},Lt);const e=Bd(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?Zd(t.CUSTOM_ELEMENT_HANDLING):kd(null);if(Z=kd(null),Bd(e,"tagNameCheck")&&zt(e.tagNameCheck)&&(Z.tagNameCheck=e.tagNameCheck),Bd(e,"attributeNameCheck")&&zt(e.attributeNameCheck)&&(Z.attributeNameCheck=e.attributeNameCheck),Bd(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),wd(Z),it&&(tt=!1),dt&&(ct=!0),yt&&(W=Vd({},ih),V=kd(null),!0===yt.html&&(Vd(W,Yd),Vd(V,rh)),!0===yt.svg&&(Vd(W,Kd),Vd(V,oh),Vd(V,ah)),!0===yt.svgFilters&&(Vd(W,Xd),Vd(V,oh),Vd(V,ah)),!0===yt.mathMl&&(Vd(W,eh),Vd(V,sh),Vd(V,ah))),K.tagCheck=null,K.attributeCheck=null,Bd(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?K.tagCheck=t.ADD_TAGS:Rd(t.ADD_TAGS)&&(W===G&&(W=Zd(W)),Vd(W,t.ADD_TAGS,qt))),Bd(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?K.attributeCheck=t.ADD_ATTR:Rd(t.ADD_ATTR)&&(V===Q&&(V=Zd(V)),Vd(V,t.ADD_ATTR,qt))),Bd(t,"ADD_URI_SAFE_ATTR")&&Rd(t.ADD_URI_SAFE_ATTR)&&Vd(_t,t.ADD_URI_SAFE_ATTR,qt),Bd(t,"FORBID_CONTENTS")&&Rd(t.FORBID_CONTENTS)&&(bt===wt&&(bt=Zd(bt)),Vd(bt,t.FORBID_CONTENTS,qt)),Bd(t,"ADD_FORBID_CONTENTS")&&Rd(t.ADD_FORBID_CONTENTS)&&(bt===wt&&(bt=Zd(bt)),Vd(bt,t.ADD_FORBID_CONTENTS,qt)),mt&&(W["#text"]=!0),ot&&Vd(W,["html","head","body"]),W.table&&(Vd(W,["tbody"]),delete J.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=S;S=t.TRUSTED_TYPES_POLICY;try{x=M("")}catch(t){throw S=e,t}}else null===t.TRUSTED_TYPES_POLICY?(S=void 0,x=""):(void 0===S&&(C||(_=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,o),C=!0),S=_),S&&"string"==typeof x&&(x=M("")));bd&&bd(t),jt=t},Ut=Vd({},[...Kd,...Xd,...th]),Wt=Vd({},[...eh,...nh]),Gt=function(t){Md(n.removed,{element:t});try{m(t).removeChild(t)}catch(e){if(f(t),!m(t))throw Ud("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vt=function(t){Jt(t);const e=p(t);if(e){const t=[];Cd(e,e=>{Md(t,e)}),Cd(t,t=>{try{f(t)}catch(t){}})}const n=y(t);if(n)for(let e=n.length-1;e>=0;--e){const i=n[e],r=i&&i.name;if("string"==typeof r)try{t.removeAttribute(r)}catch(t){}}},Qt=function(t,e){try{Md(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){Md(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ct||dt)try{Gt(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Zt=function(t){const e=y(t);if(e)for(let n=e.length-1;n>=0;--n){const i=e[n],r=i&&i.name;if("string"==typeof r&&!V[qt(r)])try{t.removeAttribute(r)}catch(t){}}},Jt=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(b?b(t):t.nodeType)&&Zt(t);const n=p(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Yt=function(t){let e=null,n=null;if(ut)t="<remove></remove>"+t;else{const e=$d(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Ft&&Mt===It&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=S?M(t):t;if(Mt===It)try{e=(new u).parseFromString(r,Ft)}catch(t){}if(!e||!e.documentElement){e=A.createDocument(Mt,"template",null);try{e.documentElement.innerHTML=At?x:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Mt===It?O.call(e,ot?"html":"body")[0]:ot?e.documentElement:o},Kt=function(t){const e=k?k(t):t.ownerDocument;return R.call(e||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Xt=function(t){return t=Ld(t,P," "),t=Ld(t,F," "),Ld(t,N," ")},te=function(t){var e;t.normalize();const n=k?k(t):t.ownerDocument,i=R.call(n||t,t,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let r=i.nextNode();for(;r;)r.data=Xt(r.data),r=i.nextNode();const o=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");o&&Cd(o,t=>{ne(t.content)&&te(t.content)})},ee=function(t){const e=w?w(t):null;return"string"==typeof e&&"form"===qt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==y(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==b(t)||t.childNodes!==p(t))},ne=function(t){if(!b||"object"!=typeof t||null===t)return!1;try{return 11===b(t)}catch(t){return!1}},ie=function(t){if(!b||"object"!=typeof t||null===t)return!1;try{return"number"==typeof b(t)}catch(t){return!1}};function re(t,e,i){0!==t.length&&Cd(t,t=>{t.call(n,e,i,jt)})}const oe=function(t,e,n,i){return 0===t.length?e:e===n||e===i?Zd(e):e},se=function(t,e){if(re(D.beforeSanitizeElements,t,null),t!==e&&null===m(t))return gt&&Jt(t),!0;if(ee(t))return Gt(t),!0;const i=qt(w?w(t):t.nodeName);if(W=oe(D.uponSanitizeElement,W,G,at),re(D.uponSanitizeElement,t,{tagName:i,allowedTags:W}),t!==e&&null===m(t))return gt&&Jt(t),!0;if(function(t,e){return!!(rt&&t.hasChildNodes()&&!ie(t.firstElementChild)&&Hd(yh,t.textContent)&&Hd(yh,t.innerHTML))||!(!rt||t.namespaceURI!==It||"style"!==e||!ie(t.firstElementChild))||7===t.nodeType||!(!rt||8!==t.nodeType||!Hd(bh,t.data))}(t,i))return Gt(t),!0;if(J[i]||!(K.tagCheck instanceof Function&&K.tagCheck(i))&&!W[i]){const n=function(t,e,n){if(!J[e]&&ue(e)){if(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,e))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))return!1}if(mt&&!bt[e]){const e=m(t),i=p(t);if(i&&e)for(let r=i.length-1;r>=0;--r){const o=t===n?h(i[r],!0):i[r];e.insertBefore(o,v(t))}}return Gt(t),!0}(t,i,e);return!1===n&&re(D.afterSanitizeElements,t,null),n}if(1===(b?b(t):t.nodeType)&&!function(t){let e=m(t);e&&e.tagName||(e={namespaceURI:Mt,tagName:"template"});const n=Ed(t.tagName),i=Ed(e.tagName);return!!Rt[t.namespaceURI]&&(t.namespaceURI===Tt?function(t,e,n){return e.namespaceURI===It?"svg"===t:e.namespaceURI===Ct?"svg"===t&&("annotation-xml"===n||$t[n]):Boolean(Ut[t])}(n,e,i):t.namespaceURI===Ct?function(t,e,n){return e.namespaceURI===It?"math"===t:e.namespaceURI===Tt?"math"===t&&Dt[n]:Boolean(Wt[t])}(n,e,i):t.namespaceURI===It?function(t,e,n){return!(e.namespaceURI===Tt&&!Dt[n])&&!(e.namespaceURI===Ct&&!$t[n])&&!Wt[t]&&(Pt[t]||!Ut[t])}(n,e,i):!("application/xhtml+xml"!==Ft||!Rt[t.namespaceURI]))}(t))return Gt(t),!0;if(("noscript"===i||"noembed"===i||"noframes"===i)&&Hd(wh,t.innerHTML))return Gt(t),!0;if(it&&3===t.nodeType){const e=Xt(t.textContent);t.textContent!==e&&(Md(n.removed,{element:t.cloneNode()}),t.textContent=e)}return re(D.afterSanitizeElements,t,null),!1},ae=function(t,e,n){if(Y[e])return!1;if(rt&&"patchsrc"===e)return!1;if(rt&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(ft&&("id"===e||"name"===e)&&(n in i||n in Bt))return!1;const r=V[e]||K.attributeCheck instanceof Function&&K.attributeCheck(e,t);if(tt&&Hd(q,e));else if(X&&Hd(j,e));else if(r){if(_t[e]);else if(Hd(U,Ld(n,z,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Dd(n,"data:")||!kt[t])if(et&&!Hd(B,Ld(n,z,"")));else if(n)return!1}else if(!(ue(t)&&(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,t)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(t))&&(Z.attributeNameCheck instanceof RegExp&&Hd(Z.attributeNameCheck,e)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(e,t))||"is"===e&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(n))))return!1;return!0},le=Vd({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ue=function(t){return!le[Ed(t)]&&Hd(H,t)},ce=function(t,e,n,i){if(S&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return M(i);case"TrustedScriptURL":return function(t){I(),T++;try{return S.createScriptURL(t)}finally{T--}}(i)}return i},de=function(t,e,i,r){try{i?t.setAttributeNS(i,e,r):t.setAttribute(e,r),ee(t)?Gt(t):Id(n.removed)}catch(n){Qt(e,t)}},he=function(t){re(D.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||ee(t))return;V=oe(D.uponSanitizeAttribute,V,Q,lt);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let i=e.length;const r=qt(t.nodeName);for(;i--;){const o=e[i],s=o.name,a=o.namespaceURI,l=o.value,u=qt(s),c=l;let d="value"===s?c:Pd(c);n.attrName=u,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,re(D.uponSanitizeAttribute,t,n),d=n.attrValue,!vt||"id"!==u&&"name"!==u||0===Dd(d,pt)||(Qt(s,t),d=pt+d),rt&&Hd(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||"attributename"===u&&$d(d,"href")?Qt(s,t):n.forceKeepAttr||(!n.keepAttr||!nt&&Hd(kh,d)?Qt(s,t):(it&&(d=Xt(d)),ae(r,u,d)?(d=ce(r,u,a,d),d!==c&&de(t,s,a,d)):Qt(s,t)))}re(D.afterSanitizeAttributes,t,null)},fe=function(t){let e=null;const n=Kt(t);for(re(D.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(re(D.uponSanitizeShadowNode,e,null),se(e,t),he(e),ne(e.content)&&fe(e.content),1===(b?b(e):e.nodeType)){const t=g(e);ne(t)&&(ve(t),fe(t))}re(D.afterSanitizeShadowDOM,t,null)},ve=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){fe(t.shadow);continue}const n=t.node,i=1===(b?b(n):n.nodeType),r=p(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(i){const t=w?w(n):null;if("string"==typeof t&&"template"===qt(t)){const t=n.content;ne(t)&&e.push({node:t,shadow:null})}}if(i){const t=g(n);ne(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,a=null;if(At=!t,At&&(t="\x3c!--\x3e"),"string"!=typeof t&&!ie(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return Fd(t);case"boolean":return Nd(t);case"bigint":return qd?qd(t):"0";case"symbol":return jd?jd(t):"Symbol()";case"undefined":default:return zd(t);case"function":case"object":{if(null===t)return zd(t);const e=t,n=Jd(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:zd(t)}return zd(t)}}}(t)))throw Ud("dirty is not a string, aborting");if(!n.isSupported)return t;st?(W=at,V=lt):Ht(e),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(W=Zd(W)),D.uponSanitizeAttribute.length>0&&(V=Zd(V)),n.removed=[];const l=gt&&"string"!=typeof t&&ie(t);if(l){!function(t){if(!rt)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=b?b(t):t.nodeType;if(7===n||8===n&&Hd(bh,t.data)){try{f(t)}catch(t){}continue}if(1===n){const e=t,n=qt(w?w(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const i=p(t);if(i)for(let t=i.length-1;t>=0;--t)e.push(i[t])}}(t);const e=w?w(t):t.nodeName;if("string"==typeof e){const n=qt(e);if(!W[n]||J[n])throw Vt(t),Ud("root node is forbidden and cannot be sanitized in-place")}if(ee(t))throw Vt(t),Ud("root node is clobbered and cannot be sanitized in-place");try{ve(t)}catch(e){throw Vt(t),e}}else if(ie(t))i=Yt("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o),ve(o);else{if(!ct&&!it&&!ot&&-1===t.indexOf("<"))return S&&ht?M(t):t;if(i=Yt(t),!i)return ct?null:ht?x:""}i&&ut&&Gt(i.firstChild);const u=l?t:i;try{const t=Kt(u);for(;s=t.nextNode();)se(s,u),he(s),ne(s.content)&&fe(s.content)}catch(e){throw l&&(Vt(t),Cd(n.removed,t=>{t.element&&Jt(t.element)})),e}if(l)return Cd(n.removed,t=>{t.element&&Jt(t.element)}),it&&te(t),t;if(ct){if(it&&te(i),dt)for(a=E.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return(V.shadowroot||V.shadowrootmode)&&(a=L.call(r,a,!0)),a}let c=ot?i.outerHTML:i.innerHTML;return ot&&W["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Hd(mh,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),it&&(c=Xt(c)),S&&ht?M(c):c},n.setConfig=function(){Ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),st=!0,at=W,lt=V},n.clearConfig=function(){jt=null,st=!1,at=null,lt=null,S=_,x=""},n.isValidAttribute=function(t,e,n){jt||Ht({});const i=qt(t),r=qt(e);return ae(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Bd(D,t)&&Md(D[t],e)},n.removeHook=function(t,e){if(Bd(D,t)){if(void 0!==e){const n=Td(D[t],e);return-1===n?void 0:Ad(D[t],n,1)[0]}return Id(D[t])}},n.removeHooks=function(t){Bd(D,t)&&(D[t]=[])},n.removeAllHooks=function(){D={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Ch=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],Th=["style","lang","title","width","height"],Ih=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],Mh={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:Ih,tfoot:["align","char","charoff","valign"],th:Ih,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};let Ah;function Rh(t){var e;const n=(null!==(e=Ah)&&void 0!==e?e:Ah=xh()).sanitize(t,{ALLOWED_TAGS:Ch,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:(t,e)=>-1!==Th.indexOf(t)||{}.hasOwnProperty.call(Mh,e)&&-1!==(Mh[e]||[]).indexOf(t),RETURN_DOM_FRAGMENT:!0}),i=n.querySelectorAll("a");for(let t=0;i.length>t;t++)i.item(t).relList.add("noopener");const r=document.createElement("div");return r.appendChild(n),r.innerHTML}const Eh=ce("[Stylesheet Loader]"),Oh="#020617",$h={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Hc,widgetType:jc,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Oh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Lh=[zc,Bc,Hc];function Dh(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Ph(t=$h.backgroundColor){let e;"#"===t[0]&&(e=Dh(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=Dh(n)),!e)return Oh;const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?Oh:"white"}return Oh}const Fh=(t,e,n)=>{const i=rf(t),r=document.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=document.createElement("div");((t,e,n)=>{const i=L(L({},$h),n),r=t.style,o=!Lh.includes(i.position)||e===Gc&&(null==n?void 0:n.widgetType)===jc;r.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),o?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",`${i.borderRadius} ${i.borderRadius} 0 0`)),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Ph(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Ph(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Ph(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Ph(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let a=s||i.inputBackground;s||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);const l=(null==n?void 0:n.inputTextColor)||Ph(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,t.type,t.appearance),o.className=i;const s=o.attachShadow({mode:"open"}),a=function(t){const e=((t,e,n)=>{let i=t.createElement("style");i.innerText=e;const r=(t=>{var e;return U(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(i=r(i)),i||(Eh.error("prepare_external_dependency_stylesheet returned null"),null)})(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==t?void 0:t.config.prepareStylesheet);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){const t=s.querySelector("style");t&&s.removeChild(t),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Nh=t=>{try{const e=cd(t);localStorage.getItem(e)||localStorage.setItem(e,"true")}catch(t){ld.error("Failed to persist survey seen state",t)}},qh=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l,u,c;i?(null===(l=i.client)||void 0===l?void 0:l.canCapture)&&(Nh(e),r&&nf(e),null===(u=i.client)||void 0===u||u.capture(nd,L(L(L({[rd]:e.name,[id]:e.id,[od]:e.current_iteration,[sd]:e.current_iteration_start_date,sessionRecordingUrl:fc(i)},Ri(L(L({event:"sent",survey:e,responses:t,submissionId:n,completed:r},!G(s)&&{surveyLanguage:s}),!G(a)&&{questionSnapshots:a}))),o),{},{$set:{[Oi(e,"responded")]:!0}})),r&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),null===(c=i.client)||void 0===c||null===(c=c.getExtension("featureFlagsCommon"))||void 0===c||c.reloadFeatureFlags())):ld.error("[survey sent] event not captured, PostHog instance not found.")},jh=(t,e,n,i)=>L({[rd]:e.name,[id]:e.id,[od]:e.current_iteration,[sd]:e.current_iteration_start_date,sessionRecordingUrl:fc(i)},Ri(L(L(L(L({event:t,survey:e},!G(null==n?void 0:n.responses)&&{responses:n.responses}),!G(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId}),!G(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage}),!G(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots}))),Bh=(t,e,n,i)=>{var r;if(!e)return void ld.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const o=tf(t),s=o?o.surveyLanguage:i,a=L(L(L({},jh("dismissed",t,o,e)),s&&{[ad]:s}),{},{$set:{[Oi(t,"dismissed")]:!0}});nf(t),Nh(t),null===(r=e.client)||void 0===r||r.capture(ed,a),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},zh=(t,e)=>{var n,i;if(!e)return void ld.error("[survey abandoned] event not captured, PostHog instance not found.");if(!(null===(n=e.client)||void 0===n?void 0:n.canCapture))return;const r=(t=>ud("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}const o=tf(t);if(o){try{localStorage.setItem(r,"true")}catch(t){}null===(i=e.client)||void 0===i||i.capture("survey abandoned",jh("abandoned",t,o,e),{delivery:"unload"})}},Hh=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Uh=(t,e)=>{var n,i,r;return(t=>t.questions.some(t=>{var e;return!!(null===(e=t.branching)||void 0===e?void 0:e.type)}))(t)?t.questions:e?null!==(n=((t,e)=>{if(!e||e.length!==t.questions.length)return null;const n=new Map(t.questions.map(t=>[t.id,t])),i=[];for(const t of e){const e=n.get(t);if(!e)return null;i.push(e)}return i})(t,e.questionOrder))&&void 0!==n?n:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?(i=t.questions,r=zi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions},Wh=t=>function(t){var e;return Ni(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||ef(t),Gh=function(t){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,Qu(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Lu++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Vh=()=>Oc(Gh),Qh=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=qu({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?wu.call(arguments,2):n),zu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:Rh(e)},style:i}:{children:e,style:i});function Zh(t,e){var n,i,r;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const o=null!==(i=be(e))&&void 0!==i?i:"u">typeof window?window.location.href:void 0;if(!o)return!1;const s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null===(r=t.conditions)||void 0===r?void 0:r.urlMatchType);return Bi[a](s,[o])}function Jh(t){var e,n;return function(t,e){var n,i,r;if(!t||0===t.length)return!0;const o="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:o,a=null==s?void 0:s.navigator,l=null==a?void 0:a.userAgent;if(!l)return!1;const u=function(t,e){var n;const i=function(t){return wt.test(t)?ht:bt.test(t)?ft:yt.test(t)?vt:new RegExp(mt,"i").test(t)?mt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?ct:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dt:kt.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(pt,"i").test(t)?pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(at).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":ut:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(lt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?gt:""}(t);return i===ct||i===ut||"Kobo"===i||"Kindle Fire"===i||i===gt?lt:i===ht||i===vt||i===ft||i===mt?"Console":i===dt?"Wearable":i?at:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(o=null==e?void 0:e.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?at:lt:"Desktop";var r,o,s}(l,{userAgentDataPlatform:null==a||null===(n=a.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==o||null===(i=o.screen)||void 0===i?void 0:i.width,screenHeight:null==o||null===(r=o.screen)||void 0===r?void 0:r.height,devicePixelRatio:null==o?void 0:o.devicePixelRatio});return Bi[null!=e?e:"icontains"](t,[u])}(null===(e=t.conditions)||void 0===e?void 0:e.deviceTypes,null===(n=t.conditions)||void 0===n?void 0:n.deviceTypesMatchType)}const Yh=t=>ud("inProgressSurvey_",t),Kh={},Xh=(t,e)=>{const n=Yh(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Kh[n]}catch(t){ld.error("Error setting in-progress survey state in localStorage",t),Kh[n]=e}},tf=t=>{const e=Yh(t),n=Kh[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){ld.error("Error getting in-progress survey state from localStorage",t)}return null},ef=t=>{const e=tf(t);return!J(null==e?void 0:e.surveySubmissionId)},nf=t=>{const e=Yh(t);delete Kh[e];try{localStorage.removeItem(e)}catch(t){ld.error("Error clearing in-progress survey state from localStorage",t)}};function rf(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function of(t,e=Hc,n){if(t===Vc)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Bc:return{left:"30px"};case zc:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Gc&&n===jc?"60px":"30px"}}}const sf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),af=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),lf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),uf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),cf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),df=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:dc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),hf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:dc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),ff=({fill:t="currentColor"}={})=>dc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[dc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),dc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),vf=dc("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[dc("g",{"clip-path":"url(#ph-survey-logo-clip)",children:[dc("path",{fill:"currentColor",d:"m50 23.34-.35-.05A4.5 4.5 0 0 1 47 21.97L35.56 10.1c-.3-.33-.86-.1-.86.35V27.5c0 .27.22.5.5.5h13.78c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.67-1.89zm-10.81.2a1.8 1.8 0 1 1 0-3.58 1.8 1.8 0 0 1 0 3.58"}),dc("path",{fill:"#0054ff",d:"M.87 19.13a.5.5 0 0 0-.87.34v5.94a2.6 2.6 0 0 0 2.59 2.58H7.8a.5.5 0 0 0 .37-.84zM.86 8.4c-.3-.32-.86-.1-.86.36v6.73q0 .2.13.34l8.81 9.68 1.8 2.06v-8.82zM4.59.82A2.67 2.67 0 0 0 0 2.68v1.93q0 .4.27.69l10.47 10.95v-9.1z"}),dc("path",{fill:"#ff5506",d:"M11.36 28h7.08a.5.5 0 0 0 .36-.85l-8.05-8.4v8.8l.23.28q.16.17.38.17m-.61-11.76 8.84 9.25 2.1 2.33q.1.11.27.14V18.7L10.75 7.15zm0-13.7v1.41a2 2 0 0 0 .55 1.28L21.96 16.2V7.65L15.32.8a2.67 2.67 0 0 0-4.57 1.71z"}),dc("path",{fill:"#ffb70f",d:"M22.06 28h7.76a.5.5 0 0 0 .36-.86l-8.22-8.45v9.27l.09.02zM31 25.49l1.13 1.14c.32.31.85.09.85-.35v-7.3l-.49-.51L21.96 7.64v8.55zM22.52 5.73l9.62 9.89c.3.32.86.1.86-.35V7.46L26.56.82a2.67 2.67 0 0 0-4.59 1.84v1.7c0 .51.2 1 .57 1.37z"})]}),dc("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),dc("defs",{children:dc("clipPath",{id:"ph-survey-logo-clip",children:dc("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})})]});function pf({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return dc("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",vf]})}function mf({text:t,submitDisabled:e,appearance:n,onSubmit:i,link:r,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Oc(Gh),c=!!a&&!!l,d=!s&&dc("button",{className:"form-submit",disabled:e,"aria-label":"Submit survey",type:"button",onClick(){var t;r&&(null===(t=window)||void 0===t||t.open(r)),u?null==o||o():i()},children:t});return dc("div",{className:"bottom-section",children:[c?dc("div",{className:"form-buttons form-buttons-with-back",children:[dc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),d]}):d,!n.whiteLabel&&dc(pf,{urlParams:{utm_source:"survey-footer"}})]})}function gf({question:t,forceDisableHtml:e,htmlFor:n}){return dc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[dc(t.type===Qc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Qh({component:Bu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function yf({onClick:t}){const{isPreviewMode:e}=Oc(Gh);return dc("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:ff({fill:"black"})})}function bf({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=Oc(Gh);return Ac(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return ve(window,"keydown",t),()=>{window.removeEventListener("keydown",t)}},[o]),dc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&dc(yf,{onClick:()=>o()}),dc("h3",{className:"thank-you-message-header",children:t}),e&&Qh({component:Bu("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&dc(mf,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function wf({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=Oc(Gh);return dc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&dc(yf,{onClick:()=>l()}),t&&dc("h3",{className:"intro-screen-header",children:t}),e&&Qh({component:Bu("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),dc(mf,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const kf=t=>H(t)&&t.every(t=>V(t));function Sf({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Vh(),c=Rc(null),[d,h]=Mc(()=>V(s)?s:""),f=null==n?void 0:n.disableAutofocus;Ac(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=Ec(()=>function(t,e,n){const i=t.trim();if(!n&&""===i)return"This field is required";if(""===i)return!1;if(e&&e.length>0)for(const t of e)switch(t.type){case P:var r;if(void 0!==t.value&&t.value>i.length)return null!==(r=t.errorMessage)&&void 0!==r?r:`Please enter at least ${t.value} characters`;break;case F:var o;if(void 0!==t.value&&i.length>t.value)return null!==(o=t.errorMessage)&&void 0!==o?o:`Please enter no more than ${t.value} characters`}return!1}(d,t.validation,t.optional),[d,t.validation,t.optional]),m=oe(t.validation,P),g=oe(t.validation,F),y=Ec(()=>function(t,e){const n=1===t?void 0:t;return n&&e?`Enter ${n}-${e} characters`:n?`Enter at least ${n} ${1===n?"character":"characters"}`:e?`Maximum ${e} ${1===e?"character":"characters"}`:void 0}(m,g),[m,g]),b=()=>{p||i(d.trim())},w=()=>{p||r(d.trim())};return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e,htmlFor:v}),dc("textarea",{ref:c,id:v,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:g,onInput(t){h(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||p||(t.preventDefault(),u?w():b())},value:d}),y&&dc("div",{className:"validation-hint",children:y})]}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function _f({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return dc(Hu,{children:[dc("div",{className:"question-container",children:dc(gf,{question:t,forceDisableHtml:e})}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function xf({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){var u;const c=t.scale,d=10===t.scale?0:1,[h,f]=Mc(()=>Y(s)?s:H(s)&&s.length>0&&Y(parseInt(s[0]))?parseInt(s[0]):V(s)&&Y(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=Vh(),m=t=>p?o(t):r(t);return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e}),dc("div",{className:"rating-section",children:[dc("div",{className:"rating-options",children:["emoji"===t.display&&dc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=Rf[t.scale])||void 0===u?void 0:u.map((e,i)=>dc("button",{"aria-label":`Rate ${i+1}`,className:`ratings-emoji question-${n}-rating-${i} ${i+1===h?"rating-active":""}`,value:i+1,type:"button",onClick(){const e=i+1;f(e),t.skipSubmitButton&&m(e)},children:e},i))}),"number"===t.display&&dc("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:Ef(t.scale).map((e,r)=>dc(Cf,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&dc("div",{className:"rating-text",children:[dc("div",{children:t.lowerBoundLabel}),dc("div",{children:t.upperBoundLabel})]})]})]}),dc(mf,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Z(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Cf({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return dc("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function Tf({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=Rc(null),c=Ec(()=>(t=>{var e;if(!t.shuffleOptions)return t.choices;const n=[...t.choices],i=t.hasOpenChoice&&null!==(e=n.pop())&&void 0!==e?e:null,r=(o=n,(s=zi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return Z(i)||r.push(i),r})(t),[t]),[d,h]=Mc(()=>((t,e)=>V(t)||kf(t)?t:e===Jc?null:[])(s,t.type)),[f,v]=Mc(()=>((t,e)=>{if(V(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(kf(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=Vh(),m=t.type===Jc,g=t.type===Zc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>L(L({},e),{},{isSelected:t,inputValue:t?e.inputValue:""})),m&&h(""),void(t&&setTimeout(()=>{var t;return null===(t=u.current)||void 0===t?void 0:t.focus()},75))}if(m)return h(t),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&H(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>L(L({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||S()||(t.preventDefault(),_()),"Escape"===t.key&&(t.preventDefault(),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},S=()=>!(t.optional||!Z(d)&&(!H(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),_=()=>{f.isSelected&&g?H(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e}),dc("fieldset",{className:"multiple-choice-options limit-height",children:[dc("legend",{className:"sr-only",children:g?" Select all that apply":" Select one"}),c.map((e,i)=>{const r=!!t.hasOpenChoice&&i===t.choices.length-1,o=`surveyQuestion${n}Choice${i}`,s=`${o}Open`,a=r?f.isSelected:m?d===e:H(d)&&d.includes(e);return dc("label",{className:r?"choice-option-open":"",children:[dc("div",{className:"response-choice",children:[dc("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),dc("span",{children:r?`${e}:`:e})]}),r&&dc("input",{type:"text",ref:u,id:s,name:`question${n}Open`,value:f.inputValue,onKeyDown:k,onInput:w,onClick(t){f.isSelected||b(e,!0),t.stopPropagation()},"aria-label":`${e} - please specify`})]},i)})]})]}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:i,onSubmit:_,onPreviewSubmit:_,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const If=[1,2,3,4,5],Mf=[1,2,3,4,5,6,7],Af=[0,1,2,3,4,5,6,7,8,9,10],Rf={2:[df,hf],3:[lf,af,sf],5:[uf,lf,af,sf,cf]};function Ef(t){switch(t){case 5:default:return If;case 7:return Mf;case 10:return Af}}const Of=ce("[Surveys]");function $f(t,e,n){var i;const r=t.questions[e],o=e+1;if(!(null===(i=r.branching)||void 0===i?void 0:i.type))return e===t.questions.length-1?Kc:o;if(r.branching.type===Kc)return Kc;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===Jc){var s;let t=r.choices.indexOf(`${n}`);if(-1===t&&r.hasOpenChoice&&(t=r.choices.length-1),null===(s=r.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(t)){const e=r.branching.responseValues[t];if(Number.isInteger(e))return e;if(e===Kc)return Kc}}else if(r.type===Yc){var a;if(r.optional&&J(n))return o===t.questions.length?Kc:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null===(a=r.branching)||void 0===a||null===(a=a.responseValues)||void 0===a?void 0:a.hasOwnProperty(e)){const t=r.branching.responseValues[e];if(Number.isInteger(t))return t;if(t===Kc)return Kc}}return o}return Of.warn("Falling back to next question index due to unexpected branching type"),o}const Lf=ce("[SurveyTranslations]");function Df(t,e){const n=function(t){var e;return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=$i(t);if(r)return null==i||i.info(`Using override display language: ${r}`),r;const o=function(t){return t&&"object"==typeof t&&"language"in t?$i(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=$i(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.overrideLanguage,storedPersonProperties:null===(e=t.client)||void 0===e?void 0:e.kv.get(s),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},Lf)}(e);if(!n)return Lf.info("No user language detected"),{survey:t,language:null};const i=Fi(t,n,Lf);return{survey:i.survey,language:i.matchedKey}}const Pf="ph:show_survey_widget",Ff="PHWidgetSurveyClickListener";function Nf(t,e){try{const n=t.getBoundingClientRect(),i=window.innerHeight,r=window.innerWidth;let o=n.left+n.width/2-e/2;o+e>r-20&&(o=r-e-20),20>o&&(o=20);const s=i-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":`${n.bottom+12}px`,left:`${o}px`,right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:$h.zIndex}}catch(t){return ld.warn("Failed to calculate trigger position:",t),null}}var qf=class{constructor(t){var e,n;this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Ti=!1,this.Ii=null,this.Mi=!1,this.Ai=null,this.Ri=null,this.Ei=null,this.Oi=!1,this.handlePageUnload=()=>{var t;const e=null===(t=this.$i.client)||void 0===t?void 0:t.kv.get(a);if(e)for(const t of e)ef(t)&&zh(t,this.$i)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l,u;if(!(null===(i=this.$i.client)||void 0===i?void 0:i.canCapture))return;const{survey:c,language:d}=this.Li(t);this.Ii=d,this.Ei=null,this.Di=e;const h=this.Pi(c,e);this.Fi(h.id);const{properties:f,initialResponses:v}=null!=e?e:{},p=!(!v||0>=Object.keys(v).length)&&this.Ni(h,v,f,d);if(p&&!(null===(r=h.appearance)||void 0===r?void 0:r.displayThankYouMessage))return;this.qi(h);let m={};if((null===(o=h.appearance)||void 0===o?void 0:o.position)===Uc&&(null===(s=h.appearance)||void 0===s?void 0:s.widgetSelector)){var g;const t=document.querySelector(h.appearance.widgetSelector);t&&(m=Nf(t,parseInt((null===(g=h.appearance)||void 0===g?void 0:g.maxWidth)||$h.maxWidth))||{})}const y=(null===(a=h.appearance)||void 0===a?void 0:a.surveyPopupDelaySeconds)||0,{shadow:b}=Fh(h,this.$i);this.xi.set(b,b.host);const w={posthog:this.$i,survey:h,removeSurveyFromFocus:this.ji,properties:f,style:m,isSurveyCompleted:p,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:d};if(this.Ei=w,0>=y)return this.Mi=!0,uc(dc(Hf,L({},w)),b);const k=()=>{this.Mi=!0;const{survey:n,language:i}=this.Li(t);this.Ii=i;const r=this.Pi(n,e),o=L(L({},w),{},{survey:r,surveyLanguage:i});this.Ei=o,uc(dc(Hf,L(L({},o),{},{survey:L(L({},r),{},{appearance:L(L({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),b)},S=()=>{var t;if(!(null===(t=this.$i.client)||void 0===t?void 0:t.canCapture)||!this.Bi(h))return ld.info(`Survey ${h.id} no longer eligible when its display delay elapsed; not displaying`),this.ji(h);k()},_=n?null===(l=this.$i.surveys)||void 0===l||null===(l=l._surveyEventReceiver)||void 0===l||null===(u=l.getActivationTimestamp)||void 0===u?void 0:u.call(l,h.id):void 0,x=Y(_)?Math.max(0,Date.now()-_):0,C=Math.max(0,1e3*y-x);if(0>=C)return S();const T=window.setTimeout(()=>{this.wi.delete(h.id),S()},C);this.wi.set(h.id,T)},this.zi=t=>{var e;const{survey:n,language:i}=this.Li(t),{shadow:r,isNewlyCreated:o}=Fh(n,this.$i);this.xi.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===jc&&this.Si.set(t.id,t),o&&uc(dc(Wf,{posthog:this.$i,survey:n,surveyLanguage:i},t.id),r)},this.Hi=t=>{const e=this.ki.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ff),this.ki.delete(t),ld.info(`Removed click listener for survey ${t}`))},this.Ui=t=>{this.Wi(t)||(this.Gi(t),this.Hi(t.id))},this.Vi=t=>{this.Wi(t)||(this.Gi(t),this.Si.delete(t.id))},this.Wi=t=>{try{var e;const n=document.querySelector(rf(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Qi=(t,e)=>{const n=document.querySelector(e),i=this.ki.get(t.id);if(n){if(this.zi(t),i){if(n===i.element)return;ld.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(Ff)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Uc?Nf(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||$h.maxWidth)):{};window.dispatchEvent(new CustomEvent(Pf,{detail:{surveyId:t.id,position:r}}))};ve(n,"click",e),n.setAttribute(Ff,"true"),this.ki.set(t.id,{element:n,listener:e,survey:t}),ld.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.Ui(t)},this.renderPopover=t=>{var e;if(!(null===(e=this.$i.client)||void 0===e?void 0:e.canCapture))return;const{survey:n,language:i}=this.Li(t),{shadow:r}=Fh(n,this.$i);this.xi.set(r,r.host),uc(dc(Hf,{posthog:this.$i,survey:n,removeSurveyFromFocus:this.ji,surveyLanguage:i}),r)},this.renderSurvey=(t,e,n)=>{var i;if(!(null===(i=this.$i.client)||void 0===i?void 0:i.canCapture))return;const{survey:r,language:o}=this.Li(t);let s=!1;this.$i.config.prefillFromUrl&&(s=this.Zi(r,o,n)),uc(dc(Hf,{posthog:this.$i,survey:r,removeSurveyFromFocus:this.ji,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this.$i.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.Bi(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{var e;const n=null===(e=this.$i.client)||void 0===e?void 0:e.canCapture,i=t.filter(t=>n&&(t.type===Wc||t.type===Gc)),r=new Set(i.map(t=>t.id));for(const t of Array.from(this.wi.keys()))r.has(t)||this.cancelSurvey(t);const o=this.Ji(i),s=new Set,a=new Set;o.forEach(t=>{if(t.type===Gc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===jc)return a.add(t.id),void this.zi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(s.add(t.id),this.Qi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}Z(this.Yi)&&t.type===Wc&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.ki.forEach(({survey:t})=>{s.has(t.id)||this.Ui(t)}),this.Si.forEach((t,e)=>{a.has(e)||this.Vi(t)})},t)},this.qi=t=>{Z(this.Yi)||ld.error(`Survey ${this.Yi} already in focus. Cannot add survey ${t.id}.`),this.Yi=t.id},this.ji=t=>{this.Yi!==t.id&&ld.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Fi(t.id),this.Yi=null,this.Ii=null,this.Mi=!1,this.Ei=null,this.Di=void 0,this.Gi(t)},this.$i=t,this.Yi=null,this.Ai=()=>this.Ki(),ve(window,"languagechange",this.Ai),this.Ri=null!==(e=null===(n=t.client)||void 0===n||null===(n=n.getExtension("featureFlagsCommon"))||void 0===n?void 0:n.onFeatureFlags(()=>this.Ki()))&&void 0!==e?e:null}Ki(){var t;if(Z(this.Yi))return;const e=null===(t=this.$i.client)||void 0===t?void 0:t.kv.get(a),n=null==e?void 0:e.find(t=>t.id===this.Yi);if(!n)return;const{survey:i,language:r}=this.Li(n);if(r===this.Ii)return;if(this.Ii=r,!this.Mi)return;const o=this.Pi(i,this.Di),{shadow:s}=Fh(o,this.$i);uc(dc(Hf,L(L({},this.Ei),{},{posthog:this.$i,survey:o,removeSurveyFromFocus:this.ji,surveyLanguage:r})),s)}Pi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?L(L({},t),{},{appearance:L(L(L({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Fi(t){const e=this.wi.get(t);e&&(clearTimeout(e),this.wi.delete(t))}cancelSurvey(t){this.wi.has(t)&&(ld.info(`Cancelled pending survey ${t}`),this.Fi(t),this.Yi===t&&(this.Yi=null,this.Ii=null,this.Mi=!1,this.Ei=null,this.Di=void 0))}startAutomaticDisplay(){if(this.Ti||this.Xi||!1===this.$i.config.automaticDisplay)return;this.Xi=()=>{};const t=function(t){let e;t.callSurveysAndEvaluateDisplayLogic(!0);const n=()=>{G(e)&&(e=setInterval(()=>{t.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},i=()=>{G(e)||(clearInterval(e),e=void 0)};n();const r=()=>{document.hidden?i():(t.callSurveysAndEvaluateDisplayLogic(!1),n())};return ve(document,"visibilitychange",r),()=>{i(),document.removeEventListener("visibilitychange",r)}}(this);this.Ti?t():this.Xi=t}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Kh))delete Kh[t]})()}dispose(){var t;this.Ti=!0,null===(t=this.Xi)||void 0===t||t.call(this),this.Xi=void 0,this.Ai&&(window.removeEventListener("languagechange",this.Ai),this.Ai=null),this.Ri&&(this.Ri(),this.Ri=null),this.wi.forEach((t,e)=>this.Fi(e)),this.ki.forEach((t,e)=>this.Hi(e)),this.xi.forEach((t,e)=>{uc(null,e),null==t||t.remove()}),this.xi.clear(),this.Si.clear(),this.Yi=null}Ji(t){return t.sort((t,e)=>{var n,i;const r=ef(t),o=ef(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Xc,a=e.schedule===Xc;return s&&!a?1:!s&&a?-1:((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=e.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)})}Li(t){return Df(t,this.$i)}Zi(t,e,n){if(this.Ci.has(t.id))return!1;const{params:i}=function(){const t={};let e=!1;const n=window.location.search.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:e};const i=n.split("&");for(const n of i){const i=n.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(n.slice(0,i)),o=decodeURIComponent(n.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){e=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const e=parseInt(s[1],10);t[e]||(t[e]=[]),t[e].push(o)}}return{params:t,autoSubmit:e}}();if(0===Object.keys(i).length)return!1;ld.info("[Survey Prefill] Detected URL prefill parameters");const r=this.er(t,i,e);return!!r&&(this.nr(t,r,n,e),this.Ci.add(t.id),r.isSurveyCompleted)}nr(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&qh({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this.$i,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Ni(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=H(n)?n.map(String):[String(n)];ld.info("[Survey] Processing initial responses");const o=this.er(t,r,i);return!!o&&(this.nr(t,o,n,i),o.isSurveyCompleted)}er(t,e,n){try{const i=function(t,e){const n={};return t.questions.forEach((t,i)=>{if(!e[i]||!t.id)return;const r=e[i],o=Mi(t.id);try{switch(t.type){case Jc:{if(!t.choices||0===t.choices.length)return void ue.warn(`[Survey Prefill] Question ${i} has no choices`);const e=parseInt(r[0],10);if(isNaN(e)||0>e||e>=t.choices.length)return void ue.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Zc:{if(!t.choices||0===t.choices.length)return void ue.warn(`[Survey Prefill] Question ${i} has no choices`);const e=r.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===e.length)return void ue.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&ue.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case Yc:{const e=parseInt(r[0],10),s=t.scale||10,a=10===s?0:1;if(isNaN(e)||a>e||e>s)return void ue.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: ${a}-${s})`);n[o]=e;break}default:ue.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){ue.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return ld.warn("[Survey Prefill] No valid responses after conversion"),null;const r=ki(),{startQuestionIndex:o,skippedResponses:s,skippedIndices:a}=function(t,e,n){let i=0;const r={},o=[],s=t.questions.length+1;let a=0;for(;t.questions.length>i&&s>a&&(a++,e.includes(i));){const e=t.questions[i];if(!e||!("skipSubmitButton"in e)||!e.skipSubmitButton)break;if(e.id){const t=Mi(e.id);G(n[t])||(r[t]=n[t])}o.push(i);const s=$f(t,i,e.id?n[Mi(e.id)]:null);if(s===Kc)return{startQuestionIndex:t.questions.length,skippedResponses:r,skippedIndices:o};i=s}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)).filter(e=>{const n=t.questions[e];return(null==n?void 0:n.id)&&!G(i[Mi(n.id)])}),i),l=o>=t.questions.length;return Xh(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:Hh(t.questions),visitedIndices:a,surveyLanguage:n}),ld.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return ld.error("[Survey Prefill] Error handling prefill:",t),null}}ir(t,e){var n;if(!t)return!0;const i=null===(n=this.$i.client)||void 0===n?void 0:n.getExtension(hc),r=!!(null==i?void 0:i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let o=!0;e&&(o=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const s=r&&o;return s||this.rr(t),s}rr(t){this.Oi||!1!==this.$i.config.featureFlagEvaluation||(this.Oi=!0,ld.warn(`Survey feature flag "${t}" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.`))}sr(t){return!t.conditions||Zh(t,this.$i)&&Jh(t)&&function(t){var e,n;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null===(n=document)||void 0===n?void 0:n.querySelector(t.conditions.selector))}(t)}ar(t){var e;return Wh(t)?{satisfied:!0}:t.internal_targeting_flag_key&&function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)&&!(null===(e=this.$i.client)||void 0===e||null===(e=e.getExtension("featureFlagsCommon"))||void 0===e?void 0:e.hasLoadedFlags)?(this.rr(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.ir(t.internal_targeting_flag_key)}}checkSurveyEligibility(t){var e,n;const i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason=`Survey is not running. It was completed on ${t.end_date}`,i;if(!dd.includes(t.type))return i.eligible=!1,i.reason=`Surveys of type ${t.type} are never eligible to be shown in the app`,i;const r=null===(e=t.conditions)||void 0===e?void 0:e.linkedFlagVariant;if(!this.ir(t.linked_flag_key,r))return i.eligible=!1,i.reason=r?`Survey linked feature flag is not enabled for variant ${r}`:"Survey linked feature flag is not enabled",i;if(!this.ir(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.ar(t);var s;return o.satisfied?(t=>{let e=null;try{e=localStorage.getItem("lastSeenSurveyDate")}catch(t){ld.error("localStorage error: "+t)}return function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>t}(t,e)})(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays)?((t=>{let e=null;try{e=localStorage.getItem(cd(t))}catch(t){ld.error("localStorage error: "+t)}return!!e&&!Wh(t)})(t)&&(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again"),i):(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyCaptureEligibility(){var t;return(null===(t=this.$i.client)||void 0===t?void 0:t.canCapture)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(t){const e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){const e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this.lr(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}lr(t){var e;if(!Ni(t)&&!function(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}(t))return!0;const n=null===(e=this.$i.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}ur(t){var e;return!(null===(e=t.feature_flag_keys)||void 0===e?void 0:e.length)||t.feature_flag_keys.every(({key:t,value:e})=>!t||!e||this.ir(e))}Bi(t){return this.checkSurveyEligibility(t).eligible&&this.sr(t)&&this.lr(t)&&this.ur(t)}Gi(t){try{const e=document.querySelector(rf(t,!0));(null==e?void 0:e.shadowRoot)&&(uc(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){ld.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.qi,removeSurveyFromFocus:this.ji,surveyInFocus:this.Yi,surveyTimeouts:this.wi,handleWidget:this.zi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Qi,sortSurveysByAppearanceDelay:this.Ji.bind(this),checkFlags:this.ur.bind(this),isSurveyFeatureFlagEnabled:this.ir.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Mi}}};function jf({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){Ac(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Gc,s=Zh(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===jc&&o;if(!s)return ld.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(ld.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};ve(window,"popstate",s),ve(window,"hashchange",s);const a=window.history.pushState,l=window.history.replaceState;return window.history.pushState=function(...t){a.apply(this,t),s()},window.history.replaceState=function(...t){l.apply(this,t),s()},()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),window.history.pushState=a,window.history.replaceState=l}},[i,t,e,n,r])}const Bf=200;function zf(t="right"){switch(t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Hf({survey:t,forceDisableHtml:e,posthog:n,style:i={},previewPageIndex:r,removeSurveyFromFocus:o=()=>{},isPopup:s=!0,onPreviewSubmit:a=()=>{},onPreviewBack:l=()=>{},onPopupSurveyDismissed:u=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:h,skipShownEvent:f,surveyLanguage:v}){var p,m,g,y,b,w,k,S,_,x,C,T;const I=Rc(null),M=Number.isInteger(r),{isPopupVisible:A,isSurveySent:R,hidePopupWithAnimation:E}=function(t,e,n,i,r,o,s,a,l){const[u,c]=Mc(i||0===n||t.type===Vc),[d,h]=Mc(!1),f=Rc(!1),v=()=>{const e=()=>{o&&r(t),c(!1)};if(f.current)return;const n=null==s?void 0:s.current;n?(f.current=!0,n.style.transition=`opacity ${Bf}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return Ac(()=>{if(!e)return void ld.error("usePopupVisibility hook called without a PostHog instance.");if(i)return;let r;const o=e=>{var n,i;if(e.detail.surveyId===t.id){if(!(null===(n=t.appearance)||void 0===n?void 0:n.displayThankYouMessage))return v();h(!0),(null===(i=t.appearance)||void 0===i?void 0:i.autoDisappear)&&(r&&clearTimeout(r),r=setTimeout(v,5e3))}},s=()=>{var n;if(Zh(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}window.dispatchEvent(new Event("PHSurveyShown")),a||null===(n=e.client)||void 0===n||n.capture(td,L(L({[rd]:t.name,[id]:t.id,[od]:t.current_iteration,[sd]:t.current_iteration_start_date},l&&{[ad]:l}),{},{sessionRecordingUrl:fc(e)}))}};ve(window,"PHSurveyClosed",p),ve(window,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),window.removeEventListener("PHSurveyClosed",p),window.removeEventListener("PHSurveySent",o)}},[]),jf({survey:t,removeSurveyFromFocus:r,setSurveyVisible:c,isPreviewMode:i,posthog:e}),{isPopupVisible:u,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:v}}(t,n,(null===(p=t.appearance)||void 0===p?void 0:p.surveyPopupDelaySeconds)?1e3*t.appearance.surveyPopupDelaySeconds:0,M,o,s,I,f,v),O=R||r===t.questions.length||!0===h,[D,P]=Mc(!1),F=Ec(()=>!!tf(t),[t]),N=!(!(null===(m=t.appearance)||void 0===m?void 0:m.introScreenHeader)&&!(null===(g=t.appearance)||void 0===g?void 0:g.introScreenDescription)),q=M?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!D&&!F,j=Ec(()=>{const e=tf(t),i=(null==e?void 0:e.surveySubmissionId)||ki()||"";return{isPreviewMode:M,previewPageIndex:r,onPopupSurveyDismissed(){v?Bh(t,n,M,v):Bh(t,n,M),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[M,r,s,n,t,u,a,l,d,v]);return A?dc(Gh.Provider,{value:j,children:dc("div",{className:"ph-survey",style:L(L({},of(t.type,null===(b=t.appearance)||void 0===b?void 0:b.position,null===(w=t.appearance)||void 0===w?void 0:w.widgetType)),i),ref:I,children:O?dc(bf,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescriptionContentType,appearance:t.appearance||$h,onClose(){E(),c()}}):q?dc(wf,{header:(null===(x=t.appearance)||void 0===x?void 0:x.introScreenHeader)||"",description:(null===(C=t.appearance)||void 0===C?void 0:C.introScreenDescription)||"",forceDisableHtml:!!e,contentType:null===(T=t.appearance)||void 0===T?void 0:T.introScreenDescriptionContentType,appearance:t.appearance||$h,onStart:()=>P(!0)}):dc(Uf,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function Uf({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=Ec(()=>{const e=tf(t);if(!e)return null;const n=Y(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(nf(t),null)},[t]),[s,a]=Mc(()=>((null==o?void 0:o.responses)&&ld.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=Mc(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=Oc(Gh),[b,w]=Mc(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=Y(e)&&e>=0&&t.questions.length>e?e:0;return Y(c)&&c>=0?c:n}),[k,S]=Mc(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[_,x]=Mc(()=>{var e;const n=tf(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=Ec(()=>Hh(Uh(t,o)),[t.id,o]),T=Ec(()=>{if(!C||new Set(C).size!==C.length)return Uh(t,o);const e=new Map(t.questions.map(t=>[t.id,t])),n=C.map(t=>e.get(t)).filter(t=>!!t);return n.length===C.length?n:t.questions},[C,t.questions,t,o]);Ac(()=>{!m||G(c)||0>c||w(c)},[c,m]);const I=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),M=T.at(b);return M?dc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&dc(yf,{onClick(){d()}}),dc("div",{className:"survey-box","data-question-index":b,children:[l&&dc("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Gf({question:M,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||$h,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{var o;if(!n)return void ld.error("onNextButtonClick called without a PostHog instance.");if(!(null===(o=n.client)||void 0===o?void 0:o.canCapture))return void u(!0);if(u(!1),!r)return void ld.error("onNextButtonClick called without a questionId.");const{responses:l,questionSnapshots:c}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:L(L({},t),{},{[Mi(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?L(L({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:_},r,e,T[i]);a(l),x(c);const d=$f(t,i,e),h=d===Kc,f=[...k,i];if(h||(S(f),w(d),Xh(t,{surveySubmissionId:p,responses:l,lastQuestionIndex:d,questionOrder:Hh(T),visitedIndices:f,surveyLanguage:y,questionSnapshots:c})),t.enable_partial_responses||h){const e=new Set(f.map(t=>{var e;return null===(e=T[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Mi(t))),i=Object.fromEntries(Object.entries(l).filter(([t])=>e.has(t)));qh({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:h,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:c})}})({res:e,displayQuestionIndex:b,questionId:M.id}),onPreviewSubmit:f,initialValue:M.id?s[Mi(M.id)]:void 0,canGoBack:I,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);S(n),w(e),Xh(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:Hh(T),visitedIndices:n,surveyLanguage:y,questionSnapshots:_})}})]})]}):null}function Wf({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d,h;const[f,v]=Mc(!0),[p,m]=Mc(!1),[g,y]=Mc({}),b=Rc(void 0),w=()=>{var t;(p||!n||i||(null===(t=n.client)||void 0===t?void 0:t.canCapture))&&m(!p)};if(Ac(()=>{var e,r,o;if(!n)return void ld.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&y((o=null===(r=t.appearance)||void 0===r?void 0:r.position)&&o!==Hc&&o!==Uc?{}:{top:"50%",bottom:"auto"});const s=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(ld.info(`Received show event for feedback button survey ${t.id}`),y(i.detail.position||{}),w())};return ve(window,Pf,s),()=>{G(b.current)||(clearTimeout(b.current),b.current=void 0),window.removeEventListener(Pf,s)}},[n,i,t.id,null===(o=t.appearance)||void 0===o?void 0:o.widgetType,null===(s=t.appearance)||void 0===s?void 0:s.position,null===(a=t.appearance)||void 0===a?void 0:a.widgetSelector,null===(l=t.appearance)||void 0===l?void 0:l.borderColor]),jf({survey:t,setSurveyVisible:v,posthog:n}),!f)return null;const k=()=>{t.schedule!==Xc&&v(!1),G(b.current)||clearTimeout(b.current),b.current=setTimeout(()=>{b.current=void 0,m(!1)},200)};return dc(Hu,{children:["tab"===(null===(u=t.appearance)||void 0===u?void 0:u.widgetType)&&dc("button",{className:"ph-survey-widget-tab "+("top"===(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition)?"widget-tab-top":""),onClick:w,disabled:i,style:zf(null===(d=t.appearance)||void 0===d?void 0:d.tabPosition),children:(null===(h=t.appearance)||void 0===h?void 0:h.widgetLabel)||""}),p&&dc(Hf,{posthog:n,survey:t,forceDisableHtml:e,style:g,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:r})]})}const Gf=({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l})=>{const u={forceDisableHtml:e,appearance:i,onPreviewSubmit(t){o(t)},onSubmit(t){r(t)},initialValue:s,displayQuestionIndex:n,canGoBack:a,onBack:l};switch(t.type){case Qc:return Bu(Sf,L(L({},u),{},{question:t,key:t.id}));case"link":return Bu(_f,L(L({},u),{},{question:t,key:t.id}));case Yc:return Bu(xf,L(L({},u),{},{question:t,key:t.id}));case Jc:case Zc:return Bu(Tf,L(L({},u),{},{question:t,key:t.id}));default:return ld.error(`Unsupported question type: ${t.type}`),null}};function Vf(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&U(n.then)&&n.then(void 0,()=>{})}}}}function Qf(t,e){return e.length>t?e.slice(0,t)+"...":e}function Zf(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!we(e));return e}function Jf(t,{e:e,maskAllElementAttributes:n,maskAllText:i,elementAttributeIgnoreList:r,elementsChainAsString:o,disableCaptureUrlHashes:s}){var a,l;if(!we(t))return{props:{}};const u=[t],c=new Set([t]);let d=t;for(;d.parentNode&&!ke(d,"body")&&1e3>u.length;){if(Se(d.parentNode)){const t=d.parentNode.host;if(c.has(t))break;c.add(t),u.push(t),d=t;continue}if(!we(d.parentNode))break;if(c.has(d.parentNode))break;c.add(d.parentNode),u.push(d.parentNode),d=d.parentNode}const h="click"===e.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?u.findIndex(t=>ke(t,"button")||ke(t,"a")):-1;h>0&&(i=i||u.slice(0,h+1).some(t=>!De(t)||Pe(t)));const f=[],v={};let p,m=!1,g=!1;if(de(u,t=>{const e=De(t);if(ke(t,"a")&&!n&&!(null==r?void 0:r.includes("href"))){const n=t.getAttribute("href");m=!!(e&&n&&Ue(n))&&(s?St(n):n)}N(xe(t),"ph-no-capture")&&(g=!0),f.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Ie.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Qf(1024,We(t)):Qf(1024,Ce(t)));const a=xe(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),de(t.attributes,function(n){var o;if((!Pe(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ue(n.value)&&(!V(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=_e(t).join(" ")),s["attr__"+n.name]=Qf(1024,"href"===n.name&&r?St(t):t)}});let l=1,u=1,c=t;for(;c=Zf(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,n,i,r,s)),de(function(t){if(!De(t))return{};const e={};return de(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){const n=t.name.replace("data-ph-capture-attribute-",""),i=t.value;n&&i&&Ue(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(v,e)||(v[e]=t)})}),g)return{props:{},explicitNoCapture:g};if(h>0&&(t=u[h],f.splice(0,h)),i||(f[0].$el_text=ke(t,"a")||ke(t,"button")?We(t):Ce(t)),m){var y,b;f[0].attr__href=m;const t=null===(y=pe(m))||void 0===y?void 0:y.host,e=null===(b=typeof window>"u"?void 0:window)||void 0===b||null===(b=b.location)||void 0===b?void 0:b.host;t&&e&&t!==e&&(p=m)}return{props:he((k=e.type,{$event_type:k,$ce_version:1}),o?{}:{$elements:f},{$elements_chain:(w=f,H(w)?function(t){return t.map(t=>{var e,n;let i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class){t.attr_class.sort();for(const e of t.attr_class)i+=`.${e.replace(/"/g,"")}`}const r=L(L(L(L({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(n=t.nth_of_type)&&void 0!==n?n:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),o={};return fe(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ve(t.toString())]=Ve(e.toString())),i+=":",i+=fe(o).map(([t,e])=>`${t}="${e}"`).join(""),i}).join(";")}(function(t){return t.map(t=>{var e,n;const i={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Qe(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return fe(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(w)):"")},(null===(a=f[0])||void 0===a?void 0:a.$el_text)?{$el_text:null===(l=f[0])||void 0===l?void 0:l.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},v),target:t};var w,k}const Yf="logs";A(function*(t){const e=yield ie(ge(t.data),Ci.DEBUG,{rethrow:!0});if(!e)return t;const n=yield e.arrayBuffer();return L(L({},t),{},{cr:{contentType:"text/plain",body:n,estimatedSize:n.byteLength}})});const Kf=()=>{var e;return(null==t||null===(e=t.performance)||void 0===e?void 0:e.now)?t.performance.now():Date.now()},Xf=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var tv=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);const n={};for(const i of t){const t=null==e?void 0:e.get_property(i);G(t)||(n[i]=t)}return n}set(t,e){var n;null===(n=this._instance.persistence)||void 0===n||n.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null===(e=this._instance.persistence)||void 0===e||e.unregister(t)}},ev=class{constructor(t){this.instance=t,this.R=ue,this.kv=new tv(t),this.onSession=t=>Vf(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>Vf(this.instance._addCaptureHook((e,n)=>{if(n)try{t({event:e,properties:n.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{const e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},n=this.instance.dr.on("extensionsRemoteConfig",e);return this.instance.vr&&e(this.instance.vr),Vf(n)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){const t=this.instance.get_property("$device_id");return"string"==typeof t?t:void 0}get library(){return{name:Ci.LIB_NAME,version:Ci.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null===(e=this.instance.persistence)||void 0===e?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,i,r;const o=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==o?void 0:o.sessionId)&&void 0!==e?e:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==o?void 0:o.sessionStartTimestamp)&&void 0!==i?i:0,lastActivityTimestamp:null!==(r=null==o?void 0:o.lastActivityTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return U(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(null===(t=this.instance.rateLimiter)||void 0===t?void 0:t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case"featureFlags":case hc:e=this.instance.featureFlags;break;case Yf:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const i=L({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(t,e,i))}pr(t){var e;return!G(t)||!(null===(e=this.instance.rateLimiter)||void 0===e?void 0:e.lastEventRateLimited)}registerDynamicEventProperties(t){return Vf(this.instance.mr(t))}sendRequest(t){var e=this;return A(function*(t,n={}){var i;const r=null!==(i=n.target)&&void 0!==i?i:"api",o=n.query?((t,e,n=!0)=>{var i;const[r,o]=t.split("?"),s=L({},e),a=null!==(i=null==o?void 0:o.split("&").map(t=>{var e;const[i,r]=t.split("="),o=n&&null!==(e=s[i])&&void 0!==e?e:r;return delete s[i],`${i}=${o}`}))&&void 0!==i?i:[],l=ye(s);return l&&a.push(l),a.length>0?`${r}?${a.join("&")}`:r})(t,n.query):t,s=e.instance.requestRouter.endpointFor(r,o),a={method:n.method,url:s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?D.Base64:void 0,timestampMode:n.sentAt};return"api"===r&&"/i/v1/logs"===t&&(a.batchKey="logs"),"sendBeacon"===n.transport?(e.instance._send_request(a),{statusCode:202}):new Promise(t=>{var n;if(a.callback=t,"flags"===r&&(null===(n=e.instance.config.metrics)||void 0===n?void 0:n.flags)){let n;a.onDispatch=()=>{n=Kf()},a.callback=i=>{G(n)||e.gr(s,i,Kf()-n),t(i)}}e.instance._send_request(a)})}).apply(this,arguments)}gr(t,e,n){try{var i,r,o;const s=e.statusCode||void 0,a={"server.address":(null!==(i=null===(r=pe(t))||void 0===r?void 0:r.hostname)&&void 0!==i?i:t).replace(/^\[(.*)\]$/,"$1")};s&&(a["http.response.status_code"]=s);const l=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(s,e.error);l&&(a["error.type"]=l);const u=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}();u&&(a["client.timezone"]=u),null===(o=this.instance.metrics)||void 0===o||o.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:a,bounds:Xf})}catch(t){ue.error("Failed to record the /flags request duration",t)}}},nv=class{constructor(t){this._instance=t}get(){var t,e,n,i;const r=null===(t=this._instance)||void 0===t?void 0:t.config;return{disableSurveys:!!(null==r?void 0:r.disable_surveys),cookielessMode:!!(null==r?void 0:r.cookieless_mode),advancedEnableSurveys:!!(null==r?void 0:r.advanced_enable_surveys),requestTimeoutMs:null!==(e=null==r?void 0:r.surveys_request_timeout_ms)&&void 0!==e?e:1e4,prefillFromUrl:!!(null==r||null===(n=r.surveys)||void 0===n?void 0:n.prefillFromUrl),automaticDisplay:!(null==r?void 0:r.disable_surveys_automatic_display),featureFlagEvaluation:!(null==r?void 0:r.advanced_disable_feature_flags),overrideLanguage:null==r?void 0:r.override_display_language,prepareStylesheet:null==r?void 0:r.prepare_external_dependency_stylesheet,get_current_url:null==r?void 0:r.get_current_url,uiHost:null===(i=this._instance)||void 0===i||null===(i=i.requestRouter)||void 0===i?void 0:i.endpointFor("ui","")}}getExtensions(){const t=null==o?void 0:o.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:i}=t;return{generateSurveys:n?t=>n(e,t):void 0,loadExternalDependency:i?t=>i(e,"surveys",t):void 0}}onMatchingConditionsChanged(e){var n,i;const r=null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook(t=>{"$pageview"!==t&&t!==td&&t!==ed&&t!==nd||e()}),o=()=>e();ve(t,"PHSurveyShown",o);let s=!1;const a=null===(i=this._instance)||void 0===i?void 0:i.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,null==r||r(),null==a||a(),null==t||t.removeEventListener("PHSurveyShown",o)}}};const iv=new WeakMap,rv=(t,e)=>{const n=function(t){var e;const n=new nv(t);if(!t)return{get config(){return n.get()}};if(null===(e=t.surveys)||void 0===e?void 0:e.getRenderContext)return t.surveys.getRenderContext();let i=iv.get(t);return i||(i={client:new ev(t),get config(){return n.get()},surveys:t.surveys},iv.set(t,i)),i}(t);return n?function(t,e){if(typeof document>"u"||typeof window>"u")return;const n=new qf(t);return!1===t.config.automaticDisplay?(ld.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===e?(ld.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}(n,e):void 0};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.generateSurveys=rv,o.extendPostHogWithSurveys=rv;const ov=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},sv=1e4,av=(t,e,n)=>n.remaining>0?e.length>n.remaining?(t.push(e.slice(0,n.remaining)),n.remaining=0,n.truncated=!0,!1):(t.push(e),n.remaining-=e.length,!0):(n.truncated=!0,!1),lv=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return av(e,i,n);if(n.truncated=!0,2>n.remaining)return!1;let r=0,o=Math.min(t.length,n.remaining-2);for(;o>r;){const e=Math.ceil((r+o)/2);JSON.stringify(t.slice(0,e)).length>n.remaining?o=e-1:r=e}return av(e,JSON.stringify(t.slice(0,r)),n)},uv=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,cv=(t,e,n)=>{if(!n.truncated){if(n.keysRemaining-=1,n.sizeRemaining-=String(e).length+t.length,0>=n.keysRemaining||0>=n.sizeRemaining)return n.truncated=!0,void(n.result.attributes_truncated=!0);n.result[t]=e}},dv=(t,e,n)=>{if(!n.truncated)if(W(t)){if(n.seen.has(t))return void cv(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(dv(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else cv(e,t,n)},hv=(t,e,n,i,r=!1,o)=>{if(!uv(t))return!r||av(e,"null",n);if(Z(t)||(t=>{try{return Y(t)||K(t)}catch(t){return!1}})(t))return av(e,JSON.stringify(t),n);if("string"==typeof t)return lv(t,e,n);if(!W(t)&&!H(t))return av(e,JSON.stringify(t),n);if(i.has(t))return lv("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(U(o))return hv(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return lv(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return av(e,JSON.stringify(t.valueOf()),n)}catch(t){}if(t instanceof Error){const s={};try{for(const e in t)({}).hasOwnProperty.call(t,e)&&(s[e]=t[e])}catch(t){}try{s.name=t.name}catch(t){}try{s.message=t.message}catch(t){}try{s.stack=t.stack}catch(t){}return hv(s,e,n,i,r,o)}if(H(t)){if(!av(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!av(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!hv(o,e,n,i,!0))return!1}return av(e,"]",n)}if(!av(e,"{",n))return!1;let s=!0;try{for(const r in t){if(!{}.hasOwnProperty.call(t,r))continue;if(0>=n.remaining)return n.truncated=!0,!1;let a;try{a=t[r]}catch(t){continue}if(o)try{dv(a,r,o)}catch(t){}if(!uv(a))continue;const l=`${s?"":","}${JSON.stringify(r)}:`;if(l.length>=n.remaining)return n.truncated=!0,!1;const u=e.length,c=n.remaining,d=n.truncated;if(!av(e,l,n))return!1;const h=e.length,f=hv(a,e,n,i,!1),v=n.truncated;if(e.length!==h){if(s=!1,!f)return!1}else if(e.length=u,n.remaining=c,n.truncated=f?d:v,!f)return!1}}catch(t){}return av(e,"}",n)},fv=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=W(t[0])?{result:{},keysRemaining:50,sizeRemaining:sv,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||av(n," ",i))&&hv(t[e],n,i,new WeakSet,!1,0===e?r:void 0);e++);return{body:n.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==r?void 0:r.result)||{}}},vv={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},pv=t=>"canCapture"in t,mv=t=>({console:o.console,hostname:o.location.host,getCapturingLogs(){let e;return e=pv(t)?t.canCapture?t.getExtension(Yf):void 0:(U(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing())?t.logs:void 0,e?{captureConsoleLog:n=>((t,e,n)=>{if(pv(t))return void e.captureConsoleLog(n);const i=(t=>{const e=/^1\.(\d+)\.(\d+)$/.exec(t);if(!e)return;const n=Number(e[1]),i=Number(e[2]);return 392>n||n>419?void 0:410===n?i>4?i>10?void 0:"de":"le":418===n?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===n?i>2?void 0:"vi":410>n?"le":"he"})(t.version),r=i?e[i]:void 0;i?U(r)&&r.call(e,n):U(e.captureConsoleLog)&&e.captureConsoleLog(n)})(t,e,n),captureBufferedConsoleLog(t,n,i){var r;return null===(r=e.captureBufferedConsoleLog)||void 0===r?void 0:r.call(e,t,n,i)}}:void 0}});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.logs={initializeLogs:t=>(t=>{const e=t.console;let n=t;const i=[],r={host:t.hostname};let o=!1;const s=()=>{n=void 0;for(const t of i)try{t()}catch(t){}};try{for(const t of Object.keys(vv)){const s=i=>(...s)=>{let a=!1;try{if(s.length>0&&!o&&n){const e=n.getCapturingLogs();if(e){o=!0,a=!0;const{body:n,truncated:i,attributes:l}=fv(s,sv),u=L(L({},r),i?{body_truncated:"true"}:{}),c={level:vv[t],body:n,attributes:L(L({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Hl(e,t,t=>{const e=s(t);return e.__rrweb_original__=ov(a),e}))}}catch(t){throw s(),t}return s})(mv(t)),replayConsoleBuffer:(t,e)=>((t,e)=>{const n=t.getCapturingLogs();if(n)for(const r of e)try{var i;const{body:e,truncated:o,attributes:s}=fv(r.args,sv);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:vv[r.level],body:e,attributes:L(L({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(mv(t),e)};const gv=ce("[ExceptionAutocapture]"),yv=new class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,e,0).apply(t),r=this.buildParsingContext(e),o=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(t){var e=this;return A(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&H(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null===(e=t.syntheticException)||void 0===e?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let i,r;if(null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack)try{r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch(t){}return L(L({},t),{},{cause:i,stack:r,errors:null===(n=t.errors)||void 0===n?void 0:n.map(t=>this.parseStacktrace(t,e))})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return A(function*(){let n=t;for(const t of e.modifiers)n=yield t(n);return n})()}convertToExceptionList(t,e){const n=[],i=(t,r,o)=>{var s;const a=n.length,l=void 0===r?L(L({type:"string"==typeof e.type&&e.type.length>0?e.type:"generic"},"boolean"==typeof e.handled?{handled:e.handled}:void 0===e.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof e.synthetic?e.synthetic:t.synthetic,exception_id:a}):{type:"chained",source:o,synthetic:t.synthetic,exception_id:a,parent_id:r},u={type:t.type,value:t.value,mechanism:l};t.stack&&(u.stacktrace={type:"raw",frames:t.stack}),n.push(u),t.cause&&i(t.cause,a,"cause");for(const e of null!==(s=t.errors)&&void 0!==s?s:[])i(e,a,"member")};return i(t),n}buildParsingContext(t){var e;return{chunkIdMap:Mt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(nt(t)){let n=Object.getPrototypeOf(t);for(let i=0;n&&100>i;i++){var e;const i=null===(e=Object.getOwnPropertyDescriptor(n,"constructor"))||void 0===e?void 0:e.value;if("function"==typeof i&&"AggregateError"===i.name){const e=t.errors;return H(e)?e:void 0}n=Object.getPrototypeOf(n)}}}catch(t){}}buildCoercingContext(t,e,n=0){let i=0,r=0,o=!1;const s=new Set,a=[],l={},u=(t,e,n=0)=>{const u=c(e,n),d=u.apply;if(u.apply=e=>{a.push(t);try{return d(e)}finally{a.pop()}},n>4||n>0&&-1!==a.indexOf(t))return this.coerceFallback(u);const h="object"==typeof t&&null!==t||"function"==typeof t;if(0===n&&i>=50||h&&s.has(t))return;h&&s.add(t),0===n&&i++;const f=this.getAggregateErrors(t);let v,p;o||(o=!!f);try{if(v=this.applyCoercers(t,u),!v)throw l}catch(t){if(t===l)return void(0===n&&i--);if(!o)throw t;v=this.coerceFallback(u)}if(!f||i>=50)return v;try{p=f.length}catch(t){return v}if(!Number.isInteger(p)||0>p||p>4294967295)return v;const m=[];for(let t=0;50>i&&1e3>r&&p>t;t++){let n;r++;try{n=u.next(f[t])}catch(t){i++,n=this.coerceFallback(c(e+1))}n&&m.push(n)}return L(L({},v),{},{errors:m})},c=(n,i=0)=>L(L({},e),{},{syntheticException:0==n?e.syntheticException:void 0,mechanism:0==n?t:{},apply(t){const e=u(t,n,i+1);if(!e)throw l;return e},next:t=>u(t,n+1)}),d=c(n);return L(L({},d),{},{apply:t=>{var e;return null!==(e=u(t,n))&&void 0!==e?e:this.coerceFallback(d)}})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=V(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return et(t,"DOMException")}isDOMError(t){return et(t,"DOMError")}},new class{match(t){return et(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!it(t))return!1;try{const e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var n;const i=this.getUnhandledRejectionReason(t);return tt(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!et(t,"ErrorEvent")&&(null!=t.error||this.yr(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return L(L({},i),{},{stack:null!==(n=this.br(t))&&void 0!==n?n:i.stack,synthetic:!0})}yr(t){return V(t.message)&&t.message.length>0}br(t){var e,n;const i=t,r=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(n=i.colno)&&void 0!==n?n:0;if(V(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return nt(t)}coerce(t,e){var n;const i=this.getStack(t),r=void 0===i?null===(n=e.syntheticException)||void 0===n?void 0:n.stack:void 0,o=!!r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:r,cause:t.cause?e.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if("string"==typeof e&&e.length>0)return e;const n=t.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(t){return}}},new class{match(t){return it(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Kt(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var n,i;const r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null!==(n=this.getStack(t))&&void 0!==n?n:null===(i=e.syntheticException)||void 0===i?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(it(t))return t.constructor.name;const e="name"in t?t.name:void 0;return V(e)&&!Q(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){let e=`'${t.name}' captured as exception`;return"message"in t&&"string"==typeof t.message&&(e+=` with message: '${t.message}'`),e}if("message"in t&&"string"==typeof t.message)return t.message;const e=this.getObjectClassName(t);return`${e&&"Object"!==e?`'${e}'`:"Object"} captured as exception with keys: ${Kt(t)}`}isSeverityLevel(t){return V(t)&&!Q(t)&&Yt.indexOf(t)>=0}getStack(t){try{return V(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:V(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(nt(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var n;const[i,r]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=r?r:t,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const i=t.match(Jt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return tt(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}}],function(t,...e){return(n,i=0)=>{const r=[],o=n.split("\n"),s=Math.min(o.length,i+1e3),a=[];for(let n=i;s>n;n++){const i=o[n];if(i.length>1024)continue;const s=zt.test(i)?i.replace(zt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Ut(r);if(t){for(let e=a.length-1;e>=0;e--){const n=a[e];if(t.start>=n.start+n.length)break;a.pop()}a.push(t)}break}}if(Qt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Gt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Wt(r,t);return a.some(t=>0===t.start&&r.length===t.length)&&function(t){const e=t.map(t=>`${t.function}|${t.filename}|${t.lineno}|${t.colno}|${t.module}`);let n=0;for(let t=1;e.length>t;t++)Zt(e,t,n)&&(n=t);t.push(...t.splice(0,n))}(r),function(t){if(!t.length)return[];const e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return L(L({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Nt,Bt)),bv=(t,e)=>{try{return t()}catch(t){return e}},wv=(t,e)=>bv(()=>t(e()),void 0),kv=t=>bv(()=>U(t)&&U(t.call),!1),Sv=(t,e)=>bv(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),_v=(t,e,n)=>{bv(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),bv(()=>{t[e]=n},void 0)},xv=e=>{const n=t;n||gv.info("window not available, cannot wrap onerror");const i=bv(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return wv(e,()=>yv.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(V(t)&&V(e)&&e.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:e,lineno:n,colno:i})}catch(e){return t}return t})(t),{mechanism:{handled:!1}})),!!kv(i)&&null!==(n=i(...t))&&void 0!==n&&n},Sv(n,"onerror"),()=>_v(n,"onerror",i)},Cv=(e,n=!1)=>{const i=t;i||gv.info("window not available, cannot wrap onUnhandledRejection");const r=bv(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return wv(e,()=>yv.buildFromUnknown(t,{mechanism:{handled:!1}})),kv(r)?null!==(i=r(t))&&void 0!==i&&i:n},Sv(i,"onunhandledrejection"),()=>_v(i,"onunhandledrejection",r)},Tv={wrapOnError:xv,wrapUnhandledRejection:Cv,wrapConsoleError(t){const e=console;e||gv.info("console not available, cannot wrap console.error");const n=bv(()=>e.error,void 0);return e.error=function(...e){bv(()=>e.length>1&&V(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||wv(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return yv.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),kv(n)&&n(...e)},Sv(e,"error"),()=>_v(e,"error",n)}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.errorWrappingFunctions=Tv,o.posthogErrorWrappingFunctions=Tv;const Iv=(t,e)=>{if(!U(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!Z(n)&&"object"==typeof n&&H(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){gv.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],r=e=>{try{var n;null===(n=t.capture)||void 0===n||n.call(t,"$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){gv.error("Failed to capture exception for a legacy client",t)}};xv(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Cv(r,!0)};o.extendPostHogWithExceptionAutoCapture=Iv,o.extendPostHogWithExceptionAutocapture=Iv;const Mv="X-POSTHOG-SESSION-ID",Av="X-POSTHOG-WINDOW-ID",Rv="X-POSTHOG-DISTINCT-ID",Ev=[Mv,Av,Rv],Ov=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],$v=(t,e)=>({}.hasOwnProperty.call(t,e)),Lv=t=>"object"==typeof t&&!Z(t)||U(t),Dv=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Pv=e=>{try{var n;return Dv(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null===(n=t.location)||void 0===n?void 0:n.href).toString()}catch(t){return}},Fv=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(H(t)&&!t.includes(o))return!1;let s=!1;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Mv,t),r.set(Av,e),s=!0}const a=(t=>U(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Rv,a),s=!0),s};o.__PosthogExtensions__=o.__PosthogExtensions__||{};const Nv={_patchFetch:(e,n,i)=>Hl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=Pv(r);if(t)if(Dv(r)){const t=new Request(r,o);Fv(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(Lv(o)?o.headers:void 0);if(Fv(e,n,i,t,s)){const t=((t,e)=>{if(G(t)||Z(t))return{headers:e};if(!Lv(t))return;const n=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){const t=Object.create(n);return Object.defineProperty(t,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),t}return new Proxy({headers:e},{get:(t,e)=>$v(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>$v(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),Ov.forEach(t=>{t in n&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){const i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&Ov.includes(e)&&e in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,e,n)}};const r=Reflect.getOwnPropertyDescriptor(n,e);return r?L(L({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(o,s);t&&(a=[r,t])}}}catch(t){a=s}return t.apply(this,a)}),_patchXHR:(e,n,i)=>Hl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=Pv(o);d&&Fv(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Ev.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};o.__PosthogExtensions__.tracingHeadersPatchFns=Nv,o.postHogTracingHeadersPatchFns=Nv,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){const e=this.length;let n=Math.trunc(t)||0;return 0>n&&(n+=e),0>n||n>=e?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(let n=this.length-1;n>=0;n--){const i=this[n];if(t.call(e,i,n,this))return i}},writable:!0,enumerable:!1,configurable:!0});var qv=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(t.hadRecentInput)return;const n=this.i[0],i=this.i.at(-1);this.o&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const jv=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bv=t=>{if("loading"===document.readyState)return"loading";const e=jv();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},zv=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Hv=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[zv(i),...Array.from(null!==(n=i.classList)&&void 0!==n?n:[]).sort()].join(".");if(e.length+r.length>99)return e||r;if(e=e?r+">"+e:r,i.id)break;t=i.parentNode}}catch(t){}return e},Uv=new WeakMap;function Wv(t,e){let n=Uv.get(e);return n||(n=new WeakMap,Uv.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let Gv=-1;const Vv=()=>Gv,Qv=t=>{addEventListener("pageshow",e=>{e.persisted&&(Gv=e.timeStamp,t(e))},!0)},Zv=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Jv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Yv=()=>{var t,e;return null!==(t=null===(e=jv())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Kv=-1;const Xv=new Set,tp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ep=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Xv)t();isFinite(Kv)||(Kv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ep,!0))}},np=(t=!1)=>{if(t&&(Kv=1/0),0>Kv){var e;const t=Yv(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Kv=null!=n?n:tp(),addEventListener("visibilitychange",ep,!0),addEventListener("prerenderingchange",ep,!0),Qv(()=>{setTimeout(()=>{Kv=tp()})})}return{get firstHiddenTime(){return Kv},onHidden(t){Xv.add(t)}}},ip=(t,e=-1,n,i=0,r,o,s)=>{const a=jv(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Vv()?a&&(document.prerendering||Yv()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},rp=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},op=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},sp=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},ap=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var lp=class{constructor(){this.u=void 0}};const up=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},cp=[1800,3e3],dp=(t,e={})=>{const n=op(e);up(()=>{const i=Wv(e,lp),r=np();let o,s=ip("FCP");const a=rp(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Yv(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=Zv(t,s,cp,e.reportAllChanges),Qv(n=>{s=ip("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Vv()),o=Zv(t,s,cp,e.reportAllChanges),Jv(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&rp(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&sp(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=ip("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=Zv(t,s,cp,e.reportAllChanges),o(!0)})},e)})},hp=[.1,.25],fp=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],vp=(t,e={})=>{const n=Wv(e=Object.assign({},e),qv),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=fp(t.sources),s=null==n?void 0:n.node;if(s){var r,o;const t=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,s))&&void 0!==r?r:Hv(s);i.set(n,t)}}},((t,e={})=>{const n=np();dp(ap(()=>{let i,r=ip("CLS",0);const o=Wv(e,qv),s=(n,s,a,l,u)=>{r=ip("CLS",0,n,s,a,l,u),o.o=0,i=Zv(t,r,hp,e.reportAllChanges)},a=(t=!1)=>{o.o>r.value&&(r.value=o.o,r.entries=o.i),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.l(e):l(e);a()},c=["layout-shift"];op(e)&&c.push("soft-navigation");const d=rp(c,u);d&&(i=Zv(t,r,hp,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Qv(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Vv()),Jv(i)}),setTimeout(i))}))})(e=>{t((t=>{let e={};if(t.entries.length){var n;const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null==r||null===(n=r.sources)||void 0===n?void 0:n.length){const t=fp(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:Bv(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},pp=(t,e={})=>{const n=Wv(e=Object.assign({},e),lp);op(e)&&(n.u=new Map),dp(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Bv(Vv())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=jv(),i=t.entries.at(-1);if(n){const r=Math.max(0,n.responseStart-(n.activationStart||0));e={timeToFirstByte:r,firstByteToFCP:t.value-r,loadState:Bv(t.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}}else{var i;const r=null===(i=n.u)||void 0===i?void 0:i.get(t.navigationId);r&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:r})}return Object.assign(t,{attribution:e})})(e))},e)};let mp=0,gp=1/0,yp=0;const bp=t=>{for(const e of t)e.interactionId&&(gp=Math.min(gp,e.interactionId),yp=Math.max(yp,e.interactionId),mp=yp?(yp-gp)/7+1:0)};let wp;const kp=()=>{var t;return wp?mp:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Sp=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return kp()-this.h}D(){this.h=kp(),this.v.length=0,this.p.clear()}S(t){const e=this.T(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{k:8,id:-1,entries:[]}}l(t){var e;if(null===(e=this.m)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>n.k){var r;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],k:t.duration},this.p.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.p.delete(e.id)}null===(r=this.M)||void 0===r||r.call(this,i)}}};const _p=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=ap(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},xp=[200,500],Cp=(t,e={})=>{const n=Wv(e=Object.assign({},e),Sp);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(_p(c),l=!0)},c=()=>{const t=new Set(n.v.map(t=>s.get(t.entries[0]))),e=r.length-10;r=r.filter((n,i)=>i>=e||t.has(n));const a=new Set;for(const t of r){const e=d(t.startTime,t.processingEnd);for(const t of e)a.add(t)}i=i.filter(t=>t.startTime>o||a.has(t)),l=!1};n.m=t=>{const n=t.startTime+t.duration;let i;o=Math.max(o,t.processingEnd);for(let o=r.length-1;o>=0;o--){const s=r[o];if(8>=Math.abs(n-s.renderTime)){i=s,i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:e.includeProcessedEventEntries?[t]:[]},r.push(i)),t.interactionId&&s.set(t,i),u()},n.M=t=>{if(!a.get(t)){var n;const s=null===(n=t.entries.find(t=>t.target))||void 0===n?void 0:n.target;if(s){var i,r;const n=null!==(i=null===(r=e.generateTarget)||void 0===r?void 0:r.call(e,s))&&void 0!==i?i:Hv(s);a.set(t,n)}else{var o;const e=null===(o=t.entries.find(t=>t.targetSelector))||void 0===o?void 0:o.targetSelector;e&&a.set(t,e)}}};const d=(t,e)=>{const n=[];for(const r of i)if(r.startTime+r.duration>=t){if(r.startTime>e)break;n.push(r)}return n};rp(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=np();up(()=>{var i;"interactionCount"in performance||wp||(wp=rp(["event"],bp,{durationThreshold:0}));let r,o=ip("INP");const s=Wv(e,Sp),a=(n,i,a,l,u)=>{s.D(),o=ip("INP",-1,n,i,a,l,u),r=Zv(t,o,xp,e.reportAllChanges)},l=()=>{const t=s.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{_p(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];op(e)&&d.push("soft-navigation");const h=rp(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=Zv(t,o,xp,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Qv(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Vv())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Bv(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}const e=t.entries[0],i=s.get(e),r=Math.max(i.processingStart,e.startTime),o=Math.max(e.startTime+e.duration,r),l=Math.min(i.processingEnd,o),u=i.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(e.startTime,l),h=n.p.get(e.interactionId),f={interactionTarget:a.get(h),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:o,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-e.startTime,processingDuration:l-r,presentationDelay:o-l,loadState:Bv(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{var e;const n=t.interactionTime,i=t.nextPaintTime;if(!(null===(e=t.longAnimationFrameEntries)||void 0===e?void 0:e.length)||!n||!i)return;const r=t.inputDelay,o=t.processingDuration;let s,a,l=0,u=0,c=0,d=0;for(const e of t.longAnimationFrameEntries){u=u+e.startTime+e.duration-e.styleAndLayoutStart;for(const t of e.scripts){const e=t.startTime+t.duration;if(n>e)continue;const i=e-Math.max(n,t.startTime),c=t.duration?i/t.duration*t.forcedStyleAndLayoutDuration:0;l+=i-c,u+=c,i>d&&(a=n+r>t.startTime?"input-delay":n+r+o>t.startTime?"processing-duration":"presentation-delay",s=t,d=i)}}const h=t.longAnimationFrameEntries.at(-1),f=h?h.startTime+h.duration:0;f>=n+r+o&&(c=i-f),s&&a&&(t.longestScript={entry:s,subpart:a,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=c,t.totalUnattributedDuration=i-n-l-u-c})(f),Object.assign(t,{attribution:f})})(e))},e)};var Tp=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null===(e=this.m)||void 0===e||e.call(this,t)}};const $=[2500,4e3];let Ip=50;const Mp=[];rp(["resource"],t=>{for(const e of t)Mp.push(e),Mp.length>Ip&&Mp.shift()});const Ap=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Ip=e.resourceBufferSize);const n=Wv(e,Tp),i=new WeakMap;op(e)&&(n.u=new Map),n.m=t=>{const n=t.element;if(n){var r,o;const s=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,n))&&void 0!==r?r:Hv(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=op(e);up(()=>{let r,o=np(),s=ip("LCP");const a=Wv(e,Tp),l=(i,a,l,u,c)=>{s=ip("LCP",-1,i,a,l,u,c),r=Zv(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=np(!0))},u=t=>{var e;a.u&&t.navigationId&&sp(a.u,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-Yv(),0),a.l(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.l(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=rp(d,c);if(h){r=Zv(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;_p(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});Qv(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Vv()),r=Zv(t,s,$,e.reportAllChanges),Jv(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})})(e=>{t((t=>{let e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r,o,s;const a=t.entries.at(-1),l=a.url&&(Mp.findLast(t=>t.name===a.url)||performance.getEntriesByType("resource").findLast(t=>t.name===a.url));let u;e.target=i.get(a),e.lcpEntry=a,a.url&&(e.url=a.url),l&&(e.lcpResourceEntry=l);let c=0,d=0;if("soft-navigation"!==t.navigationType?(u=jv(),c=null!==(r=null==u?void 0:u.activationStart)&&void 0!==r?r:0,d=null!==(o=null==u?void 0:u.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,u=null===(s=n.u)||void 0===s?void 0:s.get(t.navigationId)),u){const n=Math.max(0,d-c),i=Math.max(n,l?(l.requestStart||l.startTime)-c:0),r=Math.min(t.value,Math.max(i,l?l.responseEnd-c:0));e=L(L({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Rp=-1;const Ep=()=>Rp,Op=t=>{addEventListener("pageshow",e=>{e.persisted&&(Rp=e.timeStamp,t(e))},!0)},$p=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Lp=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Dp=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Pp=()=>{var t,e;return null!==(t=null===(e=Dp())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Fp=-1;const Np=new Set,qp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,jp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Np)t();isFinite(Fp)||(Fp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",jp,!0))}},Bp=(t=!1)=>{if(t&&(Fp=1/0),0>Fp){var e;const t=Pp(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Fp=null!=n?n:qp(),addEventListener("visibilitychange",jp,!0),addEventListener("prerenderingchange",jp,!0),Op(()=>{setTimeout(()=>{Fp=qp()})})}return{get firstHiddenTime(){return Fp},onHidden(t){Np.add(t)}}},zp=(t,e=-1,n,i=0,r,o,s)=>{const a=Dp(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Ep()?a&&(document.prerendering||Pp()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},Hp=new WeakMap;function Up(t,e){let n=Hp.get(e);return n||(n=new WeakMap,Hp.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var Wp=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(t.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Gp=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},Vp=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Qp=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},Zp=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Jp=class{constructor(){this.l=void 0}};const Yp=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Kp=[1800,3e3],Xp=(t,e={})=>{const n=Vp(e);Yp(()=>{const i=Up(e,Jp),r=Bp();let o,s=zp("FCP");const a=Gp(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Pp(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=$p(t,s,Kp,e.reportAllChanges),Op(n=>{s=zp("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Ep()),o=$p(t,s,Kp,e.reportAllChanges),Lp(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Gp(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&Qp(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=zp("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=$p(t,s,Kp,e.reportAllChanges),o(!0)})},e)})},tm=[.1,.25],em=(t,e={})=>{const n=Bp();Xp(Zp(()=>{let i,r=zp("CLS",0);const o=Up(e,Wp),s=(n,s,a,l,u)=>{r=zp("CLS",0,n,s,a,l,u),o.i=0,i=$p(t,r,tm,e.reportAllChanges)},a=(t=!1)=>{o.i>r.value&&(r.value=o.i,r.entries=o.o),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.h(e):l(e);a()},c=["layout-shift"];Vp(e)&&c.push("soft-navigation");const d=Gp(c,u);d&&(i=$p(t,r,tm,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Op(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Ep()),Lp(i)}),setTimeout(i))}))};let nm=0,im=1/0,rm=0;const om=t=>{for(const e of t)e.interactionId&&(im=Math.min(im,e.interactionId),rm=Math.max(rm,e.interactionId),nm=rm?(rm-im)/7+1:0)};let sm;const am=()=>{var t;return sm?nm:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var lm=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return am()-this.u}M(){this.u=am(),this.v.length=0,this.m.clear()}L(t){const e=this._(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{P:8,id:-1,entries:[]}}h(t){var e;if(null===(e=this.p)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>n.P){var r;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.m.delete(e.id)}null===(r=this.T)||void 0===r||r.call(this,i)}}};const um=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=Zp(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},cm=[200,500],dm=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Bp();Yp(()=>{var i;"interactionCount"in performance||sm||(sm=Gp(["event"],om,{durationThreshold:0}));let r,o=zp("INP");const s=Up(e,lm),a=(n,i,a,l,u)=>{s.M(),o=zp("INP",-1,n,i,a,l,u),r=$p(t,o,cm,e.reportAllChanges)},l=()=>{const t=s.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{um(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Vp(e)&&d.push("soft-navigation");const h=Gp(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=$p(t,o,cm,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Op(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ep())}))})};var hm=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null===(e=this.p)||void 0===e||e.call(this,t)}};const fm=[2500,4e3],vm=(t,e={})=>{let n=!1;const i=Vp(e);Yp(()=>{let r,o=Bp(),s=zp("LCP");const a=Up(e,hm),l=(i,a,l,u,c)=>{s=zp("LCP",-1,i,a,l,u,c),r=$p(t,s,fm,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Bp(!0))},u=t=>{var e;a.l&&t.navigationId&&Qp(a.l,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-Pp(),0),a.h(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.h(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=Gp(d,c);if(h){r=$p(t,s,fm,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;um(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});Op(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Ep()),r=$p(t,s,fm,e.reportAllChanges),Lp(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},pm={onLCP:Ap,onCLS:vp,onFCP:pp,onINP:Cp,withoutAttribution:{onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=pm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=pm,o.postHogWebVitalsCallbacks=pm;const mm={onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=mm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=mm,o.postHogWebVitalsCallbacks=mm,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>mm;const gm={onLCP:Ap,onCLS:vp,onFCP:pp,onINP:Cp,withoutAttribution:{onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=gm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=gm,o.postHogWebVitalsCallbacks=gm;const ym={onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=ym,o.__PosthogExtensions__.postHogWebVitalsCallbacks=ym,o.postHogWebVitalsCallbacks=ym,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ym;const bm={};function wm(t,e){const n=Te(t);return n?L({node:n,originalEvent:t,timestamp:Date.now()},e):null}function km(t){return!!_t(()=>we(t))}function Sm(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function _m(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const xm="canvas,video,audio,embed,object";function Cm(t,e){return Y(t)&&t>=e}function Tm(t,e=1e3){return t>=0&&e>t?t:void 0}function Im(t,e,n=1e3){return Y(e)?Tm(t-e,n):void 0}var Mm=class{wr(t){var e,n,i,r,o,s,a,l;const u=this.kr((null==t?void 0:t.__onCapture)||this.Sr.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==t?void 0:t.mutation_threshold_ms)&&void 0!==r?r:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(s=null==t?void 0:t.capture_dead_swipes)&&void 0!==s?s:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this._r=new WeakSet,this.Cr=!1,this.Tr=[],this.Ir=0,this.kr=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.Mr=()=>{clearTimeout(this.Ar),this.Ar=void 0,this.Rr=void 0},this.Er=t=>{if(this.Or(t),this.Mr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==n?void 0:n.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.$r(i,e),this.Rr=e}},this.Lr=t=>{Z(t.relatedTarget)&&this.Mr()},this.Dr=t=>{const e=this.Rr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(km(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.Ar=o.setTimeout(this.Mr,0)},this.Pr=t=>{this.Or(t);const e=t,n=wm(e,{type:"click"}),i=this.Rr;n&&i&&0===e.button&&e.detail>0&&e.detail===i.clickDetail&&t.isTrusted===i.trusted&&n.node===i.clickTarget&&(n.selectionChangedDuringGesture=i.selectionChanged&&this.Fr.selection_change_threshold_ms>0,this.Mr()),Z(n)||this.Nr(n)||this.qr(n),this.jr()},this.Br=()=>{const t=Date.now();this.zr=t,t%50==0&&this.Tr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Hr=t=>{var e,i;const r=null==n?void 0:n.getSelection(),o=this.Cr;this.Cr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(we(s)?s:s.parentElement),l=null==n?void 0:n.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=Oe(Te(t))||Oe(null!=a?a:null)||Oe(null!==(i=u)&&void 0!==i?i:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.Cr||c||d))return;const h=Date.now();this.Ur=h;const f=this.Rr;if(f&&(o||this.Cr||c)){const e=Te(t);let n;if(Oe(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;Oe(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.Wr(n,f):r&&(s||r.anchorNode)?this.$r(r,f):o&&!this.Cr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.Tr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.an=()=>{"hidden"===(null==n?void 0:n.visibilityState)&&this.Mr();const t=Date.now();this.Gr=t,this.Vr("visibilityChangedDelayMs",t)},this.Qr=()=>{const t=Date.now();this.Zr=t,this.Vr("focusChangedDelayMs",t)},this.Jr=t=>{this.Or(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.Yr=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.Kr=()=>{this.Yr=void 0},this.Xr=t=>{var e;const i=this.Yr;if(this.Yr=void 0,G(i)||this.Ir>=this.Fr.max_dead_swipes_per_page_load)return;const r=t,o=null===(e=r.changedTouches)||void 0===e?void 0:e[0];if(!o)return;const s=o.clientX-i.x,a=o.clientY-i.y,l=s*s+a*a,u=this.Fr.swipe_threshold_px;if(u*u>l)return;if([this.zr,this.eo,this.Ur].some(t=>Y(t)&&t>=i.timestamp))return;var c,d;if(this.no()&&(null!==(c=null==n||null===(d=n.elementsFromPoint)||void 0===d?void 0:d.call(n,i.x,i.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,xm)}))return;const h=wm(r,{type:"swipe",swipeDirection:Sm(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});Z(h)||this.Nr(h)||this.qr(h),this.jr()},this.Fr=this.wr(e),this._onCapture=this.Fr.__onCapture}start(t){this.io(),this.ro(),this.oo(),this.so(),this.ao(),this.lo(t),this.Fr.capture_dead_swipes&&this.uo()}lo(e){if(!this.co){const n=function(e){return function(e,n){const i=bm[e];if(i)return i;let r=n[e];if((t=>U(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return bm[e]=r.bind(n);const o=n.document;if(o&&U(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const u=t.contentWindow;var s,a;u&&u[e]&&(r=u[e],"MutationObserver"===e&&N(l=null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"","AppleWebKit")&&!N(l,"Chrome")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){ue.warn(`Could not create sandbox iframe for ${e} check, bailing to assignableWindow.${e}: `,t)}finally{!i&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}}var l;return r&&U(r)?bm[e]=r.bind(n):r}("MutationObserver",e)}(o);this.co=new n(t=>{this.do(t)}),this.ho(e)}}ho(t){t&&this.co&&(this._r.has(t)||(this.co.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this._r.add(t),this.fo(t)))}fo(t,e){var n,i;we(t)&&t.shadowRoot&&this.ho(t.shadowRoot);const r=null!==(n=null===(i=t.querySelectorAll)||void 0===i?void 0:i.call(t,"*"))&&void 0!==n?n:[];for(let t=0;r.length>t;t++)null==e||e.add(r[t]),this.ho(r[t].shadowRoot)}Or(t){var e,n;const i=null!==(e=null===(n=t.composedPath)||void 0===n?void 0:n.call(t))&&void 0!==e?e:[];for(let t=0;i.length>t;t++){const e=i[t];km(e)&&this.ho(e.shadowRoot)}}stop(){var t;null===(t=this.co)||void 0===t||t.disconnect(),this.co=void 0,this._r=new WeakSet,o.removeEventListener("click",this.Pr,{capture:!0}),o.removeEventListener("mousedown",this.Er,{capture:!0}),o.removeEventListener("mouseup",this.Dr,{capture:!0}),o.removeEventListener("mouseout",this.Lr,{capture:!0}),o.removeEventListener("dragstart",this.Mr,{capture:!0}),o.removeEventListener("pointercancel",this.Mr,{capture:!0}),o.removeEventListener("blur",this.Mr),this.Mr(),o.removeEventListener("scroll",this.Br,{capture:!0}),null==n||n.removeEventListener("selectionchange",this.Hr),o.removeEventListener("touchstart",this.Jr,{capture:!0}),o.removeEventListener("touchend",this.Xr,{capture:!0}),o.removeEventListener("touchcancel",this.Kr,{capture:!0}),null==n||n.removeEventListener("visibilitychange",this.an),o.removeEventListener("blur",this.Qr),o.removeEventListener("focus",this.Qr),this.Yr=void 0}do(t){const e=new Set;for(const i of t)try{var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.eo=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];km(i)&&!e.has(i)&&this.fo(i,e)}}catch(t){}}io(){ve(o,"click",this.Pr,{capture:!0}),ve(o,"mousedown",this.Er,{capture:!0}),ve(o,"mouseup",this.Dr,{capture:!0}),ve(o,"mouseout",this.Lr,{capture:!0}),ve(o,"dragstart",this.Mr,{capture:!0}),ve(o,"pointercancel",this.Mr,{capture:!0}),ve(o,"blur",this.Mr)}qr(t){t.selectionChangedDelayMs=Im(t.timestamp,this.Ur,this.Fr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Im(t.timestamp,this.Gr),t.focusChangedDelayMs=Im(t.timestamp,this.Zr),this.Tr.push(t)}jr(){this.Tr.length&&G(this.vo)&&(this.vo=o.setTimeout(()=>{this.po()},1e3))}ro(){ve(o,"scroll",this.Br,{capture:!0})}oo(){var t;this.Cr="Range"===(null==n||null===(t=n.getSelection())||void 0===t?void 0:t.type),ve(n,"selectionchange",this.Hr)}Wr(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||we(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}$r(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&_t(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&we(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=we(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.Wr(t,e)}return this.Wr(t.focusNode,e)||this.Wr(t.anchorNode,e)}so(){ve(n,"visibilitychange",this.an)}ao(){ve(o,"blur",this.Qr),ve(o,"focus",this.Qr)}Vr(t,e){this.Tr.forEach(n=>{const i=Tm(e-n.timestamp);Y(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}uo(){ve(o,"touchstart",this.Jr,{capture:!0,passive:!0}),ve(o,"touchend",this.Xr,{capture:!0,passive:!0}),ve(o,"touchcancel",this.Kr,{capture:!0,passive:!0})}no(){const t=G(this.mo)||Y(this.eo)&&this.eo>this.mo;return(G(this.yo)||t)&&(this.mo=Date.now(),this.yo=!!(null==n?void 0:n.querySelector(xm))),!!this.yo}Nr(t){return!t||("swipe"===t.type?this.bo(t):this.wo(t))}bo(t){return!((!((e=t.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==e.id&&!(null===(n=e.closest)||void 0===n?void 0:n.call(e,".toolbar-global-fade-container")))&&!this.Tr.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!ke(t.node,"html")&&we(t.node)&&function(t,e){var n;if(!(typeof window>"u"?void 0:window)||$e(t))return!1;const i=K(e)?Re:null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Re,{targetElementList:r}=Le(t,!1);return!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Me(n,t)))return!0;return!1}(r,i)}(t.node,{css_selector_ignorelist:this.Fr.css_selector_ignorelist}));var e,n}wo(t){return!(this.Fr.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.bo(t)||function(t){if(!(typeof window>"u"?void 0:window)||$e(t))return!1;const{targetElementList:e}=Le(t,!1);return e.some(t=>ke(t,"a"))}(t.node);var e}po(){if(!this.Tr.length)return;clearTimeout(this.vo),this.vo=void 0;const t=this.Tr;this.Tr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.eo&&this.eo>=n.timestamp?this.eo-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Cm(n.scrollDelayMs,this.Fr.scroll_threshold_ms),i=Cm(n.selectionChangedDelayMs,this.Fr.selection_change_threshold_ms),r=Cm(n.mutationDelayMs,this.Fr.mutation_threshold_ms),o=Cm(n.absoluteDelayMs,1.1*this.Fr.mutation_threshold_ms),s=Y(n.scrollDelayMs)&&this.Fr.scroll_threshold_ms>n.scrollDelayMs,a=Y(n.mutationDelayMs)&&this.Fr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||Y(n.selectionChangedDelayMs)&&this.Fr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=Y(n.visibilityChangedDelayMs),c=Y(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=_m(n);if("$dead_swipe"===e){if(this.Ir>=this.Fr.max_dead_swipes_per_page_load)continue;this.Ir++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.eo,[`${e}_event_timestamp`]:n.timestamp,[`${e}_scroll_timeout`]:t,[`${e}_mutation_timeout`]:r,[`${e}_absolute_timeout`]:o,[`${e}_selection_changed_timeout`]:i,[`${e}_visibility_changed_timeout`]:!1})}else this.Fr.mutation_threshold_ms>n.absoluteDelayMs&&this.Tr.push(n)}this.jr()}Sr(t,e){const n=_m(t);this.instance.capture(n,L(L(L({},e),Jf(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Fr.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props),{},{[`${n}_scroll_delay_ms`]:t.scrollDelayMs,[`${n}_mutation_delay_ms`]:t.mutationDelayMs,[`${n}_absolute_delay_ms`]:t.absoluteDelayMs,[`${n}_selection_changed_delay_ms`]:t.selectionChangedDelayMs,[`${n}_visibility_changed_delay_ms`]:t.visibilityChangedDelayMs,[`${n}_focus_changed_delay_ms`]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Mm(t,e)}();
1
+ !function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const o=null!=t?t:{},s="$stored_person_properties",a="$surveys",l="$replay_override_sampling",u="$replay_override_linked_flag",c="$replay_override_url_trigger",d="$replay_override_event_trigger",h="$session_is_sampled",f="$session_recording_url_trigger_activated_session",v="$session_recording_event_trigger_activated_session",p="$posthog_sr_group_event_trigger_",m="$posthog_sr_group_url_trigger_",g="$sess_rec_flush_size",y="$sdk_debug_replay_event_trigger_status",b="$sdk_debug_replay_linked_flag_trigger_status",w="$sdk_debug_replay_matched_recording_trigger_groups",k="$sdk_debug_replay_pending_trigger_conditions",S="$sdk_debug_replay_remote_trigger_matching_config",_="$sdk_debug_replay_trigger_groups_count",x="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",I="$session_recording_start_reason";function M(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){M(o,i,r,s,a,"next",t)}function a(t){M(o,i,r,s,a,"throw",t)}s(void 0)})}}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function E(t,e,n){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){E(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var D=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({});const P="min_length",F="max_length";function N(t,e){return-1!==t.indexOf(e)}const q=function(t){return t.trim()},j=Object.prototype,B=j.hasOwnProperty,z=j.toString,H=Array.isArray||function(t){return"[object Array]"===z.call(t)},U=t=>"function"==typeof t,W=t=>t===Object(t)&&!H(t),G=t=>void 0===t,V=t=>"[object String]"==z.call(t),Q=t=>V(t)&&0===t.trim().length,Z=t=>null===t,J=t=>G(t)||Z(t),Y=t=>"[object Number]"==z.call(t)&&t==t,K=t=>"[object Boolean]"===z.call(t),X=t=>t instanceof FormData;function tt(t){return null===t||"object"!=typeof t}function et(t,e){return{}.toString.call(t)===`[object ${e}]`}function nt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return rt(t,Error)}}function it(t){return"u">typeof Event&&rt(t,Event)}function rt(t,e){try{return t instanceof e}catch(t){return!1}}function ot(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Y(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ot(null!=r?r:n,e,n,i))}var st=class{constructor(t){this.C={},this.I=t.I,this.A=ot(t.bucketSize,0,100,t.R),this.O=ot(t.refillRate,0,this.A,t.R),this.$=ot(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};const at="Mobile",lt="Tablet",ut="Android Tablet",ct="iPad",dt="Apple Watch",ht="Nintendo",ft="PlayStation",vt="Xbox",pt="Nokia",mt="Ouya",gt="Generic tablet",yt=new RegExp(vt,"i"),bt=new RegExp("PlayStation \\w+","i"),wt=new RegExp("Nintendo \\w+","i"),kt=new RegExp("BlackBerry|PlayBook|BB10","i");function St(t){return t?t.split("#")[0]:t}function _t(t){try{return t()}catch(t){return}}let xt,Ct,Tt,It;function Mt(t){var e;const n=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!n&&!i)return;const r=n?Object.keys(n):[],o=i?Object.keys(i):[];if(It&&At(n,r,Ct)&&At(i,o,Tt))return It;Ct=n?L({},n):void 0,Tt=i?L({},i):void 0,It={},null!==(e=xt)&&void 0!==e||(xt={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==xt?void 0:xt[r];if(o){It[o]=e;continue}const s=t(r);for(let t=s.length-1;t>=0;t--){var i;const n=null===(i=s[t])||void 0===i?void 0:i.filename;if(n){It[n]=e,xt[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),It}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const Rt=/^([a-z][a-z0-9.+-]+):/i,Et=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Ot(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||Et.includes(e[1].toLowerCase())}function $t(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Ot(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Lt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return n||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Dt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ft=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=(t,e)=>{const n=Dt.exec(t);if(n){const[,t,i,r]=n;return $t(e,t,"?",+i,+r)}const i=Pt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Ft.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Lt(i[1]||"?",i[2]);return $t(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bt=(t,e)=>{const n=qt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=jt.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],i=n[1]||"?";return[i,t]=Lt(i,t),$t(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},zt=/\(error: (.*)\)/;function Ht(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Ut(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let i=!0;for(let r=0;e>r;r++)if(!Ht(t[n+r],t[n+e+r])){i=!1;break}if(i){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function Wt(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Gt(t,e){let n=e.start;for(;n>0&&Ht(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Vt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Ht(t[i],t[i-e.length]);)i++;return i-n}function Qt(t,e){const n=e[0];let i=t.length-(n?Gt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Zt(t,e,n){for(let i=0;t.length>i;i++){const r=t[(e+i)%t.length],o=t[(n+i)%t.length];if(r!==o)return o>r}return!1}const Jt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function Kt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let t=n.length;t>0;t--){const i=n.slice(0,t).join(", ");if(e>=i.length)return t===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}const Xt="NativeGzipValidationError";let te;const ee=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Xt,`Native gzip produced invalid output: ${t}`)},ne=function(){var t=A(function*(t,e){18>t.size&&ee("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&ee("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(te)return te;te=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&ee("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&ee("invalid-size")});return function(e,n){return t.apply(this,arguments)}}();function ie(t){return re.apply(this,arguments)}function re(){return re=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),s=new Response(n.readable).blob(),[a]=yield Promise.all([s,o]);return yield ne(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),re.apply(this,arguments)}function oe(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const se="0.10.7",ae={DEBUG:!1,LIB_VERSION:se,LIB_NAME:"browser-common",JS_SDK_VERSION:se},le=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ae.DEBUG||r.POSTHOG_DEBUG||e)&&!G(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>le(`${t} ${e}`,n)};return n},ue=le("[PostHog.js]"),ce=(t,e)=>ue.createLogger(t,e);function de(t,e){if(!J(t))if(H(t))t.forEach(e);else if(X(t))t.forEach((t,n)=>e(t,n));else for(const n in t)B.call(t,n)&&e(t[n],n)}const he=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function fe(t){const e=Object.keys(t);let n=e.length;const i=new Array(n);for(;n--;)i[n]=[e[n],t[e[n]]];return i}function ve(t,e,n,i){const{capture:r=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:o})}const pe=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return G(n)?null:(n.href=t,n)},me=["localhost","127.0.0.1"],ge=(t,e)=>{try{let n;return JSON.stringify(t,(t,e)=>{var i;return nt(e)?(null!==(i=n)&&void 0!==i||(n=new WeakMap),n.has(e)||n.set(e,function(t){const e=L({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch(t){}return e}(e)),n.get(e)):"bigint"==typeof e?e.toString():e},e)}catch(e){return function(t){var e;const n=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(e))return"[Circular]";n.push(e)}return e}}))&&void 0!==e?e:"null"}(t)}},ye=function(t,e="&"){let n,i;const r=[];return de(t,function(t,e){G(t)||G(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)};function be(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return G(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!U(i))return e;try{const t=i(e);return V(t)&&t?t:e}catch(t){return ue.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function we(t){return!!t&&1===t.nodeType}function ke(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Se(t){return!!t&&11===t.nodeType&&we(t.host)}function _e(t){return t?q(t).split(/\s+/):[]}function xe(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return _e(e)}function Ce(t){let e="";return De(t)&&!Pe(t)&&t.childNodes&&t.childNodes.length&&de(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return J(t)?null:q(t).split(/(\s+)/).filter(t=>Ue(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),q(e)}function Te(t){var e;return G(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const Ie=["a","button","form","input","select","textarea","label"];function Me(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch(t){return!1}}function Ae(t){const e=t.parentNode;return!(!e||!we(e))&&e}const Re=[".ph-no-deadclick",".ph-no-capture"];const Ee=["","text","search","email","password","url","tel","number"];function Oe(t){return!(!t||!we(t))&&(!!ke(t,"textarea")||(ke(t,"input")?N(Ee,(t.getAttribute("type")||"").toLowerCase()):function(t){var e;if(t.isContentEditable)return!0;const n=null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return"true"===n||""===n}(t)))}const $e=t=>!t||ke(t,"html")||!we(t),Le=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||$e(t))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[t];let o=t;for(;o.parentNode&&!ke(o,"body");){if(Se(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const t=Ae(o);if(!t)break;if(e||Ie.indexOf(t.tagName.toLowerCase())>-1)i=!0;else try{const e=n.getComputedStyle(t);e&&"pointer"===e.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(t),o=t}return{parentIsUsefulElement:i,targetElementList:r}};function De(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ke(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=xe(i);if(N(t,"ph-sensitive")||N(t,"ph-no-capture"))return!1}if(N(xe(t),"ph-include"))return!0;const i=t.type||"";if(V(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!V(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function Pe(t){return!!(ke(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ke(t,"select")||ke(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Fe=new RegExp("^(?:(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}))$"),Ne=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qe=[16,15,14,13],je=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Be=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ze=/[0-9A-Za-z_]/;function He(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}function Ue(t,e=!0){if(J(t))return!1;if(V(t)){if(t=q(t),e?Fe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Ne.lastIndex=0;e=Ne.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of qe){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Fe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?je.test(t):function(t){let e;for(Be.lastIndex=0;e=Be.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&ze.test(t)&&ze.test(n)))return!0}return!1}(t))return!1}return!0}function We(t){let e=Ce(t);return e=`${e} ${Ge(t)}`.trim(),Ue(e)?e:""}function Ge(t){let e="";return t&&t.childNodes&&t.childNodes.length&&de(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Ce(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Ge(t)}`.trim())}catch(t){ue.error("[AutoCapture]",t)}}),e}function Ve(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){const e=t.attr__class;if(e)return H(e)?e:_e(e)}const Ze=1e6;function Je(t){var e;return Math.min(Ze,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ze)}const Ye={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ze,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Ke=["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"],Xe=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],tn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],en=t=>{J(t)||de(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Ke.includes(e)||tn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},nn=["/s/","/e/","/i/"];function rn(t,e,n,i){if(J(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return V(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function on(t,e){if(J(t))return t;let n=t;return Ue(n,!1)||(n="[SessionRecording] "+e+" body redacted"),de(Xe,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const sn=new WeakSet,an="disabled",ln="sampled",un="active",cn="buffering",dn="paused",hn="rrweb_error",fn="trigger_activated",vn="trigger_pending",pn="trigger_disabled";function mn(t,e,n,i,r,o){return 0===e?pn:(null==t?void 0:t.get_property(n?i+n:r))===o?fn:vn}function gn(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function yn(t){return t.includes("trigger_activated")?fn:t.includes("trigger_pending")?vn:pn}function bn(t){const e=new Set(t);switch(e.delete(pn),e.size){case 0:return pn;case 1:return Array.from(e)[0];default:return vn}}var wn=class{constructor(t){this.j=t}triggerStatus(t){return yn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return yn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},kn=class{constructor(t){this.j=t}triggerStatus(t){return bn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return bn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Sn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return fn}stop(){}};const _n=t=>"sessionRecording"in t;var xn=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.U=new Map,this.W=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(_n(t)?W(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(_n(t)?W(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.U.clear(),this.W.clear();for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){ue.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.H)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){ue.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return mn(this._instance,this.B.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[x]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=be(this._instance);if(!t)return!1;try{return gn(t,this.H,this.W)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=be(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=gn(n,this.H,this.W);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=be(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const o=this.urlBlocked,s=gn(r,this.H,this.W);s&&!o?t():!s&&o&&e();const a=this.J(i)===fn,l=gn(r,this.B,this.U);!a&&l&&n("url",r)}stop(){this.G=""}},Cn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[b]:t}),t}triggerStatusNoSideEffects(){let t=vn;return J(this.linkedFlag)&&(t=pn),this.linkedFlagSeen&&(t=fn),t}onConfig(t,e){var n;if(this.linkedFlag=(_n(t)?W(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!J(this.linkedFlag)&&!this.linkedFlagSeen){const t=V(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=V(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(W(r)&&t in r){const e=r[t];o=K(e)?!0===e:n?e===n:!!e}const s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},Tn=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(_n(t)?W(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return mn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[y]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===fn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},In=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new xn(t,e.id),this.et=new Tn(t,e.id),this.nt=new Cn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new wn(r):new kn(r)}else this.it=new Sn}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?m+this.group.id:p+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function Mn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=!0===t.isSampled,n=new wn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ln:"trigger_activated"===n?un:"trigger_pending"===n?cn:!1===t.isSampled?an:un}function An(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=new kn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==pn,i=K(t.isSampled);return n&&"trigger_pending"===e?cn:n&&"trigger_disabled"===e||i&&!t.isSampled?an:!0===t.isSampled?ln:un}function Rn(){const t=[];return function(e,n){if(W(n)||H(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function En(t){try{const e=JSON.stringify(t,Rn());return e?new Blob([e]).size:0}catch(t){return-1}}function On(t){if(Z(t))return 4;if(G(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(H(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=G(i)||Z(i)?4:On(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];G(r)||(i||(n+=1),i=!1,n+=t.length+3+On(r))}return n}default:return 0}}function $n(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[$n({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),$n({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Ln=Uint8Array,Dn=Uint16Array,Pn=Uint32Array,Fn=new Ln([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]),Nn=new Ln([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]),qn=new Ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jn=function(t,e){for(var n=new Dn(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Pn(n[30]);for(i=1;30>i;++i)for(var o=n[i];n[i+1]>o;++o)r[o]=o-n[i]<<5|i;return[n,r]},Bn=jn(Fn,2),zn=Bn[1];Bn[0][28]=258,zn[258]=28;for(var Hn=jn(Nn,0)[1],Un=new Dn(32768),Wn=0;32768>Wn;++Wn){var Gn=(43690&Wn)>>>1|(21845&Wn)<<1;Un[Wn]=((65280&(Gn=(61680&(Gn=(52428&Gn)>>>2|(13107&Gn)<<2))>>>4|(3855&Gn)<<4))>>>8|(255&Gn)<<8)>>>1}var Vn=function(t,e,n){for(var i=t.length,r=0,o=new Dn(e);i>r;++r)++o[t[r]-1];var s,a=new Dn(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Dn(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=a[t[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)s[Un[d]>>>l]=u}else for(s=new Dn(i),r=0;i>r;++r)s[r]=Un[a[t[r]-1]++]>>>15-t[r];return s},Qn=new Ln(288);for(Wn=0;144>Wn;++Wn)Qn[Wn]=8;for(Wn=144;256>Wn;++Wn)Qn[Wn]=9;for(Wn=256;280>Wn;++Wn)Qn[Wn]=7;for(Wn=280;288>Wn;++Wn)Qn[Wn]=8;var Zn=new Ln(32);for(Wn=0;32>Wn;++Wn)Zn[Wn]=5;var Jn=Vn(Qn,9,0),Yn=Vn(Zn,5,0),Kn=function(t){return(t/8|0)+(7&t&&1)},Xn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Dn?Dn:t instanceof Pn?Pn:Ln)(n-e);return i.set(t.subarray(e,n)),i},ti=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ei=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ni=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Ln(0),0];if(1==r){var s=new Ln(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(i=1;r>i;++i)o[i].s>h&&(h=o[i].s);var f=new Dn(h+1),v=ii(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(o.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=o[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=o[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Ln(f),v]},ii=function(t,e,n){return-1==t.s?Math.max(ii(t.l,e,n+1),ii(t.r,e,n+1)):e[t.s]=n},ri=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Dn(++e),i=0,r=t[0],o=1,s=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=t[a]}return[n.subarray(0,i),e]},oi=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},si=function(t,e,n){var i=n.length,r=Kn(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;i>o;++o)t[r+o+4]=n[o];return 8*(r+4+i)},ai=function(t,e,n,i,r,o,s,a,l,u,c){ti(e,c++,n),++r[256];for(var d=ni(r,15),h=d[0],f=d[1],v=ni(o,15),p=v[0],m=v[1],g=ri(h),y=g[0],b=g[1],w=ri(p),k=w[0],S=w[1],_=new Dn(19),x=0;y.length>x;++x)_[31&y[x]]++;for(x=0;k.length>x;++x)_[31&k[x]]++;for(var C=ni(_,7),T=C[0],I=C[1],M=19;M>4&&!T[qn[M-1]];--M);var A,R,E,O,L=u+5<<3,D=oi(r,Qn)+oi(o,Zn)+s,P=oi(r,h)+oi(o,p)+s+14+3*M+oi(_,T)+(2*_[16]+3*_[17]+7*_[18]);if(D>=L&&P>=L)return si(e,c,t.subarray(l,l+u));if(ti(e,c,1+(D>P)),c+=2,D>P){A=Vn(h,f,0),R=h,E=Vn(p,m,0),O=p;var F=Vn(T,I,0);for(ti(e,c,b-257),ti(e,c+5,S-1),ti(e,c+10,M-4),c+=14,x=0;M>x;++x)ti(e,c+3*x,T[qn[x]]);c+=3*M;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ti(e,c,F[B=31&j[x]]),c+=T[B],B>15&&(ti(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else A=Jn,R=Qn,E=Yn,O=Zn;for(x=0;a>x;++x)if(i[x]>255){var B;ei(e,c,A[257+(B=i[x]>>>18&31)]),c+=R[B+257],B>7&&(ti(e,c,i[x]>>>23&31),c+=Fn[B]);var z=31&i[x];ei(e,c,E[z]),c+=O[z],z>3&&(ei(e,c,i[x]>>>5&8191),c+=Nn[z])}else ei(e,c,A[i[x]]),c+=R[i[x]];return ei(e,c,A[256]),c+R[256]},li=new Pn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ui=new Ln(0),ci=function(){for(var t=new Pn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),di=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function hi(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=ci[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,o,s,a,l,u=(r=t,o=e,s=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,n,i,r,o){var s=t.length,a=new Ln(i+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?u=si(l,u,t.subarray(c,d)):(l[c]=o,u=si(l,u,t.subarray(c,s)))}else{for(var h=li[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Dn(32768),g=new Dn(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Pn(25e3),S=new Dn(288),_=new Dn(32),x=0,C=0,T=(c=0,0),I=0,M=0;s>c;++c){var A=w(c),R=32767&c,E=g[A];if(m[R]=E,g[A]=R,c>=I){var O=s-c;if((x>7e3||T>24576)&&O>423){u=ai(t,l,0,k,S,_,C,T,M,c-M,u),T=x=C=0,M=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)_[L]=0}var D=2,P=0,F=v,N=R-E&32767;if(O>2&&A==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&R!=E;){if(t[c+D]==t[c+D-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>D){if(D=z,P=N,z>q)break;var H=Math.min(N,z-2),U=0;for(L=0;H>L;++L){var W=c-N+L+32768&32767,G=W-m[W]+32768&32767;G>U&&(U=G,E=W)}}}N+=(R=E)-(E=m[R])+32768&32767}if(P){k[T++]=268435456|zn[D]<<18|Hn[P];var V=31&zn[D],Q=31&Hn[P];C+=Fn[V]+Nn[Q],++S[257+V],++_[Q],I=c+D,++x}else k[T++]=t[c],++S[t[c]]}}u=ai(t,l,o,k,S,_,C,T,M,c-M,u),o||(u=si(l,u,ui))}return Xn(a,0,i+Kn(u)+r)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,s,a,!l)),c=u.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&di(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(u,e),di(u,c-8,n.d()),di(u,c-4,i),u}function fi(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var vi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,o,s,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=t.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.wt(e);if(0===o&&n!==o)return;if(this.St)return t;this.ct();const s=On(t);var a,l;return s>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.dt-=s,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new st({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:ue}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(o=this.rt.bytesRefillRate)&&void 0!==o?o:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const s=this.rt.resyncIntervalMs;this.Ct=Y(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}},pi=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>n||0>i||0>r||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){let t="";for(let e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(let e=0;16>e;e++){const n=this.bytes[e]-t.bytes[e];if(0!==n)return Math.sign(n)}return 0}},mi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Tt=0;const t=this.generateOrAbort();if(G(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return Y(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return pi.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.At.nextUint32())}It(){this.Mt=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.At=new bi}};const gi=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let yi;var bi=class{nextUint32(){var t;return this.Rt.length>this.Et||((null!==(t=yi)&&void 0!==t?t:yi="u">typeof window&&!G(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return gi(t)}}:gi)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let wi;const ki=()=>Si().toString(),Si=()=>(wi||(wi=new mi)).generate();let _i=null;const xi={Ot(){if(!Z(_i))return _i;if(_i=!0,G(t))_i=!1;else try{const t="__support__";xi.$t(t,"xyz"),'"xyz"'!==xi.Lt(t)&&(_i=!1),xi.Dt(t)}catch(t){_i=!1}return _i},Pt(t){ue.error("sessionStorage error: ",t)},Lt(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){xi.Pt(t)}return null},Ft(t){try{return JSON.parse(xi.Lt(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){xi.Pt(t)}return!1},Dt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){xi.Pt(t)}}};ae.DEBUG=!1,ae.LIB_VERSION="1.447.3",ae.LIB_NAME="web";var Ci=ae,Ti=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(g);return W(n=e)&&V(n.sessionId)&&Y(n.size)&&e.sessionId===t?e.size:0;var n}};function Ii(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<ot(100*e,0,100,ue)}function Mi(t){return`$survey_response_${t}`}function Ai(t,e){if(!e)return null;const n=t[Mi(e)];return H(n)?[...n]:n}function Ri({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return L(L(L(L({},!G(i)&&{$survey_submission_id:i}),"sent"===t?!G(r)&&{$survey_completed:r}:{$survey_partially_completed:Ei(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(G(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ai(t,e.id);G(o)||(i[n]=o)}),L(L({$survey_questions:e.questions.map(e=>{var i,r;return{id:e.id,question:null!==(i=null==n?void 0:n[null!==(r=e.id)&&void 0!==r?r:""])&&void 0!==i?i:e.question,response:Ai(t,e.id)}})},t),i)}(n,e,s))}function Ei(t={}){return Object.values(t).some(t=>!J(t))}function Oi(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function $i(t){return"string"==typeof t&&t.trim()?t.trim():null}function Li(t){return t.toLowerCase()}function Di(t,e,n){if(!t||!e)return null;const i=Li(e),r=Object.keys(t).find(t=>Li(t)===i);if(r)return null==n||n.debug(`Found exact translation match: ${r}`),r;if(i.includes("-")){const r=i.split("-")[0],o=Object.keys(t).find(t=>Li(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Pi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Fi(t,e,n){var i;const r=Di(t.translations,e,n),o=L({},t);let s=!1;if(r){var a;const e=null===(a=t.translations)||void 0===a?void 0:a[r];if(e)if(null==n||n.info(`Applying survey-level translation for language: ${r}`),G(e.name)||(o.name=e.name,s=!0),o.appearance){const t=L({},o.appearance);for(const n of Pi){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Pi.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Di(t.translations,e,n);if(!r)return{question:t,matchedKey:null,hasChanges:!1};const o=null===(i=t.translations)||void 0===i?void 0:i[r];if(!o)return{question:t,matchedKey:null,hasChanges:!1};const s=L({},t);let a=!1;return G(o.question)||(s.question=o.question,a=!0),G(o.description)||(s.description=o.description,a=!0),G(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!G(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!G(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!G(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return H(t.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:t,matchedKey:a?r:null,hasChanges:a}}(t,e,n)),u=l.map(t=>t.question),c=l.some(t=>t.hasChanges);let d=null;return r||(d=(null===(i=l.find(t=>t.matchedKey))||void 0===i?void 0:i.matchedKey)||null),c&&(o.questions=u,s=!0,null==n||n.info(`Applied question-level translations for language: ${e}`)),{survey:o,matchedKey:s?r||d:null}}function Ni(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}const qi=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ji=t=>t.toLowerCase(),Bi={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>qi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!qi(e,t))),icontains:(t,e)=>e.map(ji).some(e=>t.map(ji).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ji).every(e=>t.map(ji).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},zi=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Hi=new Set(["is_not","not_icontains","not_regex"]);function Ui(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],o=t.operator||"exact";if(G(r)||Z(r))return Hi.has(o);const s=Bi[o];return!!s&&!G(t.value)&&!Z(t.value)&&s(H(t.value)?t.value.map(String):[String(t.value)],H(r)?r.map(String):[String(r)])})}const Wi=ce("[SessionRecording]");function Gi(t,e){return e?t:"!"+t}function Vi(t,e){return t===e||t!=="!"+e&&null}var Qi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=o,this.zt=s,this.Ht=null,this.Ut=An}onRemoteConfig(t){this.Ht=Y(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Wt=new wn([this.et,this.tt]),this.Ut=Mn):(this.Wt=new kn([this.et,this.tt]),this.Ut=An),this._instance.register_for_session({[S]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Ut({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Y(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&J(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Wi.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!Y(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const o=this._instance.get_property(h),s=this._instance.get_property("$replay_sample_rate"),a=Vi(o,t),l=Y(s)&&s!==n,u=G(s)&&o===t,c=l||u||!K(a),d=c?Ii(t,n):a;c&&(d?this.jt("sampled"):Wi.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Gi(t,d),$replay_sample_rate:Z(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!Y(this.Ht))return;const e=this._instance.get_property(h);K(Vi(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Wt)||void 0===e?void 0:e.triggerStatus(t))===vn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},Zi=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[S]:"v2_trigger_groups",[_]:t.triggerGroups.length}),this.tt.onConfig(t)):Wi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return an;let i=!1,r=!1;for(const o of e){const e=o.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=o.group.id,e=n.get(t);G(e)?ue.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?ln:i?cn:an}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Y(t)&&(Z(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Wi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),o=this._instance.get_property(s);r.some(e=>!e.properties||0===e.properties.length||Ui(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Wi.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,o=i.sampleRate,s="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(s);let l=null,u=!1,c=!1,d=!1;if(W(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Y(n)&&n!==o,l=e===t&&Y(n)&&n===o&&K(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!K(l),f=h?Ii(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[s]:{sessionId:t,sampleRate:o,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,o;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(o=this._instance.persistence)||void 0===o||o.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Zt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[w]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Ui(n,e,this._instance.get_property(s))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new In(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const Ji=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Yi=1e5,Ki=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Xi=[],tr=()=>!1,er="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),nr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ir="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),rr="Accommodation AdministrativeArea Country Place State".split(" "),or={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:nr,publisher:ir},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Xi},Offer:{seller:ir},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ir,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ir,areaServed:rr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Xi}},sr=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),or.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),or.Event],[ir,or.Organization],[rr,or.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),or.Product]];function ar(t,e){return B.call(t,e)?t[e]:void 0}function lr(t){const e=typeof t;return Z(t)||"string"===e||"number"===e||"boolean"===e}function ur(t,e){return e&&function(t){return V(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function cr(t,e){return H(t)&&t.every(lr)?t.map(t=>ur(t,e)).filter(t=>!G(t)):lr(t)?ur(t,e):void 0}function dr(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function hr(t){if(B.call(or,t))return or[t];for(const[e,n]of sr)if(e.includes(t))return n}function fr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function vr(t,e,n,i){if(H(t)){const r=t.map(t=>vr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return pr(t,e,n,i)||void 0}function pr(t,e,n,i){if(!W(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=ar(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:H(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&Ki.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!hr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of er){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?dr(ar(t,i),e):cr(ar(t,i),n.maskUrl);G(s)||fr(a,i,s)}for(const i of s){const r=hr(i);for(const i of Object.keys(r)){const o=ar(t,i),s=r[i];if(!0===s){const t=cr(o,n.maskUrl);G(t)||fr(a,i,t)}else{const t=vr(o,e,n,s);G(t)||fr(a,i,t)}}}const l=vr(ar(t,"@graph"),e,n);return G(l)||fr(a,"@graph",l),Object.keys(a).length?a:null}function mr(t,e,n){if(!W(t))return null;const i=ar(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=pr(t,e,n);return r?L({"@context":"https://schema.org"},r):null}function gr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function yr(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function br(t,e,n){for(let i=t;i;){if(yr(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function wr(t){return gr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(gr)}function kr(t){return W(t)?t.network_timing:t}const Sr=ce("[SessionRecording]"),_r=[1,2,3,4,5,6,7,12],xr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Cr(){var t;return null==o||null===(t=o.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Tr(){var t;return null===(t=Cr())||void 0===t?void 0:t.record}function Ir(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,Rn())}}function Mr(t){return fi(hi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Ln(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},o=0;e>o;++o){if(i+5>n.length){var s=new Ln(i+8+(e-o<<1));s.set(n),n=s}var a=t.charCodeAt(o);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++o))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return Xn(n,0,i)}(Ir(t))),!0)}function Ar(t){return Rr.apply(this,arguments)}function Rr(){return(Rr=A(function*(t){const e=yield ie(Ir(t),Ci.DEBUG,{rethrow:!0});return fi(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}let Er,Or;const $r="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Lr=!1;function Dr(t){var e;return H(t)&&0===t.length?(Er=null!==(e=Er)&&void 0!==e?e:Mr([]),Er):Mr(t)}function Pr(t){return Fr.apply(this,arguments)}function Fr(){return(Fr=A(function*(t){var e;return H(t)&&0===t.length?Er||(Or=null!==(e=Or)&&void 0!==e?e:Ar([]).then(t=>(Er=t,t)).catch(t=>{throw Er=void 0,Or=void 0,t}),Or):Ar(t)})).apply(this,arguments)}function Nr(t){return $r&&!Lr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function qr(t){return{event:t,size:On(t)}}function jr(t,e){return L(L({},t),{},{data:e,cv:"2024-10"})}function Br(t,e){return L(L({},t),{},{cv:"2024-10",data:L(L({},t.data),e)})}function zr(t){try{if(2===t.type)return qr(jr(t,Mr(t.data)));if(3===t.type&&0===t.data.source)return qr(Br(t,{texts:Dr(t.data.texts),attributes:Dr(t.data.attributes),removes:Dr(t.data.removes),adds:Dr(t.data.adds)}));if(3===t.type&&8===t.data.source)return qr(Br(t,{adds:t.data.adds?Mr(t.data.adds):void 0,removes:t.data.removes?Mr(t.data.removes):void 0}))}catch(t){Sr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:En(t)}}function Hr(){return Hr=A(function*(t){try{if(2===t.type)return qr(jr(t,yield Ar(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Pr(t.data.texts),Pr(t.data.attributes),Pr(t.data.removes),Pr(t.data.adds)]);return qr(Br(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Ar(t.data.adds):void 0,t.data.removes?Ar(t.data.removes):void 0]);return qr(Br(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Xt})(e)&&(Lr=!0),Sr.warn("could not compress event asynchronously - trying synchronous compression",e),zr(t)}return{event:t,size:En(t)}}),Hr.apply(this,arguments)}function Ur(t,e){return 5===t.type&&t.data.tag===e}function Wr(t){return Ur(t,"sessionIdle")}function Gr(t){return Ur(t,"$session_ending")}function Vr(t){return Ur(t,"$session_starting")}var Qr=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return Vi(this._instance.get_property(h),this.sessionId)}get Ht(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Y(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=!1,this.ue=Date.now(),this.ce=!1,this.de=[],this.he="unknown",this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=!1,this.Te=!1,this.Ie=!1,this.Me=!1,this.Ae=void 0,this.Re=void 0,this.Ee=!1,this.Oe=[],this.$e=0,this.Le=0,this.De=!1,this.Pe=void 0,this.Gt=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=void 0,this.je=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.Be)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Be;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ue,flushed_size:null===(c=this.ze)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Cr())||void 0===r||null===(o=r.resetMaxDepthState)||void 0===o||o.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.He(),!(!1===this.he&&this.isStarted||this.Xt===t&&this.Be===e)){const e=this.Xt!==t&&!1!==this.he;this.he="unknown",this.Ue(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ue}),null===(s=this.oe)||void 0===s||s.makeSamplingDecisions(t)},this.We=!1,this.Ge=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ve=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Y(n)&&Y(i)?i-n:null},this.Qe=()=>{var t,e;const n=this.re;if(!Y(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Ze;return Y(t)&&t>=0&&n>t}if(this.Ge())return!1;const i=this.Ve();return!!Z(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Je=()=>{"buffering"!==this.status?(this.ye&&this.be&&this.Ye&&(this.Ke(void 0),this.we&&(this.we=!1,this.Bt())),this.Xe(),this.tn(!0)):this.en()},this.nn=()=>{this.Je()},this.rn=()=>{this.Vt("browser offline",{})},this.sn=()=>{this.Vt("browser online",{})},this.an=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.Ye=!0),this.Vt("window "+n.visibilityState,{}))},this.Ye=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=i,this.Be=r,this._sessionStartTimestamp=o,this.nt=new Cn(this._instance),this.tt=new xn(this._instance),this.et=new Tn(this._instance),this.Rt=this.en(),this.ln="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.te.sessionTimeoutMs>this.ee||Sr.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.ze=new Ti(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ye=!0)}get un(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},d=null!==(o=null==c?void 0:c.maskAllInputs)&&void 0!==o?o:null==u?void 0:u.maskAllInputs,h=null!==(s=null==c?void 0:c.maskTextSelector)&&void 0!==s?s:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return G(d)&&G(h)&&G(f)&&G(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}cn(){var t;if(this.Ce)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(J(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!G(i)&&i!==r});0!==i.length&&(this.Ce=!0,Sr.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get dn(){var t;return ot(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ce("canvas recording resolution scale"),1)}get hn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let d=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==l?void 0:l.quality)&&void 0!==o?o:.4;if("string"==typeof d){const t=parseFloat(d);d=isNaN(t)?.4:t}return{enabled:u,fps:ot(c,0,12,ce("canvas recording fps"),4),quality:ot(d,0,1,ce("canvas recording quality"),.4)}}get fn(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get vn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},o=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),s=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=kr(this._instance.config.capture_performance),l=kr(null==i?void 0:i.capturePerformance),u=!!(K(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}pn(){var t,e;const n=[],r=null===(t=o.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.fn&&n.push(r());const s=null===(e=o.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.vn&&U(s))if(!me.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=U(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(L(L({},((t,e,n)=>{const i={payloadSizeLimitBytes:Ye.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ye.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ye.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=Je(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=rn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=rn(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=pe(t.name);let o=0===e.indexOf("http")?null===(i=pe(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&nn.some(t=>0===s.indexOf(t))?void 0:t})((en((i=e).requestHeaders),en(i.responseHeaders),i),t.api_host,n));var i},u=U(t.session_recording.maskNetworkRequestFn);return u&&U(t.session_recording.maskCapturedNetworkRequestFn)?ue.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return L(L({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=U(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const o=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,s=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return J(s)&&o?(sn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=on(t.requestBody,"Request"),t.responseBody=on(t.responseBody,"Response"),t}(l(t)),L(L(L({},Ye),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else Sr.info("NetworkCapture not started because we are on localhost.");return n}mn(t){return this._instance.config.disable_capture_url_hashes?St(t):t}gn(t,e=!1){const n=e?St(t):this.mn(t),i=this._instance.config.mask_personal_data_properties?[...Ji,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),o=r[1],s=r[0],a=(o||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}yn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}bn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.de.length?this.de.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.bn(xr(()=>Tr().addCustomEvent(t,e)))}wn(){var t;return this.le&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.he}kn(t){if(!this.wn())return!1;try{const e=Tr();return!!e&&(e.addCustomEvent("$json_ld",t),this.wn())}catch(t){return!1}}Sn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this._n)||void 0===e?void 0:e.scan(t)})}xn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.gn(e.origin+e.pathname+e.search);this.Cn!==n&&(this.Cn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Tn(){if(this.de.length){const t=[...this.de];this.de=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.bn(t)})}}Bt(){return this.bn(xr(()=>Tr().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Y(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Mn(){if(this.An&&clearInterval(this.An),!0===this.he)return;const t=this.In;t&&(this.An=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.Rn(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.Mn()}En(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this._n)||void 0===t||t.scan(),clearInterval(this.An),Sr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}On(){var t;this.tt.urlBlocked&&(null===(t=this._n)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.Sn(),this.Mn(),this.Vt("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}$n(t,e){var n;if("event"===t&&this.Rn(),!this.ce&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ce=!0;try{var i,r;const n="url"===t?f:v;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.tn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ce=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=W(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Ln(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const o=this.ie;if(!o)return void Sr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.he&&!this.ke;this.Ke(t?"no_interaction_since_recording_started":void 0),this.ke=!1,this.be=t,this.we=!1}this.De&&(this.Dn(),this.en());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.te.checkAndGetSessionAndWindowId();this.Xt=s,this.Be=a,this._sessionStartTimestamp=h,this.Pn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.se=null==o?void 0:o.endpoint),this.oe=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Zi(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new Qi(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(o),null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.$n(t,e)),this.Ln(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Ln(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Ln(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Ln(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.oe.makeSamplingDecisions(this.sessionId),this.Fn(),this.Se||(ve(t,"beforeunload",this.Je),ve(t,"pagehide",this.nn),ve(t,"offline",this.rn),ve(t,"online",this.sn),ve(n,"visibilitychange",this.an),!this.Fe&&U(this.te.onSessionId)&&(this.Fe=this.te.onSessionId(this.je)),!this.Ne&&U(this.te.on)?this.Ne=this.te.on("forcedIdleReset",()=>{this.He(),this.he="unknown",this.stop(),this.qe=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,this.je(t,e,n)})}):U(this.te.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),J(this.Pe)&&(this.Pe=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.gn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(e||"recording_initialized"))}Nn(){var e,i,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Je),null==t||t.removeEventListener("pagehide",this.nn),null==t||t.removeEventListener("offline",this.rn),null==t||t.removeEventListener("online",this.sn),null==n||n.removeEventListener("visibilitychange",this.an),clearInterval(this.An),this.qn(),null===(e=this.Pe)||void 0===e||e.call(this),this.Pe=void 0,null===(i=this.Gt)||void 0===i||i.call(this),this.Gt=void 0,null===(r=this.Fe)||void 0===r||r.call(this),this.Fe=void 0,null===(o=this.Ne)||void 0===o||o.call(this),this.Ne=void 0,null===(s=this.qe)||void 0===s||s.call(this),this.qe=void 0,null===(a=this.oe)||void 0===a||a.stop(),this.jn(),this.Dn()}Dn(){this.Le+=1,this.Oe=[],this.$e=0,this.Bn=void 0,this.De=!1}jn(){var t,e;null===(t=this.zn)||void 0===t||t.stop(),this.de=[],null===(e=this._n)||void 0===e||e.stop(),this._n=void 0,this.le=!1;try{var n;null===(n=this.ae)||void 0===n||n.call(this)}catch(t){Sr.warn("could not stop rrweb",t)}this.ae=void 0}Hn(){if(!this.Bn||0===this.$e)return!1;if(this.De)return!0;this.De=!0,this.Un=void 0;const t=this.Le;return this.qn(),this.jn(),this.Bn.catch(()=>{}).then(()=>{t===this.Le&&(this.De=!1,this.tn(),this.en(),this.Wn(),this.Nn(),Sr.info("stopped"))}).catch(()=>{this.De=!1,this.Wn(),this.Nn(),Sr.info("stopped")}),!0}stop(){if(this.jn(),this.We)this.Xe();else if(this.Hn())return;this.tn(),this.en(),this.Wn(),this.Nn(),Sr.info("stopped")}Wn(){this.Ke(void 0,{preserveLogDedup:this.We}),this.be=!1}flushBeforeIdentityReset(){(this.isStarted||this.De)&&(this.Xe(),this.tn())}Ue(t){this.We=!0,this.ue=Date.now();try{var e,n;this.stop(),this.Gn=void 0,this.ge=0,this.ve=0,this.pe=0,this.me=0,null===(e=Cr())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.We=!1}this.Ke(t?"no_interaction_since_session_rotated":void 0),this.be=!1}Ke(t,{preserveLogDedup:e=!1}={}){if(this.ye=!G(t),this.Un=t,G(t))return void(e||(this.Vn=void 0));if(this.We)return;const n=`${this.sessionId}:${t}`;n!==this.Vn&&(this.Vn=n,Sr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Rn(){this.isStarted||(this.ke=!0),this.ye&&(this.Ke(void 0),this.be=!1,this.we&&(this.we=!1,this.Bt()),this.Qn())}discard({discardProducerEvents:t=!1}={}){this.ye=!0,t&&(this.en(),this.jn()),this.en(),this.Nn(),this.en(),this.Wn(),Sr.info("discarded")}Zn(t,e,n,i,r){if(-1===n)return this.ge+=1,void Sr.warn("could not stringify event - dropping it to keep the rest of the recording");const o={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Jn(t,i),this.Yn(o)):this.en()}Kn(){try{this.Xn()}catch(t){this.xe||(this.xe=!0,Sr.error("could not track full snapshot cost",t))}}Xn(){var t,e;const n=null===(t=Cr())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Gn&&(this.Gn=n,500>n.durationMs||Sr.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Jn(t,e){2!==t.type?3===t.type&&(G(this.Ae)||this.Ae===e||this.Re===e||(this.Re=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Ae=e}ti(t){t.counted&&t.generation===this.Le&&(this.$e=Math.max(0,this.$e-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ei(t,e,n){t.processed||t.generation!==this.Le||(t.processed=!0,this.Zn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ni(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=zr(t.event))}catch(t){Sr.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=En(t.event));try{this.ei(t,n,e)}catch(t){Sr.warn("could not capture queued compression event",t)}}finally{this.ti(t)}}Xe(){[...this.Oe].forEach(t=>{try{this.ni(t)}catch(t){Sr.warn("could not drain queued compression event",t)}})}ii(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Le,processed:!1,counted:!0};this.Oe.push(o),this.$e+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Nr(t)?yield function(t){return Hr.apply(this,arguments)}(t):zr(t):{event:t,size:En(t)};n=r.event,i=r.size}catch(e){Sr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=En(t)}r.ei(o,n,i)}finally{r.ti(o)}}),function(){return a.apply(this,arguments)});var a;this.Bn=this.Bn?this.Bn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h;if(!this._instance.sessionManager)return;if(this.Tn(),!e||!W(e))return;if(4===e.type){const t=this.gn(e.data.href);if(this.Cn=t,!t)return;e.data.href=t}else this.xn();if(null===(n=this.oe)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.On(),(t,e)=>this.$n(t,e)),this.tt.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.Kn(),Promise.resolve().then(()=>this.Kn()),this.Mn(),null===(d=this.zn)||void 0===d||d.reset(),null===(h=this._instance.persistence)||void 0===h||h.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const f=2===e.type&&(null===(i=this.oe)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ri();const v=this.zn?this.zn.throttleMutations(e):e;if(!v)return void(!0===this.he&&this.fe++);const p=function(t){const e=t;if(e&&W(e)&&6===e.type&&W(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(v),m=function(t){return Gr(t)?t.data.payload:null}(p),g=function(t){return Vr(t)?t.data.payload:null}(p),y=function(t){return Wr(t)?t.data.payload:null}(p);m||g?(null==m?void 0:m.lastActivityTimestamp)&&(p.timestamp=m.lastActivityTimestamp):(null==y?void 0:y.sessionId)||this.oi(p);const b=null!==(r=null!==(o=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==o?o:null==y?void 0:y.sessionId)&&void 0!==r?r:this.Xt,w=null!==(a=null!==(l=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==g?void 0:g.nextWindowId)&&void 0!==l?l:null==y?void 0:y.windowId)&&void 0!==a?a:this.Be;if(!0===this.he&&!function(t){return Wr(t)||Gr(t)||Vr(t)}(p))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(p)&&this.fe++);2===p.type&&(this.fe=0),y&&(p.timestamp=y.lastActivityTimestamp+y.threshold);const k=this.le;this.le=!0,f?this.Sn(!0):k||this.Sn();const S=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===p.type&&"$json_ld"===p.data.tag){let e;try{e=t?this.gn(t.location.href):void 0}catch(t){}p.data.href=e}if(this.$e>0||S&&Nr(p))return void this.ii(p,S,b,w);const{event:_,size:x}=S?zr(p):{event:p,size:En(p)};this.Zn(p,_,x,b,w)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this.Se,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):an}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.Rn(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.Rn(),this.jt("sampling_overridden")}overrideTrigger(t){this.$n(t),this.Rn()}si(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.gn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}qn(){this.ai&&(clearTimeout(this.ai),this.ai=void 0)}Qn(){this.ai||(this.ai=setTimeout(()=>{this.tn()},2e3))}li(){return this.Ae!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Gr(t)&&!Vr(t))}ui(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}ci(t){if("buffering"!==t)return G(this.di)||this._instance.register_for_session({[k]:[]}),void(this.di=void 0);const e=this.ui();if(0===e.length)return G(this.di)||this._instance.register_for_session({[k]:[]}),void(this.di=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.di&&(this.di=i,this._instance.register_for_session({[k]:e}),Sr.info(`buffering: ${n}`))}hi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.fi)&&xi.Ot()}pi(){0!==this.Rt.data.length&&this.Rt.size!==this.mi&&943718.4>=this.Rt.size&&this.hi()&&(this.mi=this.Rt.size,xi.$t(this.ln,this.Rt))}Pn(){if(this.Ee||!this.hi())return;this.Ee=!0;const t=xi.Ft(this.ln);xi.Dt(this.ln),W(t)&&H(t.data)&&0!==t.data.length&&H(t.sizes)&&t.sizes.length===t.data.length&&Y(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Be&&(this.Rt.data.length>0||(this.Rt=t))}tn(t=!1){var e;if(this.qn(),this.ye)return this.Rt;if(this.li())return this.Rt.size>943718.4?this.en():(t&&this.pi(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Qe(),r=this.status;if(this.ci(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.pi(),this.Qn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.si();$n(n).forEach(e=>{try{var n;null===(n=this.ze)||void 0===n||n.trackSize(e.sessionId,e.size),this.gi(L(L(L(L({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ci.LIB_NAME,$lib_version:Ci.LIB_VERSION,$snapshot_host:t},this.ve>0?{$sdk_debug_replay_throttled_mutations_dropped:this.ve}:{}),this.pe>0?{$sdk_debug_replay_oversized_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ge}:{}))}catch(t){Sr.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.mi)||(xi.Dt(this.ln),this.mi=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.en()}Yn(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.he&&!this.ye&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.tn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.en()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ye&&(this.we||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.we=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.he||this.ye||this.Qn())}gi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ze(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}ri(){if(!this.Rt||0===this.Rt.data.length)return this.en();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.en():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}en(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Be},this.Rt}jt(t,e){this._instance.register_for_session({[I]:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",L({reason:t},e))}yi(t){var e;return 3===t.type&&-1!==_r.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}oi(t){const e=this.yi(t);e||!0===this.he||t.timestamp-this.ue>this.ee&&(this.he=!0,clearInterval(this.An),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Be}),this.tn());const{windowId:n,sessionId:i}=this.te.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.ue=t.timestamp,this.he)){const e="unknown"===this.he;this.he=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.Be!==n;if(this.Be=n,this.Xt=i,o||s){const t=o&&!1!==this.he;t&&(this.he="unknown"),this.Ue(t)}else if(e&&this.Rn(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.oe)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.fe>0&&t&&this.Bt(),this.Sn(),this.Mn()}}He(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Un,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.ze)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this.Se,[C]:this.bi,[T]:this._e}}get bi(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Tr())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}Fn(){var e;if(this.ae)return;this._e=!0;const i={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=L({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};G(t.mousemove)||(n.mousemove=t.mousemove),G(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=L(L({},i.slimDOMOptions),{},{script:!0})),this.hn&&this.hn.enabled&&(i.recordCanvas=!0,i.sampling=L(L({},i.sampling),{},{canvas:this.hn.fps}),i.dataURLOptions={type:"image/webp",quality:this.hn.quality},i.canvasResolutionScale=this.dn,i.canvasMasking={configured:()=>{var t;return U(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(U(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.un&&(i.maskAllInputs=null===(o=this.un.maskAllInputs)||void 0===o||o,i.maskTextSelector=null!==(s=this.un.maskTextSelector)&&void 0!==s?s:void 0,i.blockSelector=null!==(a=this.un.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.un.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.Te||(this.Te=!0,Sr.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.cn();const u=Tr();if(!u)return void Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.zn=null!==(e=this.zn)&&void 0!==e?e:new vi(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Sr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.pe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.pe+=1,this.me+=t},requestFullSnapshot:()=>this.Bt()});const c=this.pn();if(this.ae=u(L(L({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Me||(this.Me=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i),{},{recordAfter:"DOMContentLoaded"})),!this.ae)return this.Se=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Se=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this._n&&(this._n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Yi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?tr:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!br(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!o||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return br(t,e.blockClass,e.blockSelector)||br(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=tr,n){if(!t||t.length>Yi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=H(i)?i.map(t=>mr(t,e,r)):mr(i,e,r);if(r.exceeded||Z(o)||H(o)&&(!o.length||o.some(Z)))return null;const s=JSON.stringify(o);return s.length>2e4?null:[o,s]}catch(t){return null}}(e.text,s,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(Z(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>o)return void(o=0);n.emit(u)&&(i.set(e,c),o-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!o||!1===r())return;const e=t=>{for(const e of wr(t))a(e)};for(const n of t)if("childList"===n.type)gr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&gr(t)&&a(t)}else"attributes"===n.type&&gr(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){o&&!1!==r()&&wr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.gn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.wn()},emit:t=>this.kn(t)}),this.tt.isCurrentUrlBlocked()&&this._n.scan()),this.ue=Date.now(),this.he=K(this.he)?this.he:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const Zr=["type"];var Jr=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),Yr=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Kr=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),Xr=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),to=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),eo=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),no=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function io(t,e){return-1!==t.indexOf(e)}Date,Date;var ro={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},oo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},so={};function ao(t){if(so[t])return so[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in ro?ro[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in oo?oo[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&s)return so[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(io(u=navigator.userAgent,"AppleWebKit")&&!io(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),so[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var lo=Object.create(null);function uo(t,e,n){var i;const r=lo[t],o=r[n];if(o)return o.call(e);const s=ao(t),a=null===(i=Object.getOwnPropertyDescriptor(s,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}lo.Node=Object.create(null),lo.ShadowRoot=Object.create(null),lo.MutationObserver=Object.create(null),lo.Element=Object.create(null);var co,ho={};function fo(t,e,n){const i=`${t}.${String(n)}`;if(ho[i])return ho[i].bind(e);const r=ao(t)[n];return"function"!=typeof r?e[n]:(ho[i]=r,r.bind(e))}function vo(){return ao("MutationObserver").constructor}function po(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},o=n(function(...t){return r.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],s=n(i);for(;s;){if(s.next===o)return void(s.next=r.next);i=s.next,s=n(i)}}}catch(t){return()=>{}}}var mo={childNodes:t=>uo("Node",t,"childNodes"),parentNode:t=>uo("Node",t,"parentNode"),parentElement:t=>uo("Node",t,"parentElement"),textContent:t=>uo("Node",t,"textContent"),previousSibling:t=>uo("Node",t,"previousSibling"),nextSibling:t=>uo("Node",t,"nextSibling"),lastChild:t=>uo("Node",t,"lastChild"),isConnected(t){if(void 0===co){var e;const t=null===(e=Object.getOwnPropertyDescriptor(ao("Node"),"isConnected"))||void 0===e?void 0:e.get;co=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==co?void 0:co.call(t)},contains:(t,e)=>fo("Node",t,"contains")(e),getRootNode:t=>fo("Node",t,"getRootNode")(),host:t=>t&&"host"in t?uo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?uo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>fo("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>fo("Element",t,"querySelectorAll")(e),mutationObserver:vo,patch:po};function go(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var yo=0;function bo(){yo+=1}function wo(){return yo}function ko(t,e){return(e!==yo||t>6e4)&&!0}var So=0,_o=0,xo=0,Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Io=null,Mo=[],Ao=0,Ro=0,Eo={slowestBatchMs:0},Oo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function $o(t){(So+=1)>1||(Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Mo=[],Ao=0,Io=(t=>t&&t>0?t:null)(t),_o=go(),xo=yo)}function Lo(){return 0===So?To||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(So-=1)>0?Co:(Co.durationMs=go()-_o,Co.deferredStylesheetCount=Ao,Oo.deferredCount+=Ao,Io=null,ko(Co.durationMs,xo)?Co:To=Co)}function Do(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const o=t[r];try{const t=o.cssRules;if(t&&t.length)i+=Do(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=Do(r,e,n+1))}}}catch(t){}}return i}function Po(t){if(0===So)return;const e=Do(t,null,0);Co.cssRuleCount+=e,Ro>0&&(Co.nonDeferrableCssRuleCount+=e)}function Fo(t){Ro+=1;try{return t()}finally{Ro-=1}}function No(t){So>0&&(Co.stylesheetMs+=t)}function qo(t){if(0===So||null===Io)return!1;const e=Co.cssRuleCount-Co.nonDeferrableCssRuleCount;return e>=Io||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Do(e,n,0)}catch(t){return 0}}(t)>Io}function jo(){const t=Mo;return Mo=[],t}function Bo(){Oo.failedCount+=1}function zo(t){t>0&&(Oo.abandonedCount+=t)}function Ho(t){return Ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ho(t)}function Uo(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ho(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ho(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wo(t){return t.nodeType===t.ELEMENT_NODE}function Go(t){const e=t&&"host"in t&&"mode"in t&&mo.host(t)||null;return Boolean(e&&"shadowRoot"in e&&mo.shadowRoot(e)===t)}function Vo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Qo(t){return t.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}function Zo(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var Jo=0;function Yo(t){const e=0===Jo,n=e?go():0;Jo+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Po(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Qo(Array.from(e,t=>Ko(t,n)).join(""))}catch(t){return null}finally{Jo-=1,e&&No(go()-n)}}function Ko(t,e){if(ts(t)){let e;try{e=Yo(t.styleSheet)||Zo(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ms(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return es(t)&&t.selectorText.includes(":")&&(n=Xo(n)),e?ms(n,e):n}}function Xo(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ts(t){return"styleSheet"in t}function es(t){return"selectorText"in t}var ns=/^-?[A-Za-z_][\w-]*$/,is=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function rs(t){const e=[];let n=!1,i=null;const r=new Map;function o(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);s(e[e.length-1],r.importRule,t)}function s(t,e,n){try{let r;try{r=n||Zo(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ms(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&ts(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const i=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(es(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ns.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ns.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":is.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?ms(i,r):i,fixColons:"sheet"===n.kind&&es(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&es(n)&&n.selectorText.includes(":")&&(i=Xo(i)),t.parts.push(t.sheetHref?ms(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Po(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!ts(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;Po(t);let o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);const s=Array.from(t);r.set(e,{sheet:i,rules:s,sheetHref:o}),n.push({sheet:i,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=go();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?Xo(n):n}else e=Qo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{No(go()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var os=class{constructor(){Uo(this,"idNodeMap",new Map),Uo(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),Wo(t)){const e=mo.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ss({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&as(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function as(t){return t.toLowerCase()}var ls=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function us({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&ls.has(as(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var cs="__rrweb_original__";function ds(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?as(e):null}catch(t){return null}}var hs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,fs=/^(?:[a-z+]+:)?\/\//i,vs=/^www\..*/i,ps=/^(data:)([^,]*),(.*)/i;function ms(t,e){return(t||"").replace(hs,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(fs.test(a)||vs.test(a))return`url(${l}${a}${l})`;if(ps.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),d=e.split("#")[0].split("/"),h=u.split("/");d.pop();for(const t of h)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${c}${l})`})}var gs,ys,bs=new Map,ws=1,ks=new RegExp("[^a-z0-9-_:]");function Ss(){return ws++}var _s=!1,xs=/^[^ \t\n\r\u000c]+/,Cs=/^[, \t\n\r\u000c]+/,Ts=new WeakMap;function Is(t,e){return e&&""!==e.trim()?Ms(t,e):e}function Ms(t,e){let n=Ts.get(t);if(n||(n=t.createElement("a"),Ts.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function As(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Rs(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=Is(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=bs.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const o=r.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>s.length?s:e;if(bs.size>=10){const t=bs.keys().next().value;void 0!==t&&bs.delete(t)}return bs.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),As(t,o)}if("image"===e)return As(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Is(t,i);return"image"===e&&n.startsWith("data:")?As(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Cs),e.length>n;){let o=i(xs);if(","===o.slice(-1))o=Is(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Is(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((o+i).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,r.push((o+i).trim());break}"("===t&&(s=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?ms(i,Ms(t)):"object"===e&&"data"===n?Is(t,i):i:Is(t,i)}function Es(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===as(e)}function Os(t){return"string"==typeof t&&as(t).split(/\s+/).includes("stylesheet")}function $s(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&$s(mo.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&$s(mo.parentNode(t),e,n)}function Ls(t,e,n,i){let r;if(Wo(t)){if(r=t,!mo.childNodes(r).length)return!1}else{if(null===mo.parentElement(t))return!1;r=mo.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if($s(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function Ds(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ps=new Map;function Fs(t={}){Ps.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),Ps.delete(n))})}function Ns(t){try{return t.sheet}catch(t){return null}}function qs(t,e,n,i,r){const o=new AbortController,s=()=>{var e;(null===(e=Ps.get(t))||void 0===e?void 0:e.controller)===o&&Ps.delete(t),o.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{s()}}};t.addEventListener("load",l,{signal:o.signal,once:!0}),t.addEventListener("error",s,{signal:o.signal,once:!0});const u=Date.now()+6e4;let c;const d=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?d(e+1):s():s()},r)};o.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),d(0),Ps.set(t,{controller:o,changedLinkBaseline:r})}var js=[100,200,400,800,1600,3200,6400,12800,25600];function Bs(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function zs(t){return null==t?"":t.toLowerCase()}var Hs=!1,Us=!1;function Ws(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S=5e3,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:I=!1,depth:M=0,maxDepth:A=50}=e;let{needsMask:R}=e,{preserveWhiteSpace:E=!0}=e;if(M>=A)return Us=!0,Hs||(Hs=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${A}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;R||(R=Ls(t,s,a,void 0===R)),So>0&&(Co.nodeCount+=1);const O=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:no.Document,childNodes:[],compatMode:t.compatMode}:{type:no.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:no.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=as(t.tagName);return ks.test(e)?"div":e}(t),b=new Set;let w={};const k=t.attributes.length;for(let e=0;k>e;e++){const i=t.attributes[e];Es(y,i.name)||(w[i.name]=Rs(n,y,as(i.name),i.value,t,c))}if("link"===y&&"string"==typeof w.href){var S;const e=null===(S=Ns(t))||void 0===S?void 0:S.href;e&&(w.href=e)}if("link"===y&&o&&!g&&Os(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=Bs(n,i),!e&&i.includes(".css"))&&(e=Bs(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(qo(e)?So>0&&(Mo.push(t),Ao+=1):i=Yo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||mo.textContent(t)||"").trim().length){const e=Fo(()=>Yo(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=ss({element:t,type:ds(t),tagName:y,value:e,maskInputOptions:s,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!s.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&h&&!(null==f?void 0:f()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,o=cs in r?r[cs]:r;let s;try{s=o.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(_=t)?void 0:_.name)?_s||(_s=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",_)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",_)}let x,C=!1;if("img"===y&&d){gs||(gs=n.createElement("canvas"),ys=gs.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>C?us({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Ds(e,"load",s);try{gs.width=e.naturalWidth,gs.height=e.naturalHeight,ys.drawImage(e,0,0);const t=gs.toDataURL(c.type,c.quality);w.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.add("rr_mediaState"),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}if(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var T,I,M;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(T=n.defaultView)||void 0===T?void 0:T.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),s&&(w.rr_position=s.position||"static",b.add("rr_position"),s.transform&&"none"!==s.transform&&(w.rr_transform=s.transform,b.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(w.rr_display=s.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=us({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));C=!0;try{customElements.get(y)&&(x=!0)}catch(t){}return{type:no.Element,tagName:y,attributes:w,childNodes:[],isSVG:(A=t,Boolean("svg"===A.tagName||A.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:x};var A}(t,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:case t.CDATA_SECTION_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=mo.parentNode(t),s=o&&o.tagName;let a=mo.textContent(t);const l="STYLE"===s||void 0,u="string"==typeof s&&"SCRIPT"===s.toUpperCase();if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(qo(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Yo(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=ms(a,Ms(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,mo.parentElement(t)):a.replace(/[\S]/g,"*")),{type:no.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.COMMENT_NODE:return{type:no.Comment,textContent:mo.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:T,newlyAddedElement:I});if(!O)return console.warn(t,"not serialized"),null;let L;L=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===no.Comment)return!0;if(t.type===no.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(zs(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===zs(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(zs(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&zs(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(zs(t.attributes.property).match(/^(og|twitter|fb):/)||zs(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===zs(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(zs(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(zs(t.attributes.name))||zs(t.attributes.property).match(/^article:/)||zs(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(zs(t.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===no.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ss();const D=Object.assign(O,{id:L});if(i.add(t,D),-2===L)return null;w&&w(t);let P=!l;if(D.type===no.Element){P=P&&!D.needBlock,delete D.needBlock;const e=mo.shadowRoot(t);e&&Vo(e)&&(D.isShadowHost=!0)}if((D.type===no.Document||D.type===no.Element)&&P){p.headWhitespace&&D.type===no.Element&&"head"===D.tagName&&(E=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M+1,maxDepth:A};if(D.type===no.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(mo.childNodes(t))){const t=Ws(n,e);t&&D.childNodes.push(t)}let I=null;if(Wo(t)&&(I=mo.shadowRoot(t)))for(const t of Array.from(mo.childNodes(I))){const n=Ws(t,e);n&&(Vo(I)&&(n.isShadow=!0),D.childNodes.push(n))}}const F=mo.parentNode(t);if(F&&Go(F)&&Vo(F)&&(D.isShadow=!0),D.type===no.Element&&"iframe"===D.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let o;try{o=r.document.readyState}catch(t){return i}const s=()=>e();if("complete"!==o){let i=!1,r=null;const o=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),Ds(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return r=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?Ds(t,"load",s):(i=!0,Ds(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),Ds(t,"load",s)}}return t.addEventListener("load",s),()=>{Ds(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=Ws(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M+1,maxDepth:A});n&&k(t,n)}},S);null==_||_(t,e)}var N,q,j;return D.type===no.Element&&"link"===D.tagName&&Os(D.attributes.rel)&&(q=()=>{if(x){const e=i.getMeta(t),l=Ws(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:T,depth:M,maxDepth:A});l&&x(t,l,e)}},j=C,Ps.has(N=t)||Ns(N)||qs(N,q,()=>Boolean(Ns(N)),[j])),D}function Gs(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var Vs=class t{constructor(...t){Uo(this,"parentElement",null),Uo(this,"parentNode",null),Uo(this,"ownerDocument",void 0),Uo(this,"firstChild",null),Uo(this,"lastChild",null),Uo(this,"previousSibling",null),Uo(this,"nextSibling",null),Uo(this,"ELEMENT_NODE",1),Uo(this,"TEXT_NODE",3),Uo(this,"nodeType",void 0),Uo(this,"nodeName",void 0),Uo(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Qs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Zs(n,t,e,i)}function Zs(t,e,n,i){Js(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Js(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Ys(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Ks="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.",Xs={map:{},getId(){return console.warn(Ks),-1},getNode(){return console.warn(Ks),null},removeNodeFromMap(){console.warn(Ks)},has(){return console.warn(Ks),!1},reset(){console.warn(Ks)}};function ta(t,e,n={}){let i=null,r=0;return function(...o){const s=Date.now();r||!1!==n.leading||(r=s);const a=e-(s-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=s,t.apply(l,o)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,o)},a))}}function ea(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>ea(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=function(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),o=r?t[r]:void 0;"function"==typeof o&&(e=o)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),s}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xs=new Proxy(Xs,{get(t,e,n){return"map"===e&&console.warn(Ks),Reflect.get(t,e,n)}}));var na=Date.now;function ia(t){var e,n,i,r;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=mo.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=mo.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollTop)||0}}function ra(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function sa(t){return t?t.nodeType===t.ELEMENT_NODE?t:mo.parentElement(t):null}function aa(t,e,n,i){if(!t)return!1;const r=sa(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if($s(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function la(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),aa(t,i||e,n,!0))return!0;const r="getRootNode"in t?mo.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?mo.host(r):null}return!1}function ua(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ca(t,e){if(Go(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=mo.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ca(i,e))}function da(t){return Boolean(t.changedTouches)}function ha(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function fa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function va(t){return!!t&&(t instanceof Vs&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(mo.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(na=()=>(new Date).getTime());var pa=class{constructor(){Uo(this,"id",1),Uo(this,"styleIDMap",new WeakMap),Uo(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ma(t){var e;let n=null;return"getRootNode"in t&&(null===(e=mo.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&mo.host(mo.getRootNode(t))&&(n=mo.host(mo.getRootNode(t))),n}function ga(t){const e=t.ownerDocument;if(!e)return!1;if(mo.contains(e,t))return!0;const n=mo.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=ma(n);)n=e;return n}(t);return mo.contains(e,n)}(t)}var ya,ba=(t,e)=>`${t}@${e}`,wa=class{constructor(){Uo(this,"frozen",!1),Uo(this,"locked",!1),Uo(this,"takePendingRecords",void 0),Uo(this,"texts",[]),Uo(this,"attributes",[]),Uo(this,"attributeMap",new WeakMap),Uo(this,"generatedAttributes",new WeakMap),Uo(this,"removes",[]),Uo(this,"mapRemoves",new Set),Uo(this,"movedMap",{}),Uo(this,"addedSet",new Set),Uo(this,"movedSet",new Set),Uo(this,"droppedSet",new Set),Uo(this,"removesSubTreeCache",new Set),Uo(this,"mutationCb",void 0),Uo(this,"blockClass",void 0),Uo(this,"blockSelector",void 0),Uo(this,"maskTextClass",void 0),Uo(this,"maskTextSelector",void 0),Uo(this,"inlineStylesheet",void 0),Uo(this,"maskInputOptions",void 0),Uo(this,"maskTextFn",void 0),Uo(this,"maskInputFn",void 0),Uo(this,"maskAllElementAttributes",void 0),Uo(this,"maskAttributeFn",void 0),Uo(this,"keepIframeSrcFn",void 0),Uo(this,"recordCanvas",void 0),Uo(this,"canvasMaskingConfigured",void 0),Uo(this,"inlineImages",void 0),Uo(this,"slimDOMOptions",void 0),Uo(this,"dataURLOptions",void 0),Uo(this,"doc",void 0),Uo(this,"mirror",void 0),Uo(this,"iframeManager",void 0),Uo(this,"stylesheetManager",void 0),Uo(this,"shadowDomManager",void 0),Uo(this,"canvasManager",void 0),Uo(this,"processedNodeManager",void 0),Uo(this,"unattachedDoc",void 0),Uo(this,"canvasManagerReleased",!1),Uo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Uo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=go(),e=wo();try{this.processBufferedMutations()}finally{n=go()-t,i=e,So>0||ko(n,null!=i?i:yo)||n>Eo.slowestBatchMs&&(Eo.slowestBatchMs=n)}var n,i}),Uo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=t=>{let e=t,n=-2;for(;-2===n;)e=e&&mo.nextSibling(e),n=e&&this.mirror.getId(e);return n};let i;const r=r=>{var o;const s=mo.parentNode(r);if(!s||!ga(r)||"TEXTAREA"===s.tagName)return!0;if(this.isBlockedAtEmission(s))return!0;const a=Go(s)?this.mirror.getId(ma(r)):this.mirror.getId(s),l=n(r);if(-1===a||-1===l)return!1;null!==(o=i)&&void 0!==o||(i=this.buildSerializationOptions());const u=Ws(r,i);return u&&(t.push({parentId:a,nextId:l,node:u}),e.add(u.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Sa(this.removesSubTreeCache,t)&&!this.movedSet.has(mo.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=_a(this.droppedSet,t),n=Sa(this.removesSubTreeCache,t),i=this.movedSet.has(t)||_a(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const o=new Set;let s=null;const a=this.addedSet.values();let l=a.next();for(;this.addedSet.size;){let t=null;if(null!==s)for(t=mo.previousSibling(s);t&&-2===this.mirror.getId(t);)t=mo.previousSibling(t);if(t&&this.addedSet.has(t))s=t;else{for(this.addedSet.has(l.value)||(l=a.next()),s=l.value;;){const t=mo.parentNode(s),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?mo.host(t):t;if(!e||!this.addedSet.has(e))break;s=e}const t=mo.parentNode(s);if(t&&this.addedSet.has(mo.lastChild(t)))s=mo.lastChild(t);else if(t)for(;;){let t=mo.nextSibling(s);for(;t&&-2===this.mirror.getId(t);)t=mo.nextSibling(t);if(!t||!this.addedSet.has(t))break;s=t}}this.addedSet.delete(s);const e=mo.parentNode(s),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?mo.host(e):e;n&&o.has(n)?o.add(s):r(s)||o.add(s)}o.size>0&&console.warn(`[rrweb] dropped ${o.size} node(s) with unresolved parent at emit`);const u={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=mo.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=us({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t},c=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of u.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===as(n.nodeName)&&Os(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&c.push(n)}if(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},u.texts.length||u.attributes.length||u.removes.length||u.adds.length){this.mutationCb(u);for(const t of c)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:Ws(t,L(L({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}}),Uo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Uo(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(mo.childNodes(t),t=>mo.textContent(t)||"").join("");e.attributes.value=ss({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ds(t),value:n,maskInputFn:this.maskInputFn})}),Uo(this,"processMutation",t=>{if(!ua(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=mo.textContent(t.target);aa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ls(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,sa(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=as(i.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(i,o,s),l=s?i.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=i,e=ds(t);l=ss({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(aa(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Es(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Rs(this.doc,r,as(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{ga(t)||this.shadowDomManager.removeShadowRootsIn(t)}),aa(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=Go(t.target)?this.mirror.getId(mo.host(t.target)):this.mirror.getId(t.target);aa(t.target,this.blockClass,this.blockSelector,!1)||ua(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ka(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ca(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ba(n,i)]?ka(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Go(t.target)||!Vo(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),mo.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Uo(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ua(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[ba(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!aa(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=mo.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(va(t)){const e=mo.childNodes(mo.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){return la(t,this.blockClass,this.blockSelector)}recordReinsertion(t){var e;const n=mo.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ha(t,this.mirror)&&this.iframeManager.addIframe(t),fa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),va(t)&&!aa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(mo.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function ka(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=mo.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function Sa(t,e,n){return 0!==t.size&&function(t,e){const n=mo.parentNode(e);return!!n&&t.has(n)}(t,e)}function _a(t,e){if(0===t.size)return!1;let n=mo.parentNode(e);for(;n;){if(t.has(n))return!0;n=mo.parentNode(n)}return!1}function xa(t){ya=t}function Ca(){ya=void 0}var Ta=(t,e="rrweb")=>ya?(...n)=>{try{return t(...n)}catch(t){if(ya&&!0===ya(t,e))return;throw t}}:t,Ia=[];function Ma(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Aa(t,e){const n=new wa;let i;n.init(t);try{i=new(vo())(Ta(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),Ia.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ra({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=Ma(o);if(!a||aa(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ia(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=[Qs("scroll",Ta(ta(Ta(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Qs("scrollend",Ta(a),e)),()=>l.forEach(t=>t())}function Ea(t,e){for(let n=Ia.length-1;n>=0;n--){const i=Ia[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ia.splice(n,1))}}var Oa=["INPUT","TEXTAREA","SELECT"],$a=new WeakMap;function La(t){return function t(e,n){if(qa("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qa("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qa("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qa("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function Da(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Pa({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:mo.host(n));const s="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ta(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Fa=new Set;function Na(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],s=Ta(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ia.indexOf(r);-1!==t&&Ia.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Ys(o)}}),a=(t,e)=>{const n=Ta(()=>{try{return e()}catch(e){throw Fa.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Aa(t,t.doc);i=e.observer,r=e.buffer}),a("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const l=ta(Ta(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Ta(ta(Ta(t=>{const e=Ma(t),{clientX:n,clientY:r}=da(t)?t.changedTouches[0]:t;s||(s=na()),a.push({x:n,y:r,id:i.getId(e),timeOffset:na()-s}),l("drag"===t.type?Yr.Drag:"touchmove"===t.type?Yr.TouchMove:Yr.MouseMove)}),r,{trailing:!1})),c=[Qs("mousemove",u,n),Qs("touchmove",u,n),Qs("drag",u,n)];return Ta(()=>{c.forEach(t=>t())})}(t)),a("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Kr).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=as(o);const u=(e=>o=>{const s=Ma(o);if(aa(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Xr.Mouse;break;case"touch":a=Xr.Touch;break;case"pen":a=Xr.Pen}a===Xr.Touch&&(Kr[e]===Kr.MouseDown?u="TouchStart":Kr[e]===Kr.MouseUp&&(u="TouchEnd"))}else da(o)&&(a=Xr.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===Xr.Touch||u.startsWith("Mouse")&&a===Xr.Mouse)&&(a=null)):Kr[e]===Kr.Click&&(a=l,l=null);const c=da(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Ta(t)(L({type:Kr[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(Kr[o]){case Kr.MouseDown:case Kr.MouseUp:s=s.replace("mouse","pointer");break;case Kr.TouchStart:case Kr.TouchEnd:return}a.push(Qs(s,u,e))}),Ta(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ra(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Qs("resize",Ta(ta(Ta(()=>{const e=ra(),r=oa();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),a("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(t){let n=Ma(t);const u=t.isTrusted,d=e.defaultView;if(n&&d&&!(n instanceof d.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=mo.parentElement(n)),!n||!f||0>Oa.indexOf(f)||aa(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=ds(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=ss({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),h(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;h(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function h(e,i){const r=$a.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){$a.set(e,i);const r=n.getId(e);Ta(t)(L(L({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Qs(t,Ta(d),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>ea(t[0],t[1],{set(){Ta(d)({target:this,isTrusted:!1})}},!1,v))),Ta(()=>{Ys(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Ta(o=>ta(Ta(r=>{const s=Ma(r);if(!s||aa(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:i.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),r.media||500)),a=[Qs("play",s(eo.Play),o),Qs("pause",s(eo.Pause),o),Qs("seeked",s(eo.Seeked),o),Qs("volumechange",s(eo.VolumeChange),o),Qs("ratechange",s(eo.RateChange),o)];return Ta(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},o=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),o(t)):r(n)},queuePendingMutation(s,a,l){if(!i)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const v=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(v,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&r(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),a("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const o=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);try{const i=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof i)return l;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Da(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=r.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=Yo(o);null!==e&&t({id:s,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Da(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};ja("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(ja("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),ja("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),ja("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,o])=>{c[i]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Da(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...La(o),l];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Ta((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Da(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...La(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ta(()=>{i.CSSStyleSheet.prototype.insertRule=o,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),a("adoptedStyleSheet",()=>Pa(t,t.doc)),a("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:o}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ta((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=Da(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=La(s.parentRule);o.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ta((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(d);const{id:h,styleId:f}=Da(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=La(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ta(()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&a("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const i=new o(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const s=po(e.fonts,"add",function(e){return function(n){return setTimeout(Ta(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=o}),i.push(s),Ta(()=>{i.forEach(t=>t())})}(t))}a("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=t;let s=!0;const a=Ta(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);aa(o,i,r,!0)||aa(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Qs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?po(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)a(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{s()}catch(t){}throw t}return s}function qa(t){return void 0!==window[t]}function ja(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function Ba(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var za=class{constructor(t){Uo(this,"generateIdFn",void 0),Uo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Uo(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t);let s=r.get(e);return void 0===s&&(s=this.generateIdFn(),r.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Ha=class{constructor(t){Uo(this,"iframes",new WeakMap),Uo(this,"crossOriginIframeMap",new WeakMap),Uo(this,"crossOriginIframeMirror",new za(Ss)),Uo(this,"crossOriginIframeStyleMirror",void 0),Uo(this,"crossOriginIframeRootIdMap",new WeakMap),Uo(this,"mirror",void 0),Uo(this,"mutationCb",void 0),Uo(this,"wrappedEmit",void 0),Uo(this,"loadListener",void 0),Uo(this,"pageHideListener",void 0),Uo(this,"stylesheetManager",void 0),Uo(this,"recordCrossOriginIframes",void 0),Uo(this,"messageHandler",void 0),Uo(this,"nestedIframeListeners",new Map),Uo(this,"attachedWindows",new WeakMap),Uo(this,"attachedDocuments",new WeakMap),Uo(this,"attachedIframes",new Map),Uo(this,"loadListenerDisposers",new WeakMap),Uo(this,"iframeElementsById",new Map),Uo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new za(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Js(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Zs(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Js(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Js(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case Jr.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Jr.IncrementalSnapshot,data:{source:Yr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Jr.Meta:case Jr.Load:case Jr.DomContentLoaded:return!1;case Jr.Plugin:return e;case Jr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Jr.IncrementalSnapshot:switch(e.data.source){case Yr.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Yr.Drag:case Yr.TouchMove:case Yr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Yr.ViewportResize:return!1;case Yr.MediaInteraction:case Yr.MouseInteraction:case Yr.Scroll:case Yr.CanvasMutation:case Yr.Input:return this.replaceIds(e.data,t,["id"]),e;case Yr.StyleSheetRule:case Yr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Yr.Font:return e;case Yr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Yr.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===no.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Zs(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Zs(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Js(()=>this.mirror.removeNodeFromMap(t))}),Js(()=>Ea(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Zs(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Zs(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Ua=class{constructor(t){Uo(this,"shadowDoms",new Map),Uo(this,"mutationCb",void 0),Uo(this,"scrollCb",void 0),Uo(this,"bypassOptions",void 0),Uo(this,"mirror",void 0),Uo(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!Vo(t))return;if(this.shadowDoms.has(t))return;const r=null!==(n=null===(i=mo.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,o={doc:r,handlers:[]};this.shadowDoms.set(t,o);const{observer:s,buffer:a}=Aa(L(L({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=Ia.indexOf(a);-1!==t&&Ia.splice(t,1)}),o.handlers.push(Ra(L(L({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(mo.host(t))),o.handlers.push(Pa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=mo.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),mo.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach(Wa)}observeAttachShadow(t){Js(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:po(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=mo.shadowRoot(this);return o&&ga(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>Wa(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach(Wa))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?Wa(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function Wa(t){try{t()}catch(t){}}var Ga="skip-frame";function Va(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Qa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ja=0;64>Ja;Ja++)Za[Qa.charCodeAt(Ja)]=Ja;var Ya=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Qa[n[e]>>2],r+=Qa[(3&n[e])<<4|n[e+1]>>4],r+=Qa[(15&n[e+1])<<2|n[e+2]>>6],r+=Qa[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Ka=!1,Xa=new Map,tl=(t,e,n)=>{if(!t||!il(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Xa.get(t);return n||(n=new Map,Xa.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function el(t,e,n,i){if(t instanceof Array)return t.map(t=>el(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Ya(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[el(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?Ka||(Ka=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[el(t.data,e,n,i),t.width,t.height]}:il(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:tl(t,e,n)}:t}var nl=(t,e,n,i)=>t.map(t=>el(t,e,n,i)),il=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},rl=["webgl","webgl2"];function ol(t){return"nodeType"in t}function sl(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return po(i.prototype,"configure",function(i){return function(r){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||ol(o)&&aa(o,e,n,!0))return i.call(this,r);ol(o)&&!("__context"in o)&&(o.__context="webgpu");const s=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==s&&r?L(L({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=po(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!aa(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&rl.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});r.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function al(t,e,n,i,r,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=po(t,u,function(t){return function(...a){const l=t.apply(this,a);if(tl(l,o,this),this.canvas&&"tagName"in this.canvas&&!aa(this.canvas,i,r,!0)){let t;try{t=nl(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=ea(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!aa(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var ll='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ul="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ll],{type:"text/javascript;charset=utf-8"});function cl(t){let e;try{if(e=ul&&(self.URL||self.webkitURL).createObjectURL(ul),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ll),{name:null==t?void 0:t.name})}}var dl="A page CSP that omits blob: from worker-src or script-src blocks it";function hl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var fl=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){Uo(this,"pendingCanvasMutations",new Map),Uo(this,"rafStamps",{latestId:0,invokeId:null}),Uo(this,"mirror",void 0),Uo(this,"mutationCb",void 0),Uo(this,"resetObservers",void 0),Uo(this,"frozen",!1),Uo(this,"locked",!1),Uo(this,"rafIdTimestamp",null),Uo(this,"rafIdFlush",null),Uo(this,"refCount",0),Uo(this,"torndown",!1),Uo(this,"resetFrameDedup",null),Uo(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,i,r,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void hl("disabled because this browser does not support OffscreenCanvas");const s="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=sl(e,n,i,!0),l=new Map;let u;try{u=new cl}catch(t){return hl(`disabled because the encode worker did not start. ${dl}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,hl(`stopped because the encode worker failed. ${dl}`,t),cancelAnimationFrame(v),null===(e=u.terminate)||void 0===e||e.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:o}=t.data;this.mutationCb({id:e,type:to["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,o]}],displayWidth:r,displayHeight:o})};let d=!1,h=!1;const f=1e3/t;let v,p=0;const m=t=>{var a;c||(p&&f>t-p||(p=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{aa(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(o*s)),h=Math.max(1,Math.round(a*s)),f=function(t,e,n,i,r,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Ga}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Va))return Ga;const a=n/r,l=i/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,o,a);if("skip-frame"===f)return d||(d=!0,hl("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void l.set(e,!1);const v=yield createImageBitmap(t,1>s?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:v,width:c,height:h,displayWidth:o,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:f},[v])}catch(t){h||(h=!0,hl("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=sl(t,e,n,!1),o=function(t,e,n,i,r){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=po(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return aa(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=nl(s,e,this,r)}catch(t){return}t(this.canvas,{type:to["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=ea(e.CanvasRenderingContext2D.prototype,a,{set(e){aa(this.canvas,n,i,!0)||t(this.canvas,{type:to["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),s=function(t,e,n,i,r){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...al(e.WebGLRenderingContext.prototype,to.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...al(e.WebGL2RenderingContext.prototype,to.WebGL2,t,n,i,e,r)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;o.length>i;i++)e.includes(n=o[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,Zr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function vl(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var pl,ml,gl,yl=class{constructor(t){var e,n,i;Uo(this,"trackedLinkElements",new WeakSet),Uo(this,"pendingDeferredSheets",new Set),Uo(this,"stopped",!1),Uo(this,"changedLinkJobs",new Map),Uo(this,"linksInlinedSinceSnapshot",new WeakSet),Uo(this,"mutationCb",void 0),Uo(this,"adoptedStyleSheetCb",void 0),Uo(this,"maskAllElementAttributes",void 0),Uo(this,"maskAttributeFn",void 0),Uo(this,"blockClass",void 0),Uo(this,"blockSelector",void 0),Uo(this,"styleMirror",new pa),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return la(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:vl({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let o=null,s=null;try{s=t.sheet,s&&(o=rs(s))}catch(t){}var a;if(!o||!s)return Bo(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=o;let u=!1;const c={sheet:s,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let d=!1;return{advance:e=>{if(d)return!0;const i=go(),o=wo();let a=!0;try{if(u)return d=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():Bo(),!0;if(!l.advance(e))return a=!1,!1;d=!0;const i=l.text();if(!t.isConnected)return!0;let o=null;try{o=t.sheet}catch(t){}return o!==s?(Bo(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(Bo(),null===(h=n.onUninlinable)||void 0===h||h.call(n),!0);var h}finally{a&&this.pendingDeferredSheets.delete(c),ko(f=go()-i,null!=(v=o)?v:yo)||(Oo.totalMs+=f,f>Oo.slowestSliceMs&&(Oo.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=Ns(t),i=Ps.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},o=()=>{const e=Ns(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};o()?e():qs(t,e,o,js,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let o=!1;const s=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,vl(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){o=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!s)return;let a=null;const l=()=>{s.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>s.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!s.advance(200)&&(l(),!o||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):Bo(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=Ba(c))};a=Ba(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),zo(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,i={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:L(L({},i),{},{_cssText:us({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=go();try{Fo(()=>{try{const t=e.rules||e.cssRules;t&&Po(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:Ko(t,e.href),index:n}))})})}finally{No(go()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),Fs()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,Fs({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},bl=class{constructor(){Uo(this,"nodeMap",new WeakMap),Uo(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},wl=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var kl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(kl=t.contentWindow)||void 0===kl?void 0:kl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Sl=new os,_l=new Set([Yr.Mutation,Yr.MediaInteraction,Yr.StyleSheetRule,Yr.CanvasMutation,Yr.Font,Yr.Log,Yr.StyleDeclaration,Yr.AdoptedStyleSheet]);function xl(t={}){let e,n=!1,i=!1;const{emit:r,checkoutEveryNms:o,checkoutEveryNth:s,blockClass:a="rr-block",blockSelector:l=null,ignoreClass:u="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,inlineStylesheetBudgetRules:v,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:g,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w=!1,maskAttributeFn:k,hooks:S,packFn:_,sampling:x={},dataURLOptions:C={},canvasResolutionScale:T,canvasMasking:I,mousemoveWait:M,recordDOM:A=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:O=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:D=!1,collectFonts:P=!1,inlineImages:F=!1,plugins:N,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:j=new Set([]),attributeFilter:B,errorHandler:z}=t;xa(z);const H=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},C),U=!E||window.parent===window;let W=!1;if(!U)try{window.parent.document&&(W=!1)}catch(t){W=!0}if(U&&!r)throw new Error("emit function is required");if(!U&&!W)return()=>{};void 0!==M&&void 0===x.mousemove&&(x.mousemove=M),Sl.reset(),Fs();const G=!0===p?{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,hidden:!0}:void 0!==m?m:{password:!0},V=Gs(void 0!==g&&g);let Q;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let Z=0;const J=new Map;let Y,K;const X=t=>{for(const e of N||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!W&&(t=_(t)),t};pl=(t,e)=>{var n;const i=t;if(i.timestamp=na(),!(null===(n=Ia[0])||void 0===n?void 0:n.isFrozen())||i.type===Jr.FullSnapshot||i.type===Jr.IncrementalSnapshot&&_l.has(i.data.source)||Ia.forEach(t=>t.unfreeze()),U)null==r||r(X(i),e);else if(W){const t={type:"rrweb",event:X(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(i.type===Jr.FullSnapshot)Q=i,Z=0;else if(i.type===Jr.IncrementalSnapshot){if(i.data.source===Yr.Mutation&&i.data.isAttachIframe)return;Z++,(s&&Z>=s||o&&i.timestamp-Q.timestamp>o)&&ml(!0)}};const tt=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=Sl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=st.getIframeElementById(t);i&&n.has(i)?st.forgetIframeId(t):(null==Y||Y(t),st.removeIframeById(t))}),null==K||K(),st.cleanupDetachedIframes()}pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Mutation},t)})},et=t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Scroll},t)}),nt=t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.CanvasMutation},t)}),it=new yl({mutationCb:tt,adoptedStyleSheetCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.AdoptedStyleSheet},t)}),maskAllElementAttributes:w,maskAttributeFn:k,blockClass:a,blockSelector:l});let rt=!1;const ot=()=>{if(!rt){rt=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;it.flushChangedLinkInlining(50-n)}finally{rt=!1}}},st=new Ha({mirror:Sl,mutationCb:tt,stylesheetManager:it,recordCrossOriginIframes:E,wrappedEmit:pl});for(const t of N||[])t.getMirror&&t.getMirror({nodeMirror:Sl,crossOriginIframeMirror:st.crossOriginIframeMirror,crossOriginIframeStyleMirror:st.crossOriginIframeStyleMirror});const at=new bl,lt=null==I?void 0:I.configured;gl=new fl({recordCanvas:R,mutationCb:nt,win:window,blockClass:a,blockSelector:l,mirror:Sl,sampling:x.canvas,dataURLOptions:H,resolutionScale:T,canvasMasking:I});const ut=new Ua({mutationCb:tt,scrollCb:et,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:G,dataURLOptions:H,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,sampling:x,slimDOMOptions:V,iframeManager:st,stylesheetManager:it,canvasManager:gl,keepIframeSrcFn:q,processedNodeManager:at,attributeFilter:B},mirror:Sl});ml=(t=!1)=>{if(A){$o(v);try{if(pl({type:Jr.Meta,data:{href:window.location.href,width:oa(),height:ra()}},t),n)return;null==e||e.cancel(),e=void 0,it.reset(),ut.init(),Ia.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new os,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:T,inlineStylesheetBudgetRules:I}=e||{},M=!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,hidden:!0}:!1===d?{password:!0}:d,A=Gs(m);$o(I);try{return Ws(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:M,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:A,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:T})}finally{Lo()}}(document,{mirror:Sl,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:G,inlineStylesheetBudgetRules:v,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,slimDOM:V,dataURLOptions:H,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,onSerialize(t){ha(t,Sl)&&st.addIframe(t),fa(t,Sl)&&it.trackLinkElement(t),va(t)&&ut.addShadowRoot(mo.shadowRoot(t),document)},onIframeLoad(t,e){st.attachIframe(t,e),ut.observeAttachShadow(t)},onIframeListenerRegistered(t,e){st.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){it.attachLinkElement(t,e,n)},keepIframeSrcFn:q})}finally{r=jo()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(pl({type:Jr.FullSnapshot,data:{node:i,initialOffset:ia(window)}},t),n)return;if(Ia.forEach(t=>t.unlock()),gl.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&Js(()=>{s=e.beginDeferredLinkInlining(n,Sl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Js(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,zo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=Ba(d):n())};return r=Ba(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);zo(e),null==s||s.discard(),s=null}return n(),e}}}(r,it,()=>{e===t&&(e=void 0)});e=t}E&&st.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&it.adoptStyleSheets(document.adoptedStyleSheets,Sl.getId(document))}finally{Lo()}}};try{const t=[];t.push(Qs("pagehide",()=>{try{ot()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Qs(e,bo,document));Y=e=>{const n=J.get(e);n&&(n.forEach(e=>{Js(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),J.delete(e))},K=()=>{for(const[t]of J){const e=Sl.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==Y||Y(t)}catch(e){null==Y||Y(t)}else null==Y||Y(t)}};const r=t=>{var e;return Ta(Na)({mutationCb:tt,mousemoveCb:(t,e)=>pl({type:Jr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.MouseInteraction},t)}),scrollCb:et,viewportResizeCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.ViewportResize},t)}),inputCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Input},t)}),mediaInteractionCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.MediaInteraction},t)}),styleSheetRuleCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.StyleSheetRule},t)}),styleDeclarationCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.StyleDeclaration},t)}),canvasMutationCb:nt,fontCb:t=>pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Font},t)}),selectionCb(t){pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.Selection},t)})},customElementCb(t){pl({type:Jr.IncrementalSnapshot,data:L({source:Yr.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:G,inlineStylesheet:f,sampling:x,recordDOM:A,recordCanvas:R,canvasMaskingConfigured:lt,inlineImages:F,userTriggeredOnInput:D,collectFonts:P,doc:t,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w,maskAttributeFn:k,keepIframeSrcFn:q,blockSelector:l,slimDOMOptions:V,dataURLOptions:H,mirror:Sl,iframeManager:st,stylesheetManager:it,shadowDomManager:ut,processedNodeManager:at,canvasManager:gl,ignoreCSSAttributes:j,attributeFilter:B,plugins:(null==N||null===(e=N.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>pl({type:Jr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},S)},o=new WeakMap,s=new WeakMap;st.addLoadListener(e=>{try{const n=e.contentDocument,i=Sl.getId(e);if(!n)return;const a=s.get(e);if(a){s.delete(e),Js(a);const n=t.indexOf(a);-1!==n&&t.splice(n,1)}const l=o.get(n);if(-1!==i&&l){if(l())return;null==Y||Y(i)}const u=r(n);if("function"==typeof u){let r=!1;const a=Qs("rrweb-check-iframe-observers",()=>{r=!0},n);-1!==i&&o.set(n,()=>{r=!1;const t=n.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),n.dispatchEvent(t),r});const l=()=>{o.delete(n),a(),u()};if(t.push(l),-1!==i){let t=J.get(i);t||(t=new Set,J.set(i,t)),t.add(l)}else s.set(e,l)}}catch(t){console.warn(t)}}),st.addPageHideListener(t=>{const e=Sl.getId(t);null==Y||Y(e),Ea(t)});let v=-1;const p=t=>pl({type:Jr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),m=()=>{var t,e,n,i;const r=document,o=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,s=o?Sl.getId(o):-1;s!==v&&(-1!==v&&p({id:v,enter:!1}),v=s,-1!==s&&p({id:s,enter:!0}))},g=()=>{if(n||i)return;if(i=!0,ml(),n)return;const e=r(document);n?"function"==typeof e&&Ys([e]):("function"==typeof e&&t.push(e),t.push(Qs("fullscreenchange",m)),t.push(Qs("webkitfullscreenchange",m)),t.push(Qs("mozfullscreenchange",m)),t.push(Qs("MSFullscreenChange",m)),wl=!0)};return["interactive","complete"].includes(document.readyState)?g():(t.push(Qs("DOMContentLoaded",()=>{pl({type:Jr.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&setTimeout(g,0)})),t.push(Qs("load",()=>{pl({type:Jr.Load,data:{}}),"load"===O&&g()},window))),()=>{n=!0;try{ot()}catch(t){}e=void 0,it.stop(),Ys(t),at.destroy(),st.removeLoadListener(),st.destroy(),J.clear(),ut.reset(),Sl.reset(),wl=!1,Ca()}}catch(t){console.warn(t)}}xl.addCustomEvent=(t,e)=>{if(!wl)throw new Error("please add custom event after start recording");pl({type:Jr.Custom,data:{tag:t,payload:e}})},xl.freezePage=()=>{Ia.forEach(t=>t.freeze())},xl.takeFullSnapshot=t=>{if(!wl)throw new Error("please take full snapshot after start recording");ml(t)},xl.isRecording=()=>wl,xl.mirror=Sl,Date,Date;var Cl=Object.create(null);function Tl(t){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(t)}function Il(t,e,n){return(e=function(t){var e=function(t){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Cl.Node=Object.create(null),Cl.ShadowRoot=Object.create(null),Cl.MutationObserver=Object.create(null),Cl.Element=Object.create(null);var Ml=class{constructor(t){Il(this,"fileName",void 0),Il(this,"functionName",void 0),Il(this,"lineNumber",void 0),Il(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},Al=/(^|@)\S+:\d+/,Rl=/^\s*at .*(\S+:\d+|\(native\))/m,El=/^(eval@)?(\[native code])?$/,Ol={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Rl)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(Rl)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new Ml({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(El)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ml({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new Ml({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new Ml({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new Ml({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(Al)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Ml({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function $l(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ll(t){return Array.isArray(t)}function Dl(t){return"object"==typeof t&&null!==t&&!Ll(t)}function Pl(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Dl(t[i])&&Pl(t[i],e-1))return!0;return!1}function Fl(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Dl(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Dl(o)&&Pl(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ll(i)?$l(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Nl={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 ql(t,e,n){const i=n?Object.assign({},Nl,n):Nl,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?e[r]:r;let s=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Ol.parse(e.error).map(t=>t.toString()),payload:[Fl(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Fl(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Fl("Uncaught (in promise)",i.stringifyOptions),Fl(e.reason,i.stringifyOptions)]),t({level:"error",trace:Ol.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,o){try{if(!(o in r))return()=>{};const u=r[o],c={next:u},d=(r=>(...o)=>{if(r.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=Ol.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>Fl(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Fl("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[o]=d,()=>{if(r[o]===d)return void(r[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var jl=t=>({name:"rrweb/console@1",observer:ql,options:t});const Bl=()=>{},zl=t=>{var e;if(U(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Hl(t,e,n){try{if(!(e in t))return Bl;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return U(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],o=zl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=zl(n)}}}catch(t){return Bl}}function Ul(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const Wl=ce("[Recorder]"),Gl=t=>"navigation"===t.entryType,Vl=t=>"resource"===t.entryType,Ql=()=>{};function Zl(t,e){var n;return Gl(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function Jl(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Zl(t,n)||Vl(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Zl(t,e))}(t):[]}function Yl(t,e){return!!e&&(K(e)||e[t])}function Kl(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Xl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function tu({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Kl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Xl))return!1;if(K(e))return!0;if(H(e))return r(e);const o=e[t];return K(o)?o:r(o)}function eu(t,e,n,i,r){return nu.apply(this,arguments)}function nu(){return nu=A(function*(t,e,n,i,r,o=0){if(o>10)return Wl.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Vl(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),eu(t,e,n,i,r,o+1))}),nu.apply(this,arguments)}function iu({body:t,options:e,url:n}){if(J(t))return null;const{hostname:i,isHostDenied:r}=Ul(n,e);if(r)return i+" is in deny list";if(V(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(X(t))return ye(t);if(W(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const ru=t=>!Z(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ou(t,{entry:e,method:n,status:i,networkRequest:r,isInitial:o,start:s,end:a,url:l,initiatorType:u}){s=e?e.startTime:s,a=e?e.responseEnd:a;const c=Math.floor(Date.now()-t.performance.now()),d=Math.floor(c+(s||0)),h=[L(L({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:l}),{},{startTime:G(s)?void 0:Math.round(s),endTime:G(a)?void 0:Math.round(a),timeOrigin:c,timestamp:d,method:n,initiatorType:u||(e?e.initiatorType:void 0),status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o})];if(ru(e))for(const t of e.serverTiming||[])h.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return h}const su=["video/","audio/"];function au(t){return W(t)&&U(t.getReader)&&U(t.tee)}const lu="[SessionReplay] Timeout while trying to read body",uu="[SessionReplay] Failed to read body";function cu(t){return`${uu}: ${t}`}function du(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function hu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(lu),500);try{t.clone().text().then(t=>e(t),t=>e(cu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(uu)}})}(t);const n=Je(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const o=parseInt(r,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(du(n)):function(t,e){return new Promise(n=>{let i,r=!1;function o(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function s(t){r||(r=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(lu),500);let l;try{l=t.clone()}catch(t){return void s(uu)}const u=l.body;if(!au(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(cu(t)))}catch(t){s(uu)}return}try{i=u.getReader()}catch(t){return void s(uu)}const c=[];let d=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,d)));else{if(i){if(d+i.byteLength>e)return void s(du(e));d+=i.byteLength,c.push(i)}t()}},t=>s(cu(t)))}()})}(t,n)}function fu(t){return vu.apply(this,arguments)}function vu(){return vu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Ul(n,e);return r?Promise.resolve(i+" is in deny list"):hu(t,e)}),vu.apply(this,arguments)}function pu(t){return mu.apply(this,arguments)}function mu(){return mu=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),o=su.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Ul(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Z(i)?hu(t,e):Promise.resolve(i)}),mu.apply(this,arguments)}let gu=null;function yu(t,e,n){if(!("performance"in e))return()=>{};if(gu)return Wl.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ye,n):Ye;let r=!0,o=!1;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let r;try{r=i.maskRequestFn(t)}catch(t){return o||(o=!0,Wl.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!r||(t=>!!t&&sn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(L(L({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:Jl(e,n).flatMap(t=>ou(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Wl.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!H(r))return;const o=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!o.length)return;const s=new i(i=>{t({requests:i.getEntries().filter(t=>Gl(t)||Vl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>ou(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(s,e,i),l=i.recordHeaders||i.recordBody;if(!a&&!l)return r=!1,Ql;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),i&&(l.requestHeaders=h);const v=d.send.bind(d);d.send=t=>(tu({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=iu({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{d.removeEventListener("readystatechange",m),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},m=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),tu({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=iu({body:d.response,options:n,url:a})),eu(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:ou(e,{entry:n,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",m),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){Wl.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),c=!0===i.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Wl.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(s,a))}catch(t){return new Promise((e,n)=>n(t))}}const u={};let c,d;const h=A(function*(){try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(u.requestHeaders=t),!au(null==a?void 0:a.body)&&tu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield fu({r:l,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch request for network capture",t)}})(),f=(v=A(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(u.responseHeaders=e),tu({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield pu({r:t,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch response for network capture",t)}}),function(t){return v.apply(this,arguments)});var v;try{c=e.performance.now()}catch(t){}let p;try{p=Kl(s)?o(l):o(s,a)}catch(t){p=new Promise((e,n)=>n(t))}const m=Promise.resolve(p).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t}));return A(function*(){let n;try{yield h;const t=yield m;if("rejected"===t.status)throw t.error;return n=t.response,yield f(n),n}finally{(i=n,eu(e,"fetch",l.url,c,d).then(n=>{t({requests:ou(e,{entry:n,method:l.method,status:null==i?void 0:i.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Yl("request",n.recordHeaders),r=Yl("response",n.recordHeaders),o=Hl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Wl.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!au(null==a?void 0:a.body)&&tu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield fu({r:l,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Kl(s)?yield o(l):yield o(s,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),tu({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield pu({r:u,options:n,url:s}))}catch(t){Wl.error("Failed to record fetch response for network capture",t)}return u}finally{eu(e,"fetch",l.url,d,h).then(n=>{t({requests:ou(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{o()}}(s,e,i)),gu=()=>{r=!1,null==a||a(),u(),c(),gu=null},gu}const bu=t=>({name:"rrweb/network@1",observer:yu,options:t});var wu,ku,Su,_u,xu,Cu,Tu,Iu,Mu,Au,Ru,Eu,Ou,$u,Lu;o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:jl,getRecordNetworkPlugin:bu},o.__PosthogExtensions__.rrweb={record:xl,version:"v2",wasMaxDepthReached:()=>Us,resetMaxDepthState(){Us=!1,Hs=!1},getLastSnapshotCost:()=>To,getMutationCost:()=>L({},Eo),getObserverInitFailures:()=>Fa.size?Array.from(Fa):void 0,resetSnapshotCostState(){So=0,_o=0,xo=0,yo=0,Co={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Io=null,Mo=[],Ao=0,Ro=0,Eo={slowestBatchMs:0},Oo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},o.rrweb={record:xl,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:jl},o.getRecordNetworkPlugin=bu,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=(t,e)=>new Qr(t,e);var Du={},Pu=[],Fu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nu=Array.isArray;function qu(t,e){for(var n in e)t[n]=e[n];return t}function ju(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Bu(t,e,n){var i,r,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?wu.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return zu(t,s,i,r,null)}function zu(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++Su:r,__i:-1,__u:0};return null==r&&null!=ku.vnode&&ku.vnode(o),o}function Hu(t){return t.children}function Uu(t,e){this.props=t,this.context=e}function Wu(t,e){if(null==e)return t.__?Wu(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Wu(t):null}function Gu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=qu({},e);o.__v=e.__v+1,ku.vnode&&ku.vnode(o),nc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Wu(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,rc(i,o,r),e.__e=e.__=null,o.__e!=n&&Vu(o)}}function Vu(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),Vu(t)}function Qu(t){(!t.__d&&(t.__d=!0)&&_u.push(t)&&!Zu.__r++||xu!=ku.debounceRendering)&&((xu=ku.debounceRendering)||Cu)(Zu)}function Zu(){try{for(var t,e=1;_u.length;)_u.length>e&&_u.sort(Tu),t=_u.shift(),e=_u.length,Gu(t)}finally{_u.length=Zu.__r=0}}function Ju(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Pu,b=e.length;for(l=function(t,e,n,i,r){var o,s,a,l,u,c=n.length,d=c,h=0;for(t.__k=new Array(r),o=0;r>o;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=zu(null,s,null,null,null):Nu(s)?s=t.__k[o]=zu(Hu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=zu(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,l=o+h,s.__=t,s.__b=t.__b+1,a=null,-1!=(u=s.__i=Ku(s,n,l,d))&&(d--,(a=n[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>c?h--:c>r&&h++),"function"!=typeof s.type&&(s.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,s.__u|=4))):t.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Wu(a)),ac(a,a));return i}(n,e,y,l,b),d=0;b>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&y[f.__i]||Du,f.__i=d,m=nc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&sc(h.ref,null,f),c.push(f.ref,f.__c||v,f)),null==p&&null!=v&&(p=v),(g=!!(4&f.__u))||h.__k===f.__k?(l=Yu(f,l,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:v&&(l=v.nextSibling),f.__u&=-7);return n.__e=p,l}function Yu(t,e,n,i){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&r.length>o;o++)r[o]&&(r[o].__=t,e=Yu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Wu(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ku(t,e,n,i){var r,o,s,a=t.key,l=t.type,u=e[n],c=null!=u&&!(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return n;if(i>(c?1:0))for(r=n-1,o=n+1;r>=0||e.length>o;)if(null!=(u=e[s=0>r?o++:r--])&&!(2&u.__u)&&a==u.key&&l==u.type)return s;return-1}function Xu(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Fu.test(e)?n:n+"px"}function tc(t,e,n,i,r){var o,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Xu(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Xu(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Ru,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n[Au]=i[Au]:(n[Au]=Eu,t.addEventListener(e,o?$u:Ou,o)):t.removeEventListener(e,o?$u:Ou,o);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function ec(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[Mu])e[Mu]=Eu++;else if(n[Au]>e[Mu])return;return n(ku.event?ku.event(e):e)}}}function nc(t,e,n,i,r,o,s,a,l,u){var c,d,h,f,v,p,m,g,y,b,$,w,k,S,_,x,C=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(c=ku.__b)&&c(e);t:if("function"==typeof C){d=s.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(c=C.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?g=(h=e.__c=n.__c).__=h.__E:(b?e.__c=h=new C(y,w):(e.__c=h=new Uu(y,w),h.constructor=C,h.render=lc),$&&$.sub(h),h.state||(h.state={}),h.__n=i,f=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=qu({},h.__s)),qu(h.__s,C.getDerivedStateFromProps(y,h.__s))),v=h.props,p=h.state,h.__v=e,f)b&&null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,w),e.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,w)){e.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),Pu.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,w),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,p,m)})}if(h.context=w,h.props=y,h.__P=t,h.__e=!1,k=ku.__r,S=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Pu.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&25>++S);h.state=h.__s,null!=h.getChildContext&&(i=qu(qu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),_=null!=c&&c.type===Hu&&null==c.key?oc(c.props.children):c,a=Ju(t,Nu(_)?_:[_],e,n,i,r,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){if(s.length=d,e.__v=null,l||null!=o)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),e.__e=a}else{if(null!=o)for(x=o.length;x--;)ju(o[x]);ic(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||ic(e);ku.__e(t,e,n)}}else null==o&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=function(t,e,n,i,r,o,s,a,l){var u,c,d,h,f,v,p,m=n.props||Du,g=e.props,y=e.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(u=0;o.length>u;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:3==f.nodeType)){t=f,o[u]=null;break}if(null==t){if(null==y)return document.createTextNode(g);t=document.createElementNS(r,y,g.is&&g),a&&(ku.__m&&ku.__m(e,o),a=!1),o=null}if(null==y)m===g||a&&t.data==g||(t.data=g);else{if(o="textarea"==y&&null!=g.defaultValue?null:o&&wu.call(t.childNodes),!a&&null!=o)for(m={},u=0;t.attributes.length>u;u++)m[(f=t.attributes[u]).name]=f.value;for(u in m)f=m[u],"dangerouslySetInnerHTML"==u?d=f:"children"==u||u in g||"value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g||tc(t,u,null,f,r);for(u in g)f=g[u],"children"==u?h=f:"dangerouslySetInnerHTML"==u?c=f:"value"==u?v=f:"checked"==u?p=f:a&&"function"!=typeof f||m[u]===f||tc(t,u,f,m[u],r);if(c)a||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Ju("template"==e.type?t.content:t,Nu(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Wu(n,0),a,l),null!=o)for(u=o.length;u--;)ju(o[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==v?t.removeAttribute("value"):null!=v&&(v!==t[u]||"progress"==y&&!v||"option"==y&&v!=m[u])&&tc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&tc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=ku.diffed)&&c(e),128&e.__u?void 0:a}function ic(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ic))}function rc(t,e,n){for(var i=0;n.length>i;i++)sc(n[i],n[++i],n[++i]);ku.__c&&ku.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){ku.__e(t,e.__v)}})}function oc(t){return"object"!=typeof t||null==t||t.__b>0?t:Nu(t)?t.map(oc):void 0!==t.constructor?null:qu({},t)}function sc(t,e,n){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ku.__e(t,n)}}function ac(t,e,n){var i,r;if(ku.unmount&&ku.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||sc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ku.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&ac(i[r],e,n||"function"!=typeof t.type);n||ju(t.__e),t.__c=t.__=t.__e=void 0}function lc(t,e,n){return this.constructor(t,n)}function uc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),ku.__&&ku.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],nc(e,t=(!i&&n||e).__k=Bu(Hu,null,[t]),r||Du,Du,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?wu.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),rc(o,t,s),t.props.children=null}wu=Pu.slice,ku={__e(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},Su=0,Uu.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=qu({},this.state);"function"==typeof t&&(t=t(qu({},n),this.props)),t&&qu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Qu(this))},Uu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Qu(this))},Uu.prototype.render=Hu,_u=[],Cu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Tu=function(t,e){return t.__v.__b-e.__v.__b},Zu.__r=0,Iu=Math.random().toString(8),Mu="__d"+Iu,Au="__a"+Iu,Ru=/(PointerCapture)$|Capture$/i,Eu=0,Ou=ec(!1),$u=ec(!0),Lu=0;var cc=0;function dc(t,e,n,i,r,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--cc,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return ku.vnode&&ku.vnode(u),u}const hc="featureFlagsCommon";function fc({client:t,config:e}){var n;if(!t||!e.uiHost)return;const i=null===(n=t.session)||void 0===n?void 0:n.sessionId;return i?`${e.uiHost}/project/${t.projectToken}/replay/${i}`:void 0}var vc,pc,mc,gc,yc=0,bc=[],wc=ku,kc=wc.__b,Sc=wc.__r,_c=wc.diffed,xc=wc.__c,Cc=wc.unmount,Tc=wc.__;function Ic(t,e){wc.__h&&wc.__h(pc,t,yc||e),yc=0;var n=pc.__H||(pc.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Mc(t){return yc=1,function(t,e){var n=Ic(vc++,2);if(n.t=t,!n.__c&&(n.__=[qc(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=pc,!pc.__f)){var i=function(t,e,i){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),r){var a=r.call(this,t,e,i);return o?a||s:a}return!o||s};pc.__f=!0;var r=pc.shouldComponentUpdate,o=pc.componentWillUpdate;pc.componentWillUpdate=function(t,e,n){if(this.__e){var s=r;r=void 0,i(t,e,n),r=s}o&&o.call(this,t,e,n)},pc.shouldComponentUpdate=i}return n.__N||n.__}(qc,t)}function Ac(t,e){var n=Ic(vc++,3);!wc.__s&&Nc(n.__H,e)&&(n.__=t,n.u=e,pc.__H.__h.push(n))}function Rc(t){return yc=5,Ec(function(){return{current:t}},[])}function Ec(t,e){var n=Ic(vc++,7);return Nc(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Oc(t){var e=pc.context[t.__c],n=Ic(vc++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(pc)),e.props.value):t.__}function $c(){for(var t;t=bc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Pc),e.__h.some(Fc),e.__h=[]}catch(n){e.__h=[],wc.__e(n,t.__v)}}}wc.__b=function(t){pc=null,kc&&kc(t)},wc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Tc&&Tc(t,e)},wc.__r=function(t){Sc&&Sc(t),vc=0;var e=(pc=t.__c).__H;e&&(mc===pc?(e.__h=[],pc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&$c(),vc=0)),mc=pc},wc.diffed=function(t){_c&&_c(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==bc.push(e)&&gc===wc.requestAnimationFrame||((gc=wc.requestAnimationFrame)||Dc)($c)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),mc=pc=null},wc.__c=function(t,e){e.some(function(t){try{t.__h.some(Pc),t.__h=t.__h.filter(function(t){return!t.__||Fc(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],wc.__e(n,t.__v)}}),xc&&xc(t,e)},wc.unmount=function(t){Cc&&Cc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{Pc(t)}catch(t){e=t}}),n.__H=void 0,e&&wc.__e(e,n.__v))};var Lc="function"==typeof requestAnimationFrame;function Dc(t){var e,n=function(){clearTimeout(i),Lc&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Lc&&(e=requestAnimationFrame(n))}function Pc(t){var e=pc,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),pc=e}function Fc(t){var e=pc;t.__c=t.__(),pc=e}function Nc(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function qc(t,e){return"function"==typeof e?e(t):e}const jc="tab",Bc="left",zc="center",Hc="right",Uc="next_to_trigger",Wc="popover",Gc="widget",Vc="external_survey",Qc="open",Zc="multiple_choice",Jc="single_choice",Yc="rating",Kc="end",Xc="always",td="survey shown",ed="survey dismissed",nd="survey sent",id="$survey_id",rd="$survey_name",od="$survey_iteration",sd="$survey_iteration_start_date",ad="$survey_language",ld=ce("[Surveys]"),ud=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,cd=t=>ud("seenSurvey_",t),dd=[Wc,Gc,"api"];function hd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);e>n;n++)i[n]=t[n];return i}function fd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return hd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hd(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const vd=Object.entries,pd=Object.setPrototypeOf,md=Object.isFrozen,gd=Object.getPrototypeOf,yd=Object.getOwnPropertyDescriptor;let bd=Object.freeze,wd=Object.seal,kd=Object.create,Sd="undefined"!=typeof Reflect&&Reflect,_d=Sd.apply,xd=Sd.construct;bd||(bd=function(t){return t}),wd||(wd=function(t){return t}),_d||(_d=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return t.apply(e,i)}),xd||(xd=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return new t(...n)});const Cd=Gd([].forEach),Td=Gd([].lastIndexOf),Id=Gd([].pop),Md=Gd([].push),Ad=Gd([].splice),Rd=Array.isArray,Ed=Gd("".toLowerCase),Od=Gd("".toString),$d=Gd("".match),Ld=Gd("".replace),Dd=Gd("".indexOf),Pd=Gd("".trim),Fd=Gd((0).toString),Nd=Gd(Boolean.prototype.toString),qd="undefined"==typeof BigInt?null:Gd(BigInt.prototype.toString),jd="undefined"==typeof Symbol?null:Gd(Symbol.prototype.toString),Bd=Gd({}.hasOwnProperty),zd=Gd({}.toString),Hd=Gd(/t/.test),Ud=(Wd=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return xd(Wd,e)});var Wd;function Gd(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];return _d(t,e,i)}}function Vd(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ed;if(pd&&pd(t,null),!Rd(e))return t;let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(md(e)||(e[i]=t),r=t)}t[r]=!0}return t}function Qd(t){for(let e=0;t.length>e;e++)Bd(t,e)||(t[e]=null);return t}function Zd(t){const e=kd(null);for(const i of vd(t)){var n=fd(i,2);const r=n[0],o=n[1];Bd(t,r)&&(e[r]=Rd(o)?Qd(o):o&&"object"==typeof o&&o.constructor===Object?Zd(o):o)}return e}function Jd(t,e){for(;null!==t;){const n=yd(t,e);if(n){if(n.get)return Gd(n.get);if("function"==typeof n.value)return Gd(n.value)}t=gd(t)}return function(){return null}}const Yd=bd(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Kd=bd(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xd=bd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),th=bd(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eh=bd(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nh=bd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ih=bd(["#text"]),rh=bd(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),oh=bd(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sh=bd(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ah=bd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lh=wd(/{{[\w\W]*|^[\w\W]*}}/g),uh=wd(/<%[\w\W]*|^[\w\W]*%>/g),ch=wd(/\${[\w\W]*/g),dh=wd(/^data-[\-\w.\u00B7-\uFFFF]+$/),hh=wd(/^aria-[\-\w]+$/),fh=wd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vh=wd(/^(?:\w+script|data):/i),ph=wd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mh=wd(/^html$/i),gh=wd(/^[a-z][.\w]*(-[.\w]+)+$/i),yh=wd(/<[/\w!]/g),bh=wd(/<[/\w]/g),wh=wd(/<\/no(script|embed|frames)/i),kh=wd(/\/>/i),Sh=function(){return"undefined"==typeof window?null:window},_h=function(t,e,n,i){return Bd(t,e)&&Rd(t[e])?Vd(i.base?Zd(i.base):{},t[e],i.transform):n};var xh=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sh();const n=e=>t(e);if(n.version="3.4.13",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let i=e.document;const r=i,o=r.currentScript,s=e.HTMLTemplateElement,a=e.Node,l=e.NodeFilter,u=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=Jd(d,"cloneNode"),f=Jd(d,"remove"),v=Jd(d,"nextSibling"),p=Jd(d,"childNodes"),m=Jd(d,"parentNode"),g=Jd(d,"shadowRoot"),y=Jd(d,"attributes"),b=a&&a.prototype?Jd(a.prototype,"nodeType"):null,w=a&&a.prototype?Jd(a.prototype,"nodeName"):null,k=a&&a.prototype?Jd(a.prototype,"ownerDocument"):null;if("function"==typeof s){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let S,_,x="",C=!1,T=0;const I=function(){if(T>0)throw Ud('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(t){I(),T++;try{return S.createHTML(t)}finally{T--}},A=i.implementation,R=i.createNodeIterator,E=i.createDocumentFragment,O=i.getElementsByTagName,L=r.importNode;let D={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof vd&&"function"==typeof m&&A&&void 0!==A.createHTMLDocument;const P=lh,F=uh,N=ch,q=dh,j=hh,B=vh,z=ph,H=gh;let U=fh,W=null;const G=Vd({},[...Yd,...Kd,...Xd,...eh,...ih]);let V=null;const Q=Vd({},[...rh,...oh,...sh,...ah]);let Z=Object.seal(kd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,Y=null;const K=Object.seal(kd(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,tt=!0,et=!1,nt=!0,it=!1,rt=!0,ot=!1,st=!1,at=null,lt=null,ut=!1,ct=!1,dt=!1,ht=!1,ft=!0,vt=!1;const pt="user-content-";let mt=!0,gt=!1,yt={},bt=null;const wt=Vd({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let kt=null;const St=Vd({},["audio","video","img","source","image","track"]);let _t=null;const xt=Vd({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let Mt=It,At=!1,Rt=null;const Et=Vd({},[Ct,Tt,It],Od),Ot=bd(["mi","mo","mn","ms","mtext"]);let $t=Vd({},Ot);const Lt=bd(["annotation-xml"]);let Dt=Vd({},Lt);const Pt=Vd({},["title","style","font","a","script"]);let Ft=null;const Nt=["application/xhtml+xml","text/html"];let qt=null,jt=null;const Bt=i.createElement("form"),zt=function(t){return t instanceof RegExp||t instanceof Function},Ht=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(jt&&jt===t)return;t&&"object"==typeof t||(t={}),t=Zd(t),Ft=-1===Nt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,qt="application/xhtml+xml"===Ft?Od:Ed,W=_h(t,"ALLOWED_TAGS",G,{transform:qt}),V=_h(t,"ALLOWED_ATTR",Q,{transform:qt}),Rt=_h(t,"ALLOWED_NAMESPACES",Et,{transform:Od}),_t=_h(t,"ADD_URI_SAFE_ATTR",xt,{transform:qt,base:xt}),kt=_h(t,"ADD_DATA_URI_TAGS",St,{transform:qt,base:St}),bt=_h(t,"FORBID_CONTENTS",wt,{transform:qt}),J=_h(t,"FORBID_TAGS",Zd({}),{transform:qt}),Y=_h(t,"FORBID_ATTR",Zd({}),{transform:qt}),yt=!!Bd(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?Zd(t.USE_PROFILES):t.USE_PROFILES),X=!1!==t.ALLOW_ARIA_ATTR,tt=!1!==t.ALLOW_DATA_ATTR,et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,it=t.SAFE_FOR_TEMPLATES||!1,rt=!1!==t.SAFE_FOR_XML,ot=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,dt=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,ut=t.FORCE_BODY||!1,ft=!1!==t.SANITIZE_DOM,vt=t.SANITIZE_NAMED_PROPS||!1,mt=!1!==t.KEEP_CONTENT,gt=t.IN_PLACE||!1,U=function(t){try{return Hd(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:fh,Mt="string"==typeof t.NAMESPACE?t.NAMESPACE:It,$t=Bd(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?Zd(t.MATHML_TEXT_INTEGRATION_POINTS):Vd({},Ot),Dt=Bd(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?Zd(t.HTML_INTEGRATION_POINTS):Vd({},Lt);const e=Bd(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?Zd(t.CUSTOM_ELEMENT_HANDLING):kd(null);if(Z=kd(null),Bd(e,"tagNameCheck")&&zt(e.tagNameCheck)&&(Z.tagNameCheck=e.tagNameCheck),Bd(e,"attributeNameCheck")&&zt(e.attributeNameCheck)&&(Z.attributeNameCheck=e.attributeNameCheck),Bd(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),wd(Z),it&&(tt=!1),dt&&(ct=!0),yt&&(W=Vd({},ih),V=kd(null),!0===yt.html&&(Vd(W,Yd),Vd(V,rh)),!0===yt.svg&&(Vd(W,Kd),Vd(V,oh),Vd(V,ah)),!0===yt.svgFilters&&(Vd(W,Xd),Vd(V,oh),Vd(V,ah)),!0===yt.mathMl&&(Vd(W,eh),Vd(V,sh),Vd(V,ah))),K.tagCheck=null,K.attributeCheck=null,Bd(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?K.tagCheck=t.ADD_TAGS:Rd(t.ADD_TAGS)&&(W===G&&(W=Zd(W)),Vd(W,t.ADD_TAGS,qt))),Bd(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?K.attributeCheck=t.ADD_ATTR:Rd(t.ADD_ATTR)&&(V===Q&&(V=Zd(V)),Vd(V,t.ADD_ATTR,qt))),Bd(t,"ADD_URI_SAFE_ATTR")&&Rd(t.ADD_URI_SAFE_ATTR)&&Vd(_t,t.ADD_URI_SAFE_ATTR,qt),Bd(t,"FORBID_CONTENTS")&&Rd(t.FORBID_CONTENTS)&&(bt===wt&&(bt=Zd(bt)),Vd(bt,t.FORBID_CONTENTS,qt)),Bd(t,"ADD_FORBID_CONTENTS")&&Rd(t.ADD_FORBID_CONTENTS)&&(bt===wt&&(bt=Zd(bt)),Vd(bt,t.ADD_FORBID_CONTENTS,qt)),mt&&(W["#text"]=!0),ot&&Vd(W,["html","head","body"]),W.table&&(Vd(W,["tbody"]),delete J.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Ud('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=S;S=t.TRUSTED_TYPES_POLICY;try{x=M("")}catch(t){throw S=e,t}}else null===t.TRUSTED_TYPES_POLICY?(S=void 0,x=""):(void 0===S&&(C||(_=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,o),C=!0),S=_),S&&"string"==typeof x&&(x=M("")));bd&&bd(t),jt=t},Ut=Vd({},[...Kd,...Xd,...th]),Wt=Vd({},[...eh,...nh]),Gt=function(t){Md(n.removed,{element:t});try{m(t).removeChild(t)}catch(e){if(f(t),!m(t))throw Ud("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vt=function(t){Jt(t);const e=p(t);if(e){const t=[];Cd(e,e=>{Md(t,e)}),Cd(t,t=>{try{f(t)}catch(t){}})}const n=y(t);if(n)for(let e=n.length-1;e>=0;--e){const i=n[e],r=i&&i.name;if("string"==typeof r)try{t.removeAttribute(r)}catch(t){}}},Qt=function(t,e){try{Md(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){Md(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ct||dt)try{Gt(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Zt=function(t){const e=y(t);if(e)for(let n=e.length-1;n>=0;--n){const i=e[n],r=i&&i.name;if("string"==typeof r&&!V[qt(r)])try{t.removeAttribute(r)}catch(t){}}},Jt=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(b?b(t):t.nodeType)&&Zt(t);const n=p(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Yt=function(t){let e=null,n=null;if(ut)t="<remove></remove>"+t;else{const e=$d(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Ft&&Mt===It&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=S?M(t):t;if(Mt===It)try{e=(new u).parseFromString(r,Ft)}catch(t){}if(!e||!e.documentElement){e=A.createDocument(Mt,"template",null);try{e.documentElement.innerHTML=At?x:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Mt===It?O.call(e,ot?"html":"body")[0]:ot?e.documentElement:o},Kt=function(t){const e=k?k(t):t.ownerDocument;return R.call(e||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Xt=function(t){return t=Ld(t,P," "),t=Ld(t,F," "),Ld(t,N," ")},te=function(t){var e;t.normalize();const n=k?k(t):t.ownerDocument,i=R.call(n||t,t,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let r=i.nextNode();for(;r;)r.data=Xt(r.data),r=i.nextNode();const o=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");o&&Cd(o,t=>{ne(t.content)&&te(t.content)})},ee=function(t){const e=w?w(t):null;return"string"==typeof e&&"form"===qt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==y(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==b(t)||t.childNodes!==p(t))},ne=function(t){if(!b||"object"!=typeof t||null===t)return!1;try{return 11===b(t)}catch(t){return!1}},ie=function(t){if(!b||"object"!=typeof t||null===t)return!1;try{return"number"==typeof b(t)}catch(t){return!1}};function re(t,e,i){0!==t.length&&Cd(t,t=>{t.call(n,e,i,jt)})}const oe=function(t,e,n,i){return 0===t.length?e:e===n||e===i?Zd(e):e},se=function(t,e){if(re(D.beforeSanitizeElements,t,null),t!==e&&null===m(t))return gt&&Jt(t),!0;if(ee(t))return Gt(t),!0;const i=qt(w?w(t):t.nodeName);if(W=oe(D.uponSanitizeElement,W,G,at),re(D.uponSanitizeElement,t,{tagName:i,allowedTags:W}),t!==e&&null===m(t))return gt&&Jt(t),!0;if(function(t,e){return!!(rt&&t.hasChildNodes()&&!ie(t.firstElementChild)&&Hd(yh,t.textContent)&&Hd(yh,t.innerHTML))||!(!rt||t.namespaceURI!==It||"style"!==e||!ie(t.firstElementChild))||7===t.nodeType||!(!rt||8!==t.nodeType||!Hd(bh,t.data))}(t,i))return Gt(t),!0;if(J[i]||!(K.tagCheck instanceof Function&&K.tagCheck(i))&&!W[i]){const n=function(t,e,n){if(!J[e]&&ue(e)){if(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,e))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))return!1}if(mt&&!bt[e]){const e=m(t),i=p(t);if(i&&e)for(let r=i.length-1;r>=0;--r){const o=t===n?h(i[r],!0):i[r];e.insertBefore(o,v(t))}}return Gt(t),!0}(t,i,e);return!1===n&&re(D.afterSanitizeElements,t,null),n}if(1===(b?b(t):t.nodeType)&&!function(t){let e=m(t);e&&e.tagName||(e={namespaceURI:Mt,tagName:"template"});const n=Ed(t.tagName),i=Ed(e.tagName);return!!Rt[t.namespaceURI]&&(t.namespaceURI===Tt?function(t,e,n){return e.namespaceURI===It?"svg"===t:e.namespaceURI===Ct?"svg"===t&&("annotation-xml"===n||$t[n]):Boolean(Ut[t])}(n,e,i):t.namespaceURI===Ct?function(t,e,n){return e.namespaceURI===It?"math"===t:e.namespaceURI===Tt?"math"===t&&Dt[n]:Boolean(Wt[t])}(n,e,i):t.namespaceURI===It?function(t,e,n){return!(e.namespaceURI===Tt&&!Dt[n])&&!(e.namespaceURI===Ct&&!$t[n])&&!Wt[t]&&(Pt[t]||!Ut[t])}(n,e,i):!("application/xhtml+xml"!==Ft||!Rt[t.namespaceURI]))}(t))return Gt(t),!0;if(("noscript"===i||"noembed"===i||"noframes"===i)&&Hd(wh,t.innerHTML))return Gt(t),!0;if(it&&3===t.nodeType){const e=Xt(t.textContent);t.textContent!==e&&(Md(n.removed,{element:t.cloneNode()}),t.textContent=e)}return re(D.afterSanitizeElements,t,null),!1},ae=function(t,e,n){if(Y[e])return!1;if(rt&&"patchsrc"===e)return!1;if(rt&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(ft&&("id"===e||"name"===e)&&(n in i||n in Bt))return!1;const r=V[e]||K.attributeCheck instanceof Function&&K.attributeCheck(e,t);if(tt&&Hd(q,e));else if(X&&Hd(j,e));else if(r){if(_t[e]);else if(Hd(U,Ld(n,z,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Dd(n,"data:")||!kt[t])if(et&&!Hd(B,Ld(n,z,"")));else if(n)return!1}else if(!(ue(t)&&(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,t)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(t))&&(Z.attributeNameCheck instanceof RegExp&&Hd(Z.attributeNameCheck,e)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(e,t))||"is"===e&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Hd(Z.tagNameCheck,n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(n))))return!1;return!0},le=Vd({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ue=function(t){return!le[Ed(t)]&&Hd(H,t)},ce=function(t,e,n,i){if(S&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return M(i);case"TrustedScriptURL":return function(t){I(),T++;try{return S.createScriptURL(t)}finally{T--}}(i)}return i},de=function(t,e,i,r){try{i?t.setAttributeNS(i,e,r):t.setAttribute(e,r),ee(t)?Gt(t):Id(n.removed)}catch(n){Qt(e,t)}},he=function(t){re(D.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||ee(t))return;V=oe(D.uponSanitizeAttribute,V,Q,lt);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let i=e.length;const r=qt(t.nodeName);for(;i--;){const o=e[i],s=o.name,a=o.namespaceURI,l=o.value,u=qt(s),c=l;let d="value"===s?c:Pd(c);n.attrName=u,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,re(D.uponSanitizeAttribute,t,n),d=n.attrValue,!vt||"id"!==u&&"name"!==u||0===Dd(d,pt)||(Qt(s,t),d=pt+d),rt&&Hd(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||"attributename"===u&&$d(d,"href")?Qt(s,t):n.forceKeepAttr||(!n.keepAttr||!nt&&Hd(kh,d)?Qt(s,t):(it&&(d=Xt(d)),ae(r,u,d)?(d=ce(r,u,a,d),d!==c&&de(t,s,a,d)):Qt(s,t)))}re(D.afterSanitizeAttributes,t,null)},fe=function(t){let e=null;const n=Kt(t);for(re(D.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(re(D.uponSanitizeShadowNode,e,null),se(e,t),he(e),ne(e.content)&&fe(e.content),1===(b?b(e):e.nodeType)){const t=g(e);ne(t)&&(ve(t),fe(t))}re(D.afterSanitizeShadowDOM,t,null)},ve=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){fe(t.shadow);continue}const n=t.node,i=1===(b?b(n):n.nodeType),r=p(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(i){const t=w?w(n):null;if("string"==typeof t&&"template"===qt(t)){const t=n.content;ne(t)&&e.push({node:t,shadow:null})}}if(i){const t=g(n);ne(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,a=null;if(At=!t,At&&(t="\x3c!--\x3e"),"string"!=typeof t&&!ie(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return Fd(t);case"boolean":return Nd(t);case"bigint":return qd?qd(t):"0";case"symbol":return jd?jd(t):"Symbol()";case"undefined":default:return zd(t);case"function":case"object":{if(null===t)return zd(t);const e=t,n=Jd(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:zd(t)}return zd(t)}}}(t)))throw Ud("dirty is not a string, aborting");if(!n.isSupported)return t;st?(W=at,V=lt):Ht(e),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(W=Zd(W)),D.uponSanitizeAttribute.length>0&&(V=Zd(V)),n.removed=[];const l=gt&&"string"!=typeof t&&ie(t);if(l){!function(t){if(!rt)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=b?b(t):t.nodeType;if(7===n||8===n&&Hd(bh,t.data)){try{f(t)}catch(t){}continue}if(1===n){const e=t,n=qt(w?w(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const i=p(t);if(i)for(let t=i.length-1;t>=0;--t)e.push(i[t])}}(t);const e=w?w(t):t.nodeName;if("string"==typeof e){const n=qt(e);if(!W[n]||J[n])throw Vt(t),Ud("root node is forbidden and cannot be sanitized in-place")}if(ee(t))throw Vt(t),Ud("root node is clobbered and cannot be sanitized in-place");try{ve(t)}catch(e){throw Vt(t),e}}else if(ie(t))i=Yt("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o),ve(o);else{if(!ct&&!it&&!ot&&-1===t.indexOf("<"))return S&&ht?M(t):t;if(i=Yt(t),!i)return ct?null:ht?x:""}i&&ut&&Gt(i.firstChild);const u=l?t:i;try{const t=Kt(u);for(;s=t.nextNode();)se(s,u),he(s),ne(s.content)&&fe(s.content)}catch(e){throw l&&(Vt(t),Cd(n.removed,t=>{t.element&&Jt(t.element)})),e}if(l)return Cd(n.removed,t=>{t.element&&Jt(t.element)}),it&&te(t),t;if(ct){if(it&&te(i),dt)for(a=E.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return(V.shadowroot||V.shadowrootmode)&&(a=L.call(r,a,!0)),a}let c=ot?i.outerHTML:i.innerHTML;return ot&&W["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Hd(mh,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),it&&(c=Xt(c)),S&&ht?M(c):c},n.setConfig=function(){Ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),st=!0,at=W,lt=V},n.clearConfig=function(){jt=null,st=!1,at=null,lt=null,S=_,x=""},n.isValidAttribute=function(t,e,n){jt||Ht({});const i=qt(t),r=qt(e);return ae(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Bd(D,t)&&Md(D[t],e)},n.removeHook=function(t,e){if(Bd(D,t)){if(void 0!==e){const n=Td(D[t],e);return-1===n?void 0:Ad(D[t],n,1)[0]}return Id(D[t])}},n.removeHooks=function(t){Bd(D,t)&&(D[t]=[])},n.removeAllHooks=function(){D={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Ch=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],Th=["style","lang","title","width","height"],Ih=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],Mh={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:Ih,tfoot:["align","char","charoff","valign"],th:Ih,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};let Ah;function Rh(t){var e;const n=(null!==(e=Ah)&&void 0!==e?e:Ah=xh()).sanitize(t,{ALLOWED_TAGS:Ch,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:(t,e)=>-1!==Th.indexOf(t)||{}.hasOwnProperty.call(Mh,e)&&-1!==(Mh[e]||[]).indexOf(t),RETURN_DOM_FRAGMENT:!0}),i=n.querySelectorAll("a");for(let t=0;i.length>t;t++)i.item(t).relList.add("noopener");const r=document.createElement("div");return r.appendChild(n),r.innerHTML}const Eh=ce("[Stylesheet Loader]"),Oh="#020617",$h={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Hc,widgetType:jc,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Oh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Lh=[zc,Bc,Hc];function Dh(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Ph(t=$h.backgroundColor){let e;"#"===t[0]&&(e=Dh(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=Dh(n)),!e)return Oh;const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?Oh:"white"}return Oh}const Fh=(t,e,n)=>{const i=rf(t),r=document.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=document.createElement("div");((t,e,n)=>{const i=L(L({},$h),n),r=t.style,o=!Lh.includes(i.position)||e===Gc&&(null==n?void 0:n.widgetType)===jc;r.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),o?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",`${i.borderRadius} ${i.borderRadius} 0 0`)),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Ph(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Ph(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Ph(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Ph(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let a=s||i.inputBackground;s||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);const l=(null==n?void 0:n.inputTextColor)||Ph(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,t.type,t.appearance),o.className=i;const s=o.attachShadow({mode:"open"}),a=function(t){const e=((t,e,n)=>{let i=t.createElement("style");i.innerText=e;const r=(t=>{var e;return U(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(i=r(i)),i||(Eh.error("prepare_external_dependency_stylesheet returned null"),null)})(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==t?void 0:t.config.prepareStylesheet);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){const t=s.querySelector("style");t&&s.removeChild(t),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Nh=t=>{try{const e=cd(t);localStorage.getItem(e)||localStorage.setItem(e,"true")}catch(t){ld.error("Failed to persist survey seen state",t)}},qh=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l,u,c;i?(null===(l=i.client)||void 0===l?void 0:l.canCapture)&&(Nh(e),r&&nf(e),null===(u=i.client)||void 0===u||u.capture(nd,L(L(L({[rd]:e.name,[id]:e.id,[od]:e.current_iteration,[sd]:e.current_iteration_start_date,sessionRecordingUrl:fc(i)},Ri(L(L({event:"sent",survey:e,responses:t,submissionId:n,completed:r},!G(s)&&{surveyLanguage:s}),!G(a)&&{questionSnapshots:a}))),o),{},{$set:{[Oi(e,"responded")]:!0}})),r&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),null===(c=i.client)||void 0===c||null===(c=c.getExtension("featureFlagsCommon"))||void 0===c||c.reloadFeatureFlags())):ld.error("[survey sent] event not captured, PostHog instance not found.")},jh=(t,e,n,i)=>L({[rd]:e.name,[id]:e.id,[od]:e.current_iteration,[sd]:e.current_iteration_start_date,sessionRecordingUrl:fc(i)},Ri(L(L(L(L({event:t,survey:e},!G(null==n?void 0:n.responses)&&{responses:n.responses}),!G(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId}),!G(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage}),!G(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots}))),Bh=(t,e,n,i)=>{var r;if(!e)return void ld.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const o=tf(t),s=o?o.surveyLanguage:i,a=L(L(L({},jh("dismissed",t,o,e)),s&&{[ad]:s}),{},{$set:{[Oi(t,"dismissed")]:!0}});nf(t),Nh(t),null===(r=e.client)||void 0===r||r.capture(ed,a),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},zh=(t,e)=>{var n,i;if(!e)return void ld.error("[survey abandoned] event not captured, PostHog instance not found.");if(!(null===(n=e.client)||void 0===n?void 0:n.canCapture))return;const r=(t=>ud("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}const o=tf(t);if(o){try{localStorage.setItem(r,"true")}catch(t){}null===(i=e.client)||void 0===i||i.capture("survey abandoned",jh("abandoned",t,o,e),{delivery:"unload"})}},Hh=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Uh=(t,e)=>{var n,i,r;return(t=>t.questions.some(t=>{var e;return!!(null===(e=t.branching)||void 0===e?void 0:e.type)}))(t)?t.questions:e?null!==(n=((t,e)=>{if(!e||e.length!==t.questions.length)return null;const n=new Map(t.questions.map(t=>[t.id,t])),i=[];for(const t of e){const e=n.get(t);if(!e)return null;i.push(e)}return i})(t,e.questionOrder))&&void 0!==n?n:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?(i=t.questions,r=zi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions},Wh=t=>function(t){var e;return Ni(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||ef(t),Gh=function(t){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,Qu(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Lu++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Vh=()=>Oc(Gh),Qh=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=qu({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?wu.call(arguments,2):n),zu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:Rh(e)},style:i}:{children:e,style:i});function Zh(t,e){var n,i,r;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const o=null!==(i=be(e))&&void 0!==i?i:"u">typeof window?window.location.href:void 0;if(!o)return!1;const s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null===(r=t.conditions)||void 0===r?void 0:r.urlMatchType);return Bi[a](s,[o])}function Jh(t){var e,n;return function(t,e){var n,i,r;if(!t||0===t.length)return!0;const o="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:o,a=null==s?void 0:s.navigator,l=null==a?void 0:a.userAgent;if(!l)return!1;const u=function(t,e){var n;const i=function(t){return wt.test(t)?ht:bt.test(t)?ft:yt.test(t)?vt:new RegExp(mt,"i").test(t)?mt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?ct:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dt:kt.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(pt,"i").test(t)?pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(at).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":ut:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(lt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?gt:""}(t);return i===ct||i===ut||"Kobo"===i||"Kindle Fire"===i||i===gt?lt:i===ht||i===vt||i===ft||i===mt?"Console":i===dt?"Wearable":i?at:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(o=null==e?void 0:e.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?at:lt:"Desktop";var r,o,s}(l,{userAgentDataPlatform:null==a||null===(n=a.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==o||null===(i=o.screen)||void 0===i?void 0:i.width,screenHeight:null==o||null===(r=o.screen)||void 0===r?void 0:r.height,devicePixelRatio:null==o?void 0:o.devicePixelRatio});return Bi[null!=e?e:"icontains"](t,[u])}(null===(e=t.conditions)||void 0===e?void 0:e.deviceTypes,null===(n=t.conditions)||void 0===n?void 0:n.deviceTypesMatchType)}const Yh=t=>ud("inProgressSurvey_",t),Kh={},Xh=(t,e)=>{const n=Yh(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Kh[n]}catch(t){ld.error("Error setting in-progress survey state in localStorage",t),Kh[n]=e}},tf=t=>{const e=Yh(t),n=Kh[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){ld.error("Error getting in-progress survey state from localStorage",t)}return null},ef=t=>{const e=tf(t);return!J(null==e?void 0:e.surveySubmissionId)},nf=t=>{const e=Yh(t);delete Kh[e];try{localStorage.removeItem(e)}catch(t){ld.error("Error clearing in-progress survey state from localStorage",t)}};function rf(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function of(t,e=Hc,n){if(t===Vc)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Bc:return{left:"30px"};case zc:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Gc&&n===jc?"60px":"30px"}}}const sf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),af=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),lf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),uf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),cf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:dc("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"})}),df=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:dc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),hf=dc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:dc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),ff=({fill:t="currentColor"}={})=>dc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[dc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),dc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),vf=dc("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[dc("g",{"clip-path":"url(#ph-survey-logo-clip)",children:[dc("path",{fill:"currentColor",d:"m50 23.34-.35-.05A4.5 4.5 0 0 1 47 21.97L35.56 10.1c-.3-.33-.86-.1-.86.35V27.5c0 .27.22.5.5.5h13.78c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.67-1.89zm-10.81.2a1.8 1.8 0 1 1 0-3.58 1.8 1.8 0 0 1 0 3.58"}),dc("path",{fill:"#0054ff",d:"M.87 19.13a.5.5 0 0 0-.87.34v5.94a2.6 2.6 0 0 0 2.59 2.58H7.8a.5.5 0 0 0 .37-.84zM.86 8.4c-.3-.32-.86-.1-.86.36v6.73q0 .2.13.34l8.81 9.68 1.8 2.06v-8.82zM4.59.82A2.67 2.67 0 0 0 0 2.68v1.93q0 .4.27.69l10.47 10.95v-9.1z"}),dc("path",{fill:"#ff5506",d:"M11.36 28h7.08a.5.5 0 0 0 .36-.85l-8.05-8.4v8.8l.23.28q.16.17.38.17m-.61-11.76 8.84 9.25 2.1 2.33q.1.11.27.14V18.7L10.75 7.15zm0-13.7v1.41a2 2 0 0 0 .55 1.28L21.96 16.2V7.65L15.32.8a2.67 2.67 0 0 0-4.57 1.71z"}),dc("path",{fill:"#ffb70f",d:"M22.06 28h7.76a.5.5 0 0 0 .36-.86l-8.22-8.45v9.27l.09.02zM31 25.49l1.13 1.14c.32.31.85.09.85-.35v-7.3l-.49-.51L21.96 7.64v8.55zM22.52 5.73l9.62 9.89c.3.32.86.1.86-.35V7.46L26.56.82a2.67 2.67 0 0 0-4.59 1.84v1.7c0 .51.2 1 .57 1.37z"})]}),dc("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),dc("defs",{children:dc("clipPath",{id:"ph-survey-logo-clip",children:dc("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})})]});function pf({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return dc("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",vf]})}function mf({text:t,submitDisabled:e,appearance:n,onSubmit:i,link:r,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Oc(Gh),c=!!a&&!!l,d=!s&&dc("button",{className:"form-submit",disabled:e,"aria-label":"Submit survey",type:"button",onClick(){var t;r&&(null===(t=window)||void 0===t||t.open(r)),u?null==o||o():i()},children:t});return dc("div",{className:"bottom-section",children:[c?dc("div",{className:"form-buttons form-buttons-with-back",children:[dc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),d]}):d,!n.whiteLabel&&dc(pf,{urlParams:{utm_source:"survey-footer"}})]})}function gf({question:t,forceDisableHtml:e,htmlFor:n}){return dc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[dc(t.type===Qc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Qh({component:Bu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function yf({onClick:t}){const{isPreviewMode:e}=Oc(Gh);return dc("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:ff({fill:"black"})})}function bf({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=Oc(Gh);return Ac(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return ve(window,"keydown",t),()=>{window.removeEventListener("keydown",t)}},[o]),dc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&dc(yf,{onClick:()=>o()}),dc("h3",{className:"thank-you-message-header",children:t}),e&&Qh({component:Bu("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&dc(mf,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function wf({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=Oc(Gh);return dc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&dc(yf,{onClick:()=>l()}),t&&dc("h3",{className:"intro-screen-header",children:t}),e&&Qh({component:Bu("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),dc(mf,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const kf=t=>H(t)&&t.every(t=>V(t));function Sf({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Vh(),c=Rc(null),[d,h]=Mc(()=>V(s)?s:""),f=null==n?void 0:n.disableAutofocus;Ac(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=Ec(()=>function(t,e,n){const i=t.trim();if(!n&&""===i)return"This field is required";if(""===i)return!1;if(e&&e.length>0)for(const t of e)switch(t.type){case P:var r;if(void 0!==t.value&&t.value>i.length)return null!==(r=t.errorMessage)&&void 0!==r?r:`Please enter at least ${t.value} characters`;break;case F:var o;if(void 0!==t.value&&i.length>t.value)return null!==(o=t.errorMessage)&&void 0!==o?o:`Please enter no more than ${t.value} characters`}return!1}(d,t.validation,t.optional),[d,t.validation,t.optional]),m=oe(t.validation,P),g=oe(t.validation,F),y=Ec(()=>function(t,e){const n=1===t?void 0:t;return n&&e?`Enter ${n}-${e} characters`:n?`Enter at least ${n} ${1===n?"character":"characters"}`:e?`Maximum ${e} ${1===e?"character":"characters"}`:void 0}(m,g),[m,g]),b=()=>{p||i(d.trim())},w=()=>{p||r(d.trim())};return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e,htmlFor:v}),dc("textarea",{ref:c,id:v,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:g,onInput(t){h(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||p||(t.preventDefault(),u?w():b())},value:d}),y&&dc("div",{className:"validation-hint",children:y})]}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function _f({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return dc(Hu,{children:[dc("div",{className:"question-container",children:dc(gf,{question:t,forceDisableHtml:e})}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function xf({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){var u;const c=t.scale,d=10===t.scale?0:1,[h,f]=Mc(()=>Y(s)?s:H(s)&&s.length>0&&Y(parseInt(s[0]))?parseInt(s[0]):V(s)&&Y(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=Vh(),m=t=>p?o(t):r(t);return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e}),dc("div",{className:"rating-section",children:[dc("div",{className:"rating-options",children:["emoji"===t.display&&dc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=Rf[t.scale])||void 0===u?void 0:u.map((e,i)=>dc("button",{"aria-label":`Rate ${i+1}`,className:`ratings-emoji question-${n}-rating-${i} ${i+1===h?"rating-active":""}`,value:i+1,type:"button",onClick(){const e=i+1;f(e),t.skipSubmitButton&&m(e)},children:e},i))}),"number"===t.display&&dc("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:Ef(t.scale).map((e,r)=>dc(Cf,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&dc("div",{className:"rating-text",children:[dc("div",{children:t.lowerBoundLabel}),dc("div",{children:t.upperBoundLabel})]})]})]}),dc(mf,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Z(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Cf({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return dc("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function Tf({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=Rc(null),c=Ec(()=>(t=>{var e;if(!t.shuffleOptions)return t.choices;const n=[...t.choices],i=t.hasOpenChoice&&null!==(e=n.pop())&&void 0!==e?e:null,r=(o=n,(s=zi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return Z(i)||r.push(i),r})(t),[t]),[d,h]=Mc(()=>((t,e)=>V(t)||kf(t)?t:e===Jc?null:[])(s,t.type)),[f,v]=Mc(()=>((t,e)=>{if(V(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(kf(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=Vh(),m=t.type===Jc,g=t.type===Zc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>L(L({},e),{},{isSelected:t,inputValue:t?e.inputValue:""})),m&&h(""),void(t&&setTimeout(()=>{var t;return null===(t=u.current)||void 0===t?void 0:t.focus()},75))}if(m)return h(t),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&H(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>L(L({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||S()||(t.preventDefault(),_()),"Escape"===t.key&&(t.preventDefault(),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},S=()=>!(t.optional||!Z(d)&&(!H(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),_=()=>{f.isSelected&&g?H(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return dc(Hu,{children:[dc("div",{className:"question-container",children:[dc(gf,{question:t,forceDisableHtml:e}),dc("fieldset",{className:"multiple-choice-options limit-height",children:[dc("legend",{className:"sr-only",children:g?" Select all that apply":" Select one"}),c.map((e,i)=>{const r=!!t.hasOpenChoice&&i===t.choices.length-1,o=`surveyQuestion${n}Choice${i}`,s=`${o}Open`,a=r?f.isSelected:m?d===e:H(d)&&d.includes(e);return dc("label",{className:r?"choice-option-open":"",children:[dc("div",{className:"response-choice",children:[dc("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),dc("span",{children:r?`${e}:`:e})]}),r&&dc("input",{type:"text",ref:u,id:s,name:`question${n}Open`,value:f.inputValue,onKeyDown:k,onInput:w,onClick(t){f.isSelected||b(e,!0),t.stopPropagation()},"aria-label":`${e} - please specify`})]},i)})]})]}),dc(mf,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:i,onSubmit:_,onPreviewSubmit:_,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const If=[1,2,3,4,5],Mf=[1,2,3,4,5,6,7],Af=[0,1,2,3,4,5,6,7,8,9,10],Rf={2:[df,hf],3:[lf,af,sf],5:[uf,lf,af,sf,cf]};function Ef(t){switch(t){case 5:default:return If;case 7:return Mf;case 10:return Af}}const Of=ce("[Surveys]");function $f(t,e,n){var i;const r=t.questions[e],o=e+1;if(!(null===(i=r.branching)||void 0===i?void 0:i.type))return e===t.questions.length-1?Kc:o;if(r.branching.type===Kc)return Kc;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===Jc){var s;let t=r.choices.indexOf(`${n}`);if(-1===t&&r.hasOpenChoice&&(t=r.choices.length-1),null===(s=r.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(t)){const e=r.branching.responseValues[t];if(Number.isInteger(e))return e;if(e===Kc)return Kc}}else if(r.type===Yc){var a;if(r.optional&&J(n))return o===t.questions.length?Kc:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null===(a=r.branching)||void 0===a||null===(a=a.responseValues)||void 0===a?void 0:a.hasOwnProperty(e)){const t=r.branching.responseValues[e];if(Number.isInteger(t))return t;if(t===Kc)return Kc}}return o}return Of.warn("Falling back to next question index due to unexpected branching type"),o}const Lf=ce("[SurveyTranslations]");function Df(t,e){const n=function(t){var e;return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=$i(t);if(r)return null==i||i.info(`Using override display language: ${r}`),r;const o=function(t){return t&&"object"==typeof t&&"language"in t?$i(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=$i(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.overrideLanguage,storedPersonProperties:null===(e=t.client)||void 0===e?void 0:e.kv.get(s),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},Lf)}(e);if(!n)return Lf.info("No user language detected"),{survey:t,language:null};const i=Fi(t,n,Lf);return{survey:i.survey,language:i.matchedKey}}const Pf="ph:show_survey_widget",Ff="PHWidgetSurveyClickListener";function Nf(t,e){try{const n=t.getBoundingClientRect(),i=window.innerHeight,r=window.innerWidth;let o=n.left+n.width/2-e/2;o+e>r-20&&(o=r-e-20),20>o&&(o=20);const s=i-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":`${n.bottom+12}px`,left:`${o}px`,right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:$h.zIndex}}catch(t){return ld.warn("Failed to calculate trigger position:",t),null}}var qf=class{constructor(t){var e,n;this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Ti=!1,this.Ii=null,this.Mi=!1,this.Ai=null,this.Ri=null,this.Ei=null,this.Oi=!1,this.handlePageUnload=()=>{var t;const e=null===(t=this.$i.client)||void 0===t?void 0:t.kv.get(a);if(e)for(const t of e)ef(t)&&zh(t,this.$i)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l,u;if(!(null===(i=this.$i.client)||void 0===i?void 0:i.canCapture))return;const{survey:c,language:d}=this.Li(t);this.Ii=d,this.Ei=null,this.Di=e;const h=this.Pi(c,e);this.Fi(h.id);const{properties:f,initialResponses:v}=null!=e?e:{},p=!(!v||0>=Object.keys(v).length)&&this.Ni(h,v,f,d);if(p&&!(null===(r=h.appearance)||void 0===r?void 0:r.displayThankYouMessage))return;this.qi(h);let m={};if((null===(o=h.appearance)||void 0===o?void 0:o.position)===Uc&&(null===(s=h.appearance)||void 0===s?void 0:s.widgetSelector)){var g;const t=document.querySelector(h.appearance.widgetSelector);t&&(m=Nf(t,parseInt((null===(g=h.appearance)||void 0===g?void 0:g.maxWidth)||$h.maxWidth))||{})}const y=(null===(a=h.appearance)||void 0===a?void 0:a.surveyPopupDelaySeconds)||0,{shadow:b}=Fh(h,this.$i);this.xi.set(b,b.host);const w={posthog:this.$i,survey:h,removeSurveyFromFocus:this.ji,properties:f,style:m,isSurveyCompleted:p,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:d};if(this.Ei=w,0>=y)return this.Mi=!0,uc(dc(Hf,L({},w)),b);const k=()=>{this.Mi=!0;const{survey:n,language:i}=this.Li(t);this.Ii=i;const r=this.Pi(n,e),o=L(L({},w),{},{survey:r,surveyLanguage:i});this.Ei=o,uc(dc(Hf,L(L({},o),{},{survey:L(L({},r),{},{appearance:L(L({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),b)},S=()=>{var t;if(!(null===(t=this.$i.client)||void 0===t?void 0:t.canCapture)||!this.Bi(h))return ld.info(`Survey ${h.id} no longer eligible when its display delay elapsed; not displaying`),this.ji(h);k()},_=n?null===(l=this.$i.surveys)||void 0===l||null===(l=l._surveyEventReceiver)||void 0===l||null===(u=l.getActivationTimestamp)||void 0===u?void 0:u.call(l,h.id):void 0,x=Y(_)?Math.max(0,Date.now()-_):0,C=Math.max(0,1e3*y-x);if(0>=C)return S();const T=window.setTimeout(()=>{this.wi.delete(h.id),S()},C);this.wi.set(h.id,T)},this.zi=t=>{var e;const{survey:n,language:i}=this.Li(t),{shadow:r,isNewlyCreated:o}=Fh(n,this.$i);this.xi.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===jc&&this.Si.set(t.id,t),o&&uc(dc(Wf,{posthog:this.$i,survey:n,surveyLanguage:i},t.id),r)},this.Hi=t=>{const e=this.ki.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ff),this.ki.delete(t),ld.info(`Removed click listener for survey ${t}`))},this.Ui=t=>{this.Wi(t)||(this.Gi(t),this.Hi(t.id))},this.Vi=t=>{this.Wi(t)||(this.Gi(t),this.Si.delete(t.id))},this.Wi=t=>{try{var e;const n=document.querySelector(rf(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Qi=(t,e)=>{const n=document.querySelector(e),i=this.ki.get(t.id);if(n){if(this.zi(t),i){if(n===i.element)return;ld.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(Ff)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Uc?Nf(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||$h.maxWidth)):{};window.dispatchEvent(new CustomEvent(Pf,{detail:{surveyId:t.id,position:r}}))};ve(n,"click",e),n.setAttribute(Ff,"true"),this.ki.set(t.id,{element:n,listener:e,survey:t}),ld.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.Ui(t)},this.renderPopover=t=>{var e;if(!(null===(e=this.$i.client)||void 0===e?void 0:e.canCapture))return;const{survey:n,language:i}=this.Li(t),{shadow:r}=Fh(n,this.$i);this.xi.set(r,r.host),uc(dc(Hf,{posthog:this.$i,survey:n,removeSurveyFromFocus:this.ji,surveyLanguage:i}),r)},this.renderSurvey=(t,e,n)=>{var i;if(!(null===(i=this.$i.client)||void 0===i?void 0:i.canCapture))return;const{survey:r,language:o}=this.Li(t);let s=!1;this.$i.config.prefillFromUrl&&(s=this.Zi(r,o,n)),uc(dc(Hf,{posthog:this.$i,survey:r,removeSurveyFromFocus:this.ji,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this.$i.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.Bi(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{var e;const n=null===(e=this.$i.client)||void 0===e?void 0:e.canCapture,i=t.filter(t=>n&&(t.type===Wc||t.type===Gc)),r=new Set(i.map(t=>t.id));for(const t of Array.from(this.wi.keys()))r.has(t)||this.cancelSurvey(t);const o=this.Ji(i),s=new Set,a=new Set;o.forEach(t=>{if(t.type===Gc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===jc)return a.add(t.id),void this.zi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(s.add(t.id),this.Qi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}Z(this.Yi)&&t.type===Wc&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.ki.forEach(({survey:t})=>{s.has(t.id)||this.Ui(t)}),this.Si.forEach((t,e)=>{a.has(e)||this.Vi(t)})},t)},this.qi=t=>{Z(this.Yi)||ld.error(`Survey ${this.Yi} already in focus. Cannot add survey ${t.id}.`),this.Yi=t.id},this.ji=t=>{this.Yi!==t.id&&ld.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Fi(t.id),this.Yi=null,this.Ii=null,this.Mi=!1,this.Ei=null,this.Di=void 0,this.Gi(t)},this.$i=t,this.Yi=null,this.Ai=()=>this.Ki(),ve(window,"languagechange",this.Ai),this.Ri=null!==(e=null===(n=t.client)||void 0===n||null===(n=n.getExtension("featureFlagsCommon"))||void 0===n?void 0:n.onFeatureFlags(()=>this.Ki()))&&void 0!==e?e:null}Ki(){var t;if(Z(this.Yi))return;const e=null===(t=this.$i.client)||void 0===t?void 0:t.kv.get(a),n=null==e?void 0:e.find(t=>t.id===this.Yi);if(!n)return;const{survey:i,language:r}=this.Li(n);if(r===this.Ii)return;if(this.Ii=r,!this.Mi)return;const o=this.Pi(i,this.Di),{shadow:s}=Fh(o,this.$i);uc(dc(Hf,L(L({},this.Ei),{},{posthog:this.$i,survey:o,removeSurveyFromFocus:this.ji,surveyLanguage:r})),s)}Pi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?L(L({},t),{},{appearance:L(L(L({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Fi(t){const e=this.wi.get(t);e&&(clearTimeout(e),this.wi.delete(t))}cancelSurvey(t){this.wi.has(t)&&(ld.info(`Cancelled pending survey ${t}`),this.Fi(t),this.Yi===t&&(this.Yi=null,this.Ii=null,this.Mi=!1,this.Ei=null,this.Di=void 0))}startAutomaticDisplay(){if(this.Ti||this.Xi||!1===this.$i.config.automaticDisplay)return;this.Xi=()=>{};const t=function(t){let e;t.callSurveysAndEvaluateDisplayLogic(!0);const n=()=>{G(e)&&(e=setInterval(()=>{t.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},i=()=>{G(e)||(clearInterval(e),e=void 0)};n();const r=()=>{document.hidden?i():(t.callSurveysAndEvaluateDisplayLogic(!1),n())};return ve(document,"visibilitychange",r),()=>{i(),document.removeEventListener("visibilitychange",r)}}(this);this.Ti?t():this.Xi=t}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Kh))delete Kh[t]})()}dispose(){var t;this.Ti=!0,null===(t=this.Xi)||void 0===t||t.call(this),this.Xi=void 0,this.Ai&&(window.removeEventListener("languagechange",this.Ai),this.Ai=null),this.Ri&&(this.Ri(),this.Ri=null),this.wi.forEach((t,e)=>this.Fi(e)),this.ki.forEach((t,e)=>this.Hi(e)),this.xi.forEach((t,e)=>{uc(null,e),null==t||t.remove()}),this.xi.clear(),this.Si.clear(),this.Yi=null}Ji(t){return t.sort((t,e)=>{var n,i;const r=ef(t),o=ef(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Xc,a=e.schedule===Xc;return s&&!a?1:!s&&a?-1:((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=e.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)})}Li(t){return Df(t,this.$i)}Zi(t,e,n){if(this.Ci.has(t.id))return!1;const{params:i}=function(){const t={};let e=!1;const n=window.location.search.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:e};const i=n.split("&");for(const n of i){const i=n.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(n.slice(0,i)),o=decodeURIComponent(n.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){e=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const e=parseInt(s[1],10);t[e]||(t[e]=[]),t[e].push(o)}}return{params:t,autoSubmit:e}}();if(0===Object.keys(i).length)return!1;ld.info("[Survey Prefill] Detected URL prefill parameters");const r=this.er(t,i,e);return!!r&&(this.nr(t,r,n,e),this.Ci.add(t.id),r.isSurveyCompleted)}nr(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&qh({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this.$i,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Ni(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=H(n)?n.map(String):[String(n)];ld.info("[Survey] Processing initial responses");const o=this.er(t,r,i);return!!o&&(this.nr(t,o,n,i),o.isSurveyCompleted)}er(t,e,n){try{const i=function(t,e){const n={};return t.questions.forEach((t,i)=>{if(!e[i]||!t.id)return;const r=e[i],o=Mi(t.id);try{switch(t.type){case Jc:{if(!t.choices||0===t.choices.length)return void ue.warn(`[Survey Prefill] Question ${i} has no choices`);const e=parseInt(r[0],10);if(isNaN(e)||0>e||e>=t.choices.length)return void ue.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Zc:{if(!t.choices||0===t.choices.length)return void ue.warn(`[Survey Prefill] Question ${i} has no choices`);const e=r.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===e.length)return void ue.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&ue.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case Yc:{const e=parseInt(r[0],10),s=t.scale||10,a=10===s?0:1;if(isNaN(e)||a>e||e>s)return void ue.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: ${a}-${s})`);n[o]=e;break}default:ue.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){ue.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return ld.warn("[Survey Prefill] No valid responses after conversion"),null;const r=ki(),{startQuestionIndex:o,skippedResponses:s,skippedIndices:a}=function(t,e,n){let i=0;const r={},o=[],s=t.questions.length+1;let a=0;for(;t.questions.length>i&&s>a&&(a++,e.includes(i));){const e=t.questions[i];if(!e||!("skipSubmitButton"in e)||!e.skipSubmitButton)break;if(e.id){const t=Mi(e.id);G(n[t])||(r[t]=n[t])}o.push(i);const s=$f(t,i,e.id?n[Mi(e.id)]:null);if(s===Kc)return{startQuestionIndex:t.questions.length,skippedResponses:r,skippedIndices:o};i=s}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)).filter(e=>{const n=t.questions[e];return(null==n?void 0:n.id)&&!G(i[Mi(n.id)])}),i),l=o>=t.questions.length;return Xh(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:Hh(t.questions),visitedIndices:a,surveyLanguage:n}),ld.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return ld.error("[Survey Prefill] Error handling prefill:",t),null}}ir(t,e){var n;if(!t)return!0;const i=null===(n=this.$i.client)||void 0===n?void 0:n.getExtension(hc),r=!!(null==i?void 0:i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let o=!0;e&&(o=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const s=r&&o;return s||this.rr(t),s}rr(t){this.Oi||!1!==this.$i.config.featureFlagEvaluation||(this.Oi=!0,ld.warn(`Survey feature flag "${t}" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.`))}sr(t){return!t.conditions||Zh(t,this.$i)&&Jh(t)&&function(t){var e,n;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null===(n=document)||void 0===n?void 0:n.querySelector(t.conditions.selector))}(t)}ar(t){var e;return Wh(t)?{satisfied:!0}:t.internal_targeting_flag_key&&function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)&&!(null===(e=this.$i.client)||void 0===e||null===(e=e.getExtension("featureFlagsCommon"))||void 0===e?void 0:e.hasLoadedFlags)?(this.rr(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.ir(t.internal_targeting_flag_key)}}checkSurveyEligibility(t){var e,n;const i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason=`Survey is not running. It was completed on ${t.end_date}`,i;if(!dd.includes(t.type))return i.eligible=!1,i.reason=`Surveys of type ${t.type} are never eligible to be shown in the app`,i;const r=null===(e=t.conditions)||void 0===e?void 0:e.linkedFlagVariant;if(!this.ir(t.linked_flag_key,r))return i.eligible=!1,i.reason=r?`Survey linked feature flag is not enabled for variant ${r}`:"Survey linked feature flag is not enabled",i;if(!this.ir(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.ar(t);var s;return o.satisfied?(t=>{let e=null;try{e=localStorage.getItem("lastSeenSurveyDate")}catch(t){ld.error("localStorage error: "+t)}return function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>t}(t,e)})(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays)?((t=>{let e=null;try{e=localStorage.getItem(cd(t))}catch(t){ld.error("localStorage error: "+t)}return!!e&&!Wh(t)})(t)&&(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again"),i):(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyCaptureEligibility(){var t;return(null===(t=this.$i.client)||void 0===t?void 0:t.canCapture)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(t){const e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){const e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this.lr(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}lr(t){var e;if(!Ni(t)&&!function(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}(t))return!0;const n=null===(e=this.$i.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}ur(t){var e;return!(null===(e=t.feature_flag_keys)||void 0===e?void 0:e.length)||t.feature_flag_keys.every(({key:t,value:e})=>!t||!e||this.ir(e))}Bi(t){return this.checkSurveyEligibility(t).eligible&&this.sr(t)&&this.lr(t)&&this.ur(t)}Gi(t){try{const e=document.querySelector(rf(t,!0));(null==e?void 0:e.shadowRoot)&&(uc(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){ld.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.qi,removeSurveyFromFocus:this.ji,surveyInFocus:this.Yi,surveyTimeouts:this.wi,handleWidget:this.zi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Qi,sortSurveysByAppearanceDelay:this.Ji.bind(this),checkFlags:this.ur.bind(this),isSurveyFeatureFlagEnabled:this.ir.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Mi}}};function jf({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){Ac(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Gc,s=Zh(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===jc&&o;if(!s)return ld.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(ld.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};ve(window,"popstate",s),ve(window,"hashchange",s);const a=window.history.pushState,l=window.history.replaceState;return window.history.pushState=function(...t){a.apply(this,t),s()},window.history.replaceState=function(...t){l.apply(this,t),s()},()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),window.history.pushState=a,window.history.replaceState=l}},[i,t,e,n,r])}const Bf=200;function zf(t="right"){switch(t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Hf({survey:t,forceDisableHtml:e,posthog:n,style:i={},previewPageIndex:r,removeSurveyFromFocus:o=()=>{},isPopup:s=!0,onPreviewSubmit:a=()=>{},onPreviewBack:l=()=>{},onPopupSurveyDismissed:u=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:h,skipShownEvent:f,surveyLanguage:v}){var p,m,g,y,b,w,k,S,_,x,C,T;const I=Rc(null),M=Number.isInteger(r),{isPopupVisible:A,isSurveySent:R,hidePopupWithAnimation:E}=function(t,e,n,i,r,o,s,a,l){const[u,c]=Mc(i||0===n||t.type===Vc),[d,h]=Mc(!1),f=Rc(!1),v=()=>{const e=()=>{o&&r(t),c(!1)};if(f.current)return;const n=null==s?void 0:s.current;n?(f.current=!0,n.style.transition=`opacity ${Bf}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return Ac(()=>{if(!e)return void ld.error("usePopupVisibility hook called without a PostHog instance.");if(i)return;let r;const o=e=>{var n,i;if(e.detail.surveyId===t.id){if(!(null===(n=t.appearance)||void 0===n?void 0:n.displayThankYouMessage))return v();h(!0),(null===(i=t.appearance)||void 0===i?void 0:i.autoDisappear)&&(r&&clearTimeout(r),r=setTimeout(v,5e3))}},s=()=>{var n;if(Zh(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}window.dispatchEvent(new Event("PHSurveyShown")),a||null===(n=e.client)||void 0===n||n.capture(td,L(L({[rd]:t.name,[id]:t.id,[od]:t.current_iteration,[sd]:t.current_iteration_start_date},l&&{[ad]:l}),{},{sessionRecordingUrl:fc(e)}))}};ve(window,"PHSurveyClosed",p),ve(window,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),window.removeEventListener("PHSurveyClosed",p),window.removeEventListener("PHSurveySent",o)}},[]),jf({survey:t,removeSurveyFromFocus:r,setSurveyVisible:c,isPreviewMode:i,posthog:e}),{isPopupVisible:u,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:v}}(t,n,(null===(p=t.appearance)||void 0===p?void 0:p.surveyPopupDelaySeconds)?1e3*t.appearance.surveyPopupDelaySeconds:0,M,o,s,I,f,v),O=R||r===t.questions.length||!0===h,[D,P]=Mc(!1),F=Ec(()=>!!tf(t),[t]),N=!(!(null===(m=t.appearance)||void 0===m?void 0:m.introScreenHeader)&&!(null===(g=t.appearance)||void 0===g?void 0:g.introScreenDescription)),q=M?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!D&&!F,j=Ec(()=>{const e=tf(t),i=(null==e?void 0:e.surveySubmissionId)||ki()||"";return{isPreviewMode:M,previewPageIndex:r,onPopupSurveyDismissed(){v?Bh(t,n,M,v):Bh(t,n,M),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[M,r,s,n,t,u,a,l,d,v]);return A?dc(Gh.Provider,{value:j,children:dc("div",{className:"ph-survey",style:L(L({},of(t.type,null===(b=t.appearance)||void 0===b?void 0:b.position,null===(w=t.appearance)||void 0===w?void 0:w.widgetType)),i),ref:I,children:O?dc(bf,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescriptionContentType,appearance:t.appearance||$h,onClose(){E(),c()}}):q?dc(wf,{header:(null===(x=t.appearance)||void 0===x?void 0:x.introScreenHeader)||"",description:(null===(C=t.appearance)||void 0===C?void 0:C.introScreenDescription)||"",forceDisableHtml:!!e,contentType:null===(T=t.appearance)||void 0===T?void 0:T.introScreenDescriptionContentType,appearance:t.appearance||$h,onStart:()=>P(!0)}):dc(Uf,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function Uf({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=Ec(()=>{const e=tf(t);if(!e)return null;const n=Y(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(nf(t),null)},[t]),[s,a]=Mc(()=>((null==o?void 0:o.responses)&&ld.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=Mc(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=Oc(Gh),[b,w]=Mc(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=Y(e)&&e>=0&&t.questions.length>e?e:0;return Y(c)&&c>=0?c:n}),[k,S]=Mc(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[_,x]=Mc(()=>{var e;const n=tf(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=Ec(()=>Hh(Uh(t,o)),[t.id,o]),T=Ec(()=>{if(!C||new Set(C).size!==C.length)return Uh(t,o);const e=new Map(t.questions.map(t=>[t.id,t])),n=C.map(t=>e.get(t)).filter(t=>!!t);return n.length===C.length?n:t.questions},[C,t.questions,t,o]);Ac(()=>{!m||G(c)||0>c||w(c)},[c,m]);const I=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),M=T.at(b);return M?dc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&dc(yf,{onClick(){d()}}),dc("div",{className:"survey-box","data-question-index":b,children:[l&&dc("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Gf({question:M,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||$h,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{var o;if(!n)return void ld.error("onNextButtonClick called without a PostHog instance.");if(!(null===(o=n.client)||void 0===o?void 0:o.canCapture))return void u(!0);if(u(!1),!r)return void ld.error("onNextButtonClick called without a questionId.");const{responses:l,questionSnapshots:c}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:L(L({},t),{},{[Mi(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?L(L({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:_},r,e,T[i]);a(l),x(c);const d=$f(t,i,e),h=d===Kc,f=[...k,i];if(h||(S(f),w(d),Xh(t,{surveySubmissionId:p,responses:l,lastQuestionIndex:d,questionOrder:Hh(T),visitedIndices:f,surveyLanguage:y,questionSnapshots:c})),t.enable_partial_responses||h){const e=new Set(f.map(t=>{var e;return null===(e=T[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Mi(t))),i=Object.fromEntries(Object.entries(l).filter(([t])=>e.has(t)));qh({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:h,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:c})}})({res:e,displayQuestionIndex:b,questionId:M.id}),onPreviewSubmit:f,initialValue:M.id?s[Mi(M.id)]:void 0,canGoBack:I,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);S(n),w(e),Xh(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:Hh(T),visitedIndices:n,surveyLanguage:y,questionSnapshots:_})}})]})]}):null}function Wf({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d,h;const[f,v]=Mc(!0),[p,m]=Mc(!1),[g,y]=Mc({}),b=Rc(void 0),w=()=>{var t;(p||!n||i||(null===(t=n.client)||void 0===t?void 0:t.canCapture))&&m(!p)};if(Ac(()=>{var e,r,o;if(!n)return void ld.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&y((o=null===(r=t.appearance)||void 0===r?void 0:r.position)&&o!==Hc&&o!==Uc?{}:{top:"50%",bottom:"auto"});const s=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(ld.info(`Received show event for feedback button survey ${t.id}`),y(i.detail.position||{}),w())};return ve(window,Pf,s),()=>{G(b.current)||(clearTimeout(b.current),b.current=void 0),window.removeEventListener(Pf,s)}},[n,i,t.id,null===(o=t.appearance)||void 0===o?void 0:o.widgetType,null===(s=t.appearance)||void 0===s?void 0:s.position,null===(a=t.appearance)||void 0===a?void 0:a.widgetSelector,null===(l=t.appearance)||void 0===l?void 0:l.borderColor]),jf({survey:t,setSurveyVisible:v,posthog:n}),!f)return null;const k=()=>{t.schedule!==Xc&&v(!1),G(b.current)||clearTimeout(b.current),b.current=setTimeout(()=>{b.current=void 0,m(!1)},200)};return dc(Hu,{children:["tab"===(null===(u=t.appearance)||void 0===u?void 0:u.widgetType)&&dc("button",{className:"ph-survey-widget-tab "+("top"===(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition)?"widget-tab-top":""),onClick:w,disabled:i,style:zf(null===(d=t.appearance)||void 0===d?void 0:d.tabPosition),children:(null===(h=t.appearance)||void 0===h?void 0:h.widgetLabel)||""}),p&&dc(Hf,{posthog:n,survey:t,forceDisableHtml:e,style:g,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:r})]})}const Gf=({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l})=>{const u={forceDisableHtml:e,appearance:i,onPreviewSubmit(t){o(t)},onSubmit(t){r(t)},initialValue:s,displayQuestionIndex:n,canGoBack:a,onBack:l};switch(t.type){case Qc:return Bu(Sf,L(L({},u),{},{question:t,key:t.id}));case"link":return Bu(_f,L(L({},u),{},{question:t,key:t.id}));case Yc:return Bu(xf,L(L({},u),{},{question:t,key:t.id}));case Jc:case Zc:return Bu(Tf,L(L({},u),{},{question:t,key:t.id}));default:return ld.error(`Unsupported question type: ${t.type}`),null}};function Vf(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&U(n.then)&&n.then(void 0,()=>{})}}}}function Qf(t,e){return e.length>t?e.slice(0,t)+"...":e}function Zf(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!we(e));return e}function Jf(t,{e:e,maskAllElementAttributes:n,maskAllText:i,elementAttributeIgnoreList:r,elementsChainAsString:o,disableCaptureUrlHashes:s}){var a,l;if(!we(t))return{props:{}};const u=[t],c=new Set([t]);let d=t;for(;d.parentNode&&!ke(d,"body")&&1e3>u.length;){if(Se(d.parentNode)){const t=d.parentNode.host;if(c.has(t))break;c.add(t),u.push(t),d=t;continue}if(!we(d.parentNode))break;if(c.has(d.parentNode))break;c.add(d.parentNode),u.push(d.parentNode),d=d.parentNode}const h="click"===e.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?u.findIndex(t=>ke(t,"button")||ke(t,"a")):-1;h>0&&(i=i||u.slice(0,h+1).some(t=>!De(t)||Pe(t)));const f=[],v={};let p,m=!1,g=!1;if(de(u,t=>{const e=De(t);if(ke(t,"a")&&!n&&!(null==r?void 0:r.includes("href"))){const n=t.getAttribute("href");m=!!(e&&n&&Ue(n))&&(s?St(n):n)}N(xe(t),"ph-no-capture")&&(g=!0),f.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Ie.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Qf(1024,We(t)):Qf(1024,Ce(t)));const a=xe(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),de(t.attributes,function(n){var o;if((!Pe(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ue(n.value)&&(!V(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=_e(t).join(" ")),s["attr__"+n.name]=Qf(1024,"href"===n.name&&r?St(t):t)}});let l=1,u=1,c=t;for(;c=Zf(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,n,i,r,s)),de(function(t){if(!De(t))return{};const e={};return de(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){const n=t.name.replace("data-ph-capture-attribute-",""),i=t.value;n&&i&&Ue(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(v,e)||(v[e]=t)})}),g)return{props:{},explicitNoCapture:g};if(h>0&&(t=u[h],f.splice(0,h)),i||(f[0].$el_text=ke(t,"a")||ke(t,"button")?We(t):Ce(t)),m){var y,b;f[0].attr__href=m;const t=null===(y=pe(m))||void 0===y?void 0:y.host,e=null===(b=typeof window>"u"?void 0:window)||void 0===b||null===(b=b.location)||void 0===b?void 0:b.host;t&&e&&t!==e&&(p=m)}return{props:he((k=e.type,{$event_type:k,$ce_version:1}),o?{}:{$elements:f},{$elements_chain:(w=f,H(w)?function(t){return t.map(t=>{var e,n;let i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class){t.attr_class.sort();for(const e of t.attr_class)i+=`.${e.replace(/"/g,"")}`}const r=L(L(L(L({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(n=t.nth_of_type)&&void 0!==n?n:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),o={};return fe(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ve(t.toString())]=Ve(e.toString())),i+=":",i+=fe(o).map(([t,e])=>`${t}="${e}"`).join(""),i}).join(";")}(function(t){return t.map(t=>{var e,n;const i={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Qe(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return fe(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(w)):"")},(null===(a=f[0])||void 0===a?void 0:a.$el_text)?{$el_text:null===(l=f[0])||void 0===l?void 0:l.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},v),target:t};var w,k}const Yf="logs";A(function*(t){const e=yield ie(ge(t.data),Ci.DEBUG,{rethrow:!0});if(!e)return t;const n=yield e.arrayBuffer();return L(L({},t),{},{cr:{contentType:"text/plain",body:n,estimatedSize:n.byteLength}})});const Kf=()=>{var e;return(null==t||null===(e=t.performance)||void 0===e?void 0:e.now)?t.performance.now():Date.now()},Xf=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var tv=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);const n={};for(const i of t){const t=null==e?void 0:e.get_property(i);G(t)||(n[i]=t)}return n}set(t,e){var n;null===(n=this._instance.persistence)||void 0===n||n.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null===(e=this._instance.persistence)||void 0===e||e.unregister(t)}},ev=class{constructor(t){this.instance=t,this.R=ue,this.kv=new tv(t),this.onSession=t=>Vf(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>Vf(this.instance._addCaptureHook((e,n)=>{if(n)try{t({event:e,properties:n.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{const e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},n=this.instance.dr.on("extensionsRemoteConfig",e);return this.instance.vr&&e(this.instance.vr),Vf(n)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){const t=this.instance.get_property("$device_id");return"string"==typeof t?t:void 0}get library(){return{name:Ci.LIB_NAME,version:Ci.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null===(e=this.instance.persistence)||void 0===e?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,i,r;const o=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==o?void 0:o.sessionId)&&void 0!==e?e:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==o?void 0:o.sessionStartTimestamp)&&void 0!==i?i:0,lastActivityTimestamp:null!==(r=null==o?void 0:o.lastActivityTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return U(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(null===(t=this.instance.rateLimiter)||void 0===t?void 0:t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case"featureFlags":case hc:e=this.instance.featureFlags;break;case Yf:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const i=L({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(t,e,i))}pr(t){var e;return!G(t)||!(null===(e=this.instance.rateLimiter)||void 0===e?void 0:e.lastEventRateLimited)}registerDynamicEventProperties(t){return Vf(this.instance.mr(t))}sendRequest(t){var e=this;return A(function*(t,n={}){var i;const r=null!==(i=n.target)&&void 0!==i?i:"api",o=n.query?((t,e,n=!0)=>{var i;const[r,o]=t.split("?"),s=L({},e),a=null!==(i=null==o?void 0:o.split("&").map(t=>{var e;const[i,r]=t.split("="),o=n&&null!==(e=s[i])&&void 0!==e?e:r;return delete s[i],`${i}=${o}`}))&&void 0!==i?i:[],l=ye(s);return l&&a.push(l),a.length>0?`${r}?${a.join("&")}`:r})(t,n.query):t,s=e.instance.requestRouter.endpointFor(r,o),a={method:n.method,url:s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?D.Base64:void 0,timestampMode:n.sentAt};return"api"===r&&"/i/v1/logs"===t&&(a.batchKey="logs"),"sendBeacon"===n.transport?(e.instance._send_request(a),{statusCode:202}):new Promise(t=>{var n;if(a.callback=t,"flags"===r&&(null===(n=e.instance.config.metrics)||void 0===n?void 0:n.flags)){let n;a.onDispatch=()=>{n=Kf()},a.callback=i=>{G(n)||e.gr(s,i,Kf()-n),t(i)}}e.instance._send_request(a)})}).apply(this,arguments)}gr(t,e,n){try{var i,r,o;const s=e.statusCode||void 0,a={"server.address":(null!==(i=null===(r=pe(t))||void 0===r?void 0:r.hostname)&&void 0!==i?i:t).replace(/^\[(.*)\]$/,"$1")};s&&(a["http.response.status_code"]=s);const l=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(s,e.error);l&&(a["error.type"]=l);const u=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}();u&&(a["client.timezone"]=u),null===(o=this.instance.metrics)||void 0===o||o.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:a,bounds:Xf})}catch(t){ue.error("Failed to record the /flags request duration",t)}}},nv=class{constructor(t){this._instance=t}get(){var t,e,n,i;const r=null===(t=this._instance)||void 0===t?void 0:t.config;return{disableSurveys:!!(null==r?void 0:r.disable_surveys),cookielessMode:!!(null==r?void 0:r.cookieless_mode),advancedEnableSurveys:!!(null==r?void 0:r.advanced_enable_surveys),requestTimeoutMs:null!==(e=null==r?void 0:r.surveys_request_timeout_ms)&&void 0!==e?e:1e4,prefillFromUrl:!!(null==r||null===(n=r.surveys)||void 0===n?void 0:n.prefillFromUrl),automaticDisplay:!(null==r?void 0:r.disable_surveys_automatic_display),featureFlagEvaluation:!(null==r?void 0:r.advanced_disable_feature_flags),overrideLanguage:null==r?void 0:r.override_display_language,prepareStylesheet:null==r?void 0:r.prepare_external_dependency_stylesheet,get_current_url:null==r?void 0:r.get_current_url,uiHost:null===(i=this._instance)||void 0===i||null===(i=i.requestRouter)||void 0===i?void 0:i.endpointFor("ui","")}}getExtensions(){const t=null==o?void 0:o.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:i}=t;return{generateSurveys:n?t=>n(e,t):void 0,loadExternalDependency:i?t=>i(e,"surveys",t):void 0}}onMatchingConditionsChanged(e){var n,i;const r=null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook(t=>{"$pageview"!==t&&t!==td&&t!==ed&&t!==nd||e()}),o=()=>e();ve(t,"PHSurveyShown",o);let s=!1;const a=null===(i=this._instance)||void 0===i?void 0:i.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,null==r||r(),null==a||a(),null==t||t.removeEventListener("PHSurveyShown",o)}}};const iv=new WeakMap,rv=(t,e)=>{const n=function(t){var e;const n=new nv(t);if(!t)return{get config(){return n.get()}};if(null===(e=t.surveys)||void 0===e?void 0:e.getRenderContext)return t.surveys.getRenderContext();let i=iv.get(t);return i||(i={client:new ev(t),get config(){return n.get()},surveys:t.surveys},iv.set(t,i)),i}(t);return n?function(t,e){if(typeof document>"u"||typeof window>"u")return;const n=new qf(t);return!1===t.config.automaticDisplay?(ld.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===e?(ld.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}(n,e):void 0};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.generateSurveys=rv,o.extendPostHogWithSurveys=rv;const ov=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},sv=1e4,av=(t,e,n)=>n.remaining>0?e.length>n.remaining?(t.push(e.slice(0,n.remaining)),n.remaining=0,n.truncated=!0,!1):(t.push(e),n.remaining-=e.length,!0):(n.truncated=!0,!1),lv=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return av(e,i,n);if(n.truncated=!0,2>n.remaining)return!1;let r=0,o=Math.min(t.length,n.remaining-2);for(;o>r;){const e=Math.ceil((r+o)/2);JSON.stringify(t.slice(0,e)).length>n.remaining?o=e-1:r=e}return av(e,JSON.stringify(t.slice(0,r)),n)},uv=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,cv=(t,e,n)=>{if(!n.truncated){if(n.keysRemaining-=1,n.sizeRemaining-=String(e).length+t.length,0>=n.keysRemaining||0>=n.sizeRemaining)return n.truncated=!0,void(n.result.attributes_truncated=!0);n.result[t]=e}},dv=(t,e,n)=>{if(!n.truncated)if(W(t)){if(n.seen.has(t))return void cv(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(dv(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else cv(e,t,n)},hv=(t,e,n,i,r=!1,o)=>{if(!uv(t))return!r||av(e,"null",n);if(Z(t)||(t=>{try{return Y(t)||K(t)}catch(t){return!1}})(t))return av(e,JSON.stringify(t),n);if("string"==typeof t)return lv(t,e,n);if(!W(t)&&!H(t))return av(e,JSON.stringify(t),n);if(i.has(t))return lv("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(U(o))return hv(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return lv(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return av(e,JSON.stringify(t.valueOf()),n)}catch(t){}if(t instanceof Error){const s={};try{for(const e in t)({}).hasOwnProperty.call(t,e)&&(s[e]=t[e])}catch(t){}try{s.name=t.name}catch(t){}try{s.message=t.message}catch(t){}try{s.stack=t.stack}catch(t){}return hv(s,e,n,i,r,o)}if(H(t)){if(!av(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!av(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!hv(o,e,n,i,!0))return!1}return av(e,"]",n)}if(!av(e,"{",n))return!1;let s=!0;try{for(const r in t){if(!{}.hasOwnProperty.call(t,r))continue;if(0>=n.remaining)return n.truncated=!0,!1;let a;try{a=t[r]}catch(t){continue}if(o)try{dv(a,r,o)}catch(t){}if(!uv(a))continue;const l=`${s?"":","}${JSON.stringify(r)}:`;if(l.length>=n.remaining)return n.truncated=!0,!1;const u=e.length,c=n.remaining,d=n.truncated;if(!av(e,l,n))return!1;const h=e.length,f=hv(a,e,n,i,!1),v=n.truncated;if(e.length!==h){if(s=!1,!f)return!1}else if(e.length=u,n.remaining=c,n.truncated=f?d:v,!f)return!1}}catch(t){}return av(e,"}",n)},fv=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=W(t[0])?{result:{},keysRemaining:50,sizeRemaining:sv,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||av(n," ",i))&&hv(t[e],n,i,new WeakSet,!1,0===e?r:void 0);e++);return{body:n.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==r?void 0:r.result)||{}}},vv={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},pv=t=>"canCapture"in t,mv=t=>({console:o.console,hostname:o.location.host,getCapturingLogs(){let e;return e=pv(t)?t.canCapture?t.getExtension(Yf):void 0:(U(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing())?t.logs:void 0,e?{captureConsoleLog:n=>((t,e,n)=>{if(pv(t))return void e.captureConsoleLog(n);const i=(t=>{const e=/^1\.(\d+)\.(\d+)$/.exec(t);if(!e)return;const n=Number(e[1]),i=Number(e[2]);return 392>n||n>419?void 0:410===n?i>4?i>10?void 0:"de":"le":418===n?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===n?i>2?void 0:"vi":410>n?"le":"he"})(t.version),r=i?e[i]:void 0;i?U(r)&&r.call(e,n):U(e.captureConsoleLog)&&e.captureConsoleLog(n)})(t,e,n),captureBufferedConsoleLog(t,n,i){var r;return null===(r=e.captureBufferedConsoleLog)||void 0===r?void 0:r.call(e,t,n,i)}}:void 0}});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.logs={initializeLogs:t=>(t=>{const e=t.console;let n=t;const i=[],r={host:t.hostname};let o=!1;const s=()=>{n=void 0;for(const t of i)try{t()}catch(t){}};try{for(const t of Object.keys(vv)){const s=i=>(...s)=>{let a=!1;try{if(s.length>0&&!o&&n){const e=n.getCapturingLogs();if(e){o=!0,a=!0;const{body:n,truncated:i,attributes:l}=fv(s,sv),u=L(L({},r),i?{body_truncated:"true"}:{}),c={level:vv[t],body:n,attributes:L(L({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Hl(e,t,t=>{const e=s(t);return e.__rrweb_original__=ov(a),e}))}}catch(t){throw s(),t}return s})(mv(t)),replayConsoleBuffer:(t,e)=>((t,e)=>{const n=t.getCapturingLogs();if(n)for(const r of e)try{var i;const{body:e,truncated:o,attributes:s}=fv(r.args,sv);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:vv[r.level],body:e,attributes:L(L({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(mv(t),e)};const gv=ce("[ExceptionAutocapture]"),yv=new class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,e,0).apply(t),r=this.buildParsingContext(e),o=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(t){var e=this;return A(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&H(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null===(e=t.syntheticException)||void 0===e?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let i,r;if(null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack)try{r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch(t){}return L(L({},t),{},{cause:i,stack:r,errors:null===(n=t.errors)||void 0===n?void 0:n.map(t=>this.parseStacktrace(t,e))})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return A(function*(){let n=t;for(const t of e.modifiers)n=yield t(n);return n})()}convertToExceptionList(t,e){const n=[],i=(t,r,o)=>{var s;const a=n.length,l=void 0===r?L(L({type:"string"==typeof e.type&&e.type.length>0?e.type:"generic"},"boolean"==typeof e.handled?{handled:e.handled}:void 0===e.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof e.synthetic?e.synthetic:t.synthetic,exception_id:a}):{type:"chained",source:o,synthetic:t.synthetic,exception_id:a,parent_id:r},u={type:t.type,value:t.value,mechanism:l};t.stack&&(u.stacktrace={type:"raw",frames:t.stack}),n.push(u),t.cause&&i(t.cause,a,"cause");for(const e of null!==(s=t.errors)&&void 0!==s?s:[])i(e,a,"member")};return i(t),n}buildParsingContext(t){var e;return{chunkIdMap:Mt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(nt(t)){let n=Object.getPrototypeOf(t);for(let i=0;n&&100>i;i++){var e;const i=null===(e=Object.getOwnPropertyDescriptor(n,"constructor"))||void 0===e?void 0:e.value;if("function"==typeof i&&"AggregateError"===i.name){const e=t.errors;return H(e)?e:void 0}n=Object.getPrototypeOf(n)}}}catch(t){}}buildCoercingContext(t,e,n=0){let i=0,r=0,o=!1;const s=new Set,a=[],l={},u=(t,e,n=0)=>{const u=c(e,n),d=u.apply;if(u.apply=e=>{a.push(t);try{return d(e)}finally{a.pop()}},n>4||n>0&&-1!==a.indexOf(t))return this.coerceFallback(u);const h="object"==typeof t&&null!==t||"function"==typeof t;if(0===n&&i>=50||h&&s.has(t))return;h&&s.add(t),0===n&&i++;const f=this.getAggregateErrors(t);let v,p;o||(o=!!f);try{if(v=this.applyCoercers(t,u),!v)throw l}catch(t){if(t===l)return void(0===n&&i--);if(!o)throw t;v=this.coerceFallback(u)}if(!f||i>=50)return v;try{p=f.length}catch(t){return v}if(!Number.isInteger(p)||0>p||p>4294967295)return v;const m=[];for(let t=0;50>i&&1e3>r&&p>t;t++){let n;r++;try{n=u.next(f[t])}catch(t){i++,n=this.coerceFallback(c(e+1))}n&&m.push(n)}return L(L({},v),{},{errors:m})},c=(n,i=0)=>L(L({},e),{},{syntheticException:0==n?e.syntheticException:void 0,mechanism:0==n?t:{},apply(t){const e=u(t,n,i+1);if(!e)throw l;return e},next:t=>u(t,n+1)}),d=c(n);return L(L({},d),{},{apply:t=>{var e;return null!==(e=u(t,n))&&void 0!==e?e:this.coerceFallback(d)}})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=V(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return et(t,"DOMException")}isDOMError(t){return et(t,"DOMError")}},new class{match(t){return et(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!it(t))return!1;try{const e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var n;const i=this.getUnhandledRejectionReason(t);return tt(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!et(t,"ErrorEvent")&&(null!=t.error||this.yr(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return L(L({},i),{},{stack:null!==(n=this.br(t))&&void 0!==n?n:i.stack,synthetic:!0})}yr(t){return V(t.message)&&t.message.length>0}br(t){var e,n;const i=t,r=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(n=i.colno)&&void 0!==n?n:0;if(V(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return nt(t)}coerce(t,e){var n;const i=this.getStack(t),r=void 0===i?null===(n=e.syntheticException)||void 0===n?void 0:n.stack:void 0,o=!!r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:r,cause:t.cause?e.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if("string"==typeof e&&e.length>0)return e;const n=t.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(t){return}}},new class{match(t){return it(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Kt(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var n,i;const r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null!==(n=this.getStack(t))&&void 0!==n?n:null===(i=e.syntheticException)||void 0===i?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(it(t))return t.constructor.name;const e="name"in t?t.name:void 0;return V(e)&&!Q(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){let e=`'${t.name}' captured as exception`;return"message"in t&&"string"==typeof t.message&&(e+=` with message: '${t.message}'`),e}if("message"in t&&"string"==typeof t.message)return t.message;const e=this.getObjectClassName(t);return`${e&&"Object"!==e?`'${e}'`:"Object"} captured as exception with keys: ${Kt(t)}`}isSeverityLevel(t){return V(t)&&!Q(t)&&Yt.indexOf(t)>=0}getStack(t){try{return V(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:V(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(nt(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var n;const[i,r]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=r?r:t,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const i=t.match(Jt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return tt(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}}],function(t,...e){return(n,i=0)=>{const r=[],o=n.split("\n"),s=Math.min(o.length,i+1e3),a=[];for(let n=i;s>n;n++){const i=o[n];if(i.length>1024)continue;const s=zt.test(i)?i.replace(zt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Ut(r);if(t){for(let e=a.length-1;e>=0;e--){const n=a[e];if(t.start>=n.start+n.length)break;a.pop()}a.push(t)}break}}if(Qt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Gt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Wt(r,t);return a.some(t=>0===t.start&&r.length===t.length)&&function(t){const e=t.map(t=>`${t.function}|${t.filename}|${t.lineno}|${t.colno}|${t.module}`);let n=0;for(let t=1;e.length>t;t++)Zt(e,t,n)&&(n=t);t.push(...t.splice(0,n))}(r),function(t){if(!t.length)return[];const e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return L(L({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Nt,Bt)),bv=(t,e)=>{try{return t()}catch(t){return e}},wv=(t,e)=>bv(()=>t(e()),void 0),kv=t=>bv(()=>U(t)&&U(t.call),!1),Sv=(t,e)=>bv(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),_v=(t,e,n)=>{bv(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),bv(()=>{t[e]=n},void 0)},xv=e=>{const n=t;n||gv.info("window not available, cannot wrap onerror");const i=bv(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return wv(e,()=>yv.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(V(t)&&V(e)&&e.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:e,lineno:n,colno:i})}catch(e){return t}return t})(t),{mechanism:{handled:!1}})),!!kv(i)&&null!==(n=i(...t))&&void 0!==n&&n},Sv(n,"onerror"),()=>_v(n,"onerror",i)},Cv=(e,n=!1)=>{const i=t;i||gv.info("window not available, cannot wrap onUnhandledRejection");const r=bv(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return wv(e,()=>yv.buildFromUnknown(t,{mechanism:{handled:!1}})),kv(r)?null!==(i=r(t))&&void 0!==i&&i:n},Sv(i,"onunhandledrejection"),()=>_v(i,"onunhandledrejection",r)},Tv={wrapOnError:xv,wrapUnhandledRejection:Cv,wrapConsoleError(t){const e=console;e||gv.info("console not available, cannot wrap console.error");const n=bv(()=>e.error,void 0);return e.error=function(...e){bv(()=>e.length>1&&V(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||wv(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return yv.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),kv(n)&&n(...e)},Sv(e,"error"),()=>_v(e,"error",n)}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.errorWrappingFunctions=Tv,o.posthogErrorWrappingFunctions=Tv;const Iv=(t,e)=>{if(!U(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!Z(n)&&"object"==typeof n&&H(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){gv.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],r=e=>{try{var n;null===(n=t.capture)||void 0===n||n.call(t,"$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){gv.error("Failed to capture exception for a legacy client",t)}};xv(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Cv(r,!0)};o.extendPostHogWithExceptionAutoCapture=Iv,o.extendPostHogWithExceptionAutocapture=Iv;const Mv="X-POSTHOG-SESSION-ID",Av="X-POSTHOG-WINDOW-ID",Rv="X-POSTHOG-DISTINCT-ID",Ev=[Mv,Av,Rv],Ov=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],$v=(t,e)=>({}.hasOwnProperty.call(t,e)),Lv=t=>"object"==typeof t&&!Z(t)||U(t),Dv=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Pv=e=>{try{var n;return Dv(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null===(n=t.location)||void 0===n?void 0:n.href).toString()}catch(t){return}},Fv=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(H(t)&&!t.includes(o))return!1;let s=!1;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Mv,t),r.set(Av,e),s=!0}const a=(t=>U(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Rv,a),s=!0),s};o.__PosthogExtensions__=o.__PosthogExtensions__||{};const Nv={_patchFetch:(e,n,i)=>Hl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=Pv(r);if(t)if(Dv(r)){const t=new Request(r,o);Fv(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(Lv(o)?o.headers:void 0);if(Fv(e,n,i,t,s)){const t=((t,e)=>{if(G(t)||Z(t))return{headers:e};if(!Lv(t))return;const n=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){const t=Object.create(n);return Object.defineProperty(t,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),t}return new Proxy({headers:e},{get:(t,e)=>$v(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>$v(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),Ov.forEach(t=>{t in n&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){const i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&Ov.includes(e)&&e in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,e,n)}};const r=Reflect.getOwnPropertyDescriptor(n,e);return r?L(L({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(o,s);t&&(a=[r,t])}}}catch(t){a=s}return t.apply(this,a)}),_patchXHR:(e,n,i)=>Hl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=Pv(o);d&&Fv(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Ev.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};o.__PosthogExtensions__.tracingHeadersPatchFns=Nv,o.postHogTracingHeadersPatchFns=Nv,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){const e=this.length;let n=Math.trunc(t)||0;return 0>n&&(n+=e),0>n||n>=e?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(let n=this.length-1;n>=0;n--){const i=this[n];if(t.call(e,i,n,this))return i}},writable:!0,enumerable:!1,configurable:!0});var qv=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(t.hadRecentInput)return;const n=this.i[0],i=this.i.at(-1);this.o&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const jv=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bv=t=>{if("loading"===document.readyState)return"loading";const e=jv();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},zv=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Hv=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[zv(i),...Array.from(null!==(n=i.classList)&&void 0!==n?n:[]).sort()].join(".");if(e.length+r.length>99)return e||r;if(e=e?r+">"+e:r,i.id)break;t=i.parentNode}}catch(t){}return e},Uv=new WeakMap;function Wv(t,e){let n=Uv.get(e);return n||(n=new WeakMap,Uv.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let Gv=-1;const Vv=()=>Gv,Qv=t=>{addEventListener("pageshow",e=>{e.persisted&&(Gv=e.timeStamp,t(e))},!0)},Zv=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Jv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Yv=()=>{var t,e;return null!==(t=null===(e=jv())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Kv=-1;const Xv=new Set,tp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ep=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Xv)t();isFinite(Kv)||(Kv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ep,!0))}},np=(t=!1)=>{if(t&&(Kv=1/0),0>Kv){var e;const t=Yv(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Kv=null!=n?n:tp(),addEventListener("visibilitychange",ep,!0),addEventListener("prerenderingchange",ep,!0),Qv(()=>{setTimeout(()=>{Kv=tp()})})}return{get firstHiddenTime(){return Kv},onHidden(t){Xv.add(t)}}},ip=(t,e=-1,n,i=0,r,o,s)=>{const a=jv(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Vv()?a&&(document.prerendering||Yv()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},rp=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},op=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},sp=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},ap=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var lp=class{constructor(){this.u=void 0}};const up=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},cp=[1800,3e3],dp=(t,e={})=>{const n=op(e);up(()=>{const i=Wv(e,lp),r=np();let o,s=ip("FCP");const a=rp(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Yv(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=Zv(t,s,cp,e.reportAllChanges),Qv(n=>{s=ip("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Vv()),o=Zv(t,s,cp,e.reportAllChanges),Jv(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&rp(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&sp(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=ip("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=Zv(t,s,cp,e.reportAllChanges),o(!0)})},e)})},hp=[.1,.25],fp=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],vp=(t,e={})=>{const n=Wv(e=Object.assign({},e),qv),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=fp(t.sources),s=null==n?void 0:n.node;if(s){var r,o;const t=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,s))&&void 0!==r?r:Hv(s);i.set(n,t)}}},((t,e={})=>{const n=np();dp(ap(()=>{let i,r=ip("CLS",0);const o=Wv(e,qv),s=(n,s,a,l,u)=>{r=ip("CLS",0,n,s,a,l,u),o.o=0,i=Zv(t,r,hp,e.reportAllChanges)},a=(t=!1)=>{o.o>r.value&&(r.value=o.o,r.entries=o.i),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.l(e):l(e);a()},c=["layout-shift"];op(e)&&c.push("soft-navigation");const d=rp(c,u);d&&(i=Zv(t,r,hp,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Qv(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Vv()),Jv(i)}),setTimeout(i))}))})(e=>{t((t=>{let e={};if(t.entries.length){var n;const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null==r||null===(n=r.sources)||void 0===n?void 0:n.length){const t=fp(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:Bv(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},pp=(t,e={})=>{const n=Wv(e=Object.assign({},e),lp);op(e)&&(n.u=new Map),dp(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Bv(Vv())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=jv(),i=t.entries.at(-1);if(n){const r=Math.max(0,n.responseStart-(n.activationStart||0));e={timeToFirstByte:r,firstByteToFCP:t.value-r,loadState:Bv(t.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}}else{var i;const r=null===(i=n.u)||void 0===i?void 0:i.get(t.navigationId);r&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:r})}return Object.assign(t,{attribution:e})})(e))},e)};let mp=0,gp=1/0,yp=0;const bp=t=>{for(const e of t)e.interactionId&&(gp=Math.min(gp,e.interactionId),yp=Math.max(yp,e.interactionId),mp=yp?(yp-gp)/7+1:0)};let wp;const kp=()=>{var t;return wp?mp:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Sp=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return kp()-this.h}D(){this.h=kp(),this.v.length=0,this.p.clear()}S(t){const e=this.T(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{k:8,id:-1,entries:[]}}l(t){var e;if(null===(e=this.m)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>n.k){var r;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],k:t.duration},this.p.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.p.delete(e.id)}null===(r=this.M)||void 0===r||r.call(this,i)}}};const _p=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=ap(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},xp=[200,500],Cp=(t,e={})=>{const n=Wv(e=Object.assign({},e),Sp);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(_p(c),l=!0)},c=()=>{const t=new Set(n.v.map(t=>s.get(t.entries[0]))),e=r.length-10;r=r.filter((n,i)=>i>=e||t.has(n));const a=new Set;for(const t of r){const e=d(t.startTime,t.processingEnd);for(const t of e)a.add(t)}i=i.filter(t=>t.startTime>o||a.has(t)),l=!1};n.m=t=>{const n=t.startTime+t.duration;let i;o=Math.max(o,t.processingEnd);for(let o=r.length-1;o>=0;o--){const s=r[o];if(8>=Math.abs(n-s.renderTime)){i=s,i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:e.includeProcessedEventEntries?[t]:[]},r.push(i)),t.interactionId&&s.set(t,i),u()},n.M=t=>{if(!a.get(t)){var n;const s=null===(n=t.entries.find(t=>t.target))||void 0===n?void 0:n.target;if(s){var i,r;const n=null!==(i=null===(r=e.generateTarget)||void 0===r?void 0:r.call(e,s))&&void 0!==i?i:Hv(s);a.set(t,n)}else{var o;const e=null===(o=t.entries.find(t=>t.targetSelector))||void 0===o?void 0:o.targetSelector;e&&a.set(t,e)}}};const d=(t,e)=>{const n=[];for(const r of i)if(r.startTime+r.duration>=t){if(r.startTime>e)break;n.push(r)}return n};rp(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=np();up(()=>{var i;"interactionCount"in performance||wp||(wp=rp(["event"],bp,{durationThreshold:0}));let r,o=ip("INP");const s=Wv(e,Sp),a=(n,i,a,l,u)=>{s.D(),o=ip("INP",-1,n,i,a,l,u),r=Zv(t,o,xp,e.reportAllChanges)},l=()=>{const t=s.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{_p(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];op(e)&&d.push("soft-navigation");const h=rp(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=Zv(t,o,xp,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Qv(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Vv())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Bv(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}const e=t.entries[0],i=s.get(e),r=Math.max(i.processingStart,e.startTime),o=Math.max(e.startTime+e.duration,r),l=Math.min(i.processingEnd,o),u=i.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(e.startTime,l),h=n.p.get(e.interactionId),f={interactionTarget:a.get(h),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:o,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-e.startTime,processingDuration:l-r,presentationDelay:o-l,loadState:Bv(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{var e;const n=t.interactionTime,i=t.nextPaintTime;if(!(null===(e=t.longAnimationFrameEntries)||void 0===e?void 0:e.length)||!n||!i)return;const r=t.inputDelay,o=t.processingDuration;let s,a,l=0,u=0,c=0,d=0;for(const e of t.longAnimationFrameEntries){u=u+e.startTime+e.duration-e.styleAndLayoutStart;for(const t of e.scripts){const e=t.startTime+t.duration;if(n>e)continue;const i=e-Math.max(n,t.startTime),c=t.duration?i/t.duration*t.forcedStyleAndLayoutDuration:0;l+=i-c,u+=c,i>d&&(a=n+r>t.startTime?"input-delay":n+r+o>t.startTime?"processing-duration":"presentation-delay",s=t,d=i)}}const h=t.longAnimationFrameEntries.at(-1),f=h?h.startTime+h.duration:0;f>=n+r+o&&(c=i-f),s&&a&&(t.longestScript={entry:s,subpart:a,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=c,t.totalUnattributedDuration=i-n-l-u-c})(f),Object.assign(t,{attribution:f})})(e))},e)};var Tp=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null===(e=this.m)||void 0===e||e.call(this,t)}};const $=[2500,4e3];let Ip=50;const Mp=[];rp(["resource"],t=>{for(const e of t)Mp.push(e),Mp.length>Ip&&Mp.shift()});const Ap=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Ip=e.resourceBufferSize);const n=Wv(e,Tp),i=new WeakMap;op(e)&&(n.u=new Map),n.m=t=>{const n=t.element;if(n){var r,o;const s=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,n))&&void 0!==r?r:Hv(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=op(e);up(()=>{let r,o=np(),s=ip("LCP");const a=Wv(e,Tp),l=(i,a,l,u,c)=>{s=ip("LCP",-1,i,a,l,u,c),r=Zv(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=np(!0))},u=t=>{var e;a.u&&t.navigationId&&sp(a.u,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-Yv(),0),a.l(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.l(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=rp(d,c);if(h){r=Zv(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;_p(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});Qv(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Vv()),r=Zv(t,s,$,e.reportAllChanges),Jv(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})})(e=>{t((t=>{let e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r,o,s;const a=t.entries.at(-1),l=a.url&&(Mp.findLast(t=>t.name===a.url)||performance.getEntriesByType("resource").findLast(t=>t.name===a.url));let u;e.target=i.get(a),e.lcpEntry=a,a.url&&(e.url=a.url),l&&(e.lcpResourceEntry=l);let c=0,d=0;if("soft-navigation"!==t.navigationType?(u=jv(),c=null!==(r=null==u?void 0:u.activationStart)&&void 0!==r?r:0,d=null!==(o=null==u?void 0:u.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,u=null===(s=n.u)||void 0===s?void 0:s.get(t.navigationId)),u){const n=Math.max(0,d-c),i=Math.max(n,l?(l.requestStart||l.startTime)-c:0),r=Math.min(t.value,Math.max(i,l?l.responseEnd-c:0));e=L(L({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Rp=-1;const Ep=()=>Rp,Op=t=>{addEventListener("pageshow",e=>{e.persisted&&(Rp=e.timeStamp,t(e))},!0)},$p=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Lp=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Dp=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Pp=()=>{var t,e;return null!==(t=null===(e=Dp())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Fp=-1;const Np=new Set,qp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,jp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Np)t();isFinite(Fp)||(Fp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",jp,!0))}},Bp=(t=!1)=>{if(t&&(Fp=1/0),0>Fp){var e;const t=Pp(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Fp=null!=n?n:qp(),addEventListener("visibilitychange",jp,!0),addEventListener("prerenderingchange",jp,!0),Op(()=>{setTimeout(()=>{Fp=qp()})})}return{get firstHiddenTime(){return Fp},onHidden(t){Np.add(t)}}},zp=(t,e=-1,n,i=0,r,o,s)=>{const a=Dp(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Ep()?a&&(document.prerendering||Pp()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},Hp=new WeakMap;function Up(t,e){let n=Hp.get(e);return n||(n=new WeakMap,Hp.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var Wp=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(t.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Gp=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},Vp=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Qp=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},Zp=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Jp=class{constructor(){this.l=void 0}};const Yp=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Kp=[1800,3e3],Xp=(t,e={})=>{const n=Vp(e);Yp(()=>{const i=Up(e,Jp),r=Bp();let o,s=zp("FCP");const a=Gp(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Pp(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=$p(t,s,Kp,e.reportAllChanges),Op(n=>{s=zp("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Ep()),o=$p(t,s,Kp,e.reportAllChanges),Lp(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Gp(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&Qp(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=zp("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=$p(t,s,Kp,e.reportAllChanges),o(!0)})},e)})},tm=[.1,.25],em=(t,e={})=>{const n=Bp();Xp(Zp(()=>{let i,r=zp("CLS",0);const o=Up(e,Wp),s=(n,s,a,l,u)=>{r=zp("CLS",0,n,s,a,l,u),o.i=0,i=$p(t,r,tm,e.reportAllChanges)},a=(t=!1)=>{o.i>r.value&&(r.value=o.i,r.entries=o.o),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.h(e):l(e);a()},c=["layout-shift"];Vp(e)&&c.push("soft-navigation");const d=Gp(c,u);d&&(i=$p(t,r,tm,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Op(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Ep()),Lp(i)}),setTimeout(i))}))};let nm=0,im=1/0,rm=0;const om=t=>{for(const e of t)e.interactionId&&(im=Math.min(im,e.interactionId),rm=Math.max(rm,e.interactionId),nm=rm?(rm-im)/7+1:0)};let sm;const am=()=>{var t;return sm?nm:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var lm=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return am()-this.u}M(){this.u=am(),this.v.length=0,this.m.clear()}L(t){const e=this._(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{P:8,id:-1,entries:[]}}h(t){var e;if(null===(e=this.p)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>n.P){var r;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.m.delete(e.id)}null===(r=this.T)||void 0===r||r.call(this,i)}}};const um=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=Zp(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},cm=[200,500],dm=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Bp();Yp(()=>{var i;"interactionCount"in performance||sm||(sm=Gp(["event"],om,{durationThreshold:0}));let r,o=zp("INP");const s=Up(e,lm),a=(n,i,a,l,u)=>{s.M(),o=zp("INP",-1,n,i,a,l,u),r=$p(t,o,cm,e.reportAllChanges)},l=()=>{const t=s.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{um(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Vp(e)&&d.push("soft-navigation");const h=Gp(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=$p(t,o,cm,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Op(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ep())}))})};var hm=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null===(e=this.p)||void 0===e||e.call(this,t)}};const fm=[2500,4e3],vm=(t,e={})=>{let n=!1;const i=Vp(e);Yp(()=>{let r,o=Bp(),s=zp("LCP");const a=Up(e,hm),l=(i,a,l,u,c)=>{s=zp("LCP",-1,i,a,l,u,c),r=$p(t,s,fm,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Bp(!0))},u=t=>{var e;a.l&&t.navigationId&&Qp(a.l,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-Pp(),0),a.h(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.h(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=Gp(d,c);if(h){r=$p(t,s,fm,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;um(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});Op(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Ep()),r=$p(t,s,fm,e.reportAllChanges),Lp(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},pm={onLCP:Ap,onCLS:vp,onFCP:pp,onINP:Cp,withoutAttribution:{onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=pm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=pm,o.postHogWebVitalsCallbacks=pm;const mm={onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=mm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=mm,o.postHogWebVitalsCallbacks=mm,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>mm;const gm={onLCP:Ap,onCLS:vp,onFCP:pp,onINP:Cp,withoutAttribution:{onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=gm,o.__PosthogExtensions__.postHogWebVitalsCallbacks=gm,o.postHogWebVitalsCallbacks=gm;const ym={onLCP:vm,onCLS:em,onFCP:Xp,onINP:dm};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=ym,o.__PosthogExtensions__.postHogWebVitalsCallbacks=ym,o.postHogWebVitalsCallbacks=ym,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ym;const bm={};function wm(t,e){const n=Te(t);return n?L({node:n,originalEvent:t,timestamp:Date.now()},e):null}function km(t){return!!_t(()=>we(t))}function Sm(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function _m(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const xm="canvas,video,audio,embed,object";function Cm(t,e){return Y(t)&&t>=e}function Tm(t,e=1e3){return t>=0&&e>t?t:void 0}function Im(t,e,n=1e3){return Y(e)?Tm(t-e,n):void 0}var Mm=class{wr(t){var e,n,i,r,o,s,a,l;const u=this.kr((null==t?void 0:t.__onCapture)||this.Sr.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==t?void 0:t.mutation_threshold_ms)&&void 0!==r?r:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(s=null==t?void 0:t.capture_dead_swipes)&&void 0!==s?s:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this._r=new WeakSet,this.Cr=!1,this.Tr=[],this.Ir=0,this.kr=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.Mr=()=>{clearTimeout(this.Ar),this.Ar=void 0,this.Rr=void 0},this.Er=t=>{if(this.Or(t),this.Mr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==n?void 0:n.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.$r(i,e),this.Rr=e}},this.Lr=t=>{Z(t.relatedTarget)&&this.Mr()},this.Dr=t=>{const e=this.Rr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(km(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.Ar=o.setTimeout(this.Mr,0)},this.Pr=t=>{this.Or(t);const e=t,n=wm(e,{type:"click"}),i=this.Rr;n&&i&&0===e.button&&e.detail>0&&e.detail===i.clickDetail&&t.isTrusted===i.trusted&&n.node===i.clickTarget&&(n.selectionChangedDuringGesture=i.selectionChanged&&this.Fr.selection_change_threshold_ms>0,this.Mr()),Z(n)||this.Nr(n)||this.qr(n),this.jr()},this.Br=()=>{const t=Date.now();this.zr=t,t%50==0&&this.Tr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Hr=t=>{var e,i;const r=null==n?void 0:n.getSelection(),o=this.Cr;this.Cr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(we(s)?s:s.parentElement),l=null==n?void 0:n.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=Oe(Te(t))||Oe(null!=a?a:null)||Oe(null!==(i=u)&&void 0!==i?i:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.Cr||c||d))return;const h=Date.now();this.Ur=h;const f=this.Rr;if(f&&(o||this.Cr||c)){const e=Te(t);let n;if(Oe(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;Oe(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.Wr(n,f):r&&(s||r.anchorNode)?this.$r(r,f):o&&!this.Cr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.Tr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.an=()=>{"hidden"===(null==n?void 0:n.visibilityState)&&this.Mr();const t=Date.now();this.Gr=t,this.Vr("visibilityChangedDelayMs",t)},this.Qr=()=>{const t=Date.now();this.Zr=t,this.Vr("focusChangedDelayMs",t)},this.Jr=t=>{this.Or(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.Yr=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.Kr=()=>{this.Yr=void 0},this.Xr=t=>{var e;const i=this.Yr;if(this.Yr=void 0,G(i)||this.Ir>=this.Fr.max_dead_swipes_per_page_load)return;const r=t,o=null===(e=r.changedTouches)||void 0===e?void 0:e[0];if(!o)return;const s=o.clientX-i.x,a=o.clientY-i.y,l=s*s+a*a,u=this.Fr.swipe_threshold_px;if(u*u>l)return;if([this.zr,this.eo,this.Ur].some(t=>Y(t)&&t>=i.timestamp))return;var c,d;if(this.no()&&(null!==(c=null==n||null===(d=n.elementsFromPoint)||void 0===d?void 0:d.call(n,i.x,i.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,xm)}))return;const h=wm(r,{type:"swipe",swipeDirection:Sm(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});Z(h)||this.Nr(h)||this.qr(h),this.jr()},this.Fr=this.wr(e),this._onCapture=this.Fr.__onCapture}start(t){this.io(),this.ro(),this.oo(),this.so(),this.ao(),this.lo(t),this.Fr.capture_dead_swipes&&this.uo()}lo(e){if(!this.co){const n=function(e){return function(e,n){const i=bm[e];if(i)return i;let r=n[e];if((t=>U(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return bm[e]=r.bind(n);const o=n.document;if(o&&U(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const u=t.contentWindow;var s,a;u&&u[e]&&(r=u[e],"MutationObserver"===e&&N(l=null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"","AppleWebKit")&&!N(l,"Chrome")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){ue.warn(`Could not create sandbox iframe for ${e} check, bailing to assignableWindow.${e}: `,t)}finally{!i&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}}var l;return r&&U(r)?bm[e]=r.bind(n):r}("MutationObserver",e)}(o);this.co=new n(t=>{this.do(t)}),this.ho(e)}}ho(t){t&&this.co&&(this._r.has(t)||(this.co.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this._r.add(t),this.fo(t)))}fo(t,e){var n,i;we(t)&&t.shadowRoot&&this.ho(t.shadowRoot);const r=null!==(n=null===(i=t.querySelectorAll)||void 0===i?void 0:i.call(t,"*"))&&void 0!==n?n:[];for(let t=0;r.length>t;t++)null==e||e.add(r[t]),this.ho(r[t].shadowRoot)}Or(t){var e,n;const i=null!==(e=null===(n=t.composedPath)||void 0===n?void 0:n.call(t))&&void 0!==e?e:[];for(let t=0;i.length>t;t++){const e=i[t];km(e)&&this.ho(e.shadowRoot)}}stop(){var t;null===(t=this.co)||void 0===t||t.disconnect(),this.co=void 0,this._r=new WeakSet,o.removeEventListener("click",this.Pr,{capture:!0}),o.removeEventListener("mousedown",this.Er,{capture:!0}),o.removeEventListener("mouseup",this.Dr,{capture:!0}),o.removeEventListener("mouseout",this.Lr,{capture:!0}),o.removeEventListener("dragstart",this.Mr,{capture:!0}),o.removeEventListener("pointercancel",this.Mr,{capture:!0}),o.removeEventListener("blur",this.Mr),this.Mr(),o.removeEventListener("scroll",this.Br,{capture:!0}),null==n||n.removeEventListener("selectionchange",this.Hr),o.removeEventListener("touchstart",this.Jr,{capture:!0}),o.removeEventListener("touchend",this.Xr,{capture:!0}),o.removeEventListener("touchcancel",this.Kr,{capture:!0}),null==n||n.removeEventListener("visibilitychange",this.an),o.removeEventListener("blur",this.Qr),o.removeEventListener("focus",this.Qr),this.Yr=void 0}do(t){const e=new Set;for(const i of t)try{var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.eo=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];km(i)&&!e.has(i)&&this.fo(i,e)}}catch(t){}}io(){ve(o,"click",this.Pr,{capture:!0}),ve(o,"mousedown",this.Er,{capture:!0}),ve(o,"mouseup",this.Dr,{capture:!0}),ve(o,"mouseout",this.Lr,{capture:!0}),ve(o,"dragstart",this.Mr,{capture:!0}),ve(o,"pointercancel",this.Mr,{capture:!0}),ve(o,"blur",this.Mr)}qr(t){t.selectionChangedDelayMs=Im(t.timestamp,this.Ur,this.Fr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Im(t.timestamp,this.Gr),t.focusChangedDelayMs=Im(t.timestamp,this.Zr),this.Tr.push(t)}jr(){this.Tr.length&&G(this.vo)&&(this.vo=o.setTimeout(()=>{this.po()},1e3))}ro(){ve(o,"scroll",this.Br,{capture:!0})}oo(){var t;this.Cr="Range"===(null==n||null===(t=n.getSelection())||void 0===t?void 0:t.type),ve(n,"selectionchange",this.Hr)}Wr(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||we(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}$r(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&_t(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&we(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=we(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.Wr(t,e)}return this.Wr(t.focusNode,e)||this.Wr(t.anchorNode,e)}so(){ve(n,"visibilitychange",this.an)}ao(){ve(o,"blur",this.Qr),ve(o,"focus",this.Qr)}Vr(t,e){this.Tr.forEach(n=>{const i=Tm(e-n.timestamp);Y(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}uo(){ve(o,"touchstart",this.Jr,{capture:!0,passive:!0}),ve(o,"touchend",this.Xr,{capture:!0,passive:!0}),ve(o,"touchcancel",this.Kr,{capture:!0,passive:!0})}no(){const t=G(this.mo)||Y(this.eo)&&this.eo>this.mo;return(G(this.yo)||t)&&(this.mo=Date.now(),this.yo=!!(null==n?void 0:n.querySelector(xm))),!!this.yo}Nr(t){return!t||("swipe"===t.type?this.bo(t):this.wo(t))}bo(t){return!((!((e=t.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==e.id&&!(null===(n=e.closest)||void 0===n?void 0:n.call(e,".toolbar-global-fade-container")))&&!this.Tr.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!ke(t.node,"html")&&we(t.node)&&function(t,e){var n;if(!(typeof window>"u"?void 0:window)||$e(t))return!1;const i=K(e)?Re:null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Re,{targetElementList:r}=Le(t,!1);return!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Me(n,t)))return!0;return!1}(r,i)}(t.node,{css_selector_ignorelist:this.Fr.css_selector_ignorelist}));var e,n}wo(t){return!(this.Fr.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.bo(t)||function(t){if(!(typeof window>"u"?void 0:window)||$e(t))return!1;const{targetElementList:e}=Le(t,!1);return e.some(t=>ke(t,"a"))}(t.node);var e}po(){if(!this.Tr.length)return;clearTimeout(this.vo),this.vo=void 0;const t=this.Tr;this.Tr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.eo&&this.eo>=n.timestamp?this.eo-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Cm(n.scrollDelayMs,this.Fr.scroll_threshold_ms),i=Cm(n.selectionChangedDelayMs,this.Fr.selection_change_threshold_ms),r=Cm(n.mutationDelayMs,this.Fr.mutation_threshold_ms),o=Cm(n.absoluteDelayMs,1.1*this.Fr.mutation_threshold_ms),s=Y(n.scrollDelayMs)&&this.Fr.scroll_threshold_ms>n.scrollDelayMs,a=Y(n.mutationDelayMs)&&this.Fr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||Y(n.selectionChangedDelayMs)&&this.Fr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=Y(n.visibilityChangedDelayMs),c=Y(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=_m(n);if("$dead_swipe"===e){if(this.Ir>=this.Fr.max_dead_swipes_per_page_load)continue;this.Ir++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.eo,[`${e}_event_timestamp`]:n.timestamp,[`${e}_scroll_timeout`]:t,[`${e}_mutation_timeout`]:r,[`${e}_absolute_timeout`]:o,[`${e}_selection_changed_timeout`]:i,[`${e}_visibility_changed_timeout`]:!1})}else this.Fr.mutation_threshold_ms>n.absoluteDelayMs&&this.Tr.push(n)}this.jr()}Sr(t,e){const n=_m(t);this.instance.capture(n,L(L(L({},e),Jf(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Fr.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props),{},{[`${n}_scroll_delay_ms`]:t.scrollDelayMs,[`${n}_mutation_delay_ms`]:t.mutationDelayMs,[`${n}_absolute_delay_ms`]:t.absoluteDelayMs,[`${n}_selection_changed_delay_ms`]:t.selectionChangedDelayMs,[`${n}_visibility_changed_delay_ms`]:t.visibilityChangedDelayMs,[`${n}_focus_changed_delay_ms`]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Mm(t,e)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map