posthog-js 1.434.6 → 1.434.7

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 (38) 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.full.js +1 -1
  11. package/dist/customizations.js +1 -1
  12. package/dist/default-extensions.js +1 -1
  13. package/dist/extension-bundles.js +1 -1
  14. package/dist/lazy-recorder.js +1 -1
  15. package/dist/lazy-recorder.js.map +1 -1
  16. package/dist/main.js +1 -1
  17. package/dist/module.full.cjs +1 -1
  18. package/dist/module.full.js +1 -1
  19. package/dist/module.full.js.map +1 -1
  20. package/dist/module.full.no-external.cjs +1 -1
  21. package/dist/module.full.no-external.js +1 -1
  22. package/dist/module.full.no-external.js.map +1 -1
  23. package/dist/module.js +1 -1
  24. package/dist/module.mjs +1 -1
  25. package/dist/module.no-external.cjs +1 -1
  26. package/dist/module.no-external.js +1 -1
  27. package/dist/module.slim.js +1 -1
  28. package/dist/module.slim.no-external.js +1 -1
  29. package/dist/posthog-recorder.js +1 -1
  30. package/dist/posthog-recorder.js.map +1 -1
  31. package/dist/recorder-v2.js +1 -1
  32. package/dist/recorder-v2.js.map +1 -1
  33. package/dist/recorder.js +1 -1
  34. package/dist/recorder.js.map +1 -1
  35. package/lib/package.json +1 -1
  36. package/lib/src/extensions/replay/external/network-plugin.js +40 -14
  37. package/lib/src/extensions/replay/external/network-plugin.js.map +1 -1
  38. package/package.json +3 -3
@@ -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.navigator,i=null==e?void 0:e.document,r=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const o=null==n?void 0:n.userAgent,s="undefined"!=typeof globalThis?globalThis:t;s&&"undefined"==typeof self&&(s.self=s),s&&"undefined"==typeof File&&(s.File=function(){});const a=null!=t?t:{},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="$stored_person_properties",b="$surveys",w="$sdk_debug_replay_event_trigger_status",k="$sdk_debug_replay_linked_flag_trigger_status",_="$sdk_debug_replay_matched_recording_trigger_groups",S="$sdk_debug_replay_pending_trigger_conditions",x="$sdk_debug_replay_remote_trigger_matching_config",C="$sdk_debug_replay_trigger_groups_count",M="$sdk_debug_replay_url_trigger_status",I="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",R="$session_recording_start_reason";function E(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){E(o,i,r,s,a,"next",t)}function a(t){E(o,i,r,s,a,"throw",t)}s(void 0)})}}function O(t){return O="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},O(t)}function L(t,e,n){return(e=function(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P(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 D(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach(function(e){L(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F="min_length",N="max_length";function q(t,e){return-1!==t.indexOf(e)}const j=function(t){return t.trim()},B=Object.prototype,H=B.hasOwnProperty,z=B.toString,U=Array.isArray||function(t){return"[object Array]"===z.call(t)},W=t=>"function"==typeof t,V=t=>t===Object(t)&&!U(t),Z=t=>void 0===t,G=t=>"[object String]"==z.call(t),Q=t=>G(t)&&0===t.trim().length,J=t=>null===t,K=t=>Z(t)||J(t),X=t=>"[object Number]"==z.call(t)&&t==t,Y=t=>"[object Boolean]"===z.call(t),tt=t=>t instanceof FormData;function et(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)===`[object ${e}]`}function it(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 ot(t,Error)}}function rt(t){return"u">typeof Event&&ot(t,Event)}function ot(t,e){try{return t instanceof e}catch(t){return!1}}function st(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),X(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),st(null!=r?r:n,e,n,i))}var at=class{constructor(t){this.C={},this.I=t.I,this.R=st(t.bucketSize,0,100,t.$),this.A=st(t.refillRate,0,this.R,t.$),this.O=st(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}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.R,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 lt="Mobile",ut="Tablet",ct="Android Tablet",dt="iPad",ht="Apple Watch",ft="Nintendo",vt="PlayStation",pt="Xbox",mt="Nokia",gt="Ouya",yt="Generic "+lt.toLowerCase(),bt="Generic "+ut.toLowerCase(),wt=new RegExp(pt,"i"),kt=new RegExp("PlayStation \\w+","i"),_t=new RegExp("Nintendo \\w+","i"),St=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(ft,"i"),new RegExp(vt,"i"),new RegExp("Windows","i");function xt(t){return t?t.split("#")[0]:t}let Ct,Mt,It;function Tt(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return It&&n.length===Mt||(Mt=n.length,It=n.reduce((n,i)=>{Ct||(Ct={});const r=Ct[i];if(r)n[r[0]]=r[1];else{const r=t(i);for(let t=r.length-1;t>=0;t--){const o=r[t],s=null==o?void 0:o.filename,a=e[i];if(s&&a){n[s]=a,Ct[i]=[s,a];break}}}return n},{})),It}const Rt=/^([a-z][a-z0-9.+-]+):/i,$t=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Et(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||$t.includes(e[1].toLowerCase())}function At(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Et(e)};return Z(i)||(o.lineno=i),Z(r)||(o.colno=r),o}const Ot=(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]},Lt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ft=(t,e)=>{const n=Lt.exec(t);if(n){const[,t,i,r]=n;return At(e,t,"?",+i,+r)}const i=Pt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Dt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Ot(i[1]||"?",i[2]);return At(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jt=(t,e)=>{const n=Nt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=qt.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]=Ot(i,t),At(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Bt=/\(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 zt(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 Ut(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Wt(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 Zt(t,e){const n=e[0];let i=t.length-(n?Wt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Gt(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 Qt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Jt=["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 Yt;const te=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}`)},ee=(ne=A(function*(t,e){18>t.size&&te("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])&&te("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(Yt)return Yt;Yt=[];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;Yt[t]=e>>>0}return Yt})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&te("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&te("invalid-size")}),function(t,e){return ne.apply(this,arguments)});var ne;function ie(){return ie=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 ee(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}),ie.apply(this,arguments)}function re(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const oe="0.9.0",se={DEBUG:!1,LIB_VERSION:oe,LIB_NAME:"browser-common",JS_SDK_VERSION:oe},ae=(e,{debugEnabled:n}={})=>{const i={N(i,...r){t&&(se.DEBUG||t.POSTHOG_DEBUG||n)&&!Z(t.console)&&t.console&&("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i])(e,...r)},debug(...t){i.N("debug",...t)},info(...t){i.N("log",...t)},warn(...t){i.N("warn",...t)},error(...t){i.N("error",...t)},critical(...t){console.error(e,...t)},uninitializedWarning(t){i.error(`You must initialize PostHog before calling ${t}`)},createLogger:(t,n)=>ae(`${e} ${t}`,n)};return i},le=ae("[PostHog.js]"),ue=le.createLogger;function ce(t,e){if(!K(t))if(U(t))t.forEach(e);else if(tt(t))t.forEach((t,n)=>e(t,n));else for(const n in t)H.call(t,n)&&e(t[n],n)}const de=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function he(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 fe(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 ve=["localhost","127.0.0.1"],pe=t=>{const e=null==i?void 0:i.createElement("a");return Z(e)?null:(e.href=t,e)};function me(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.href;return Z(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(!W(i))return e;try{const t=i(e);return G(t)&&t?t:e}catch(t){return le.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}function ge(t){return!!t&&1===t.nodeType}function ye(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function be(t){return!!t&&11===t.nodeType&&ge(t.host)}function we(t){return t?j(t).split(/\s+/):[]}function ke(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 we(e)}function _e(t){let e="";return Ae(t)&&!Oe(t)&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return K(t)?null:j(t).split(/(\s+)/).filter(t=>Be(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),j(e)}function Se(t){var e;return Z(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const xe=["a","button","form","input","select","textarea","label"];function Ce(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 Me(t){const e=t.parentNode;return!(!e||!ge(e))&&e}const Ie=[".ph-no-deadclick",".ph-no-capture"];const Te=["","text","search","email","password","url","tel","number"];function Re(t){return!(!t||!ge(t))&&(!!ye(t,"textarea")||(ye(t,"input")?q(Te,(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||ye(t,"html")||!ge(t),Ee=(e,n)=>{if(!t||$e(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[e];let o=e;for(;o.parentNode&&!ye(o,"body");){if(be(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const e=Me(o);if(!e)break;if(n||xe.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{const n=t.getComputedStyle(e);n&&"pointer"===n.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(e),o=e}return{parentIsUsefulElement:i,targetElementList:r}};function Ae(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ye(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=ke(i);if(q(t,"ph-sensitive")||q(t,"ph-no-capture"))return!1}if(q(ke(t),"ph-include"))return!0;const i=t.type||"";if(G(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!G(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 Oe(t){return!!(ye(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ye(t,"select")||ye(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Le=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}))$"),Pe=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,De=[16,15,14,13],Fe=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ne=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),qe=/[0-9A-Za-z_]/;function je(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 Be(t,e=!0){if(K(t))return!1;if(G(t)){if(t=j(t),e?Le.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Pe.lastIndex=0;e=Pe.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 De){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Le.test(e)&&je(e))return!0}}}return!1}(t))return!1;if(e?Fe.test(t):function(t){let e;for(Ne.lastIndex=0;e=Ne.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&qe.test(t)&&qe.test(n)))return!0}return!1}(t))return!1}return!0}function He(t){let e=_e(t);return e=`${e} ${ze(t)}`.trim(),Be(e)?e:""}function ze(t){let e="";return t&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=_e(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${ze(t)}`.trim())}catch(t){le.error("[AutoCapture]",t)}}),e}function Ue(t){return t.replace(/"|\\"/g,'\\"')}function We(t){const e=t.attr__class;if(e)return U(e)?e:we(e)}const Ve=1e6;function Ze(t){var e;return Math.min(Ve,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ve)}const Ge={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:Ve,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},Qe=["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"],Je=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ke=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Xe=t=>{K(t)||ce(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Qe.includes(e)||Ke.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Ye=["/s/","/e/","/i/"];function tn(t,e,n,i){if(K(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return G(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function en(t,e){if(K(t))return t;let n=t;return Be(n,!1)||(n="[SessionRecording] "+e+" body redacted"),ce(Je,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 nn=new WeakSet,rn="disabled",on="sampled",sn="active",an="buffering",ln="paused",un="rrweb_error",cn="trigger_activated",dn="trigger_pending",hn="trigger_disabled";function fn(t,e,n,i,r,o){return 0===e?hn:(null==t?void 0:t.get_property(n?i+n:r))===o?cn:dn}function vn(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 pn(t){return t.includes("trigger_activated")?cn:t.includes("trigger_pending")?dn:hn}function mn(t){const e=new Set(t);switch(e.delete(hn),e.size){case 0:return hn;case 1:return Array.from(e)[0];default:return dn}}var gn=class{constructor(t){this.q=t}triggerStatus(t){return pn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return pn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},yn=class{constructor(t){this.q=t}triggerStatus(t){return mn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return mn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},bn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return cn}stop(){}};const wn=t=>"sessionRecording"in t;var kn=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(wn(t)?V(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(wn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.H.clear(),this.U.clear();for(const t of this.j)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){le.error("Invalid URL trigger regex pattern:",t.url,e)}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){le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}G(t){return fn(this._instance,this.j.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[M]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){const t=me(this._instance);if(!t)return!1;try{return vn(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=me(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=vn(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=me(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const o=this.urlBlocked,s=vn(r,this.B,this.U);s&&!o?t():!s&&o&&e();const a=this.G(i)===cn,l=vn(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},_n=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[k]:t}),t}triggerStatusNoSideEffects(){let t=dn;return K(this.linkedFlag)&&(t=hn),this.linkedFlagSeen&&(t=cn),t}onConfig(t,e){var n;if(this.linkedFlag=(wn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!K(this.linkedFlag)&&!this.linkedFlagSeen){const t=G(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=G(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(V(r)&&t in r){const e=r[t];o=Y(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.J()}},Sn=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(wn(t)?V(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 fn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[w]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===cn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},xn=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new kn(t,e.id),this.tt=new Sn(t,e.id),this.et=new _n(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.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new gn(r):new yn(r)}else this.nt=new bn}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===dn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.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.Y.stop(),this.tt.stop(),this.et.stop()}};function Cn(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=!0===t.isSampled,n=new gn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?on:"trigger_activated"===n?sn:"trigger_pending"===n?an:!1===t.isSampled?rn:sn}function Mn(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=new yn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==hn,i=Y(t.isSampled);return n&&"trigger_pending"===e?an:n&&"trigger_disabled"===e||i&&!t.isSampled?rn:!0===t.isSampled?on:sn}function In(){const t=[];return function(e,n){if(V(n)||U(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function Tn(t){try{const e=JSON.stringify(t,In());return e?new Blob([e]).size:0}catch(t){return-1}}function Rn(t){if(J(t))return 4;if(Z(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(U(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=Z(i)||J(i)?4:Rn(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];Z(r)||(i||(n+=1),i=!1,n+=t.length+3+Rn(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 En=Uint8Array,An=Uint16Array,On=Uint32Array,Ln=new En([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]),Pn=new En([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]),Dn=new En([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fn=function(t,e){for(var n=new An(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new On(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]},Nn=Fn(Ln,2),qn=Nn[1];Nn[0][28]=258,qn[258]=28;for(var jn=Fn(Pn,0)[1],Bn=new An(32768),Hn=0;32768>Hn;++Hn){var zn=(43690&Hn)>>>1|(21845&Hn)<<1;Bn[Hn]=((65280&(zn=(61680&(zn=(52428&zn)>>>2|(13107&zn)<<2))>>>4|(3855&zn)<<4))>>>8|(255&zn)<<8)>>>1}var Un=function(t,e,n){for(var i=t.length,r=0,o=new An(e);i>r;++r)++o[t[r]-1];var s,a=new An(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new An(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[Bn[d]>>>l]=u}else for(s=new An(i),r=0;i>r;++r)s[r]=Bn[a[t[r]-1]++]>>>15-t[r];return s},Wn=new En(288);for(Hn=0;144>Hn;++Hn)Wn[Hn]=8;for(Hn=144;256>Hn;++Hn)Wn[Hn]=9;for(Hn=256;280>Hn;++Hn)Wn[Hn]=7;for(Hn=280;288>Hn;++Hn)Wn[Hn]=8;var Vn=new En(32);for(Hn=0;32>Hn;++Hn)Vn[Hn]=5;var Zn=Un(Wn,9,0),Gn=Un(Vn,5,0),Qn=function(t){return(t/8|0)+(7&t&&1)},Jn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof An?An:t instanceof On?On:En)(n-e);return i.set(t.subarray(e,n)),i},Kn=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Xn=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Yn=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 En(0),0];if(1==r){var s=new En(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 An(h+1),v=ti(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 En(f),v]},ti=function(t,e,n){return-1==t.s?Math.max(ti(t.l,e,n+1),ti(t.r,e,n+1)):e[t.s]=n},ei=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new An(++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]},ni=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},ii=function(t,e,n){var i=n.length,r=Qn(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)},ri=function(t,e,n,i,r,o,s,a,l,u,c){Kn(e,c++,n),++r[256];for(var d=Yn(r,15),h=d[0],f=d[1],v=Yn(o,15),p=v[0],m=v[1],g=ei(h),y=g[0],b=g[1],w=ei(p),k=w[0],_=w[1],S=new An(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=Yn(S,7),M=C[0],I=C[1],T=19;T>4&&!M[Dn[T-1]];--T);var R,E,A,O,L=u+5<<3,P=ni(r,Wn)+ni(o,Vn)+s,D=ni(r,h)+ni(o,p)+s+14+3*T+ni(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=L&&D>=L)return ii(e,c,t.subarray(l,l+u));if(Kn(e,c,1+(P>D)),c+=2,P>D){R=Un(h,f,0),E=h,A=Un(p,m,0),O=p;var F=Un(M,I,0);for(Kn(e,c,b-257),Kn(e,c+5,_-1),Kn(e,c+10,T-4),c+=14,x=0;T>x;++x)Kn(e,c+3*x,M[Dn[x]]);c+=3*T;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Kn(e,c,F[B=31&j[x]]),c+=M[B],B>15&&(Kn(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else R=Zn,E=Wn,A=Gn,O=Vn;for(x=0;a>x;++x)if(i[x]>255){var B;Xn(e,c,R[257+(B=i[x]>>>18&31)]),c+=E[B+257],B>7&&(Kn(e,c,i[x]>>>23&31),c+=Ln[B]);var H=31&i[x];Xn(e,c,A[H]),c+=O[H],H>3&&(Xn(e,c,i[x]>>>5&8191),c+=Pn[H])}else Xn(e,c,R[i[x]]),c+=E[i[x]];return Xn(e,c,R[256]),c+E[256]},oi=new On([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),si=new En(0),ai=function(){for(var t=new On(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),li=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function ui(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=ai[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 En(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=ii(l,u,t.subarray(c,d)):(l[c]=o,u=ii(l,u,t.subarray(c,s)))}else{for(var h=oi[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new An(32768),g=new An(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 On(25e3),_=new An(288),S=new An(32),x=0,C=0,M=(c=0,0),I=0,T=0;s>c;++c){var R=w(c),E=32767&c,A=g[R];if(m[E]=A,g[R]=E,c>=I){var O=s-c;if((x>7e3||M>24576)&&O>423){u=ri(t,l,0,k,_,S,C,M,T,c-T,u),M=x=C=0,T=c;for(var L=0;286>L;++L)_[L]=0;for(L=0;30>L;++L)S[L]=0}var P=2,D=0,F=v,N=E-A&32767;if(O>2&&R==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&E!=A;){if(t[c+P]==t[c+P-N]){for(var H=0;B>H&&t[c+H]==t[c+H-N];++H);if(H>P){if(P=H,D=N,H>q)break;var z=Math.min(N,H-2),U=0;for(L=0;z>L;++L){var W=c-N+L+32768&32767,V=W-m[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(E=A)-(A=m[E])+32768&32767}if(D){k[M++]=268435456|qn[P]<<18|jn[D];var Z=31&qn[P],G=31&jn[D];C+=Ln[Z]+Pn[G],++_[257+Z],++S[G],I=c+P,++x}else k[M++]=t[c],++_[t[c]]}}u=ri(t,l,o,k,_,S,C,M,T,c-T,u),o||(u=ii(l,u,si))}return Jn(a,0,i+Qn(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&&li(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),li(u,c-8,n.d()),li(u,c-4,i),u}function ci(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 di=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(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.vt=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.bt(e);if(0===o&&n!==o)return;if(this.kt)return t;this.ut();const s=Rn(t);var a,l;return s>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.ct-=s,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new at({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,$:le}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const s=this.it.resyncIntervalMs;this.xt=X(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return X(t)&&isFinite(t)&&Math.floor(t)===t});var hi=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}},fi=class{generate(){const t=this.generateOrAbort();if(!Z(t))return t;{this.Ct=0;const t=this.generateOrAbort();if(Z(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return X(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return hi.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new pi}};let vi=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};t&&!Z(t.crypto)&&crypto.getRandomValues&&(vi=t=>crypto.getRandomValues(t));var pi=class{nextUint32(){return this.Rt.length>this.$t||(vi(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let mi;const gi=()=>yi().toString(),yi=()=>(mi||(mi=new fi)).generate();let bi=null;const wi={Et(){if(!J(bi))return bi;let e=!0;if(Z(t))e=!1;else try{const t="__mplssupport__";wi.At(t,"xyz"),'"xyz"'!==wi.Ot(t)&&(e=!1),wi.Lt(t)}catch(t){e=!1}return e||le.error("localStorage unsupported; falling back to cookie store"),bi=e,e},Pt(t){le.error("localStorage error: "+t)},Ot(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){wi.Pt(t)}return null},Dt(t){try{return JSON.parse(wi.Ot(t))||{}}catch(t){}return null},At(e,n){try{return null==t||t.localStorage.setItem(e,JSON.stringify(n)),!0}catch(t){wi.Pt(t)}return!1},Lt(e){try{null==t||t.localStorage.removeItem(e)}catch(t){wi.Pt(t)}}};let ki=null;const _i={Et(){if(!J(ki))return ki;if(ki=!0,Z(t))ki=!1;else try{const t="__support__";_i.At(t,"xyz"),'"xyz"'!==_i.Ot(t)&&(ki=!1),_i.Lt(t)}catch(t){ki=!1}return ki},Pt(t){le.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){_i.Pt(t)}return null},Dt(t){try{return JSON.parse(_i.Ot(t))||null}catch(t){}return null},At(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){_i.Pt(t)}return!1},Lt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){_i.Pt(t)}}};se.DEBUG=!1,se.LIB_VERSION="1.434.6",se.LIB_NAME="web";var Si=se,xi=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.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(g);return V(n=e)&&G(n.sessionId)&&X(n.size)&&e.sessionId===t?e.size:0;var n}};function Ci(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<st(100*e,0,100,le)}function Mi(t){return`$survey_response_${t}`}function Ii(t,e){if(!e)return null;const n=t[Mi(e)];return U(n)?[...n]:n}function Ti({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return D(D(D(D({},!Z(i)&&{$survey_submission_id:i}),"sent"===t?!Z(r)&&{$survey_completed:r}:{$survey_partially_completed:Ri(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(Z(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ii(t,e.id);Z(o)||(i[n]=o)}),D(D({$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:Ii(t,e.id)}})},t),i)}(n,e,s))}function Ri(t={}){return Object.values(t).some(t=>!K(t))}function $i(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 Ei(t){return"string"==typeof t&&t.trim()?t.trim():null}function Ai(t){return t.toLowerCase()}function Oi(t,e,n){if(!t||!e)return null;const i=Ai(e),r=Object.keys(t).find(t=>Ai(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=>Ai(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Li=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Pi(t,e,n){var i;const r=Oi(t.translations,e,n),o=D({},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}`),Z(e.name)||(o.name=e.name,s=!0),o.appearance){const t=D({},o.appearance);for(const n of Li){const i=e[n];Z(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Li.some(e=>!Z(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Oi(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=D({},t);let a=!1;return Z(o.question)||(s.question=o.question,a=!0),Z(o.description)||(s.description=o.description,a=!0),Z(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!Z(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!Z(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!Z(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return U(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 Di(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 Fi=(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}},Ni=t=>t.toLowerCase(),qi={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=>Fi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Fi(e,t))),icontains:(t,e)=>e.map(Ni).some(e=>t.map(Ni).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Ni).every(e=>t.map(Ni).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))})},ji=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},Bi=new Set(["is_not","not_icontains","not_regex"]);function Hi(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(Z(r)||J(r))return Bi.has(o);const s=qi[o];return!!s&&!Z(t.value)&&!J(t.value)&&s(U(t.value)?t.value.map(String):[String(t.value)],U(r)?r.map(String):[String(r)])})}const zi=ue("[SessionRecording]");function Ui(t,e){return e?t:"!"+t}function Wi(t,e){return t===e||t!=="!"+e&&null}var Vi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=o,this.Bt=s,this.Ht=null,this.zt=Mn}onRemoteConfig(t){this.Ht=X(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new gn([this.tt,this.Y]),this.zt=Cn):(this.Ut=new yn([this.tt,this.Y]),this.zt=Mn),this._instance.register_for_session({[x]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.zt({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 X(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&K(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){zi.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!X(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=Wi(o,t),l=X(s)&&s!==n,u=Z(s)&&o===t,c=l||u||!Y(a),d=c?Ci(t,n):a;c&&(d?this.qt("sampled"):zi.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:Ui(t,d),$replay_sample_rate:J(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!X(this.Ht))return;const e=this._instance.get_property(h);Y(Wi(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.Ut)||void 0===e?void 0:e.triggerStatus(t))===dn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===dn).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Zi=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[x]:"v2_trigger_groups",[C]:t.triggerGroups.length}),this.Y.onConfig(t)):zi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return rn;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);Z(e)?le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?on:i?an:rn}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Zt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;X(t)&&(J(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Zt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Qt)return zi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Zt)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(y);r.some(e=>!e.properties||0===e.properties.length||Hi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){zi.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Zt){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(V(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=X(n)&&n!==o,l=e===t&&X(n)&&n===o&&Y(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!Y(l),f=h?Ci(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Gt.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.Qt=!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.Zt){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.Zt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Gt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[_]:e})}hasPendingTriggers(t){for(const e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Hi(n,e,this._instance.get_property(y))}Jt(t){this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();for(const e of t){const t=new xn(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Zt.push(t)}}};const Gi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Qi=1e5,Ji=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Ki=[],Xi=()=>!1,Yi="@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(" "),tr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),er="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(" "),nr="Accommodation AdministrativeArea Country Place State".split(" "),ir={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:tr,publisher:er},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ki},Offer:{seller:er},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:er,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:er,areaServed:nr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ki}},rr=[["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(" "),ir.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ir.Event],[er,ir.Organization],[nr,ir.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ir.Product]];function or(t,e){return H.call(t,e)?t[e]:void 0}function sr(t){const e=typeof t;return J(t)||"string"===e||"number"===e||"boolean"===e}function ar(t,e){return e&&function(t){return G(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function lr(t,e){return U(t)&&t.every(sr)?t.map(t=>ar(t,e)).filter(t=>!Z(t)):sr(t)?ar(t,e):void 0}function ur(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 cr(t){if(H.call(ir,t))return ir[t];for(const[e,n]of rr)if(e.includes(t))return n}function dr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function hr(t,e,n,i){if(U(t)){const r=t.map(t=>hr(t,e,n,i)).filter(t=>!Z(t));return r.length?r:void 0}return fr(t,e,n,i)||void 0}function fr(t,e,n,i){if(!V(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=or(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:U(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&Ji.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!cr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of Yi){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?ur(or(t,i),e):lr(or(t,i),n.maskUrl);Z(s)||dr(a,i,s)}for(const i of s){const r=cr(i);for(const i of Object.keys(r)){const o=or(t,i),s=r[i];if(!0===s){const t=lr(o,n.maskUrl);Z(t)||dr(a,i,t)}else{const t=hr(o,e,n,s);Z(t)||dr(a,i,t)}}}const l=hr(or(t,"@graph"),e,n);return Z(l)||dr(a,"@graph",l),Object.keys(a).length?a:null}function vr(t,e,n){if(!V(t))return null;const i=or(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=fr(t,e,n);return r?D({"@context":"https://schema.org"},r):null}function pr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function mr(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 gr(t,e,n){for(let i=t;i;){if(mr(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 yr(t){return pr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(pr)}function br(t){return Z(t)?void 0:Math.round(t)}function wr(t){return V(t)?t.network_timing:t}const kr=ue("[SessionRecording]"),_r=[1,2,3,4,5,6,7,12],Sr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function xr(){var t;return null==a||null===(t=a.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Cr(){var t;return null===(t=xr())||void 0===t?void 0:t.record}function Mr(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,In())}}function Ir(t){return ci(ui(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new En(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 En(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 Jn(n,0,i)}(Mr(t))),!0)}function Tr(t){return Rr.apply(this,arguments)}function Rr(){return Rr=A(function*(t){const e=yield function(t){return ie.apply(this,arguments)}(Mr(t),Si.DEBUG,{rethrow:!0});return ci(new Uint8Array(yield e.arrayBuffer()),!0)}),Rr.apply(this,arguments)}let $r,Er;const Ar="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Or=!1;function Lr(t){var e;return U(t)&&0===t.length?($r=null!==(e=$r)&&void 0!==e?e:Ir([]),$r):Ir(t)}function Pr(t){return Dr.apply(this,arguments)}function Dr(){return(Dr=A(function*(t){var e;return U(t)&&0===t.length?$r||(Er=null!==(e=Er)&&void 0!==e?e:Tr([]).then(t=>($r=t,t)).catch(t=>{throw $r=void 0,Er=void 0,t}),Er):Tr(t)})).apply(this,arguments)}function Fr(t){return Ar&&!Or&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Nr(t){return{event:t,size:Rn(t)}}function qr(t,e){return D(D({},t),{},{data:e,cv:"2024-10"})}function jr(t,e){return D(D({},t),{},{cv:"2024-10",data:D(D({},t.data),e)})}function Br(t){try{if(2===t.type)return Nr(qr(t,Ir(t.data)));if(3===t.type&&0===t.data.source)return Nr(jr(t,{texts:Lr(t.data.texts),attributes:Lr(t.data.attributes),removes:Lr(t.data.removes),adds:Lr(t.data.adds)}));if(3===t.type&&8===t.data.source)return Nr(jr(t,{adds:t.data.adds?Ir(t.data.adds):void 0,removes:t.data.removes?Ir(t.data.removes):void 0}))}catch(t){kr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:Tn(t)}}function Hr(){return Hr=A(function*(t){try{if(2===t.type)return Nr(qr(t,yield Tr(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 Nr(jr(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?Tr(t.data.adds):void 0,t.data.removes?Tr(t.data.removes):void 0]);return Nr(jr(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)&&(Or=!0),kr.warn("could not compress event asynchronously - trying synchronous compression",e),Br(t)}return{event:t,size:Tn(t)}}),Hr.apply(this,arguments)}function zr(t,e){return 5===t.type&&t.data.tag===e}function Ur(t){return zr(t,"sessionIdle")}function Wr(t){return zr(t,"$session_ending")}function Vr(t){return zr(t,"$session_starting")}var Zr=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Wi(this._instance.get_property(h),this.sessionId)}get Ht(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return X(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Ie=!1,this.Te=!1,this.Re=[],this.$e=void 0,this.Ee=void 0,this.Ae=!1,this.Oe=[],this.Le=0,this.Pe=0,this.De=!1,this.Fe=void 0,this.Wt=void 0,this.Ne=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.He)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.He;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,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"),this.Se=!1,null===(r=xr())||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.Ue(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.He===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.We(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(s=this.re)||void 0===s||s.makeSamplingDecisions(t)},this.Ve=!1,this.Ze=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ge=()=>{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 X(n)&&X(i)?i-n:null},this.Qe=()=>{var t,e;const n=this.ie;if(!X(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.Je;return X(t)&&t>=0&&n>t}if(this.Ze())return!1;const i=this.Ge();return!!J(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ke=()=>{"buffering"!==this.status?(this.ge&&this.ye&&this.Xe&&!this.be&&this.Ye(void 0),this.tn(),this.en(!0)):this.nn()},this.rn=()=>{this.Ke()},this.sn=()=>{this.Vt("browser offline",{})},this.an=()=>{this.Vt("browser online",{})},this.ln=()=>{(null==i?void 0:i.visibilityState)&&("visible"===i.visibilityState&&(this.Xe=!0),this.Vt("window "+i.visibilityState,{}))},this.Xe=null==e||e;const{sessionId:n,windowId:r,sessionStartTimestamp:o}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=n,this.He=r,this._sessionStartTimestamp=o,this.et=new _n(this._instance),this.Y=new kn(this._instance),this.tt=new Sn(this._instance),this.Rt=this.nn(),this.un="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||kr.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.ze=new xi(this._instance)}setDocumentWasEverVisible(t){t&&(this.Xe=!0)}get cn(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ne)||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 Z(d)&&Z(h)&&Z(f)&&Z(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}dn(){var t;if(this.Ce)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(K(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!Z(i)&&i!==r});0!==i.length&&(this.Ce=!0,kr.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 hn(){var t;return st(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ue("canvas recording resolution scale"),1)}get fn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||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:st(c,0,12,ue("canvas recording fps"),4),quality:st(d,0,1,ue("canvas recording quality"),.4)}}get vn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get pn(){var t,e,n;const i=null===(t=this.ne)||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=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=wr(this._instance.config.capture_performance),l=wr(null==i?void 0:i.capturePerformance),u=!!(Y(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}mn(){var t,e;const n=[],i=null===(t=a.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;i&&this.vn&&n.push(i());const o=null===(e=a.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.pn&&W(o))if(!ve.includes(r.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(((t,e,n)=>{const i={payloadSizeLimitBytes:Ge.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ge.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ge.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=Ze(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=tn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=tn(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&&Ye.some(t=>0===s.indexOf(t))?void 0:t})((Xe((i=e).requestHeaders),Xe(i.responseHeaders),i),t.api_host,n));var i},u=W(t.session_recording.maskNetworkRequestFn);return u&&W(t.session_recording.maskCapturedNetworkRequestFn)&&le.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});return!n&&e.isInitial?n:D(D({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=W(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 K(s)&&o?(nn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!Z(t))return t.requestBody=en(t.requestBody,"Request"),t.responseBody=en(t.responseBody,"Response"),t}(l(t)),D(D(D({},Ge),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.pn,t)))}else kr.info("NetworkCapture not started because we are on localhost.");return n}gn(t){return this._instance.config.disable_capture_url_hashes?xt(t):t}yn(t,e=!1){const n=e?xt(t):this.gn(t),i=this._instance.config.mask_personal_data_properties?[...Gi,...this._instance.config.custom_personal_data_properties||[]]:[];return this.bn(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("=");U(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}bn(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}wn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):kr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.wn(Sr(()=>Cr().addCustomEvent(t,e)))}kn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}_n(t){if(!this.kn())return!1;try{const e=Cr();return!!e&&(e.addCustomEvent("$json_ld",t),this.kn())}catch(t){return!1}}Sn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.xn)||void 0===e?void 0:e.scan(t)})}Cn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.yn(e.origin+e.pathname+e.search);this.Mn!==n&&(this.Mn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}In(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.wn(t)})}}jt(){return this.wn(Sr(()=>Cr().takeFullSnapshot()))}get Tn(){var t,e,n;if((null===(t=this.re)||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 X(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}Rn(){if(this.$n&&clearInterval(this.$n),!0===this.de)return;const t=this.Tn;t&&(this.$n=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.En(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rn()}An(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this.xn)||void 0===t||t.scan(),clearInterval(this.$n),kr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}On(){var t;this.Y.urlBlocked&&(null===(t=this.xn)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this.Sn(),this.Rn(),this.Vt("recording resumed",{reason:"left blocked url"}),kr.info("recording resumed"))}Ln(t,e){var n;if("event"===t&&this.En(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!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.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.en(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=V(t)?t:JSON.parse(t)}catch(t){return void kr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ve){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void kr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Pn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var n,r;const o=this.ne;if(!o)return void kr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.we;this.Ye(t?"no_interaction_since_recording_started":void 0),this.we=!1,this.ye=t,this.be=!1}this.De&&(this.Dn(),this.nn());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=s,this.He=a,this._sessionStartTimestamp=h,this.Fn(),null===(n=this._instance.persistence)||void 0===n||n.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.oe=null==o?void 0:o.endpoint),this.re=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Zi(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Vi(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(o),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Ln(t,e)),this.Pn(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Pn(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Pn(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Pn(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.re.makeSamplingDecisions(this.sessionId),this.Nn(),this.ke||(fe(t,"beforeunload",this.Ke),fe(t,"pagehide",this.rn),fe(t,"offline",this.sn),fe(t,"online",this.an),fe(i,"visibilitychange",this.ln),!this.Ne&&W(this.Yt.onSessionId)&&(this.Ne=this.Yt.onSessionId(this.Be)),!this.qe&&W(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.Ue(),this.de="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.je)||void 0===i||i.call(this),this.je=void 0,this.Be(t,e,n)})}):W(this.Yt.on)||kr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),K(this.Fe)&&(this.Fe=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.yn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){kr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}qn(){var e,n,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Ke),null==t||t.removeEventListener("pagehide",this.rn),null==t||t.removeEventListener("offline",this.sn),null==t||t.removeEventListener("online",this.an),null==i||i.removeEventListener("visibilitychange",this.ln),clearInterval(this.$n),this.jn(),null===(e=this.Fe)||void 0===e||e.call(this),this.Fe=void 0,null===(n=this.Wt)||void 0===n||n.call(this),this.Wt=void 0,null===(r=this.Ne)||void 0===r||r.call(this),this.Ne=void 0,null===(o=this.qe)||void 0===o||o.call(this),this.qe=void 0,null===(s=this.je)||void 0===s||s.call(this),this.je=void 0,null===(a=this.re)||void 0===a||a.stop(),this.Bn(),this.Dn()}Dn(){this.Pe+=1,this.Oe=[],this.Le=0,this.Hn=void 0,this.De=!1}Bn(){var t,e;null===(t=this.zn)||void 0===t||t.stop(),this.ce=[],null===(e=this.xn)||void 0===e||e.stop(),this.xn=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){kr.warn("could not stop rrweb",t)}this.se=void 0}Un(){if(!this.Hn||0===this.Le)return!1;if(this.De)return!0;this.De=!0,this.Wn=void 0;const t=this.Pe;return this.jn(),this.Bn(),this.Hn.catch(()=>{}).then(()=>{t===this.Pe&&(this.De=!1,this.en(),this.nn(),this.Vn(),this.qn(),kr.info("stopped"))}).catch(()=>{this.De=!1,this.Vn(),this.qn(),kr.info("stopped")}),!0}stop(){if(this.Bn(),this.Ve)this.tn();else if(this.Un())return;this.en(),this.nn(),this.Vn(),this.qn(),kr.info("stopped")}Vn(){this.Ye(void 0,{preserveLogDedup:this.Ve}),this.ye=!1}flushBeforeIdentityReset(){(this.isStarted||this.De)&&(this.tn(),this.en())}We(t){this.Ve=!0,this.le=Date.now();try{var e,n;this.stop(),this.Zn=void 0,this.Gn=void 0,this.fe=0,this.ve=0,this.pe=0,this.me=0,null===(e=xr())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.Ve=!1}this.Ye(t?"no_interaction_since_session_rotated":void 0),this.ye=!1}Ye(t,{preserveLogDedup:e=!1}={}){if(this.ge=!Z(t),this.Wn=t,Z(t))return void(e||(this.Qn=void 0));if(this.Ve)return;const n=`${this.sessionId}:${t}`;n!==this.Qn&&(this.Qn=n,kr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}En(){this.isStarted||(this.we=!0),this.ge&&(this.Ye(void 0),this.ye=!1,this.be&&(this.be=!1,this.jt()),this.Jn())}discard({discardProducerEvents:t=!1}={}){this.ge=!0,t&&(this.nn(),this.Bn()),this.nn(),this.qn(),this.nn(),this.Vn(),kr.info("discarded")}Kn(t,e,n,i,r){if(-1===n)return this.me+=1,void kr.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.Xn(t,i),this.Yn(o)):this.nn()}ti(){try{this.ei()}catch(t){this.xe||(this.xe=!0,kr.error("could not track full snapshot cost",t))}}ei(){var t,e;const n=null===(t=xr())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Gn&&(this.Gn=n,this.Zn&&this.Zn.durationMs>=n.durationMs||(this.Zn=n),500>n.durationMs||kr.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}))}Xn(t,e){2!==t.type?3===t.type&&(Z(this.$e)||this.$e===e||this.Ee===e||(this.Ee=e,kr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.$e=e}ni(t){t.counted&&t.generation===this.Pe&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,n){t.processed||t.generation!==this.Pe||(t.processed=!0,this.Kn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ri(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Br(t.event))}catch(t){kr.warn("could not process queued compression event - will use uncompressed event",t)}Z(e)&&(e=Tn(t.event));try{this.ii(t,n,e)}catch(t){kr.warn("could not capture queued compression event",t)}}finally{this.ni(t)}}tn(){[...this.Oe].forEach(t=>{try{this.ri(t)}catch(t){kr.warn("could not drain queued compression event",t)}})}oi(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Pe,processed:!1,counted:!0};this.Oe.push(o),this.Le+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Fr(t)?yield function(t){return Hr.apply(this,arguments)}(t):Br(t):{event:t,size:Tn(t)};n=r.event,i=r.size}catch(e){kr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=Tn(t)}r.ii(o,n,i)}finally{r.ni(o)}}),function(){return a.apply(this,arguments)});var a;this.Hn=this.Hn?this.Hn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h,f,v;if(!this._instance.sessionManager)return;if(this.In(),!e||!V(e))return;if(4===e.type){const t=this.yn(e.data.href);if(this.Mn=t,!t)return;e.data.href=t}else this.Cn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.An(),()=>this.On(),(t,e)=>this.Ln(t,e)),this.Y.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&((null===(d=xr())||void 0===d||null===(h=d.wasMaxDepthReached)||void 0===h?void 0:h.call(d))&&(this.Se=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rn(),null===(f=this.zn)||void 0===f||f.reset(),null===(v=this._instance.persistence)||void 0===v||v.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const p=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));p&&this.si();const m=this.zn?this.zn.throttleMutations(e):e;if(!m)return void(!0===this.de&&this.he++);const g=function(t){const e=t;if(e&&V(e)&&6===e.type&&V(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}(m),y=function(t){return Wr(t)?t.data.payload:null}(g),b=function(t){return Vr(t)?t.data.payload:null}(g),w=function(t){return Ur(t)?t.data.payload:null}(g);y||b?(null==y?void 0:y.lastActivityTimestamp)&&(g.timestamp=y.lastActivityTimestamp):(null==w?void 0:w.sessionId)||this.ai(g),2===e.type&&(this.Re.push([this.Xt,e.timestamp]),this.Re.length>6&&(this.Re=this.Re.slice(-6)));const k=null!==(r=null!==(o=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==o?o:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Xt,_=null!==(a=null!==(l=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==l?l:null==w?void 0:w.windowId)&&void 0!==a?a:this.He;if(!0===this.de&&!function(t){return Ur(t)||Wr(t)||Vr(t)}(g))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(g)&&this.he++);2===g.type&&(this.he=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);const S=this.ae;this.ae=!0,p?this.Sn(!0):S||this.Sn();const x=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===g.type&&"$json_ld"===g.data.tag){let e;try{e=t?this.yn(t.location.href):void 0}catch(t){}g.data.href=e}if(this.Le>0||x&&Fr(g))return void this.oi(g,x,k,_);const{event:C,size:M}=x?Br(g):{event:g,size:Tn(g)};this.Kn(g,C,M,k,_)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.ke,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):rn}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.et.linkedFlagSeen=!0,this.jt(),this.En(),this.qt("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.jt(),this.En(),this.qt("sampling_overridden")}overrideTrigger(t){this.Ln(t),this.En()}li(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.yn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}jn(){this.ui&&(clearTimeout(this.ui),this.ui=void 0)}Jn(){this.ui||(this.ui=setTimeout(()=>{this.en()},2e3))}ci(){return this.$e!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Wr(t)&&!Vr(t))}di(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}hi(t){if("buffering"!==t)return Z(this.fi)||this._instance.register_for_session({[S]:[]}),void(this.fi=void 0);const e=this.di();if(0===e.length)return Z(this.fi)||this._instance.register_for_session({[S]:[]}),void(this.fi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.fi&&(this.fi=i,this._instance.register_for_session({[S]:e}),kr.info(`buffering: ${n}`))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.mi)&&_i.Et()}gi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,_i.At(this.un,this.Rt))}Fn(){if(this.Ae||!this.pi())return;this.Ae=!0;const t=_i.Dt(this.un);_i.Lt(this.un),V(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&X(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}en(t=!1){var e;if(this.jn(),this.ge)return this.Rt;if(this.ci())return this.Rt.size>943718.4?this.nn():(t&&this.gi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Qe(),r=this.status;if(this.hi(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.gi(),this.Jn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.li();$n(n).forEach(e=>{try{var n;null===(n=this.ze)||void 0===n||n.trackSize(e.sessionId,e.size),this.bi(D({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Si.LIB_NAME,$lib_version:Si.LIB_VERSION,$snapshot_host:t},this.me>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.me}:{}))}catch(t){kr.warn("could not capture snapshot chunk - skipping it",t)}}),Z(this.yi)||(_i.Lt(this.un),this.yi=void 0),null===(o=this.re)||void 0===o||o.onFlushComplete()}return this.nn()}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.de&&!this.ge&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.en(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.nn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.be||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.be||(this.be=!0,this.Rt=this.nn()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.ge||this.Jn())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Je(){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}si(){if(!this.Rt||0===this.Rt.data.length)return this.nn();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.nn():(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)}nn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}qt(t,e){this._instance.register_for_session({[R]:t}),kr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",D({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==_r.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}ai(t){const e=this.wi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.$n),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.en());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.He!==n;if(this.He=n,this.Xt=i,o||s){const t=o&&!1!==this.de;t&&(this.de="unknown"),this.We(t)}else if(e&&this.En(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this.Sn(),this.Rn()}}Ue(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,n,i,r,o,s,a,l,u,c,d,h,f;const v=null===(t=xr())||void 0===t||null===(e=t.getDeferredStylesheetStats)||void 0===e?void 0:e.call(t);return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wn,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Je,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(n=this.ze)||void 0===n?void 0:n.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Re,$snapshot_max_depth_exceeded:this.Se,$sdk_debug_replay_slowest_full_snapshot_ms:br(null===(i=this.Zn)||void 0===i?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:br(null===(r=this.Zn)||void 0===r?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null===(o=this.Zn)||void 0===o?void 0:o.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null===(s=this.Zn)||void 0===s?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null===(a=this.Zn)||void 0===a?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==v?void 0:v.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==v?void 0:v.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==v?void 0:v.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:br(null==v?void 0:v.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:br(null==v?void 0:v.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:br(null===(l=xr())||void 0===l||null===(u=l.getMutationCost)||void 0===u||null===(u=u.call(l))||void 0===u?void 0:u.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null===(c=xr())||void 0===c||null===(d=c.getDiscardedDurationSamples)||void 0===d?void 0:d.call(c),$sdk_debug_replay_throttled_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_unstringifiable_events_dropped:this.me,$sdk_debug_replay_rrweb_error:this.ke,$sdk_debug_replay_observer_init_failures:null===(h=xr())||void 0===h||null===(f=h.getObserverInitFailures)||void 0===f?void 0:f.call(h),[I]:!!this.se,[T]:this._e}}Nn(){var e;if(this.se)return;this._e=!0;const n={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 n)if("maskInputOptions"===t)n.maskInputOptions=D({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},i={};Z(t.mousemove)||(i.mousemove=t.mousemove),Z(t.mouseInteraction)||(i.mouseInteraction=t.mouseInteraction),n.sampling=i}else n[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==n.slimDOMOptions&&"all"!==n.slimDOMOptions&&(n.slimDOMOptions=D(D({},n.slimDOMOptions),{},{script:!0})),this.fn&&this.fn.enabled&&(n.recordCanvas=!0,n.sampling=D(D({},n.sampling),{},{canvas:this.fn.fps}),n.dataURLOptions={type:"image/webp",quality:this.fn.quality},n.canvasResolutionScale=this.hn,n.canvasMasking={configured:()=>{var t;return W(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(W(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,kr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.cn&&(n.maskAllInputs=null===(o=this.cn.maskAllInputs)||void 0===o||o,n.maskTextSelector=null!==(s=this.cn.maskTextSelector)&&void 0!==s?s:void 0,n.blockSelector=null!==(a=this.cn.blockSelector)&&void 0!==a?a:void 0,n.maskAllElementAttributes=null!==(l=this.cn.maskAllElementAttributes)&&void 0!==l&&l),n.maskAllElementAttributes&&n.maskAttributeFn&&(n.maskAttributeFn=void 0,this.Me||(this.Me=!0,kr.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.dn();const u=Cr();if(!u)return void kr.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 di(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`;kr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Tn,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.mn();if(this.se=u(D({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,kr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},n)),!this.se)return this.ke=!0,void kr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ke=!1,!0===(null==r?void 0:r.captureJsonLd)&&i&&(null==t?void 0:t.MutationObserver)&&!this.xn&&(this.xn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Qi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?Xi:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!gr(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 gr(t,e.blockClass,e.blockSelector)||gr(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=Xi,n){if(!t||t.length>Qi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>vr(t,e,r)):vr(i,e,r);if(r.exceeded||J(o)||U(o)&&(!o.length||o.some(J)))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(J(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 yr(t))a(e)};for(const n of t)if("childList"===n.type)pr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&pr(t)&&a(t)}else"attributes"===n.type&&pr(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()&&yr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{maskUrl:t=>this.yn(t),attributeFilter:n.attributeFilter,blockClass:n.blockClass,blockSelector:n.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:n.maskAllElementAttributes,maskAttributeFn:n.maskAttributeFn,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.kn()},emit:t=>this._n(t)}),this.Y.isCurrentUrlBlocked()&&this.xn.scan()),this.le=Date.now(),this.de=Y(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:n,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 Gr=["type"];var Qr=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}({}),Jr=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}({}),Yr=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),to=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}({}),eo=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 no(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var io={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},oo={};function so(t){if(oo[t])return oo[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 io?io[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 ro?ro[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 oo[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?(function(t){return no(t,"AppleWebKit")&&!no(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),oo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var ao=Object.create(null);function lo(t,e,n){var i;const r=ao[t],o=r[n];if(o)return o.call(e);const s=so(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]}ao.Node=Object.create(null),ao.ShadowRoot=Object.create(null),ao.MutationObserver=Object.create(null),ao.Element=Object.create(null);var uo,co={};function ho(t,e,n){const i=`${t}.${String(n)}`;if(co[i])return co[i].bind(e);const r=so(t)[n];return"function"!=typeof r?e[n]:(co[i]=r,r.bind(e))}function fo(){return so("MutationObserver").constructor}function vo(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 po={childNodes:t=>lo("Node",t,"childNodes"),parentNode:t=>lo("Node",t,"parentNode"),parentElement:t=>lo("Node",t,"parentElement"),textContent:t=>lo("Node",t,"textContent"),isConnected(t){if(void 0===uo){var e;const t=null===(e=Object.getOwnPropertyDescriptor(so("Node"),"isConnected"))||void 0===e?void 0:e.get;uo=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==uo?void 0:uo.call(t)},contains:(t,e)=>ho("Node",t,"contains")(e),getRootNode:t=>ho("Node",t,"getRootNode")(),host:t=>t&&"host"in t?lo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?lo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>ho("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>ho("Element",t,"querySelectorAll")(e),mutationObserver:fo,patch:vo};function mo(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var go=0;function yo(){go+=1}function bo(){return go}function wo(t,e){return(e!==go||t>6e4)&&!0}var ko=0,_o=0,So=0,xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Co=null,Mo=null,Io=[],To=0,Ro=0,$o={slowestBatchMs:0},Eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Ao(t){(ko+=1)>1||(xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Io=[],To=0,Mo=(t=>t&&t>0?t:null)(t),_o=mo(),So=go)}function Oo(){return 0===ko?Co||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(ko-=1)>0?xo:(xo.durationMs=mo()-_o,xo.deferredStylesheetCount=To,Eo.deferredCount+=To,Mo=null,wo(xo.durationMs,So)?xo:Co=xo)}function Lo(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+=Lo(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+=Lo(r,e,n+1))}}}catch(t){}}return i}function Po(t){if(0===ko)return;const e=Lo(t,null,0);xo.cssRuleCount+=e,Ro>0&&(xo.nonDeferrableCssRuleCount+=e)}function Do(t){Ro+=1;try{return t()}finally{Ro-=1}}function Fo(t){ko>0&&(xo.stylesheetMs+=t)}function No(t){if(0===ko||null===Mo)return!1;const e=xo.cssRuleCount-xo.nonDeferrableCssRuleCount;return e>=Mo||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Lo(e,n,0)}catch(t){return 0}}(t)>Mo}function qo(){const t=Io;return Io=[],t}function jo(){Eo.failedCount+=1}function Bo(t){t>0&&(Eo.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 zo(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 Uo(t){return t.nodeType===t.ELEMENT_NODE}function Wo(t){const e=t&&"host"in t&&"mode"in t&&po.host(t)||null;return Boolean(e&&"shadowRoot"in e&&po.shadowRoot(e)===t)}function Vo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Zo(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 Go(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 Qo=0;function Jo(t){const e=0===Qo,n=e?mo():0;Qo+=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),Zo(Array.from(e,t=>Ko(t,n)).join(""))}catch(t){return null}finally{Qo-=1,e&&Fo(mo()-n)}}function Ko(t,e){if(Yo(t)){let e;try{e=Jo(t.styleSheet)||Go(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ps(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ts(t)&&t.selectorText.includes(":")&&(n=Xo(n)),e?ps(n,e):n}}function Xo(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Yo(t){return"styleSheet"in t}function ts(t){return"selectorText"in t}var es=/^-?[A-Za-z_][\w-]*$/,ns=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function is(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||Go(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ps(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&&Yo(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(ts(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&&!es.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]?es.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":ns.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?ps(i,r):i,fixColons:"sheet"===n.kind&&ts(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&ts(n)&&n.selectorText.includes(":")&&(i=Xo(i)),t.parts.push(t.sheetHref?ps(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,!Yo(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=mo();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=Zo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{Fo(mo()-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 rs=class{constructor(){zo(this,"idNodeMap",new Map),zo(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)),Uo(t)){const e=po.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 os({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&ss(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function ss(t){return t.toLowerCase()}var as=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 ls({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&as.has(ss(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var us="__rrweb_original__";function cs(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ss(e):null}catch(t){return null}}var ds=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,hs=/^(?:[a-z+]+:)?\/\//i,fs=/^www\..*/i,vs=/^(data:)([^,]*),(.*)/i;function ps(t,e){return(t||"").replace(ds,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(hs.test(a)||fs.test(a))return`url(${l}${a}${l})`;if(vs.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=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var ms,gs,ys=new Map,bs=1,ws=new RegExp("[^a-z0-9-_:]");function ks(){return bs++}var _s=!1,Ss=/^[^ \t\n\r\u000c]+/,xs=/^[, \t\n\r\u000c]+/,Cs=new WeakMap;function Ms(t,e){return e&&""!==e.trim()?Is(t,e):e}function Is(t,e){let n=Cs.get(t);if(n||(n=t.createElement("a"),Cs.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Ts(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])){if("link"===e&&r){var s;const t=null===(s=r.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=Ms(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=ys.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(ys.size>=10){const t=ys.keys().next().value;void 0!==t&&ys.delete(t)}return ys.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),Ts(t,o)}if("image"===e)return Ts(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Ms(t,i);return"image"===e&&n.startsWith("data:")?Ts(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(xs),e.length>n;){let o=i(Ss);if(","===o.slice(-1))o=Ms(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Ms(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?ps(i,Is(t)):"object"===e&&"data"===n?Ms(t,i):i:Ms(t,i)}function $s(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===ss(e)}function Es(t){return"string"==typeof t&&ss(t).split(/\s+/).includes("stylesheet")}function As(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&As(po.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&As(po.parentNode(t),e,n)}function Os(t,e,n,i){let r;if(Uo(t)){if(r=t,!po.childNodes(r).length)return!1}else{if(null===po.parentElement(t))return!1;r=po.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(As(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 Ls(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ps=new Map;function Ds(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Fs(t){return null==t?"":t.toLowerCase()}var Ns=!1,qs=!1;function js(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:_=5e3,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:I=!1,depth:T=0,maxDepth:R=50}=e;let{needsMask:E}=e,{preserveWhiteSpace:A=!0}=e;if(T>=R)return qs=!0,Ns||(Ns=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${R}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;E||(E=Os(t,s,a,void 0===E)),ko>0&&(xo.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:eo.Document,childNodes:[],compatMode:t.compatMode}:{type:eo.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:eo.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=ss(t.tagName);return ws.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];$s(y,i.name)||(w[i.name]=Rs(n,y,ss(i.name),i.value,t,c))}if("link"===y&&o&&!g&&Es(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=Ds(n,i),!e&&i.includes(".css"))&&(e=Ds(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(No(e)?ko>0&&(Io.push(t),To+=1):i=Jo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||po.textContent(t)||"").trim().length){const e=Do(()=>Jo(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=os({element:t,type:cs(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=us in r?r[us]: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 S,x=!1;if("img"===y&&d){ms||(ms=n.createElement("canvas"),gs=ms.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>x?ls({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Ls(e,"load",s);try{ms.width=e.naturalWidth,ms.height=e.naturalHeight,gs.drawImage(e,0,0);const t=ms.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 C,M,I;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(I=n.defaultView)||void 0===I?void 0:I.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]=ls({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));x=!0;try{customElements.get(y)&&(S=!0)}catch(t){}return{type:eo.Element,tagName:y,attributes:w,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:S};var T}(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=po.parentNode(t),s=o&&o.tagName;let a=po.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(No(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Jo(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=ps(a,Is(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,po.parentElement(t)):a.replace(/[\S]/g,"*")),{type:eo.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:eo.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:eo.Comment,textContent:po.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:M,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===eo.Comment)return!0;if(t.type===eo.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&&(Fs(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fs(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Fs(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Fs(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Fs(t.attributes.property).match(/^(og|twitter|fb):/)||Fs(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fs(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Fs(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(Fs(t.attributes.name))||Fs(t.attributes.property).match(/^article:/)||Fs(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(Fs(t.attributes.name)))return!0}}return!1}(O,p)||!A&&O.type===eo.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ks();const P=Object.assign(O,{id:L});if(i.add(t,P),-2===L)return null;w&&w(t);let D=!l;if(P.type===eo.Element){D=D&&!P.needBlock,delete P.needBlock;const e=po.shadowRoot(t);e&&Vo(e)&&(P.isShadowHost=!0)}if((P.type===eo.Document||P.type===eo.Element)&&D){p.headWhitespace&&P.type===eo.Element&&"head"===P.tagName&&(A=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T+1,maxDepth:R};if(P.type===eo.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(po.childNodes(t))){const t=js(n,e);t&&P.childNodes.push(t)}let I=null;if(Uo(t)&&(I=po.shadowRoot(t)))for(const t of Array.from(po.childNodes(I))){const n=js(t,e);n&&(Vo(I)&&(n.isShadow=!0),P.childNodes.push(n))}}const F=po.parentNode(t);if(F&&Wo(F)&&Vo(F)&&(P.isShadow=!0),P.type===eo.Element&&"iframe"===P.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),Ls(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?Ls(t,"load",s):(i=!0,Ls(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),Ls(t,"load",s)}}return t.addEventListener("load",s),()=>{Ls(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=js(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T+1,maxDepth:R});n&&k(t,n)}},_);null==S||S(t,e)}return P.type===eo.Element&&"link"===P.tagName&&Es(P.attributes.rel)&&function(e,l,S){if(Ps.has(e))return;let I;try{I=e.sheet}catch(t){return}if(I)return;const O=new AbortController;let L=!1;const P=()=>{if(!L){L=!0;try{(()=>{if(x){const e=js(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T,maxDepth:R});e&&x(t,e)}})()}finally{Ps.delete(e),O.abort()}}},D=setTimeout(P,S);O.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",P,{signal:O.signal,once:!0}),Ps.set(e,O)}(t,0,C),P}function Bs(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 Hs=class t{constructor(...t){zo(this,"parentElement",null),zo(this,"parentNode",null),zo(this,"ownerDocument",void 0),zo(this,"firstChild",null),zo(this,"lastChild",null),zo(this,"previousSibling",null),zo(this,"nextSibling",null),zo(this,"ELEMENT_NODE",1),zo(this,"TEXT_NODE",3),zo(this,"nodeType",void 0),zo(this,"nodeName",void 0),zo(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 zs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Us(n,t,e,i)}function Us(t,e,n,i){Ws(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Ws(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Vs(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Zs="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.",Gs={map:{},getId(){return console.warn(Zs),-1},getNode(){return console.warn(Zs),null},removeNodeFromMap(){console.warn(Zs)},has(){return console.warn(Zs),!1},reset(){console.warn(Zs)}};function Qs(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 Js(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e);return r.Object.defineProperty(t,e,i?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>Js(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Gs=new Proxy(Gs,{get(t,e,n){return"map"===e&&console.warn(Zs),Reflect.get(t,e,n)}}));var Ks=Date.now;function Xs(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=po.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=po.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 Ys(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ta(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ea(t){return t?t.nodeType===t.ELEMENT_NODE?t:po.parentElement(t):null}function na(t,e,n,i){if(!t)return!1;const r=ea(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(As(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 ia(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ra(t,e){if(Wo(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=po.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ra(i,e))}function oa(t){return Boolean(t.changedTouches)}function sa(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function aa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function la(t){return!!t&&(t instanceof Hs&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(po.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ks=()=>(new Date).getTime());var ua=class{constructor(){zo(this,"id",1),zo(this,"styleIDMap",new WeakMap),zo(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 ca(t){var e;let n=null;return"getRootNode"in t&&(null===(e=po.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&po.host(po.getRootNode(t))&&(n=po.host(po.getRootNode(t))),n}function da(t){const e=t.ownerDocument;if(!e)return!1;if(po.contains(e,t))return!0;const n=po.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=ca(n);)n=e;return n}(t);return po.contains(e,n)}(t)}function ha(t){return"__ln"in t}var fa,va=class{constructor(){zo(this,"length",0),zo(this,"head",null),zo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ha(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&ha(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},pa=(t,e)=>`${t}@${e}`,ma=class{constructor(){zo(this,"frozen",!1),zo(this,"locked",!1),zo(this,"texts",[]),zo(this,"attributes",[]),zo(this,"attributeMap",new WeakMap),zo(this,"generatedAttributes",new WeakMap),zo(this,"removes",[]),zo(this,"mapRemoves",new Set),zo(this,"movedMap",{}),zo(this,"addedSet",new Set),zo(this,"movedSet",new Set),zo(this,"droppedSet",new Set),zo(this,"removesSubTreeCache",new Set),zo(this,"mutationCb",void 0),zo(this,"blockClass",void 0),zo(this,"blockSelector",void 0),zo(this,"maskTextClass",void 0),zo(this,"maskTextSelector",void 0),zo(this,"inlineStylesheet",void 0),zo(this,"maskInputOptions",void 0),zo(this,"maskTextFn",void 0),zo(this,"maskInputFn",void 0),zo(this,"maskAllElementAttributes",void 0),zo(this,"maskAttributeFn",void 0),zo(this,"keepIframeSrcFn",void 0),zo(this,"recordCanvas",void 0),zo(this,"canvasMaskingConfigured",void 0),zo(this,"inlineImages",void 0),zo(this,"slimDOMOptions",void 0),zo(this,"dataURLOptions",void 0),zo(this,"doc",void 0),zo(this,"mirror",void 0),zo(this,"iframeManager",void 0),zo(this,"stylesheetManager",void 0),zo(this,"shadowDomManager",void 0),zo(this,"canvasManager",void 0),zo(this,"processedNodeManager",void 0),zo(this,"unattachedDoc",void 0),zo(this,"canvasManagerReleased",!1),zo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),zo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=mo(),e=bo();try{this.processBufferedMutations()}finally{n=mo()-t,i=e,ko>0||wo(n,null!=i?i:go)||n>$o.slowestBatchMs&&($o.slowestBatchMs=n)}var n,i}),zo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new va,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=po.parentNode(o);if(!a||!da(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Wo(a)?this.mirror.getId(ca(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=r)&&void 0!==s||(r={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{sa(t,this.mirror)&&this.iframeManager.addIframe(t),aa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),la(t)&&!na(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(po.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)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=js(o,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)ya(this.removesSubTreeCache,t)&&!this.movedSet.has(po.parentNode(t))||o(t);for(const t of this.addedSet)ba(this.droppedSet,t)||ya(this.removesSubTreeCache,t)?ba(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(po.parentNode(s.value)),n=i(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(po.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=po.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=po.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=po.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]=ls({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};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={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),zo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),zo(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(po.childNodes(t),t=>po.textContent(t)||"").join("");e.attributes.value=os({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:cs(t),value:n,maskInputFn:this.maskInputFn})}),zo(this,"processMutation",t=>{if(!ia(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=po.textContent(t.target);na(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Os(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ea(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=ss(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=cs(t);l=os({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(na(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"),!$s(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,ss(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(na(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=Wo(t.target)?this.mirror.getId(po.host(t.target)):this.mirror.getId(t.target);na(t.target,this.blockClass,this.blockSelector,!1)||ia(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ga(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ra(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[pa(n,i)]?ga(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Wo(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),po.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),zo(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(ia(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[pa(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!na(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=po.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(la(t)){const e=po.childNodes(po.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()}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){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),na(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?po.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?po.host(i):null}return!1}};function ga(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=po.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function ya(t,e,n){return 0!==t.size&&function(t,e){const n=po.parentNode(e);return!!n&&t.has(n)}(t,e)}function ba(t,e){if(0===t.size)return!1;let n=po.parentNode(e);for(;n;){if(t.has(n))return!0;n=po.parentNode(n)}return!1}function wa(t){fa=t}function ka(){fa=void 0}var _a=(t,e="rrweb")=>fa?(...n)=>{try{return t(...n)}catch(t){if(fa&&!0===fa(t,e))return;throw t}}:t,Sa=[];function xa(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 Ca(t,e){const n=new ma;let i;n.init(t);try{i=new(fo())(_a(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),Sa.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ma({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=xa(o);if(!a||na(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=Xs(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=[zs("scroll",_a(Qs(_a(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(zs("scrollend",_a(a),e)),()=>l.forEach(t=>t())}function Ia(t,e){for(let n=Sa.length-1;n>=0;n--){const i=Sa[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Sa.splice(n,1))}}var Ta=["INPUT","TEXTAREA","SELECT"],Ra=new WeakMap;function $a(t){return function t(e,n){if(Pa("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Pa("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Pa("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Pa("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 Ea(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Aa({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:po.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}}),_a(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Oa=new Set;function La(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=_a(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Sa.indexOf(r);-1!==t&&Sa.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Vs(o)}}),a=(t,e)=>{const n=_a(()=>{try{return e()}catch(e){throw Oa.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Ca(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=Qs(_a(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=_a(Qs(_a(t=>{const e=xa(t),{clientX:n,clientY:r}=oa(t)?t.changedTouches[0]:t;s||(s=Ks()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Ks()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Jr.Drag:t instanceof MouseEvent?Jr.MouseMove:Jr.TouchMove)}),r,{trailing:!1})),c=[zs("mousemove",u,n),zs("touchmove",u,n),zs("drag",u,n)];return _a(()=>{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=ss(o);const u=(e=>o=>{const s=xa(o);if(na(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 oa(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=oa(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;_a(t)(D({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(zs(s,u,e))}),_a(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ma(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return zs("resize",_a(Qs(_a(()=>{const e=Ys(),r=ta();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=xa(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=po.parentElement(n)),!n||!f||0>Ta.indexOf(f)||na(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=cs(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=os({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=Ra.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){Ra.set(e,i);const r=n.getId(e);_a(t)(D(D({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>zs(t,_a(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=>Js(t[0],t[1],{set(){_a(d)({target:this,isTrusted:!1})}},!1,v))),_a(()=>{Vs(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=_a(o=>Qs(_a(r=>{const s=xa(r);if(!s||na(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=[zs("play",s(to.Play),o),zs("pause",s(to.Pause),o),zs("seeked",s(to.Seeked),o),zs("volumechange",s(to.VolumeChange),o),zs("ratechange",s(to.RateChange),o)];return _a(()=>{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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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:_a((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}=Ea(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=Jo(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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={};Da("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Da("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Da("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Da("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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ea(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...$a(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ea(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...$a(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),_a(()=>{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",()=>Aa(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:_a((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}=Ea(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=$a(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:_a((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}=Ea(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=$a(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),_a(()=>{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=vo(e.fonts,"add",function(e){return function(n){return setTimeout(_a(()=>{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),_a(()=>{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=_a(()=>{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);na(o,i,r,!0)||na(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),zs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?vo(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 Pa(t){return void 0!==window[t]}function Da(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Fa=class{constructor(t){zo(this,"generateIdFn",void 0),zo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),zo(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}},Na=class{constructor(t){zo(this,"iframes",new WeakMap),zo(this,"crossOriginIframeMap",new WeakMap),zo(this,"crossOriginIframeMirror",new Fa(ks)),zo(this,"crossOriginIframeStyleMirror",void 0),zo(this,"crossOriginIframeRootIdMap",new WeakMap),zo(this,"mirror",void 0),zo(this,"mutationCb",void 0),zo(this,"wrappedEmit",void 0),zo(this,"loadListener",void 0),zo(this,"pageHideListener",void 0),zo(this,"stylesheetManager",void 0),zo(this,"recordCrossOriginIframes",void 0),zo(this,"messageHandler",void 0),zo(this,"nestedIframeListeners",new Map),zo(this,"attachedWindows",new WeakMap),zo(this,"attachedDocuments",new WeakMap),zo(this,"attachedIframes",new Map),zo(this,"loadListenerDisposers",new WeakMap),zo(this,"iframeElementsById",new Map),zo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Fa(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=>Ws(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Us(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);Ws(()=>{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)})}Ws(()=>{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 Qr.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:Qr.IncrementalSnapshot,data:{source:Jr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Qr.Meta:case Qr.Load:case Qr.DomContentLoaded:return!1;case Qr.Plugin:return e;case Qr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Qr.IncrementalSnapshot:switch(e.data.source){case Jr.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 Jr.Drag:case Jr.TouchMove:case Jr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Jr.ViewportResize:return!1;case Jr.MediaInteraction:case Jr.MouseInteraction:case Jr.Scroll:case Jr.CanvasMutation:case Jr.Input:return this.replaceIds(e.data,t,["id"]),e;case Jr.StyleSheetRule:case Jr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Jr.Font:return e;case Jr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Jr.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===eo.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&&(Us(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Us(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=>{Ws(()=>this.mirror.removeNodeFromMap(t))}),Ws(()=>Ia(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&&Us(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Us(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}},qa=class{constructor(t){zo(this,"shadowDoms",new WeakSet),zo(this,"mutationCb",void 0),zo(this,"scrollCb",void 0),zo(this,"bypassOptions",void 0),zo(this,"mirror",void 0),zo(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;this.shadowDoms.add(t);const r=null!==(n=null===(i=po.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:o,buffer:s}=Ca(D(D({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();const t=Sa.indexOf(s);-1!==t&&Sa.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:Ma(D(D({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(po.host(t))),this.restoreHandlers.push({doc:r,handler:Aa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:vo(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=po.shadowRoot(this);return o&&da(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},ja="skip-frame";function Ba(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 Ha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ua=0;64>Ua;Ua++)za[Ha.charCodeAt(Ua)]=Ua;var Wa=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Ha[n[e]>>2],r+=Ha[(3&n[e])<<4|n[e+1]>>4],r+=Ha[(15&n[e+1])<<2|n[e+2]>>6],r+=Ha[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},Va=!1,Za=new Map,Ga=(t,e,n)=>{if(!t||!Ka(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Za.get(t);return n||(n=new Map,Za.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 Qa(t,e,n,i){if(t instanceof Array)return t.map(t=>Qa(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:Wa(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Qa(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)?Va||(Va=!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:[Qa(t.data,e,n,i),t.width,t.height]}:Ka(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ga(t,e,n)}:t}var Ja=(t,e,n,i)=>t.map(t=>Qa(t,e,n,i)),Ka=(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]))},Xa=["webgl","webgl2"];function Ya(t){return"nodeType"in t}function tl(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 vo(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||Ya(o)&&na(o,e,n,!0))return i.call(this,r);Ya(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?D(D({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=vo(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!na(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&Xa.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 el(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=vo(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Ga(l,o,this),this.canvas&&"tagName"in this.canvas&&!na(this.canvas,i,r,!0)){let t;try{t=Ja(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=Js(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!na(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var nl='(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',il="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",nl],{type:"text/javascript;charset=utf-8"});function rl(t){let e;try{if(e=il&&(self.URL||self.webkitURL).createObjectURL(il),!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(nl),{name:null==t?void 0:t.name})}}var ol="A page CSP that omits blob: from worker-src or script-src blocks it";function sl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var al,ll,ul,cl=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){zo(this,"pendingCanvasMutations",new Map),zo(this,"rafStamps",{latestId:0,invokeId:null}),zo(this,"mirror",void 0),zo(this,"mutationCb",void 0),zo(this,"resetObservers",void 0),zo(this,"frozen",!1),zo(this,"locked",!1),zo(this,"rafIdTimestamp",null),zo(this,"rafIdFlush",null),zo(this,"refCount",0),zo(this,"torndown",!1),zo(this,"resetFrameDedup",null),zo(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 sl("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=tl(e,n,i,!0),l=new Map;let u;try{u=new rl}catch(t){return sl(`disabled because the encode worker did not start. ${ol}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,sl(`stopped because the encode worker failed. ${ol}`,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:Yr["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=>{na(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 ja}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ba))return ja;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,sl("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,sl("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=tl(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=vo(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return na(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Ja(s,e,this,r)}catch(t){return}t(this.canvas,{type:Yr["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Js(e.CanvasRenderingContext2D.prototype,a,{set(e){na(this.canvas,n,i,!0)||t(this.canvas,{type:Yr["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(...el(e.WebGLRenderingContext.prototype,Yr.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...el(e.WebGL2RenderingContext.prototype,Yr.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,Gr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},dl=class{constructor(t){var e;zo(this,"trackedLinkElements",new WeakSet),zo(this,"pendingDeferredSheets",new Set),zo(this,"mutationCb",void 0),zo(this,"adoptedStyleSheetCb",void 0),zo(this,"maskAllElementAttributes",void 0),zo(this,"maskAttributeFn",void 0),zo(this,"styleMirror",new ua),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=is(i))}catch(t){}if(!n||!i)return jo(),null;const r=n;let o=!1;const s={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=mo(),u=bo();let c=!0;try{if(o)return a=!0,jo(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const s=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(jo(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(jo(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),wo(d=mo()-l,null!=(h=u)?h:go)||(Eo.totalMs+=d,d>Eo.slowestSliceMs&&(Eo.slowestSliceMs=d))}var d,h},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:ls({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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=mo();try{Do(()=>{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{Fo(mo()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ps.forEach(t=>t.abort()),Ps.clear()}trackStylesheetInLinkElement(t){}},hl=class{constructor(){zo(this,"nodeMap",new WeakMap),zo(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(){}},fl=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var vl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(vl=t.contentWindow)||void 0===vl?void 0:vl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var pl=new rs,ml=new Set([Jr.Mutation,Jr.MediaInteraction,Jr.StyleSheetRule,Jr.CanvasMutation,Jr.Font,Jr.Log,Jr.StyleDeclaration,Jr.AdoptedStyleSheet]);function gl(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)}}function yl(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineStylesheetBudgetRules:h,maskAllInputs:f,maskInputOptions:v,slimDOMOptions:p,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y=!1,maskAttributeFn:b,hooks:w,packFn:k,sampling:_={},dataURLOptions:S={},canvasResolutionScale:x,canvasMasking:C,mousemoveWait:M,recordDOM:I=!0,recordCanvas:T=!1,recordCrossOriginIframes:R=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:O=!1,inlineImages:L=!1,plugins:P,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:N=new Set([]),attributeFilter:q,errorHandler:j}=t;wa(j);const B=D({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),H=!R||window.parent===window;let z=!1;if(!H)try{window.parent.document&&(z=!1)}catch(t){z=!0}if(H&&!n)throw new Error("emit function is required");if(!H&&!z)return()=>{};void 0!==M&&void 0===_.mousemove&&(_.mousemove=M),pl.reset();const U=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},W=Bs(void 0!==p&&p);let V;!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 G=new Map;let Q,J;const K=t=>{for(const e of P||[])e.eventProcessor&&(t=e.eventProcessor(t));return k&&!z&&(t=k(t)),t};al=(t,e)=>{var o;const s=t;if(s.timestamp=Ks(),!(null===(o=Sa[0])||void 0===o?void 0:o.isFrozen())||s.type===Qr.FullSnapshot||s.type===Qr.IncrementalSnapshot&&ml.has(s.data.source)||Sa.forEach(t=>t.unfreeze()),H)null==n||n(K(s),e);else if(z){const t={type:"rrweb",event:K(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(s.type===Qr.FullSnapshot)V=s,Z=0;else if(s.type===Qr.IncrementalSnapshot){if(s.data.source===Jr.Mutation&&s.data.isAttachIframe)return;Z++,(r&&Z>=r||i&&s.timestamp-V.timestamp>i)&&ll(!0)}};const X=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=pl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=nt.getIframeElementById(t);i&&n.has(i)?nt.forgetIframeId(t):(null==Q||Q(t),nt.removeIframeById(t))}),null==J||J(),nt.cleanupDetachedIframes()}al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Mutation},t)})},Y=t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Scroll},t)}),tt=t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.CanvasMutation},t)}),et=new dl({mutationCb:X,adoptedStyleSheetCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.AdoptedStyleSheet},t)}),maskAllElementAttributes:y,maskAttributeFn:b}),nt=new Na({mirror:pl,mutationCb:X,stylesheetManager:et,recordCrossOriginIframes:R,wrappedEmit:al});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:pl,crossOriginIframeMirror:nt.crossOriginIframeMirror,crossOriginIframeStyleMirror:nt.crossOriginIframeStyleMirror});const it=new hl,rt=null==C?void 0:C.configured;ul=new cl({recordCanvas:T,mutationCb:tt,win:window,blockClass:o,blockSelector:s,mirror:pl,sampling:_.canvas,dataURLOptions:B,resolutionScale:x,canvasMasking:C});const ot=new qa({mutationCb:X,scrollCb:Y,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:U,dataURLOptions:B,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,sampling:_,slimDOMOptions:W,iframeManager:nt,stylesheetManager:et,canvasManager:ul,keepIframeSrcFn:F,processedNodeManager:it,attributeFilter:q},mirror:pl});ll=(t=!1)=>{if(I){Ao(h);try{al({type:Qr.Meta,data:{href:window.location.href,width:ta(),height:Ys()}},t),null==e||e.cancel(),e=void 0,et.reset(),ot.init(),Sa.forEach(t=>t.lock());let n=null,i=[];try{n=function(t,e){const{mirror:n=new rs,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:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:M,inlineStylesheetBudgetRules:I}=e||{},T=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,R=Bs(m);Ao(I);try{return js(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:T,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:R,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:M})}finally{Oo()}}(document,{mirror:pl,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:U,inlineStylesheetBudgetRules:h,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOM:W,dataURLOptions:B,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,onSerialize(t){sa(t,pl)&&nt.addIframe(t),aa(t,pl)&&et.trackLinkElement(t),la(t)&&ot.addShadowRoot(po.shadowRoot(t),document)},onIframeLoad(t,e){nt.attachIframe(t,e),ot.observeAttachShadow(t)},onIframeListenerRegistered(t,e){nt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){et.attachLinkElement(t,e)},keepIframeSrcFn:F})}finally{i=qo()}if(!n)return console.warn("Failed to snapshot the document");if(al({type:Qr.FullSnapshot,data:{node:n,initialOffset:Xs(window)}},t),Sa.forEach(t=>t.unlock()),ul.onFullSnapshot(),i.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&&Ws(()=>{s=e.beginDeferredLinkInlining(n,pl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Ws(()=>{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,Bo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=gl(d):n())};return r=gl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return;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);Bo(e),null==s||s.discard(),s=null}n()}}}(i,et,()=>{e===t&&(e=void 0)});e=t}R&&nt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&et.adoptStyleSheets(document.adoptedStyleSheets,pl.getId(document))}finally{Oo()}}};try{const t=[];t.push(zs("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(zs(e,yo,document));Q=e=>{const n=G.get(e);n&&(n.forEach(e=>{Ws(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),G.delete(e))},J=()=>{for(const[t]of G){const e=pl.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==Q||Q(t)}catch(e){null==Q||Q(t)}else null==Q||Q(t)}};const n=t=>{var e;return _a(La)({mutationCb:X,mousemoveCb:(t,e)=>al({type:Qr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.MouseInteraction},t)}),scrollCb:Y,viewportResizeCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.ViewportResize},t)}),inputCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Input},t)}),mediaInteractionCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.MediaInteraction},t)}),styleSheetRuleCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.StyleSheetRule},t)}),styleDeclarationCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.StyleDeclaration},t)}),canvasMutationCb:tt,fontCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Font},t)}),selectionCb(t){al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Selection},t)})},customElementCb(t){al({type:Qr.IncrementalSnapshot,data:D({source:Jr.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:U,inlineStylesheet:d,sampling:_,recordDOM:I,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,userTriggeredOnInput:A,collectFonts:O,doc:t,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y,maskAttributeFn:b,keepIframeSrcFn:F,blockSelector:s,slimDOMOptions:W,dataURLOptions:B,mirror:pl,iframeManager:nt,stylesheetManager:et,shadowDomManager:ot,processedNodeManager:it,canvasManager:ul,ignoreCSSAttributes:N,attributeFilter:q,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>al({type:Qr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},w)};nt.addLoadListener(e=>{try{const i=pl.getId(e),r=n(e.contentDocument);if("function"==typeof r&&(t.push(r),-1!==i)){let t=G.get(i);t||(t=new Set,G.set(i,t)),t.add(r)}}catch(t){console.warn(t)}}),nt.addPageHideListener(t=>{const e=pl.getId(t);null==Q||Q(e),Ia(t)});let i=-1;const r=t=>al({type:Qr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),h=()=>{var t,e,n,o;const s=document,a=null!==(t=null!==(e=null!==(n=null!==(o=s.fullscreenElement)&&void 0!==o?o:s.webkitFullscreenElement)&&void 0!==n?n:s.mozFullScreenElement)&&void 0!==e?e:s.msFullscreenElement)&&void 0!==t?t:null,l=a?pl.getId(a):-1;l!==i&&(-1!==i&&r({id:i,enter:!1}),i=l,-1!==l&&r({id:l,enter:!0}))},f=()=>{ll();const e=n(document);"function"==typeof e&&t.push(e),t.push(zs("fullscreenchange",h)),t.push(zs("webkitfullscreenchange",h)),t.push(zs("mozfullscreenchange",h)),t.push(zs("MSFullscreenChange",h)),fl=!0};return["interactive","complete"].includes(document.readyState)?f():(t.push(zs("DOMContentLoaded",()=>{al({type:Qr.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&f()})),t.push(zs("load",()=>{al({type:Qr.Load,data:{}}),"load"===E&&f()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Vs(t),it.destroy(),nt.removeLoadListener(),nt.destroy(),G.clear(),ot.reset(),pl.reset(),fl=!1,ka()}}catch(t){console.warn(t)}}yl.addCustomEvent=(t,e)=>{if(!fl)throw new Error("please add custom event after start recording");al({type:Qr.Custom,data:{tag:t,payload:e}})},yl.freezePage=()=>{Sa.forEach(t=>t.freeze())},yl.takeFullSnapshot=t=>{if(!fl)throw new Error("please take full snapshot after start recording");ll(t)},yl.mirror=pl,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var bl=Object.create(null);function wl(t){return wl="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},wl(t)}function kl(t,e,n){return(e=function(t){var e=function(t){if("object"!=wl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}bl.Node=Object.create(null),bl.ShadowRoot=Object.create(null),bl.MutationObserver=Object.create(null),bl.Element=Object.create(null);var _l=class{constructor(t){kl(this,"fileName",void 0),kl(this,"functionName",void 0),kl(this,"lineNumber",void 0),kl(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}`}},Sl=/(^|@)\S+:\d+/,xl=/^\s*at .*(\S+:\d+|\(native\))/m,Cl=/^(eval@)?(\[native code])?$/,Ml={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(xl)?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(xl)},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 _l({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(Cl)},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 _l({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new _l({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 _l({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 _l({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(Sl)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new _l({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Il(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 Tl(t){return Array.isArray(t)}function Rl(t){return"object"==typeof t&&null!==t&&!Tl(t)}function $l(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Rl(t[i])&&$l(t[i],e-1))return!0;return!1}function El(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(Rl(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Rl(o)&&$l(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]=Tl(i)?Il(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 Al={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 Ol(t,e,n){const i=n?Object.assign({},Al,n):Al,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:Ml.parse(e.error).map(t=>t.toString()),payload:[El(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=[El(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[El("Uncaught (in promise)",i.stringifyOptions),El(e.reason,i.stringifyOptions)]),t({level:"error",trace:Ml.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=Ml.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>El(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[El("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 Ll=t=>({name:"rrweb/console@1",observer:Ol,options:t});const Pl=()=>{},Dl=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Fl(t,e,n){try{if(!(e in t))return Pl;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return W(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=Dl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=Dl(n)}}}catch(t){return Pl}}function Nl(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 ql=ue("[Recorder]"),jl=t=>"navigation"===t.entryType,Bl=t=>"resource"===t.entryType;function Hl(t,e){var n;return jl(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function zl(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Hl(t,n)||Bl(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=>Hl(t,e))}(t):[]}function Ul(t,e){return!!e&&(Y(e)||e[t])}function Wl(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 Vl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Zl({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:!!Wl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Vl))return!1;if(Y(e))return!0;if(U(e))return r(e);const o=e[t];return Y(o)?o:r(o)}function Gl(t,e,n,i,r){return Ql.apply(this,arguments)}function Ql(){return Ql=A(function*(t,e,n,i,r,o=0){if(o>10)return ql.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=>Bl(t)&&t.initiatorType===e&&(Z(i)||t.startTime>=i)&&(Z(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Gl(t,e,n,i,r,o+1))}),Ql.apply(this,arguments)}function Jl({body:t,options:e,url:n}){if(K(t))return null;const{hostname:i,isHostDenied:r}=Nl(n,e);if(r)return i+" is in deny list";if(G(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(tt(t))return function(t,e="&"){let n,i;const r=[];return ce(t,function(t,e){Z(t)||Z(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)}(t);if(V(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 Kl=t=>!J(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Xl({entry:t,method:e,status:n,networkRequest:i,isInitial:r,start:o,end:s,url:a,initiatorType:l}){o=t?t.startTime:o,s=t?t.responseEnd:s;const u=Math.floor(Date.now()-performance.now()),c=Math.floor(u+(o||0)),d=[D(D({},t?t.toJSON():{name:a}),{},{startTime:Z(o)?void 0:Math.round(o),endTime:Z(s)?void 0:Math.round(s),timeOrigin:u,timestamp:c,method:e,initiatorType:l||(t?t.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:r})];if(Kl(t))for(const e of t.serverTiming||[])d.push({timeOrigin:u,timestamp:c,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return d}const Yl=["video/","audio/"];function tu(t){return V(t)&&W(t.getReader)&&W(t.tee)}const eu="[SessionReplay] Timeout while trying to read body",nu="[SessionReplay] Failed to read body";function iu(t){return`${nu}: ${t}`}function ru(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function ou(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(eu),500);try{t.clone().text().then(t=>e(t),t=>e(iu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(nu)}})}(t);const n=Ze(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(ru(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(eu),500);let l;try{l=t.clone()}catch(t){return void s(nu)}const u=l.body;if(!tu(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(iu(t)))}catch(t){s(nu)}return}try{i=u.getReader()}catch(t){return void s(nu)}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(ru(e));d+=i.byteLength,c.push(i)}t()}},t=>s(iu(t)))}()})}(t,n)}function su(){return su=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Nl(n,e);return r?Promise.resolve(i+" is in deny list"):ou(t,e)}),su.apply(this,arguments)}function au(){return au=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=Yl.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Nl(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return J(i)?ou(t,e):Promise.resolve(i)}),au.apply(this,arguments)}let lu=null;function uu(t,e,n){if(!("performance"in e))return()=>{};if(lu)return ql.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ge,n):Ge;let r=!0;const o=e=>{if(!r)return;const n=[];let o=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&o)return;const r=i.maskRequestFn(t);e||(o=!r||(t=>!!t&&nn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(D(D({},e),{},{requests:n}))},s=function(t,e,n){try{t({requests:zl(e,n).flatMap(t=>Xl({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){ql.error("Failed to capture initial performance entries for network capture",t)}const i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>jl(t)||Bl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Xl({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),r=PerformanceObserver.supportedEntryTypes.filter(t=>n.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:r}),()=>{i.disconnect()}}(o,e,i);let a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Ul("request",n.recordHeaders),r=Ul("response",n.recordHeaders),o=Fl(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=>(Zl({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=Jl({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),Zl({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Jl({body:d.response,options:n,url:a})),Gl(e,"xmlhttprequest",o.url,u,c).then(e=>{t({requests:Xl({entry:e,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){ql.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(o,e,i),l=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Ul("request",n.recordHeaders),r=Ul("response",n.recordHeaders),o=Fl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return ql.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),!tu(null==a?void 0:a.body)&&Zl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return su.apply(this,arguments)}({r:l,options:n,url:s}))}catch(t){ql.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Wl(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),Zl({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return au.apply(this,arguments)}({r:u,options:n,url:s}))}catch(t){ql.error("Failed to record fetch response for network capture",t)}return u}finally{Gl(e,"fetch",l.url,d,h).then(e=>{t({requests:Xl({entry:e,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()}}(o,e,i)),lu=()=>{r=!1,s(),a(),l(),lu=null},lu}const cu=t=>({name:"rrweb/network@1",observer:uu,options:t});var du,hu,fu,vu,pu,mu,gu,yu,bu,wu,ku,_u,Su,xu,Cu;a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ll,getRecordNetworkPlugin:cu},a.__PosthogExtensions__.rrweb={record:yl,version:"v2",wasMaxDepthReached:()=>qs,resetMaxDepthState(){qs=!1,Ns=!1},getLastSnapshotCost:()=>Co,getMutationCost:()=>D({},$o),getObserverInitFailures:()=>Oa.size?Array.from(Oa):void 0,resetSnapshotCostState(){ko=0,_o=0,So=0,go=0,xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Co=null,Mo=null,Io=[],To=0,Ro=0,$o={slowestBatchMs:0},Eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},a.rrweb={record:yl,version:"v2"},a.rrwebConsoleRecord={getRecordConsolePlugin:Ll},a.getRecordNetworkPlugin=cu,a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initSessionRecording=(t,e)=>new Zr(t,e);var Mu,Iu,Tu,Ru,$u={},Eu=[],Au=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ou=Array.isArray;function Lu(t,e){for(var n in e)t[n]=e[n];return t}function Pu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Du(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?du.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 Fu(t,s,i,r,null)}function Fu(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?++fu:r,__i:-1,__u:0};return null==r&&null!=hu.vnode&&hu.vnode(o),o}function Nu(t){return t.children}function qu(t,e){this.props=t,this.context=e}function ju(t,e){if(null==e)return t.__?ju(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?ju(t):null}function Bu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Lu({},e);o.__v=e.__v+1,hu.vnode&&hu.vnode(o),Ku(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?ju(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,Yu(i,o,r),e.__e=e.__=null,o.__e!=n&&Hu(o)}}function Hu(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}),Hu(t)}function zu(t){(!t.__d&&(t.__d=!0)&&vu.push(t)&&!Uu.__r++||pu!=hu.debounceRendering)&&((pu=hu.debounceRendering)||mu)(Uu)}function Uu(){try{for(var t,e=1;vu.length;)vu.length>e&&vu.sort(gu),t=vu.shift(),e=vu.length,Bu(t)}finally{vu.length=Uu.__r=0}}function Wu(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Eu,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]=Fu(null,s,null,null,null):Ou(s)?s=t.__k[o]=Fu(Nu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Fu(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=Zu(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=ju(a)),nc(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]||$u,f.__i=d,m=Ku(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ec(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=Vu(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 Vu(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=Vu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=ju(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Zu(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 Gu(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Au.test(e)?n:n+"px"}function Qu(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||Gu(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Gu(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(ku,"$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[wu]=i[wu]:(n[wu]=_u,t.addEventListener(e,o?xu:Su,o)):t.removeEventListener(e,o?xu:Su,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 Ju(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[bu])e[bu]=_u++;else if(n[wu]>e[bu])return;return n(hu.event?hu.event(e):e)}}}function Ku(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=hu.__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 qu(y,w),h.constructor=C,h.render=ic),$&&$.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=Lu({},h.__s)),Lu(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)}),Eu.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=hu.__r,_=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Eu.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>++_);h.state=h.__s,null!=h.getChildContext&&(i=Lu(Lu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),S=null!=c&&c.type===Nu&&null==c.key?tc(c.props.children):c,a=Wu(t,Ou(S)?S:[S],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--;)Pu(o[x]);Xu(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||Xu(e);hu.__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||$u,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&&(hu.__m&&hu.__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&&du.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||Qu(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||Qu(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=""),Wu("template"==e.type?t.content:t,Ou(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&ju(n,0),a,l),null!=o)for(u=o.length;u--;)Pu(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])&&Qu(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&Qu(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=hu.diffed)&&c(e),128&e.__u?void 0:a}function Xu(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Xu))}function Yu(t,e,n){for(var i=0;n.length>i;i++)ec(n[i],n[++i],n[++i]);hu.__c&&hu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){hu.__e(t,e.__v)}})}function tc(t){return"object"!=typeof t||null==t||t.__b>0?t:Ou(t)?t.map(tc):void 0!==t.constructor?null:Lu({},t)}function ec(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){hu.__e(t,n)}}function nc(t,e,n){var i,r;if(hu.unmount&&hu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||ec(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){hu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&nc(i[r],e,n||"function"!=typeof t.type);n||Pu(t.__e),t.__c=t.__=t.__e=void 0}function ic(t,e,n){return this.constructor(t,n)}function rc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),hu.__&&hu.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],Ku(e,t=(!i&&n||e).__k=Du(Nu,null,[t]),r||$u,$u,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?du.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),Yu(o,t,s),t.props.children=null}du=Eu.slice,hu={__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}},fu=0,qu.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Lu({},this.state);"function"==typeof t&&(t=t(Lu({},n),this.props)),t&&Lu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),zu(this))},qu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),zu(this))},qu.prototype.render=Nu,vu=[],mu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gu=function(t,e){return t.__v.__b-e.__v.__b},Uu.__r=0,yu=Math.random().toString(8),bu="__d"+yu,wu="__a"+yu,ku=/(PointerCapture)$|Capture$/i,_u=0,Su=Ju(!1),xu=Ju(!0),Cu=0;var oc=0,sc=[],ac=hu,lc=ac.__b,uc=ac.__r,cc=ac.diffed,dc=ac.__c,hc=ac.unmount,fc=ac.__;function vc(t,e){ac.__h&&ac.__h(Iu,t,oc||e),oc=0;var n=Iu.__H||(Iu.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function pc(t){return oc=1,function(t,e){var n=vc(Mu++,2);if(n.t=t,!n.__c&&(n.__=[Mc(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=Iu,!Iu.__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};Iu.__f=!0;var r=Iu.shouldComponentUpdate,o=Iu.componentWillUpdate;Iu.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)},Iu.shouldComponentUpdate=i}return n.__N||n.__}(Mc,t)}function mc(t,e){var n=vc(Mu++,3);!ac.__s&&Cc(n.__H,e)&&(n.__=t,n.u=e,Iu.__H.__h.push(n))}function gc(t){return oc=5,yc(function(){return{current:t}},[])}function yc(t,e){var n=vc(Mu++,7);return Cc(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function bc(t){var e=Iu.context[t.__c],n=vc(Mu++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Iu)),e.props.value):t.__}function wc(){for(var t;t=sc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Sc),e.__h.some(xc),e.__h=[]}catch(n){e.__h=[],ac.__e(n,t.__v)}}}ac.__b=function(t){Iu=null,lc&&lc(t)},ac.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),fc&&fc(t,e)},ac.__r=function(t){uc&&uc(t),Mu=0;var e=(Iu=t.__c).__H;e&&(Tu===Iu?(e.__h=[],Iu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&wc(),Mu=0)),Tu=Iu},ac.diffed=function(t){cc&&cc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==sc.push(e)&&Ru===ac.requestAnimationFrame||((Ru=ac.requestAnimationFrame)||_c)(wc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Tu=Iu=null},ac.__c=function(t,e){e.some(function(t){try{t.__h.some(Sc),t.__h=t.__h.filter(function(t){return!t.__||xc(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],ac.__e(n,t.__v)}}),dc&&dc(t,e)},ac.unmount=function(t){hc&&hc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{Sc(t)}catch(t){e=t}}),n.__H=void 0,e&&ac.__e(e,n.__v))};var kc="function"==typeof requestAnimationFrame;function _c(t){var e,n=function(){clearTimeout(i),kc&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);kc&&(e=requestAnimationFrame(n))}function Sc(t){var e=Iu,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Iu=e}function xc(t){var e=Iu;t.__c=t.__(),Iu=e}function Cc(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Mc(t,e){return"function"==typeof e?e(t):e}const Ic="tab",Tc="left",Rc="center",$c="right",Ec="next_to_trigger",Ac="popover",Oc="widget",Lc="external_survey",Pc="open",Dc="multiple_choice",Fc="single_choice",Nc="rating",qc="end",jc="always",Bc="$survey_id",Hc="$survey_name",zc="$survey_iteration",Uc="$survey_iteration_start_date",Wc="$survey_language",Vc=ue("[Surveys]");function Zc(t){return W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}const Gc=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,Qc=t=>Gc("seenSurvey_",t),Jc=t=>{try{const e=Qc(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Vc.error("Failed to persist survey seen state",t)}},Kc=[Ac,Oc,"api"],Xc=ue("[Stylesheet Loader]"),Yc=t,td=i,ed="#020617",nd={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:$c,widgetType:Ic,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ed,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},id=[Rc,Tc,$c];function rd(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 od(t=nd.backgroundColor){let e;"#"===t[0]&&(e=rd(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=rd(n)),!e)return ed;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?ed:"white"}return ed}const sd=(t,e,n)=>{const i=Cd(t),r=td.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=td.createElement("div");((t,e,n)=>{const i=D(D({},nd),n),r=t.style,o=!id.includes(i.position)||e===Oc&&(null==n?void 0:n.widgetType)===Ic;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)||od(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",od(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||od(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",od(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)||od(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 W(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||(Xc.error("prepare_external_dependency_stylesheet returned null"),null)})(td,':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)}}',t);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||td.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},ad=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l;i?Zc(i)&&(Jc(e),i.capture("survey sent",D(D(D({[Hc]:e.name,[Bc]:e.id,[zc]:e.current_iteration,[Uc]:e.current_iteration_start_date,sessionRecordingUrl:null===(l=i.get_session_replay_url)||void 0===l?void 0:l.call(i)},Ti({event:"sent",survey:e,responses:t,submissionId:n,completed:r,surveyLanguage:s,questionSnapshots:a})),o),{},{$set:{[$i(e,"responded")]:!0}})),r&&(Yc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),xd(e),i.reloadFeatureFlags())):Vc.error("[survey sent] event not captured, PostHog instance not found.")},ld=(t,e,n,i)=>{var r;return D({[Hc]:e.name,[Bc]:e.id,[zc]:e.current_iteration,[Uc]:e.current_iteration_start_date,sessionRecordingUrl:null===(r=i.get_session_replay_url)||void 0===r?void 0:r.call(i)},Ti({event:t,survey:e,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},ud=(t,e,n,i)=>{if(!e)return void Vc.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const r=_d(t),o=r?r.surveyLanguage:i;e.capture("survey dismissed",D(D(D({},ld("dismissed",t,r,e)),o&&{[Wc]:o}),{},{$set:{[$i(t,"dismissed")]:!0}})),xd(t),Jc(t),Yc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},cd=(t,e)=>{if(!e)return void Vc.error("[survey abandoned] event not captured, PostHog instance not found.");const n=(t=>Gc("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(n))return}catch(t){return}const i=_d(t);if(i){try{localStorage.setItem(n,"true")}catch(t){}e.capture("survey abandoned",ld("abandoned",t,i,e),{transport:"sendBeacon"})}},dd=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},hd=(t,e)=>{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=ji(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions;var n,i,r},fd=t=>function(t){var e;return Di(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||Sd(t),vd=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,zu(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"+Cu++,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}),pd=()=>bc(vd),md=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Lu({},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?du.call(arguments,2):n),Fu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i});function gd(t,e){var n,i;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const r=me(e);if(!r)return!1;const o=[t.conditions.url],s=function(t){return null!=t?t:"icontains"}(null===(i=t.conditions)||void 0===i?void 0:i.urlMatchType);return qi[s](o,[r])}function yd(e){var i,r;return function(e,i){var r,s,a;if(!e||0===e.length)return!0;if(!o)return!1;const l=function(t,e){var n;const i=function(t){return _t.test(t)?ft:kt.test(t)?vt:wt.test(t)?pt:new RegExp(gt,"i").test(t)?gt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ht:St.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(mt,"i").test(t)?mt:/(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(lt).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":ct:new RegExp("(pda|Mobile)","i").test(t)?yt:new RegExp(ut,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?bt:""}(t);return i===dt||i===ct||"Kobo"===i||"Kindle Fire"===i||i===bt?ut:i===ft||i===pt||i===vt||i===gt?"Console":i===ht?"Wearable":i?lt:"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)?lt:ut:"Desktop";var r,o,s}(o,{userAgentDataPlatform:null==n||null===(r=n.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==n?void 0:n.maxTouchPoints,screenWidth:null==t||null===(s=t.screen)||void 0===s?void 0:s.width,screenHeight:null==t||null===(a=t.screen)||void 0===a?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return qi[null!=i?i:"icontains"](e,[l])}(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const bd=t=>Gc("inProgressSurvey_",t),wd={},kd=(t,e)=>{const n=bd(t);try{localStorage.setItem(n,JSON.stringify(e)),delete wd[n]}catch(t){Vc.error("Error setting in-progress survey state in localStorage",t),wd[n]=e}},_d=t=>{const e=bd(t),n=wd[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Vc.error("Error getting in-progress survey state from localStorage",t)}return null},Sd=t=>{const e=_d(t);return!K(null==e?void 0:e.surveySubmissionId)},xd=t=>{const e=bd(t);delete wd[e];try{localStorage.removeItem(e)}catch(t){Vc.error("Error clearing in-progress survey state from localStorage",t)}};function Cd(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function Md(t,e=$c,n){if(t===Lc)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 Tc:return{left:"30px"};case Rc:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Oc&&n===Ic?"60px":"30px"}}}var Id=0;function Td(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:--Id,__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 hu.vnode&&hu.vnode(u),u}const Rd=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Td("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"})}),$d=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Td("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"})}),Ed=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Td("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"})}),Ad=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Td("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"})}),Od=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Td("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"})}),Ld=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Td("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"})}),Pd=Td("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Td("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"})}),Dd=({fill:t="currentColor"}={})=>Td("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:[Td("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Td("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})]}),Fd=Td("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Td("g",{"clip-path":"url(#clip0_2415_6911)",children:[Td("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Td("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Td("g",{mask:"url(#mask0_2415_6911)",children:[Td("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Td("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Td("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Td("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Td("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Td("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Td("defs",{children:Td("clipPath",{id:"clip0_2415_6911",children:Td("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Nd({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Td("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Fd]})}function qd({text:e,submitDisabled:n,appearance:i,onSubmit:r,link:o,onPreviewSubmit:s,skipSubmitButton:a,canGoBack:l,onBack:u}){const{isPreviewMode:c}=bc(vd),d=!!l&&!!u,h=!a&&Td("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():r()},children:e});return Td("div",{className:"bottom-section",children:[d?Td("div",{className:"form-buttons form-buttons-with-back",children:[Td("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Td(Nd,{urlParams:{utm_source:"survey-footer"}})]})}function jd({question:t,forceDisableHtml:e,htmlFor:n}){return Td("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Td(t.type===Pc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&md({component:Du("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function Bd({onClick:t}){const{isPreviewMode:e}=bc(vd);return Td("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:Dd({fill:"black"})})}const Hd=t;function zd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=bc(vd);return mc(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return fe(Hd,"keydown",t),()=>{Hd.removeEventListener("keydown",t)}},[o]),Td("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Td(Bd,{onClick:()=>o()}),Td("h3",{className:"thank-you-message-header",children:t}),e&&md({component:Du("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Td(qd,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function Ud({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=bc(vd);return Td("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Td(Bd,{onClick:()=>l()}),t&&Td("h3",{className:"intro-screen-header",children:t}),e&&md({component:Du("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Td(qd,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const Wd=t=>U(t)&&t.every(t=>G(t));function Vd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=pd(),c=gc(null),[d,h]=pc(()=>G(s)?s:""),f=null==n?void 0:n.disableAutofocus;mc(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=yc(()=>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 F: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 N: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=re(t.validation,F),g=re(t.validation,N),y=yc(()=>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 Td(Nu,{children:[Td("div",{className:"question-container",children:[Td(jd,{question:t,forceDisableHtml:e,htmlFor:v}),Td("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&&Td("div",{className:"validation-hint",children:y})]}),Td(qd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function Zd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Td(Nu,{children:[Td("div",{className:"question-container",children:Td(jd,{question:t,forceDisableHtml:e})}),Td(qd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function Gd({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]=pc(()=>X(s)?s:U(s)&&s.length>0&&X(parseInt(s[0]))?parseInt(s[0]):G(s)&&X(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=pd(),m=t=>p?o(t):r(t);return Td(Nu,{children:[Td("div",{className:"question-container",children:[Td(jd,{question:t,forceDisableHtml:e}),Td("div",{className:"rating-section",children:[Td("div",{className:"rating-options",children:["emoji"===t.display&&Td("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=th[t.scale])||void 0===u?void 0:u.map((e,i)=>Td("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&&Td("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:eh(t.scale).map((e,r)=>Td(Qd,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Td("div",{className:"rating-text",children:[Td("div",{children:t.lowerBoundLabel}),Td("div",{children:t.upperBoundLabel})]})]})]}),Td(qd,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:J(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Qd({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Td("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function Jd({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=gc(null),c=yc(()=>(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=ji(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return J(i)||r.push(i),r})(t),[t]),[d,h]=pc(()=>((t,e)=>G(t)||Wd(t)?t:e===Fc?null:[])(s,t.type)),[f,v]=pc(()=>((t,e)=>{if(G(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Wd(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=pd(),m=t.type===Fc,g=t.type===Dc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>D(D({},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=>D(D({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&U(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>D(D({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||_()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),v(t=>D(D({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},_=()=>!(t.optional||!J(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),S=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Td(Nu,{children:[Td("div",{className:"question-container",children:[Td(jd,{question:t,forceDisableHtml:e}),Td("fieldset",{className:"multiple-choice-options limit-height",children:[Td("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:U(d)&&d.includes(e);return Td("label",{className:r?"choice-option-open":"",children:[Td("div",{className:"response-choice",children:[Td("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Td("span",{children:r?`${e}:`:e})]}),r&&Td("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)})]})]}),Td(qd,{text:t.buttonText||"Submit",submitDisabled:_(),appearance:i,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const Kd=[1,2,3,4,5],Xd=[1,2,3,4,5,6,7],Yd=[0,1,2,3,4,5,6,7,8,9,10],th={2:[Ld,Pd],3:[Ed,$d,Rd],5:[Ad,Ed,$d,Rd,Od]};function eh(t){switch(t){case 5:default:return Kd;case 7:return Xd;case 10:return Yd}}const nh=ue("[Surveys]");function ih(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?qc:o;if(r.branching.type===qc)return qc;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===Fc){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];return Number.isInteger(e)?e:e===qc?qc:o}}else if(r.type===Nc){var a;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const t=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(t)){const e=r.branching.responseValues[t];return Number.isInteger(e)?e:e===qc?qc:o}}return o}return nh.warn("Falling back to next question index due to unexpected branching type"),o}const rh=ue("[SurveyTranslations]");function oh(t,e){const n=function(t){return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Ei(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?Ei(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Ei(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:W(t.get_property)?t.get_property(y):void 0,locale:navigator.language||navigator.userLanguage},rh)}(e);if(!n)return rh.info("No user language detected"),{survey:t,language:null};const i=Pi(t,n,rh);return{survey:i.survey,language:i.matchedKey}}const sh=t,ah=i,lh="ph:show_survey_widget",uh="PHWidgetSurveyClickListener";function ch(t,e){try{const n=t.getBoundingClientRect(),i=sh.innerHeight,r=sh.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:nd.zIndex}}catch(t){return Vc.warn("Failed to calculate trigger position:",t),null}}var dh=class{constructor(t){this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ii=null,this.Ti=!1,this.Ri=null,this.$i=null,this.Ei=null,this.Ai=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(b);if(t)for(const e of t)Sd(e)&&cd(e,this._posthog)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l;if(!Zc(this._posthog))return;const{survey:u,language:c}=this.Oi(t);this.Ii=c,this.Ei=null,this.Li=e;const d=this.Pi(u,e);this.Di(d.id);const{properties:h,initialResponses:f}=null!=e?e:{},v=!(!f||0>=Object.keys(f).length)&&this.Fi(d,f,h,c);if(v&&!(null===(i=d.appearance)||void 0===i?void 0:i.displayThankYouMessage))return;this.Ni(d);let p={};if((null===(r=d.appearance)||void 0===r?void 0:r.position)===Ec&&(null===(o=d.appearance)||void 0===o?void 0:o.widgetSelector)){const t=ah.querySelector(d.appearance.widgetSelector);var m;t&&(p=ch(t,parseInt((null===(m=d.appearance)||void 0===m?void 0:m.maxWidth)||nd.maxWidth))||{})}const g=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:y}=sd(d,this._posthog);this.Ci.set(y,y.host);const b={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.qi,properties:h,style:p,isSurveyCompleted:v,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:c};if(this.Ei=b,0>=g)return this.Ti=!0,rc(Td(mh,D({},b)),y);const w=()=>{this.Ti=!0;const{survey:n,language:i}=this.Oi(t);this.Ii=i;const r=this.Pi(n,e),o=D(D({},b),{},{survey:r,surveyLanguage:i});this.Ei=o,rc(Td(mh,D(D({},o),{},{survey:D(D({},r),{},{appearance:D(D({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),y)},k=()=>{if(!Zc(this._posthog)||!this.ji(d))return Vc.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.qi(d);w()},_=n?null===(a=this._posthog.surveys)||void 0===a||null===(a=a._surveyEventReceiver)||void 0===a||null===(l=a.getActivationTimestamp)||void 0===l?void 0:l.call(a,d.id):void 0,S=X(_)?Math.max(0,Date.now()-_):0,x=Math.max(0,1e3*g-S);if(0>=x)return k();const C=sh.setTimeout(()=>{this.ki.delete(d.id),k()},x);this.ki.set(d.id,C)},this.Bi=t=>{var e;const{survey:n,language:i}=this.Oi(t),{shadow:r,isNewlyCreated:o}=sd(n,this._posthog);this.Ci.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Ic&&this.xi.set(t.id,t),o&&rc(Td(yh,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),r)},this.Hi=t=>{const e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(uh),this.Si.delete(t),Vc.info(`Removed click listener for survey ${t}`))},this.zi=t=>{this.Ui(t)||(this.Wi(t),this.Hi(t.id))},this.Vi=t=>{this.Ui(t)||(this.Wi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var e;const n=ah.querySelector(Cd(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Zi=(t,e)=>{const n=ah.querySelector(e),i=this.Si.get(t.id);if(n){if(this.Bi(t),i){if(n===i.element)return;Vc.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(uh)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Ec?ch(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||nd.maxWidth)):{};sh.dispatchEvent(new CustomEvent(lh,{detail:{surveyId:t.id,position:r}}))};fe(n,"click",e),n.setAttribute(uh,"true"),this.Si.set(t.id,{element:n,listener:e,survey:t}),Vc.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.zi(t)},this.renderPopover=t=>{if(!Zc(this._posthog))return;const{survey:e,language:n}=this.Oi(t),{shadow:i}=sd(e,this._posthog);this.Ci.set(i,i.host),rc(Td(mh,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.qi,surveyLanguage:n}),i)},this.renderSurvey=(t,e,n)=>{var i;if(!Zc(this._posthog))return;const{survey:r,language:o}=this.Oi(t);let s=!1;(null===(i=this._posthog.config)||void 0===i||null===(i=i.surveys)||void 0===i?void 0:i.prefillFromUrl)&&(s=this.Gi(r,o,n)),rc(Td(mh,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this._posthog)||void 0===n||null===(n=n.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.ji(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{const e=Zc(this._posthog),n=t.filter(t=>e&&(t.type===Ac||t.type===Oc)),i=new Set(n.map(t=>t.id));for(const t of Array.from(this.ki.keys()))i.has(t)||this.cancelSurvey(t);const r=this.Qi(n),o=new Set,s=new Set;r.forEach(t=>{if(t.type===Oc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Ic)return s.add(t.id),void this.Bi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(o.add(t.id),this.Zi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}J(this.Ji)&&t.type===Ac&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.Si.forEach(({survey:t})=>{o.has(t.id)||this.zi(t)}),this.xi.forEach((t,e)=>{s.has(e)||this.Vi(t)})},t)},this.Ni=t=>{J(this.Ji)||Vc.error(`Survey ${this.Ji} already in focus. Cannot add survey ${t.id}.`),this.Ji=t.id},this.qi=t=>{this.Ji!==t.id&&Vc.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Di(t.id),this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0,this.Wi(t)},this._posthog=t,this.Ji=null,this.Ri=()=>this.Ki(),fe(sh,"languagechange",this.Ri),this.$i=t.onFeatureFlags(()=>this.Ki())}Ki(){if(J(this.Ji))return;const t=this._posthog.get_property(b),e=null==t?void 0:t.find(t=>t.id===this.Ji);if(!e)return;const{survey:n,language:i}=this.Oi(e);if(i===this.Ii)return;if(this.Ii=i,!this.Ti)return;const r=this.Pi(n,this.Li),{shadow:o}=sd(r,this._posthog);rc(Td(mh,D(D({},this.Ei),{},{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,surveyLanguage:i})),o)}get Xi(){var t,e,n;return null!==(t=null===(e=(n=this._posthog).getExtension)||void 0===e?void 0:e.call(n,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Pi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?D(D({},t),{},{appearance:D(D(D({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Di(t){const e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(Vc.info(`Cancelled pending survey ${t}`),this.Di(t),this.Ji===t&&(this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(wd))delete wd[t]})()}setAutomaticDisplayDispose(t){this.Yi=t}dispose(){var t;null===(t=this.Yi)||void 0===t||t.call(this),this.Yi=void 0,this.Ri&&(sh.removeEventListener("languagechange",this.Ri),this.Ri=null),this.$i&&(this.$i(),this.$i=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Hi(e)),this.Ci.forEach((t,e)=>{rc(null,e),null==t||t.remove()}),this.Ci.clear(),this.xi.clear(),this.Ji=null}Qi(t){return t.sort((t,e)=>{var n,i;const r=Sd(t),o=Sd(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===jc,a=e.schedule===jc;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)})}Oi(t){return oh(t,this._posthog)}Gi(t,e,n){if(this.Mi.has(t.id))return!1;const{params:i}=function(t){const e={};let n=!1;const i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:n};const r=i.split("&");for(const t of r){const[i,r]=t.split("=");if(!i||Z(r))continue;const o=decodeURIComponent(i),s=decodeURIComponent(r);if("auto_submit"===o&&"true"===s){n=!0;continue}const a=o.match(/^q(\d+)$/);if(a){const t=parseInt(a[1],10);e[t]||(e[t]=[]),e[t].push(s)}}return{params:e,autoSubmit:n}}(sh.location.search);if(0===Object.keys(i).length)return!1;Vc.info("[Survey Prefill] Detected URL prefill parameters");const r=this.tr(t,i,e);return!!r&&(this.er(t,r,n,e),this.Mi.add(t.id),r.isSurveyCompleted)}er(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&ad({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Fi(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Vc.info("[Survey] Processing initial responses");const o=this.tr(t,r,i);return!!o&&(this.er(t,o,n,i),o.isSurveyCompleted)}tr(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 Fc:{if(!t.choices||0===t.choices.length)return void le.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 le.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Dc:{if(!t.choices||0===t.choices.length)return void le.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 le.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&le.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case Nc:{const e=parseInt(r[0],10),s=t.scale||10;if(isNaN(e)||0>e||e>s)return void le.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: 0-${s})`);n[o]=e;break}default:le.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){le.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return Vc.warn("[Survey Prefill] No valid responses after conversion"),null;const r=gi(),{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);Z(n[t])||(r[t]=n[t])}o.push(i);const s=ih(t,i,e.id?n[Mi(e.id)]:null);if(s===qc)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)),i),l=o>=t.questions.length;return kd(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:dd(t.questions),visitedIndices:a,surveyLanguage:n}),Vc.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Vc.error("[Survey Prefill] Error handling prefill:",t),null}}nr(t,e=void 0){if(!t)return!0;const n=this.Xi,i=!!(null==n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let r=!0;e&&(r=(null==n?void 0:n.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const o=i&&r;return o||this.ir(t),o}ir(t){var e;!this.Ai&&(null===(e=this._posthog.config)||void 0===e?void 0:e.advanced_disable_feature_flags)&&(this.Ai=!0,Vc.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.`))}rr(t){return!t.conditions||gd(t,this._posthog)&&yd(t)&&function(t){var e;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null==td?void 0:td.querySelector(t.conditions.selector))}(t)}sr(t){var e;return fd(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.Xi)||void 0===e?void 0:e.hasLoadedFlags)?(this.ir(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.nr(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(!Kc.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.nr(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.nr(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.sr(t);var s;return o.satisfied?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}(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays,wi.Ot("lastSeenSurveyDate"))?(t=>!!wi.Ot(Qc(t))&&!fd(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):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(){return Zc(this._posthog)?{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.ar(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ar(t){var e;if(!Di(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._posthog.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}lr(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.nr(e))}ji(t){return this.checkSurveyEligibility(t).eligible&&this.rr(t)&&this.ar(t)&&this.lr(t)}Wi(t){try{const e=ah.querySelector(Cd(t,!0));(null==e?void 0:e.shadowRoot)&&(rc(null,e.shadowRoot),this.Ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Vc.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.qi,surveyInFocus:this.Ji,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Zi,sortSurveysByAppearanceDelay:this.Qi,checkFlags:this.lr.bind(this),isSurveyFeatureFlagEnabled:this.nr.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Ti}}};function hh(t,e){if(!ah||!sh)return;const n=new dh(t);if(t.config.disable_surveys_automatic_display)return Vc.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===e)return Vc.info("There are no surveys to load or Surveys is disabled in the project settings."),n;let i;n.callSurveysAndEvaluateDisplayLogic(!0);const r=()=>{Z(i)&&(i=setInterval(()=>{n.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{Z(i)||(clearInterval(i),i=void 0)};r();const s=()=>{ah.hidden?o():(n.callSurveysAndEvaluateDisplayLogic(!1),r())};return fe(ah,"visibilitychange",s),n.setAutomaticDisplayDispose(()=>{o(),ah.removeEventListener("visibilitychange",s)}),n}function fh({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){mc(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Oc,s=gd(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===Ic&&o;if(!s)return Vc.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Vc.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};fe(sh,"popstate",s),fe(sh,"hashchange",s);const a=sh.history.pushState,l=sh.history.replaceState;return sh.history.pushState=function(...t){a.apply(this,t),s()},sh.history.replaceState=function(...t){l.apply(this,t),s()},()=>{sh.removeEventListener("popstate",s),sh.removeEventListener("hashchange",s),sh.history.pushState=a,sh.history.replaceState=l}},[i,t,e,n,r])}const vh=200;function ph(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 mh({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,M;const I=gc(null),T=Number.isInteger(r),{isPopupVisible:R,isSurveySent:E,hidePopupWithAnimation:A}=function(t,e,n,i,r,o,s,a,l){const[u,c]=pc(i||0===n||t.type===Lc),[d,h]=pc(!1),f=gc(!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 ${vh}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return mc(()=>{if(!e)return void Vc.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=()=>{if(gd(t,e)){var n;c(!0),sh.dispatchEvent(new Event("PHSurveyShown")),a||e.capture("survey shown",D(D({[Hc]:t.name,[Bc]:t.id,[zc]:t.current_iteration,[Uc]:t.current_iteration_start_date},l&&{[Wc]:l}),{},{sessionRecordingUrl:null===(n=e.get_session_replay_url)||void 0===n?void 0:n.call(e)}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};fe(sh,"PHSurveyClosed",p),fe(sh,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return Z(u)&&s(),()=>{Z(u)||clearTimeout(u),Z(r)||clearTimeout(r),sh.removeEventListener("PHSurveyClosed",p),sh.removeEventListener("PHSurveySent",o)}},[]),fh({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,T,o,s,I,f,v),O=E||r===t.questions.length||!0===h,[L,P]=pc(!1),F=yc(()=>!!_d(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=T?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!L&&!F,j=yc(()=>{const e=_d(t),i=(null==e?void 0:e.surveySubmissionId)||gi();return{isPreviewMode:T,previewPageIndex:r,onPopupSurveyDismissed(){v?ud(t,n,T,v):ud(t,n,T),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[T,r,s,n,t,u,a,l,d,v]);return R?Td(vd.Provider,{value:j,children:Td("div",{className:"ph-survey",style:D(D({},Md(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?Td(zd,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:t.appearance||nd,onClose(){A(),c()}}):q?Td(Ud,{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===(M=t.appearance)||void 0===M?void 0:M.introScreenDescriptionContentType,appearance:t.appearance||nd,onStart:()=>P(!0)}):Td(gh,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function gh({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=yc(()=>{const e=_d(t);if(!e)return null;const n=X(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(xd(t),null)},[t]),[s,a]=pc(()=>((null==o?void 0:o.responses)&&Vc.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=pc(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=bc(vd),[b,w]=pc(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=X(e)&&e>=0&&t.questions.length>e?e:0;return X(c)&&c>=0?c:n}),[k,_]=pc(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[S,x]=pc(()=>{var e;const n=_d(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=yc(()=>dd(hd(t,o)),[t.id,o]),M=yc(()=>{if(!C||new Set(C).size!==C.length)return hd(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]);mc(()=>{!m||Z(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),T=M.at(b);return T?Td("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Td(Bd,{onClick(){d()}}),Td("div",{className:"survey-box","data-question-index":b,children:[l&&Td("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),bh({question:T,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||nd,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{if(!n)return void Vc.error("onNextButtonClick called without a PostHog instance.");if(!Zc(n))return void u(!0);if(u(!1),!r)return void Vc.error("onNextButtonClick called without a questionId.");const{responses:o,questionSnapshots:l}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:D(D({},t),{},{[Mi(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?D(D({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:S},r,e,M[i]);a(o),x(l);const c=ih(t,i,e),d=c===qc,h=[...k,i];if(d||(_(h),w(c),kd(t,{surveySubmissionId:p,responses:o,lastQuestionIndex:c,questionOrder:dd(M),visitedIndices:h,surveyLanguage:y,questionSnapshots:l})),t.enable_partial_responses||d){const e=new Set(h.map(t=>{var e;return null===(e=M[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Mi(t))),i=Object.fromEntries(Object.entries(o).filter(([t])=>e.has(t)));ad({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:d,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:l})}})({res:e,displayQuestionIndex:b,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?s[Mi(T.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);_(n),w(e),kd(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:dd(M),visitedIndices:n,surveyLanguage:y,questionSnapshots:S})}})]})]}):null}function yh({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d;const[h,f]=pc(!0),[v,p]=pc(!1),[m,g]=pc({}),y=gc(void 0),b=()=>{(v||!n||i||Zc(n))&&p(!v)};if(mc(()=>{var e;if(!n)return void Vc.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});const r=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Vc.info(`Received show event for feedback button survey ${t.id}`),g(i.detail.position||{}),b())};return fe(sh,lh,r),()=>{Z(y.current)||(clearTimeout(y.current),y.current=void 0),sh.removeEventListener(lh,r)}},[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.widgetSelector,null===(a=t.appearance)||void 0===a?void 0:a.borderColor]),fh({survey:t,setSurveyVisible:f,posthog:n}),!h)return null;const w=()=>{t.schedule!==jc&&f(!1),Z(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,p(!1)},200)};return Td(Nu,{children:["tab"===(null===(l=t.appearance)||void 0===l?void 0:l.widgetType)&&Td("button",{className:"ph-survey-widget-tab "+("top"===(null===(u=t.appearance)||void 0===u?void 0:u.tabPosition)?"widget-tab-top":""),onClick:b,disabled:i,style:ph(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=t.appearance)||void 0===d?void 0:d.widgetLabel)||""}),v&&Td(mh,{posthog:n,survey:t,forceDisableHtml:e,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:r})]})}const bh=({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 Pc:return Du(Vd,D(D({},u),{},{question:t,key:t.id}));case"link":return Du(Zd,D(D({},u),{},{question:t,key:t.id}));case Nc:return Du(Gd,D(D({},u),{},{question:t,key:t.id}));case Fc:case Dc:return Du(Jd,D(D({},u),{},{question:t,key:t.id}));default:return Vc.error(`Unsupported question type: ${t.type}`),null}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.generateSurveys=hh,a.extendPostHogWithSurveys=hh;const wh=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},kh=1e4,_h=(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),Sh=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return _h(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 _h(e,JSON.stringify(t.slice(0,r)),n)},xh=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Ch=(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}},Mh=(t,e,n)=>{if(!n.truncated)if(V(t)){if(n.seen.has(t))return void Ch(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Mh(t[i],e?`${e}.${i}`:i,n),n.truncated)return}catch(t){continue}}catch(t){}}else Ch(e,t,n)},Ih=(t,e,n,i,r=!1,o)=>{if(!xh(t))return!r||_h(e,"null",n);if(J(t)||(t=>{try{return X(t)||Y(t)}catch(t){return!1}})(t))return _h(e,JSON.stringify(t),n);if("string"==typeof t)return Sh(t,e,n);if(!V(t)&&!U(t))return _h(e,JSON.stringify(t),n);if(i.has(t))return Sh("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return Ih(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return Sh(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return _h(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 Ih(s,e,n,i,r,o)}if(U(t)){if(!_h(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!_h(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!Ih(o,e,n,i,!0))return!1}return _h(e,"]",n)}if(!_h(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{Mh(a,r,o)}catch(t){}if(!xh(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(!_h(e,l,n))return!1;const h=e.length,f=Ih(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 _h(e,"}",n)},Th=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=V(t[0])?{result:{},keysRemaining:50,sizeRemaining:kh,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||_h(n," ",i))&&Ih(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)||{}}},Rh={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},$h=t=>"canCapture"in t,Eh=t=>$h(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0,Ah=(t,e,n)=>{if($h(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;W(r)&&r.call(e,n)};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.logs={initializeLogs(t){let e=t;const n=[],i={host:a.location.host};let r=!1;for(const t of Object.keys(Rh)){const o=n=>(...o)=>{let s=!1;try{const n=e;if(o.length>0&&!r&&n){const e=Eh(n);if(e){r=!0,s=!0;const{body:a,truncated:l,attributes:u}=Th(o,kh),c=D(D({},i),l?{body_truncated:"true"}:{}),d={level:Rh[t],body:a,attributes:D(D({"log.source":`console.${t}`},c),u)};Ah(n,e,d)}}}catch(t){}finally{s&&(r=!1),n.apply(a.console,o)}},s=a.console[t];n.push(Fl(a.console,t,t=>{const e=o(t);return e.__rrweb_original__=wh(s),e}))}return()=>{e=void 0,n.forEach(t=>t())}},replayConsoleBuffer(t,e){const n=Eh(t);if(n)for(const t of e)try{var i;const{body:e,truncated:r,attributes:o}=Th(t.args,kh);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:Rh[t.level],body:e,attributes:D(D({"log.source":`console.${t.level}`,host:a.location.host},r?{body_truncated:"true"}:{}),o)},t.context,t.occurredAtMs)}catch(t){}}},ue("[Error tracking]");const Oh=ue("[ExceptionAutocapture]"),Lh=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&&U(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 D(D({},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?D(D({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:Tt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(it(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 U(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 D(D({},v),{},{errors:m})},c=(n,i=0)=>D(D({},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 D(D({},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=G(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 nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!rt(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 et(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!!nt(t,"ErrorEvent")&&(null!=t.error||this.ur(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return D(D({},i),{},{stack:null!==(n=this.cr(t))&&void 0!==n?n:i.stack,synthetic:!0})}ur(t){return G(t.message)&&t.message.length>0}cr(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(G(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return it(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 rt(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(rt(t))return t.constructor.name;const e="name"in t?t.name:void 0;return G(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 G(t)&&!Q(t)&&Jt.indexOf(t)>=0}getStack(t){try{return G(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:G(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(it(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(Qt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return et(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=Bt.test(i)?i.replace(Bt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=zt(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(Zt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Wt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Ut(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++)Gt(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 D(D({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Ft,jt)),Ph=(t,e)=>{try{return t()}catch(t){return e}},Dh=(t,e)=>Ph(()=>t(e()),void 0),Fh=t=>Ph(()=>W(t)&&W(t.call),!1),Nh=(t,e)=>Ph(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),qh=(t,e,n)=>{Ph(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),Ph(()=>{t[e]=n},void 0)},jh=e=>{const n=t;n||Oh.info("window not available, cannot wrap onerror");const i=Ph(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return Dh(e,()=>Lh.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(G(t)&&G(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}})),!!Fh(i)&&null!==(n=i(...t))&&void 0!==n&&n},Nh(n,"onerror"),()=>qh(n,"onerror",i)},Bh=(e,n=!1)=>{const i=t;i||Oh.info("window not available, cannot wrap onUnhandledRejection");const r=Ph(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return Dh(e,()=>Lh.buildFromUnknown(t,{mechanism:{handled:!1}})),Fh(r)?null!==(i=r(t))&&void 0!==i&&i:n},Nh(i,"onunhandledrejection"),()=>qh(i,"onunhandledrejection",r)},Hh={wrapOnError:jh,wrapUnhandledRejection:Bh,wrapConsoleError(t){const e=console;e||Oh.info("console not available, cannot wrap console.error");const n=Ph(()=>e.error,void 0);return e.error=function(...e){Ph(()=>e.length>1&&G(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||Dh(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return Lh.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Fh(n)&&n(...e)},Nh(e,"error"),()=>qh(e,"error",n)}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.errorWrappingFunctions=Hh,a.posthogErrorWrappingFunctions=Hh;const zh=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!J(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){Oh.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){Oh.error("Failed to capture exception for a legacy client",t)}};jh(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Bh(r,!0)};a.extendPostHogWithExceptionAutoCapture=zh,a.extendPostHogWithExceptionAutocapture=zh;const Uh="X-POSTHOG-SESSION-ID",Wh="X-POSTHOG-WINDOW-ID",Vh="X-POSTHOG-DISTINCT-ID",Zh=[Uh,Wh,Vh],Gh=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Qh=(t,e)=>({}.hasOwnProperty.call(t,e)),Jh=t=>"object"==typeof t&&!J(t)||W(t),Kh=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Xh=e=>{try{var n;return Kh(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}},Yh=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(U(t)&&!t.includes(o))return!1;let s=!1;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Uh,t),r.set(Wh,e),s=!0}const a=(t=>W(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Vh,a),s=!0),s};a.__PosthogExtensions__=a.__PosthogExtensions__||{};const tf={_patchFetch:(e,n,i)=>Fl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=Xh(r);if(t)if(Kh(r)){const t=new Request(r,o);Yh(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(Jh(o)?o.headers:void 0);if(Yh(e,n,i,t,s)){const t=((t,e)=>{if(Z(t)||J(t))return{headers:e};if(!Jh(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)=>Qh(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>Qh(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),Gh.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&&Gh.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?D(D({},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)=>Fl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=Xh(o);d&&Yh(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Zh.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};a.__PosthogExtensions__.tracingHeadersPatchFns=tf,a.postHogTracingHeadersPatchFns=tf,"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 ef=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 nf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},rf=t=>{if("loading"===document.readyState)return"loading";const e=nf();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"},of=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},sf=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[of(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},af=new WeakMap;function lf(t,e){let n=af.get(e);return n||(n=new WeakMap,af.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let uf=-1;const cf=()=>uf,df=t=>{addEventListener("pageshow",e=>{e.persisted&&(uf=e.timeStamp,t(e))},!0)},hf=(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)))}},ff=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},vf=()=>{var t,e;return null!==(t=null===(e=nf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let pf=-1;const mf=new Set,gf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,yf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of mf)t();isFinite(pf)||(pf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",yf,!0))}},bf=(t=!1)=>{if(t&&(pf=1/0),0>pf){var e;const t=vf(),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;pf=null!=n?n:gf(),addEventListener("visibilitychange",yf,!0),addEventListener("prerenderingchange",yf,!0),df(()=>{setTimeout(()=>{pf=gf()})})}return{get firstHiddenTime(){return pf},onHidden(t){mf.add(t)}}},wf=(t,e=-1,n,i=0,r,o,s)=>{const a=nf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>cf()?a&&(document.prerendering||vf()>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}},kf=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},_f=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},Sf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},xf=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Cf=class{constructor(){this.u=void 0}};const Mf=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},If=[1800,3e3],Tf=(t,e={})=>{const n=_f(e);Mf(()=>{const i=lf(e,Cf),r=bf();let o,s=wf("FCP");const a=kf(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-vf(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=hf(t,s,If,e.reportAllChanges),df(n=>{s=wf("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,cf()),o=hf(t,s,If,e.reportAllChanges),ff(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&kf(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&Sf(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=wf("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=hf(t,s,If,e.reportAllChanges),o(!0)})},e)})},Rf=[.1,.25],$f=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],Ef=(t,e={})=>{const n=lf(e=Object.assign({},e),ef),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=$f(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:sf(s);i.set(n,t)}}},((t,e={})=>{const n=bf();Tf(xf(()=>{let i,r=wf("CLS",0);const o=lf(e,ef),s=(n,s,a,l,u)=>{r=wf("CLS",0,n,s,a,l,u),o.o=0,i=hf(t,r,Rf,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"];_f(e)&&c.push("soft-navigation");const d=kf(c,u);d&&(i=hf(t,r,Rf,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),df(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,cf()),ff(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=$f(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:rf(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Af=(t,e={})=>{const n=lf(e=Object.assign({},e),Cf);_f(e)&&(n.u=new Map),Tf(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:rf(cf())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=nf(),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:rf(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 Of=0,Lf=1/0,Pf=0;const Df=t=>{for(const e of t)e.interactionId&&(Lf=Math.min(Lf,e.interactionId),Pf=Math.max(Pf,e.interactionId),Of=Pf?(Pf-Lf)/7+1:0)};let Ff;const Nf=()=>{var t;return Ff?Of:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var qf=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Nf()-this.h}D(){this.h=Nf(),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 jf=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=xf(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})}},Bf=[200,500],Hf=(t,e={})=>{const n=lf(e=Object.assign({},e),qf);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(jf(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:sf(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};kf(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=bf();Mf(()=>{var i;"interactionCount"in performance||Ff||(Ff=kf(["event"],Df,{durationThreshold:0}));let r,o=wf("INP");const s=lf(e,qf),a=(n,i,a,l,u)=>{s.D(),o=wf("INP",-1,n,i,a,l,u),r=hf(t,o,Bf,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)=>{jf(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];_f(e)&&d.push("soft-navigation");const h=kf(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=hf(t,o,Bf,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),df(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,cf())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:rf(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:rf(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 zf=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 Uf=50;const Wf=[];kf(["resource"],t=>{for(const e of t)Wf.push(e),Wf.length>Uf&&Wf.shift()});const Vf=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Uf=e.resourceBufferSize);const n=lf(e,zf),i=new WeakMap;_f(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:sf(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=_f(e);Mf(()=>{let r,o=bf(),s=wf("LCP");const a=lf(e,zf),l=(i,a,l,u,c)=>{s=wf("LCP",-1,i,a,l,u,c),r=hf(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=bf(!0))},u=t=>{var e;a.u&&t.navigationId&&Sf(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-vf(),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=kf(d,c);if(h){r=hf(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;jf(()=>{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});df(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,cf()),r=hf(t,s,$,e.reportAllChanges),ff(()=>{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&&(Wf.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=nf(),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=D(D({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Zf=-1;const Gf=()=>Zf,Qf=t=>{addEventListener("pageshow",e=>{e.persisted&&(Zf=e.timeStamp,t(e))},!0)},Jf=(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)))}},Kf=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Xf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Yf=()=>{var t,e;return null!==(t=null===(e=Xf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let tv=-1;const ev=new Set,nv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,iv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of ev)t();isFinite(tv)||(tv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",iv,!0))}},rv=(t=!1)=>{if(t&&(tv=1/0),0>tv){var e;const t=Yf(),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;tv=null!=n?n:nv(),addEventListener("visibilitychange",iv,!0),addEventListener("prerenderingchange",iv,!0),Qf(()=>{setTimeout(()=>{tv=nv()})})}return{get firstHiddenTime(){return tv},onHidden(t){ev.add(t)}}},ov=(t,e=-1,n,i=0,r,o,s)=>{const a=Xf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Gf()?a&&(document.prerendering||Yf()>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}},sv=new WeakMap;function av(t,e){let n=sv.get(e);return n||(n=new WeakMap,sv.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var lv=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 uv=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},cv=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},dv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},hv=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var fv=class{constructor(){this.l=void 0}};const vv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},pv=[1800,3e3],mv=(t,e={})=>{const n=cv(e);vv(()=>{const i=av(e,fv),r=rv();let o,s=ov("FCP");const a=uv(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Yf(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=Jf(t,s,pv,e.reportAllChanges),Qf(n=>{s=ov("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Gf()),o=Jf(t,s,pv,e.reportAllChanges),Kf(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&uv(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&dv(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=ov("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=Jf(t,s,pv,e.reportAllChanges),o(!0)})},e)})},gv=[.1,.25],yv=(t,e={})=>{const n=rv();mv(hv(()=>{let i,r=ov("CLS",0);const o=av(e,lv),s=(n,s,a,l,u)=>{r=ov("CLS",0,n,s,a,l,u),o.i=0,i=Jf(t,r,gv,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"];cv(e)&&c.push("soft-navigation");const d=uv(c,u);d&&(i=Jf(t,r,gv,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Qf(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Gf()),Kf(i)}),setTimeout(i))}))};let bv=0,wv=1/0,kv=0;const _v=t=>{for(const e of t)e.interactionId&&(wv=Math.min(wv,e.interactionId),kv=Math.max(kv,e.interactionId),bv=kv?(kv-wv)/7+1:0)};let Sv;const xv=()=>{var t;return Sv?bv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Cv=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return xv()-this.u}M(){this.u=xv(),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 Mv=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=hv(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})}},Iv=[200,500],Tv=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=rv();vv(()=>{var i;"interactionCount"in performance||Sv||(Sv=uv(["event"],_v,{durationThreshold:0}));let r,o=ov("INP");const s=av(e,Cv),a=(n,i,a,l,u)=>{s.M(),o=ov("INP",-1,n,i,a,l,u),r=Jf(t,o,Iv,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)=>{Mv(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];cv(e)&&d.push("soft-navigation");const h=uv(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=Jf(t,o,Iv,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Qf(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Gf())}))})};var Rv=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 $v=[2500,4e3],Ev=(t,e={})=>{let n=!1;const i=cv(e);vv(()=>{let r,o=rv(),s=ov("LCP");const a=av(e,Rv),l=(i,a,l,u,c)=>{s=ov("LCP",-1,i,a,l,u,c),r=Jf(t,s,$v,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=rv(!0))},u=t=>{var e;a.l&&t.navigationId&&dv(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-Yf(),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=uv(d,c);if(h){r=Jf(t,s,$v,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Mv(()=>{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});Qf(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Gf()),r=Jf(t,s,$v,e.reportAllChanges),Kf(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},Av={onLCP:Vf,onCLS:Ef,onFCP:Af,onINP:Hf,withoutAttribution:{onLCP:Ev,onCLS:yv,onFCP:mv,onINP:Tv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Av,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Av,a.postHogWebVitalsCallbacks=Av;const Ov={onLCP:Ev,onCLS:yv,onFCP:mv,onINP:Tv};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Ov,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Ov,a.postHogWebVitalsCallbacks=Ov,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Ov;const Lv={onLCP:Vf,onCLS:Ef,onFCP:Af,onINP:Hf,withoutAttribution:{onLCP:Ev,onCLS:yv,onFCP:mv,onINP:Tv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Lv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Lv,a.postHogWebVitalsCallbacks=Lv;const Pv={onLCP:Ev,onCLS:yv,onFCP:mv,onINP:Tv};function Dv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Fv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!ge(e));return e}function Nv(e,{e:n,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:o,elementsChainAsString:s,disableCaptureUrlHashes:a}){var l,u;if(!ge(e))return{props:{}};const c=[e],d=new Set([e]);let h=e;for(;h.parentNode&&!ye(h,"body")&&1e3>c.length;){if(be(h.parentNode)){const t=h.parentNode.host;if(d.has(t))break;d.add(t),c.push(t),h=t;continue}if(!ge(h.parentNode))break;if(d.has(h.parentNode))break;d.add(h.parentNode),c.push(h.parentNode),h=h.parentNode}const f="click"===n.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(t=>ye(t,"button")||ye(t,"a")):-1;f>0&&(r=r||c.slice(0,f+1).some(t=>!Ae(t)||Oe(t)));const v=[],p={};let m,g=!1,y=!1;if(ce(c,t=>{const e=Ae(t);if(ye(t,"a")&&!i&&!(null==o?void 0:o.includes("href"))){const n=t.getAttribute("href");g=!!(e&&n&&Be(n))&&(a?xt(n):n)}q(ke(t),"ph-no-capture")&&(y=!0),v.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};xe.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Dv(1024,He(t)):Dv(1024,_e(t)));const a=ke(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),ce(t.attributes,function(n){var o;if((!Oe(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Be(n.value)&&(!G(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=we(t).join(" ")),s["attr__"+n.name]=Dv(1024,"href"===n.name&&r?xt(t):t)}});let l=1,u=1,c=t;for(;c=Fv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,i,r,o,a)),ce(function(t){if(!Ae(t))return{};const e={};return ce(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&&Be(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(p,e)||(p[e]=t)})}),y)return{props:{},explicitNoCapture:y};if(f>0&&(e=c[f],v.splice(0,f)),r||(v[0].$el_text=ye(e,"a")||ye(e,"button")?He(e):_e(e)),g){var b,w;v[0].attr__href=g;const e=null===(b=pe(g))||void 0===b?void 0:b.host,n=null==t||null===(w=t.location)||void 0===w?void 0:w.host;e&&n&&e!==n&&(m=g)}return{props:de((_=n.type,{$event_type:_,$ce_version:1}),s?{}:{$elements:v},{$elements_chain:(k=v,U(k)?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=D(D(D(D({},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 he(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ue(t.toString())]=Ue(e.toString())),i+=":",i+=he(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:We(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return he(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(k)):"")},(null===(l=v[0])||void 0===l?void 0:l.$el_text)?{$el_text:null===(u=v[0])||void 0===u?void 0:u.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},p),target:e};var k,_}a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Pv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Pv,a.postHogWebVitalsCallbacks=Pv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Pv,ue("[AutoCapture]");const qv={};function jv(t,e){const n=Se(t);return n?D({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Bv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Hv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const zv="canvas,video,audio,embed,object";function Uv(t,e){return X(t)&&t>=e}function Wv(t,e=1e3){return t>=0&&e>t?t:void 0}function Vv(t,e,n=1e3){return X(e)?Wv(t-e,n):void 0}var Zv=class{dr(t){var e,n,i,r,o,s,a,l;const u=this.hr((null==t?void 0:t.__onCapture)||this.vr.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.pr=new WeakSet,this.mr=!1,this.gr=[],this.yr=0,this.hr=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.br=()=>{clearTimeout(this.wr),this.wr=void 0,this.kr=void 0},this._r=t=>{if(this.Sr(t),this.br(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},n=null==i?void 0:i.getSelection();e.selectionInitiallyRelated="Range"===(null==n?void 0:n.type)&&this.Cr(n,e),this.kr=e}},this.Mr=t=>{J(t.relatedTarget)&&this.br()},this.Ir=t=>{const e=this.kr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(ge(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.wr=a.setTimeout(this.br,0)},this.Tr=t=>{this.Sr(t);const e=t,n=jv(e,{type:"click"}),i=this.kr;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.Rr.selection_change_threshold_ms>0,this.br()),J(n)||this.$r(n)||this.Er(n),this.Ar()},this.Or=()=>{const t=Date.now();this.Lr=t,t%50==0&&this.gr.forEach(e=>{Z(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Pr=t=>{var e,n;const r=null==i?void 0:i.getSelection(),o=this.mr;this.mr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(ge(s)?s:s.parentElement),l=null==i?void 0:i.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=Re(Se(t))||Re(null!=a?a:null)||Re(null!==(n=u)&&void 0!==n?n:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.mr||c||d))return;const h=Date.now();this.Dr=h;const f=this.kr;if(f&&(o||this.mr||c)){const e=Se(t);let n;if(Re(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;Re(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.Fr(n,f):r&&(s||r.anchorNode)?this.Cr(r,f):o&&!this.mr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.gr.forEach(t=>{const e=h-t.timestamp;0>e||!Z(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.ln=()=>{"hidden"===(null==i?void 0:i.visibilityState)&&this.br();const t=Date.now();this.Nr=t,this.qr("visibilityChangedDelayMs",t)},this.jr=()=>{const t=Date.now();this.Br=t,this.qr("focusChangedDelayMs",t)},this.Hr=t=>{this.Sr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.zr=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.Ur=()=>{this.zr=void 0},this.Wr=t=>{var e;const n=this.zr;if(this.zr=void 0,Z(n)||this.yr>=this.Rr.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-n.x,a=o.clientY-n.y,l=s*s+a*a,u=this.Rr.swipe_threshold_px;if(u*u>l)return;if([this.Lr,this.Vr,this.Dr].some(t=>X(t)&&t>=n.timestamp))return;var c,d;if(this.Zr()&&(null!==(c=null==i||null===(d=i.elementsFromPoint)||void 0===d?void 0:d.call(i,n.x,n.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,zv)}))return;const h=jv(r,{type:"swipe",swipeDirection:Bv(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});J(h)||this.$r(h)||this.Er(h),this.Ar()},this.Rr=this.dr(e),this._onCapture=this.Rr.__onCapture}start(t){this.Gr(),this.Qr(),this.Jr(),this.Kr(),this.Xr(),this.Yr(t),this.Rr.capture_dead_swipes&&this.eo()}Yr(e){if(!this.no){const n=function(e){return function(e,n){const i=qv[e];if(i)return i;let r=n[e];if((t=>W(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return qv[e]=r.bind(n);const o=n.document;if(o&&W(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const l=t.contentWindow;var s,a;l&&l[e]&&(r=l[e],"MutationObserver"===e&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){le.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)}}return r&&W(r)?qv[e]=r.bind(n):r}("MutationObserver",e)}(a);this.no=new n(t=>{this.io(t)}),this.ro(e)}}ro(t){t&&this.no&&(this.pr.has(t)||(this.no.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.pr.add(t),this.oo(t)))}oo(t,e){var n,i;ge(t)&&t.shadowRoot&&this.ro(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.ro(r[t].shadowRoot)}Sr(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];ge(e)&&this.ro(e.shadowRoot)}}stop(){var t;null===(t=this.no)||void 0===t||t.disconnect(),this.no=void 0,this.pr=new WeakSet,a.removeEventListener("click",this.Tr,{capture:!0}),a.removeEventListener("mousedown",this._r,{capture:!0}),a.removeEventListener("mouseup",this.Ir,{capture:!0}),a.removeEventListener("mouseout",this.Mr,{capture:!0}),a.removeEventListener("dragstart",this.br,{capture:!0}),a.removeEventListener("pointercancel",this.br,{capture:!0}),a.removeEventListener("blur",this.br),this.br(),a.removeEventListener("scroll",this.Or,{capture:!0}),null==i||i.removeEventListener("selectionchange",this.Pr),a.removeEventListener("touchstart",this.Hr,{capture:!0}),a.removeEventListener("touchend",this.Wr,{capture:!0}),a.removeEventListener("touchcancel",this.Ur,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.ln),a.removeEventListener("blur",this.jr),a.removeEventListener("focus",this.jr),this.zr=void 0}io(t){const e=new Set;for(const i of t){var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.Vr=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];ge(i)&&!e.has(i)&&this.oo(i,e)}}}Gr(){fe(a,"click",this.Tr,{capture:!0}),fe(a,"mousedown",this._r,{capture:!0}),fe(a,"mouseup",this.Ir,{capture:!0}),fe(a,"mouseout",this.Mr,{capture:!0}),fe(a,"dragstart",this.br,{capture:!0}),fe(a,"pointercancel",this.br,{capture:!0}),fe(a,"blur",this.br)}Er(t){t.selectionChangedDelayMs=Vv(t.timestamp,this.Dr,this.Rr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Vv(t.timestamp,this.Nr),t.focusChangedDelayMs=Vv(t.timestamp,this.Br),this.gr.push(t)}Ar(){this.gr.length&&Z(this.so)&&(this.so=a.setTimeout(()=>{this.ao()},1e3))}Qr(){fe(a,"scroll",this.Or,{capture:!0})}Jr(){var t;this.mr="Range"===(null==i||null===(t=i.getSelection())||void 0===t?void 0:t.type),fe(i,"selectionchange",this.Pr)}Fr(t,e){const n=e.path[0];for(;t;){if(-1!==e.path.indexOf(t)||ge(n)&&n.contains(t))return!0;t=t.getRootNode().host}return!1}Cr(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0;if(i&&ge(n)&&i.startContainer.getRootNode()===n.getRootNode()){var r;if(!i.collapsed)return i.intersectsNode(n);const t=ge(i.startContainer)&&null!==(r=i.startContainer.childNodes[i.startOffset])&&void 0!==r?r:i.startContainer;return this.Fr(t,e)}return this.Fr(t.focusNode,e)||this.Fr(t.anchorNode,e)}Kr(){fe(i,"visibilitychange",this.ln)}Xr(){fe(a,"blur",this.jr),fe(a,"focus",this.jr)}qr(t,e){this.gr.forEach(n=>{const i=Wv(e-n.timestamp);X(i)&&(Z(n[t])||n[t]>i)&&(n[t]=i)})}eo(){fe(a,"touchstart",this.Hr,{capture:!0,passive:!0}),fe(a,"touchend",this.Wr,{capture:!0,passive:!0}),fe(a,"touchcancel",this.Ur,{capture:!0,passive:!0})}Zr(){const t=Z(this.lo)||X(this.Vr)&&this.Vr>this.lo;return(Z(this.uo)||t)&&(this.lo=Date.now(),this.uo=!!(null==i?void 0:i.querySelector(zv))),!!this.uo}$r(t){return!t||("swipe"===t.type?this.co(t):this.do(t))}co(e){return!((!((n=e.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==n.id&&!(null===(i=n.closest)||void 0===i?void 0:i.call(n,".toolbar-global-fade-container")))&&!this.gr.some(t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp))&&!ye(e.node,"html")&&ge(e.node)&&function(e,n){var i;if(!t||$e(e))return!1;const r=Y(n)?Ie:null!==(i=null==n?void 0:n.css_selector_ignorelist)&&void 0!==i?i:Ie,{targetElementList:o}=Ee(e,!1);return!function(t,e){if(Z(e))return!0;for(const n of t)if(e.some(t=>Ce(n,t)))return!0;return!1}(o,r)}(e.node,{css_selector_ignorelist:this.Rr.css_selector_ignorelist}));var n,i}do(e){return!(this.Rr.capture_clicks_with_modifier_keys||(n=e.originalEvent,!(n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)))||!!this.co(e)||function(e){if(!t||$e(e))return!1;const{targetElementList:n}=Ee(e,!1);return n.some(t=>ye(t,"a"))}(e.node);var n}ao(){if(!this.gr.length)return;clearTimeout(this.so),this.so=void 0;const t=this.gr;this.gr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.Vr&&this.Vr>=n.timestamp?this.Vr-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Uv(n.scrollDelayMs,this.Rr.scroll_threshold_ms),i=Uv(n.selectionChangedDelayMs,this.Rr.selection_change_threshold_ms),r=Uv(n.mutationDelayMs,this.Rr.mutation_threshold_ms),o=Uv(n.absoluteDelayMs,1.1*this.Rr.mutation_threshold_ms),s=X(n.scrollDelayMs)&&this.Rr.scroll_threshold_ms>n.scrollDelayMs,a=X(n.mutationDelayMs)&&this.Rr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||X(n.selectionChangedDelayMs)&&this.Rr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=X(n.visibilityChangedDelayMs),c=X(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=Hv(n);if("$dead_swipe"===e){if(this.yr>=this.Rr.max_dead_swipes_per_page_load)continue;this.yr++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.Vr,[`${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.Rr.mutation_threshold_ms>n.absoluteDelayMs&&this.gr.push(n)}this.Ar()}vr(t,e){const n=Hv(t);this.instance.capture(n,D(D(D({},e),Nv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rr.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)})}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Zv(t,e)}();
1
+ !function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.navigator,i=null==e?void 0:e.document,r=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const o=null==n?void 0:n.userAgent,s="undefined"!=typeof globalThis?globalThis:t;s&&"undefined"==typeof self&&(s.self=s),s&&"undefined"==typeof File&&(s.File=function(){});const a=null!=t?t:{},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="$stored_person_properties",b="$surveys",w="$sdk_debug_replay_event_trigger_status",k="$sdk_debug_replay_linked_flag_trigger_status",_="$sdk_debug_replay_matched_recording_trigger_groups",S="$sdk_debug_replay_pending_trigger_conditions",x="$sdk_debug_replay_remote_trigger_matching_config",C="$sdk_debug_replay_trigger_groups_count",M="$sdk_debug_replay_url_trigger_status",I="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",R="$session_recording_start_reason";function E(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){E(o,i,r,s,a,"next",t)}function a(t){E(o,i,r,s,a,"throw",t)}s(void 0)})}}function O(t){return O="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},O(t)}function L(t,e,n){return(e=function(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P(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 D(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach(function(e){L(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F="min_length",N="max_length";function q(t,e){return-1!==t.indexOf(e)}const j=function(t){return t.trim()},B=Object.prototype,H=B.hasOwnProperty,z=B.toString,U=Array.isArray||function(t){return"[object Array]"===z.call(t)},W=t=>"function"==typeof t,V=t=>t===Object(t)&&!U(t),Z=t=>void 0===t,G=t=>"[object String]"==z.call(t),Q=t=>G(t)&&0===t.trim().length,J=t=>null===t,K=t=>Z(t)||J(t),X=t=>"[object Number]"==z.call(t)&&t==t,Y=t=>"[object Boolean]"===z.call(t),tt=t=>t instanceof FormData;function et(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)===`[object ${e}]`}function it(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 ot(t,Error)}}function rt(t){return"u">typeof Event&&ot(t,Event)}function ot(t,e){try{return t instanceof e}catch(t){return!1}}function st(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),X(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),st(null!=r?r:n,e,n,i))}var at=class{constructor(t){this.C={},this.I=t.I,this.R=st(t.bucketSize,0,100,t.$),this.A=st(t.refillRate,0,this.R,t.$),this.O=st(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}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.R,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 lt="Mobile",ut="Tablet",ct="Android Tablet",dt="iPad",ht="Apple Watch",ft="Nintendo",vt="PlayStation",pt="Xbox",mt="Nokia",gt="Ouya",yt="Generic "+lt.toLowerCase(),bt="Generic "+ut.toLowerCase(),wt=new RegExp(pt,"i"),kt=new RegExp("PlayStation \\w+","i"),_t=new RegExp("Nintendo \\w+","i"),St=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(ft,"i"),new RegExp(vt,"i"),new RegExp("Windows","i");function xt(t){return t?t.split("#")[0]:t}let Ct,Mt,It;function Tt(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return It&&n.length===Mt||(Mt=n.length,It=n.reduce((n,i)=>{Ct||(Ct={});const r=Ct[i];if(r)n[r[0]]=r[1];else{const r=t(i);for(let t=r.length-1;t>=0;t--){const o=r[t],s=null==o?void 0:o.filename,a=e[i];if(s&&a){n[s]=a,Ct[i]=[s,a];break}}}return n},{})),It}const Rt=/^([a-z][a-z0-9.+-]+):/i,$t=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Et(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||$t.includes(e[1].toLowerCase())}function At(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Et(e)};return Z(i)||(o.lineno=i),Z(r)||(o.colno=r),o}const Ot=(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]},Lt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ft=(t,e)=>{const n=Lt.exec(t);if(n){const[,t,i,r]=n;return At(e,t,"?",+i,+r)}const i=Pt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Dt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Ot(i[1]||"?",i[2]);return At(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jt=(t,e)=>{const n=Nt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=qt.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]=Ot(i,t),At(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Bt=/\(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 zt(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 Ut(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Wt(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 Zt(t,e){const n=e[0];let i=t.length-(n?Wt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Gt(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 Qt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Jt=["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 Yt;const te=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}`)},ee=(ne=A(function*(t,e){18>t.size&&te("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])&&te("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(Yt)return Yt;Yt=[];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;Yt[t]=e>>>0}return Yt})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&te("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&te("invalid-size")}),function(t,e){return ne.apply(this,arguments)});var ne;function ie(){return ie=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 ee(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}),ie.apply(this,arguments)}function re(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const oe="0.9.0",se={DEBUG:!1,LIB_VERSION:oe,LIB_NAME:"browser-common",JS_SDK_VERSION:oe},ae=(e,{debugEnabled:n}={})=>{const i={N(i,...r){t&&(se.DEBUG||t.POSTHOG_DEBUG||n)&&!Z(t.console)&&t.console&&("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i])(e,...r)},debug(...t){i.N("debug",...t)},info(...t){i.N("log",...t)},warn(...t){i.N("warn",...t)},error(...t){i.N("error",...t)},critical(...t){console.error(e,...t)},uninitializedWarning(t){i.error(`You must initialize PostHog before calling ${t}`)},createLogger:(t,n)=>ae(`${e} ${t}`,n)};return i},le=ae("[PostHog.js]"),ue=le.createLogger;function ce(t,e){if(!K(t))if(U(t))t.forEach(e);else if(tt(t))t.forEach((t,n)=>e(t,n));else for(const n in t)H.call(t,n)&&e(t[n],n)}const de=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function he(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 fe(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 ve=["localhost","127.0.0.1"],pe=t=>{const e=null==i?void 0:i.createElement("a");return Z(e)?null:(e.href=t,e)};function me(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.href;return Z(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(!W(i))return e;try{const t=i(e);return G(t)&&t?t:e}catch(t){return le.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}function ge(t){return!!t&&1===t.nodeType}function ye(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function be(t){return!!t&&11===t.nodeType&&ge(t.host)}function we(t){return t?j(t).split(/\s+/):[]}function ke(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 we(e)}function _e(t){let e="";return Ae(t)&&!Oe(t)&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return K(t)?null:j(t).split(/(\s+)/).filter(t=>Be(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),j(e)}function Se(t){var e;return Z(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const xe=["a","button","form","input","select","textarea","label"];function Ce(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 Me(t){const e=t.parentNode;return!(!e||!ge(e))&&e}const Ie=[".ph-no-deadclick",".ph-no-capture"];const Te=["","text","search","email","password","url","tel","number"];function Re(t){return!(!t||!ge(t))&&(!!ye(t,"textarea")||(ye(t,"input")?q(Te,(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||ye(t,"html")||!ge(t),Ee=(e,n)=>{if(!t||$e(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[e];let o=e;for(;o.parentNode&&!ye(o,"body");){if(be(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const e=Me(o);if(!e)break;if(n||xe.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{const n=t.getComputedStyle(e);n&&"pointer"===n.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(e),o=e}return{parentIsUsefulElement:i,targetElementList:r}};function Ae(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ye(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=ke(i);if(q(t,"ph-sensitive")||q(t,"ph-no-capture"))return!1}if(q(ke(t),"ph-include"))return!0;const i=t.type||"";if(G(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!G(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 Oe(t){return!!(ye(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ye(t,"select")||ye(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Le=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}))$"),Pe=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,De=[16,15,14,13],Fe=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ne=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),qe=/[0-9A-Za-z_]/;function je(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 Be(t,e=!0){if(K(t))return!1;if(G(t)){if(t=j(t),e?Le.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Pe.lastIndex=0;e=Pe.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 De){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Le.test(e)&&je(e))return!0}}}return!1}(t))return!1;if(e?Fe.test(t):function(t){let e;for(Ne.lastIndex=0;e=Ne.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&qe.test(t)&&qe.test(n)))return!0}return!1}(t))return!1}return!0}function He(t){let e=_e(t);return e=`${e} ${ze(t)}`.trim(),Be(e)?e:""}function ze(t){let e="";return t&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=_e(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${ze(t)}`.trim())}catch(t){le.error("[AutoCapture]",t)}}),e}function Ue(t){return t.replace(/"|\\"/g,'\\"')}function We(t){const e=t.attr__class;if(e)return U(e)?e:we(e)}const Ve=1e6;function Ze(t){var e;return Math.min(Ve,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ve)}const Ge={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:Ve,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},Qe=["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"],Je=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ke=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Xe=t=>{K(t)||ce(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Qe.includes(e)||Ke.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Ye=["/s/","/e/","/i/"];function tn(t,e,n,i){if(K(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return G(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function en(t,e){if(K(t))return t;let n=t;return Be(n,!1)||(n="[SessionRecording] "+e+" body redacted"),ce(Je,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 nn=new WeakSet,rn="disabled",on="sampled",sn="active",an="buffering",ln="paused",un="rrweb_error",cn="trigger_activated",dn="trigger_pending",hn="trigger_disabled";function fn(t,e,n,i,r,o){return 0===e?hn:(null==t?void 0:t.get_property(n?i+n:r))===o?cn:dn}function vn(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 pn(t){return t.includes("trigger_activated")?cn:t.includes("trigger_pending")?dn:hn}function mn(t){const e=new Set(t);switch(e.delete(hn),e.size){case 0:return hn;case 1:return Array.from(e)[0];default:return dn}}var gn=class{constructor(t){this.q=t}triggerStatus(t){return pn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return pn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},yn=class{constructor(t){this.q=t}triggerStatus(t){return mn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return mn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},bn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return cn}stop(){}};const wn=t=>"sessionRecording"in t;var kn=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(wn(t)?V(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(wn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.H.clear(),this.U.clear();for(const t of this.j)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){le.error("Invalid URL trigger regex pattern:",t.url,e)}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){le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}G(t){return fn(this._instance,this.j.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[M]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){const t=me(this._instance);if(!t)return!1;try{return vn(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=me(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=vn(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=me(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const o=this.urlBlocked,s=vn(r,this.B,this.U);s&&!o?t():!s&&o&&e();const a=this.G(i)===cn,l=vn(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},_n=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[k]:t}),t}triggerStatusNoSideEffects(){let t=dn;return K(this.linkedFlag)&&(t=hn),this.linkedFlagSeen&&(t=cn),t}onConfig(t,e){var n;if(this.linkedFlag=(wn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!K(this.linkedFlag)&&!this.linkedFlagSeen){const t=G(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=G(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(V(r)&&t in r){const e=r[t];o=Y(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.J()}},Sn=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(wn(t)?V(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 fn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[w]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===cn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},xn=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new kn(t,e.id),this.tt=new Sn(t,e.id),this.et=new _n(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.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new gn(r):new yn(r)}else this.nt=new bn}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===dn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.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.Y.stop(),this.tt.stop(),this.et.stop()}};function Cn(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=!0===t.isSampled,n=new gn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?on:"trigger_activated"===n?sn:"trigger_pending"===n?an:!1===t.isSampled?rn:sn}function Mn(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=new yn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==hn,i=Y(t.isSampled);return n&&"trigger_pending"===e?an:n&&"trigger_disabled"===e||i&&!t.isSampled?rn:!0===t.isSampled?on:sn}function In(){const t=[];return function(e,n){if(V(n)||U(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function Tn(t){try{const e=JSON.stringify(t,In());return e?new Blob([e]).size:0}catch(t){return-1}}function Rn(t){if(J(t))return 4;if(Z(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(U(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=Z(i)||J(i)?4:Rn(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];Z(r)||(i||(n+=1),i=!1,n+=t.length+3+Rn(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 En=Uint8Array,An=Uint16Array,On=Uint32Array,Ln=new En([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]),Pn=new En([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]),Dn=new En([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fn=function(t,e){for(var n=new An(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new On(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]},Nn=Fn(Ln,2),qn=Nn[1];Nn[0][28]=258,qn[258]=28;for(var jn=Fn(Pn,0)[1],Bn=new An(32768),Hn=0;32768>Hn;++Hn){var zn=(43690&Hn)>>>1|(21845&Hn)<<1;Bn[Hn]=((65280&(zn=(61680&(zn=(52428&zn)>>>2|(13107&zn)<<2))>>>4|(3855&zn)<<4))>>>8|(255&zn)<<8)>>>1}var Un=function(t,e,n){for(var i=t.length,r=0,o=new An(e);i>r;++r)++o[t[r]-1];var s,a=new An(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new An(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[Bn[d]>>>l]=u}else for(s=new An(i),r=0;i>r;++r)s[r]=Bn[a[t[r]-1]++]>>>15-t[r];return s},Wn=new En(288);for(Hn=0;144>Hn;++Hn)Wn[Hn]=8;for(Hn=144;256>Hn;++Hn)Wn[Hn]=9;for(Hn=256;280>Hn;++Hn)Wn[Hn]=7;for(Hn=280;288>Hn;++Hn)Wn[Hn]=8;var Vn=new En(32);for(Hn=0;32>Hn;++Hn)Vn[Hn]=5;var Zn=Un(Wn,9,0),Gn=Un(Vn,5,0),Qn=function(t){return(t/8|0)+(7&t&&1)},Jn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof An?An:t instanceof On?On:En)(n-e);return i.set(t.subarray(e,n)),i},Kn=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Xn=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Yn=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 En(0),0];if(1==r){var s=new En(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 An(h+1),v=ti(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 En(f),v]},ti=function(t,e,n){return-1==t.s?Math.max(ti(t.l,e,n+1),ti(t.r,e,n+1)):e[t.s]=n},ei=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new An(++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]},ni=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},ii=function(t,e,n){var i=n.length,r=Qn(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)},ri=function(t,e,n,i,r,o,s,a,l,u,c){Kn(e,c++,n),++r[256];for(var d=Yn(r,15),h=d[0],f=d[1],v=Yn(o,15),p=v[0],m=v[1],g=ei(h),y=g[0],b=g[1],w=ei(p),k=w[0],_=w[1],S=new An(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=Yn(S,7),M=C[0],I=C[1],T=19;T>4&&!M[Dn[T-1]];--T);var R,E,A,O,L=u+5<<3,P=ni(r,Wn)+ni(o,Vn)+s,D=ni(r,h)+ni(o,p)+s+14+3*T+ni(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=L&&D>=L)return ii(e,c,t.subarray(l,l+u));if(Kn(e,c,1+(P>D)),c+=2,P>D){R=Un(h,f,0),E=h,A=Un(p,m,0),O=p;var F=Un(M,I,0);for(Kn(e,c,b-257),Kn(e,c+5,_-1),Kn(e,c+10,T-4),c+=14,x=0;T>x;++x)Kn(e,c+3*x,M[Dn[x]]);c+=3*T;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Kn(e,c,F[B=31&j[x]]),c+=M[B],B>15&&(Kn(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else R=Zn,E=Wn,A=Gn,O=Vn;for(x=0;a>x;++x)if(i[x]>255){var B;Xn(e,c,R[257+(B=i[x]>>>18&31)]),c+=E[B+257],B>7&&(Kn(e,c,i[x]>>>23&31),c+=Ln[B]);var H=31&i[x];Xn(e,c,A[H]),c+=O[H],H>3&&(Xn(e,c,i[x]>>>5&8191),c+=Pn[H])}else Xn(e,c,R[i[x]]),c+=E[i[x]];return Xn(e,c,R[256]),c+E[256]},oi=new On([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),si=new En(0),ai=function(){for(var t=new On(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),li=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function ui(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=ai[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 En(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=ii(l,u,t.subarray(c,d)):(l[c]=o,u=ii(l,u,t.subarray(c,s)))}else{for(var h=oi[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new An(32768),g=new An(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 On(25e3),_=new An(288),S=new An(32),x=0,C=0,M=(c=0,0),I=0,T=0;s>c;++c){var R=w(c),E=32767&c,A=g[R];if(m[E]=A,g[R]=E,c>=I){var O=s-c;if((x>7e3||M>24576)&&O>423){u=ri(t,l,0,k,_,S,C,M,T,c-T,u),M=x=C=0,T=c;for(var L=0;286>L;++L)_[L]=0;for(L=0;30>L;++L)S[L]=0}var P=2,D=0,F=v,N=E-A&32767;if(O>2&&R==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&E!=A;){if(t[c+P]==t[c+P-N]){for(var H=0;B>H&&t[c+H]==t[c+H-N];++H);if(H>P){if(P=H,D=N,H>q)break;var z=Math.min(N,H-2),U=0;for(L=0;z>L;++L){var W=c-N+L+32768&32767,V=W-m[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(E=A)-(A=m[E])+32768&32767}if(D){k[M++]=268435456|qn[P]<<18|jn[D];var Z=31&qn[P],G=31&jn[D];C+=Ln[Z]+Pn[G],++_[257+Z],++S[G],I=c+P,++x}else k[M++]=t[c],++_[t[c]]}}u=ri(t,l,o,k,_,S,C,M,T,c-T,u),o||(u=ii(l,u,si))}return Jn(a,0,i+Qn(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&&li(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),li(u,c-8,n.d()),li(u,c-4,i),u}function ci(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 di=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(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.vt=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.bt(e);if(0===o&&n!==o)return;if(this.kt)return t;this.ut();const s=Rn(t);var a,l;return s>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.ct-=s,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new at({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,$:le}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const s=this.it.resyncIntervalMs;this.xt=X(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return X(t)&&isFinite(t)&&Math.floor(t)===t});var hi=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}},fi=class{generate(){const t=this.generateOrAbort();if(!Z(t))return t;{this.Ct=0;const t=this.generateOrAbort();if(Z(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return X(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return hi.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new pi}};let vi=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};t&&!Z(t.crypto)&&crypto.getRandomValues&&(vi=t=>crypto.getRandomValues(t));var pi=class{nextUint32(){return this.Rt.length>this.$t||(vi(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let mi;const gi=()=>yi().toString(),yi=()=>(mi||(mi=new fi)).generate();let bi=null;const wi={Et(){if(!J(bi))return bi;let e=!0;if(Z(t))e=!1;else try{const t="__mplssupport__";wi.At(t,"xyz"),'"xyz"'!==wi.Ot(t)&&(e=!1),wi.Lt(t)}catch(t){e=!1}return e||le.error("localStorage unsupported; falling back to cookie store"),bi=e,e},Pt(t){le.error("localStorage error: "+t)},Ot(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){wi.Pt(t)}return null},Dt(t){try{return JSON.parse(wi.Ot(t))||{}}catch(t){}return null},At(e,n){try{return null==t||t.localStorage.setItem(e,JSON.stringify(n)),!0}catch(t){wi.Pt(t)}return!1},Lt(e){try{null==t||t.localStorage.removeItem(e)}catch(t){wi.Pt(t)}}};let ki=null;const _i={Et(){if(!J(ki))return ki;if(ki=!0,Z(t))ki=!1;else try{const t="__support__";_i.At(t,"xyz"),'"xyz"'!==_i.Ot(t)&&(ki=!1),_i.Lt(t)}catch(t){ki=!1}return ki},Pt(t){le.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){_i.Pt(t)}return null},Dt(t){try{return JSON.parse(_i.Ot(t))||null}catch(t){}return null},At(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){_i.Pt(t)}return!1},Lt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){_i.Pt(t)}}};se.DEBUG=!1,se.LIB_VERSION="1.434.7",se.LIB_NAME="web";var Si=se,xi=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.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(g);return V(n=e)&&G(n.sessionId)&&X(n.size)&&e.sessionId===t?e.size:0;var n}};function Ci(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<st(100*e,0,100,le)}function Mi(t){return`$survey_response_${t}`}function Ii(t,e){if(!e)return null;const n=t[Mi(e)];return U(n)?[...n]:n}function Ti({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return D(D(D(D({},!Z(i)&&{$survey_submission_id:i}),"sent"===t?!Z(r)&&{$survey_completed:r}:{$survey_partially_completed:Ri(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(Z(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ii(t,e.id);Z(o)||(i[n]=o)}),D(D({$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:Ii(t,e.id)}})},t),i)}(n,e,s))}function Ri(t={}){return Object.values(t).some(t=>!K(t))}function $i(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 Ei(t){return"string"==typeof t&&t.trim()?t.trim():null}function Ai(t){return t.toLowerCase()}function Oi(t,e,n){if(!t||!e)return null;const i=Ai(e),r=Object.keys(t).find(t=>Ai(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=>Ai(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Li=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Pi(t,e,n){var i;const r=Oi(t.translations,e,n),o=D({},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}`),Z(e.name)||(o.name=e.name,s=!0),o.appearance){const t=D({},o.appearance);for(const n of Li){const i=e[n];Z(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Li.some(e=>!Z(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Oi(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=D({},t);let a=!1;return Z(o.question)||(s.question=o.question,a=!0),Z(o.description)||(s.description=o.description,a=!0),Z(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!Z(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!Z(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!Z(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return U(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 Di(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 Fi=(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}},Ni=t=>t.toLowerCase(),qi={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=>Fi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Fi(e,t))),icontains:(t,e)=>e.map(Ni).some(e=>t.map(Ni).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Ni).every(e=>t.map(Ni).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))})},ji=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},Bi=new Set(["is_not","not_icontains","not_regex"]);function Hi(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(Z(r)||J(r))return Bi.has(o);const s=qi[o];return!!s&&!Z(t.value)&&!J(t.value)&&s(U(t.value)?t.value.map(String):[String(t.value)],U(r)?r.map(String):[String(r)])})}const zi=ue("[SessionRecording]");function Ui(t,e){return e?t:"!"+t}function Wi(t,e){return t===e||t!=="!"+e&&null}var Vi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=o,this.Bt=s,this.Ht=null,this.zt=Mn}onRemoteConfig(t){this.Ht=X(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new gn([this.tt,this.Y]),this.zt=Cn):(this.Ut=new yn([this.tt,this.Y]),this.zt=Mn),this._instance.register_for_session({[x]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.zt({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 X(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&K(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){zi.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!X(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=Wi(o,t),l=X(s)&&s!==n,u=Z(s)&&o===t,c=l||u||!Y(a),d=c?Ci(t,n):a;c&&(d?this.qt("sampled"):zi.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:Ui(t,d),$replay_sample_rate:J(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!X(this.Ht))return;const e=this._instance.get_property(h);Y(Wi(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.Ut)||void 0===e?void 0:e.triggerStatus(t))===dn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===dn).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Zi=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[x]:"v2_trigger_groups",[C]:t.triggerGroups.length}),this.Y.onConfig(t)):zi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return un;if(!t.receivedFlags)return an;if(!t.isRecordingEnabled)return rn;if(t.urlTriggerMatching.urlBlocked)return ln;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return rn;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);Z(e)?le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?on:i?an:rn}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Zt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;X(t)&&(J(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Zt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Qt)return zi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Zt)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(y);r.some(e=>!e.properties||0===e.properties.length||Hi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){zi.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Zt){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(V(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=X(n)&&n!==o,l=e===t&&X(n)&&n===o&&Y(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!Y(l),f=h?Ci(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Gt.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.Qt=!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.Zt){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.Zt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Gt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[_]:e})}hasPendingTriggers(t){for(const e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Hi(n,e,this._instance.get_property(y))}Jt(t){this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();for(const e of t){const t=new xn(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Zt.push(t)}}};const Gi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Qi=1e5,Ji=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Ki=[],Xi=()=>!1,Yi="@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(" "),tr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),er="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(" "),nr="Accommodation AdministrativeArea Country Place State".split(" "),ir={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:tr,publisher:er},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ki},Offer:{seller:er},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:er,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:er,areaServed:nr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ki}},rr=[["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(" "),ir.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ir.Event],[er,ir.Organization],[nr,ir.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ir.Product]];function or(t,e){return H.call(t,e)?t[e]:void 0}function sr(t){const e=typeof t;return J(t)||"string"===e||"number"===e||"boolean"===e}function ar(t,e){return e&&function(t){return G(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function lr(t,e){return U(t)&&t.every(sr)?t.map(t=>ar(t,e)).filter(t=>!Z(t)):sr(t)?ar(t,e):void 0}function ur(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 cr(t){if(H.call(ir,t))return ir[t];for(const[e,n]of rr)if(e.includes(t))return n}function dr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function hr(t,e,n,i){if(U(t)){const r=t.map(t=>hr(t,e,n,i)).filter(t=>!Z(t));return r.length?r:void 0}return fr(t,e,n,i)||void 0}function fr(t,e,n,i){if(!V(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=or(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:U(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&Ji.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!cr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of Yi){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?ur(or(t,i),e):lr(or(t,i),n.maskUrl);Z(s)||dr(a,i,s)}for(const i of s){const r=cr(i);for(const i of Object.keys(r)){const o=or(t,i),s=r[i];if(!0===s){const t=lr(o,n.maskUrl);Z(t)||dr(a,i,t)}else{const t=hr(o,e,n,s);Z(t)||dr(a,i,t)}}}const l=hr(or(t,"@graph"),e,n);return Z(l)||dr(a,"@graph",l),Object.keys(a).length?a:null}function vr(t,e,n){if(!V(t))return null;const i=or(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=fr(t,e,n);return r?D({"@context":"https://schema.org"},r):null}function pr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function mr(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 gr(t,e,n){for(let i=t;i;){if(mr(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 yr(t){return pr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(pr)}function br(t){return Z(t)?void 0:Math.round(t)}function wr(t){return V(t)?t.network_timing:t}const kr=ue("[SessionRecording]"),_r=[1,2,3,4,5,6,7,12],Sr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function xr(){var t;return null==a||null===(t=a.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Cr(){var t;return null===(t=xr())||void 0===t?void 0:t.record}function Mr(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,In())}}function Ir(t){return ci(ui(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new En(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 En(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 Jn(n,0,i)}(Mr(t))),!0)}function Tr(t){return Rr.apply(this,arguments)}function Rr(){return Rr=A(function*(t){const e=yield function(t){return ie.apply(this,arguments)}(Mr(t),Si.DEBUG,{rethrow:!0});return ci(new Uint8Array(yield e.arrayBuffer()),!0)}),Rr.apply(this,arguments)}let $r,Er;const Ar="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Or=!1;function Lr(t){var e;return U(t)&&0===t.length?($r=null!==(e=$r)&&void 0!==e?e:Ir([]),$r):Ir(t)}function Pr(t){return Dr.apply(this,arguments)}function Dr(){return(Dr=A(function*(t){var e;return U(t)&&0===t.length?$r||(Er=null!==(e=Er)&&void 0!==e?e:Tr([]).then(t=>($r=t,t)).catch(t=>{throw $r=void 0,Er=void 0,t}),Er):Tr(t)})).apply(this,arguments)}function Fr(t){return Ar&&!Or&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Nr(t){return{event:t,size:Rn(t)}}function qr(t,e){return D(D({},t),{},{data:e,cv:"2024-10"})}function jr(t,e){return D(D({},t),{},{cv:"2024-10",data:D(D({},t.data),e)})}function Br(t){try{if(2===t.type)return Nr(qr(t,Ir(t.data)));if(3===t.type&&0===t.data.source)return Nr(jr(t,{texts:Lr(t.data.texts),attributes:Lr(t.data.attributes),removes:Lr(t.data.removes),adds:Lr(t.data.adds)}));if(3===t.type&&8===t.data.source)return Nr(jr(t,{adds:t.data.adds?Ir(t.data.adds):void 0,removes:t.data.removes?Ir(t.data.removes):void 0}))}catch(t){kr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:Tn(t)}}function Hr(){return Hr=A(function*(t){try{if(2===t.type)return Nr(qr(t,yield Tr(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 Nr(jr(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?Tr(t.data.adds):void 0,t.data.removes?Tr(t.data.removes):void 0]);return Nr(jr(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)&&(Or=!0),kr.warn("could not compress event asynchronously - trying synchronous compression",e),Br(t)}return{event:t,size:Tn(t)}}),Hr.apply(this,arguments)}function zr(t,e){return 5===t.type&&t.data.tag===e}function Ur(t){return zr(t,"sessionIdle")}function Wr(t){return zr(t,"$session_ending")}function Vr(t){return zr(t,"$session_starting")}var Zr=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Wi(this._instance.get_property(h),this.sessionId)}get Ht(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return X(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Ie=!1,this.Te=!1,this.Re=[],this.$e=void 0,this.Ee=void 0,this.Ae=!1,this.Oe=[],this.Le=0,this.Pe=0,this.De=!1,this.Fe=void 0,this.Wt=void 0,this.Ne=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.He)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.He;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,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"),this.Se=!1,null===(r=xr())||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.Ue(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.He===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.We(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(s=this.re)||void 0===s||s.makeSamplingDecisions(t)},this.Ve=!1,this.Ze=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ge=()=>{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 X(n)&&X(i)?i-n:null},this.Qe=()=>{var t,e;const n=this.ie;if(!X(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.Je;return X(t)&&t>=0&&n>t}if(this.Ze())return!1;const i=this.Ge();return!!J(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ke=()=>{"buffering"!==this.status?(this.ge&&this.ye&&this.Xe&&!this.be&&this.Ye(void 0),this.tn(),this.en(!0)):this.nn()},this.rn=()=>{this.Ke()},this.sn=()=>{this.Vt("browser offline",{})},this.an=()=>{this.Vt("browser online",{})},this.ln=()=>{(null==i?void 0:i.visibilityState)&&("visible"===i.visibilityState&&(this.Xe=!0),this.Vt("window "+i.visibilityState,{}))},this.Xe=null==e||e;const{sessionId:n,windowId:r,sessionStartTimestamp:o}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=n,this.He=r,this._sessionStartTimestamp=o,this.et=new _n(this._instance),this.Y=new kn(this._instance),this.tt=new Sn(this._instance),this.Rt=this.nn(),this.un="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||kr.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.ze=new xi(this._instance)}setDocumentWasEverVisible(t){t&&(this.Xe=!0)}get cn(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ne)||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 Z(d)&&Z(h)&&Z(f)&&Z(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}dn(){var t;if(this.Ce)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(K(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!Z(i)&&i!==r});0!==i.length&&(this.Ce=!0,kr.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 hn(){var t;return st(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ue("canvas recording resolution scale"),1)}get fn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||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:st(c,0,12,ue("canvas recording fps"),4),quality:st(d,0,1,ue("canvas recording quality"),.4)}}get vn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get pn(){var t,e,n;const i=null===(t=this.ne)||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=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=wr(this._instance.config.capture_performance),l=wr(null==i?void 0:i.capturePerformance),u=!!(Y(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}mn(){var t,e;const n=[],i=null===(t=a.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;i&&this.vn&&n.push(i());const o=null===(e=a.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.pn&&W(o))if(!ve.includes(r.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(((t,e,n)=>{const i={payloadSizeLimitBytes:Ge.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ge.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ge.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=Ze(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=tn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=tn(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&&Ye.some(t=>0===s.indexOf(t))?void 0:t})((Xe((i=e).requestHeaders),Xe(i.responseHeaders),i),t.api_host,n));var i},u=W(t.session_recording.maskNetworkRequestFn);return u&&W(t.session_recording.maskCapturedNetworkRequestFn)&&le.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});return!n&&e.isInitial?n:D(D({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=W(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 K(s)&&o?(nn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!Z(t))return t.requestBody=en(t.requestBody,"Request"),t.responseBody=en(t.responseBody,"Response"),t}(l(t)),D(D(D({},Ge),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.pn,t)))}else kr.info("NetworkCapture not started because we are on localhost.");return n}gn(t){return this._instance.config.disable_capture_url_hashes?xt(t):t}yn(t,e=!1){const n=e?xt(t):this.gn(t),i=this._instance.config.mask_personal_data_properties?[...Gi,...this._instance.config.custom_personal_data_properties||[]]:[];return this.bn(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("=");U(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}bn(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}wn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):kr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.wn(Sr(()=>Cr().addCustomEvent(t,e)))}kn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}_n(t){if(!this.kn())return!1;try{const e=Cr();return!!e&&(e.addCustomEvent("$json_ld",t),this.kn())}catch(t){return!1}}Sn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.xn)||void 0===e?void 0:e.scan(t)})}Cn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.yn(e.origin+e.pathname+e.search);this.Mn!==n&&(this.Mn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}In(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.wn(t)})}}jt(){return this.wn(Sr(()=>Cr().takeFullSnapshot()))}get Tn(){var t,e,n;if((null===(t=this.re)||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 X(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}Rn(){if(this.$n&&clearInterval(this.$n),!0===this.de)return;const t=this.Tn;t&&(this.$n=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.En(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rn()}An(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this.xn)||void 0===t||t.scan(),clearInterval(this.$n),kr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}On(){var t;this.Y.urlBlocked&&(null===(t=this.xn)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this.Sn(),this.Rn(),this.Vt("recording resumed",{reason:"left blocked url"}),kr.info("recording resumed"))}Ln(t,e){var n;if("event"===t&&this.En(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!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.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.en(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=V(t)?t:JSON.parse(t)}catch(t){return void kr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ve){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void kr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Pn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var n,r;const o=this.ne;if(!o)return void kr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.we;this.Ye(t?"no_interaction_since_recording_started":void 0),this.we=!1,this.ye=t,this.be=!1}this.De&&(this.Dn(),this.nn());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=s,this.He=a,this._sessionStartTimestamp=h,this.Fn(),null===(n=this._instance.persistence)||void 0===n||n.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.oe=null==o?void 0:o.endpoint),this.re=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Zi(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Vi(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(o),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Ln(t,e)),this.Pn(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Pn(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Pn(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Pn(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.re.makeSamplingDecisions(this.sessionId),this.Nn(),this.ke||(fe(t,"beforeunload",this.Ke),fe(t,"pagehide",this.rn),fe(t,"offline",this.sn),fe(t,"online",this.an),fe(i,"visibilitychange",this.ln),!this.Ne&&W(this.Yt.onSessionId)&&(this.Ne=this.Yt.onSessionId(this.Be)),!this.qe&&W(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.Ue(),this.de="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.je)||void 0===i||i.call(this),this.je=void 0,this.Be(t,e,n)})}):W(this.Yt.on)||kr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),K(this.Fe)&&(this.Fe=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.yn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){kr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}qn(){var e,n,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Ke),null==t||t.removeEventListener("pagehide",this.rn),null==t||t.removeEventListener("offline",this.sn),null==t||t.removeEventListener("online",this.an),null==i||i.removeEventListener("visibilitychange",this.ln),clearInterval(this.$n),this.jn(),null===(e=this.Fe)||void 0===e||e.call(this),this.Fe=void 0,null===(n=this.Wt)||void 0===n||n.call(this),this.Wt=void 0,null===(r=this.Ne)||void 0===r||r.call(this),this.Ne=void 0,null===(o=this.qe)||void 0===o||o.call(this),this.qe=void 0,null===(s=this.je)||void 0===s||s.call(this),this.je=void 0,null===(a=this.re)||void 0===a||a.stop(),this.Bn(),this.Dn()}Dn(){this.Pe+=1,this.Oe=[],this.Le=0,this.Hn=void 0,this.De=!1}Bn(){var t,e;null===(t=this.zn)||void 0===t||t.stop(),this.ce=[],null===(e=this.xn)||void 0===e||e.stop(),this.xn=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){kr.warn("could not stop rrweb",t)}this.se=void 0}Un(){if(!this.Hn||0===this.Le)return!1;if(this.De)return!0;this.De=!0,this.Wn=void 0;const t=this.Pe;return this.jn(),this.Bn(),this.Hn.catch(()=>{}).then(()=>{t===this.Pe&&(this.De=!1,this.en(),this.nn(),this.Vn(),this.qn(),kr.info("stopped"))}).catch(()=>{this.De=!1,this.Vn(),this.qn(),kr.info("stopped")}),!0}stop(){if(this.Bn(),this.Ve)this.tn();else if(this.Un())return;this.en(),this.nn(),this.Vn(),this.qn(),kr.info("stopped")}Vn(){this.Ye(void 0,{preserveLogDedup:this.Ve}),this.ye=!1}flushBeforeIdentityReset(){(this.isStarted||this.De)&&(this.tn(),this.en())}We(t){this.Ve=!0,this.le=Date.now();try{var e,n;this.stop(),this.Zn=void 0,this.Gn=void 0,this.fe=0,this.ve=0,this.pe=0,this.me=0,null===(e=xr())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.Ve=!1}this.Ye(t?"no_interaction_since_session_rotated":void 0),this.ye=!1}Ye(t,{preserveLogDedup:e=!1}={}){if(this.ge=!Z(t),this.Wn=t,Z(t))return void(e||(this.Qn=void 0));if(this.Ve)return;const n=`${this.sessionId}:${t}`;n!==this.Qn&&(this.Qn=n,kr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}En(){this.isStarted||(this.we=!0),this.ge&&(this.Ye(void 0),this.ye=!1,this.be&&(this.be=!1,this.jt()),this.Jn())}discard({discardProducerEvents:t=!1}={}){this.ge=!0,t&&(this.nn(),this.Bn()),this.nn(),this.qn(),this.nn(),this.Vn(),kr.info("discarded")}Kn(t,e,n,i,r){if(-1===n)return this.me+=1,void kr.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.Xn(t,i),this.Yn(o)):this.nn()}ti(){try{this.ei()}catch(t){this.xe||(this.xe=!0,kr.error("could not track full snapshot cost",t))}}ei(){var t,e;const n=null===(t=xr())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Gn&&(this.Gn=n,this.Zn&&this.Zn.durationMs>=n.durationMs||(this.Zn=n),500>n.durationMs||kr.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}))}Xn(t,e){2!==t.type?3===t.type&&(Z(this.$e)||this.$e===e||this.Ee===e||(this.Ee=e,kr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.$e=e}ni(t){t.counted&&t.generation===this.Pe&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,n){t.processed||t.generation!==this.Pe||(t.processed=!0,this.Kn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ri(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Br(t.event))}catch(t){kr.warn("could not process queued compression event - will use uncompressed event",t)}Z(e)&&(e=Tn(t.event));try{this.ii(t,n,e)}catch(t){kr.warn("could not capture queued compression event",t)}}finally{this.ni(t)}}tn(){[...this.Oe].forEach(t=>{try{this.ri(t)}catch(t){kr.warn("could not drain queued compression event",t)}})}oi(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Pe,processed:!1,counted:!0};this.Oe.push(o),this.Le+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Fr(t)?yield function(t){return Hr.apply(this,arguments)}(t):Br(t):{event:t,size:Tn(t)};n=r.event,i=r.size}catch(e){kr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=Tn(t)}r.ii(o,n,i)}finally{r.ni(o)}}),function(){return a.apply(this,arguments)});var a;this.Hn=this.Hn?this.Hn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h,f,v;if(!this._instance.sessionManager)return;if(this.In(),!e||!V(e))return;if(4===e.type){const t=this.yn(e.data.href);if(this.Mn=t,!t)return;e.data.href=t}else this.Cn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.An(),()=>this.On(),(t,e)=>this.Ln(t,e)),this.Y.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&((null===(d=xr())||void 0===d||null===(h=d.wasMaxDepthReached)||void 0===h?void 0:h.call(d))&&(this.Se=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rn(),null===(f=this.zn)||void 0===f||f.reset(),null===(v=this._instance.persistence)||void 0===v||v.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const p=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));p&&this.si();const m=this.zn?this.zn.throttleMutations(e):e;if(!m)return void(!0===this.de&&this.he++);const g=function(t){const e=t;if(e&&V(e)&&6===e.type&&V(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}(m),y=function(t){return Wr(t)?t.data.payload:null}(g),b=function(t){return Vr(t)?t.data.payload:null}(g),w=function(t){return Ur(t)?t.data.payload:null}(g);y||b?(null==y?void 0:y.lastActivityTimestamp)&&(g.timestamp=y.lastActivityTimestamp):(null==w?void 0:w.sessionId)||this.ai(g),2===e.type&&(this.Re.push([this.Xt,e.timestamp]),this.Re.length>6&&(this.Re=this.Re.slice(-6)));const k=null!==(r=null!==(o=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==o?o:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Xt,_=null!==(a=null!==(l=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==l?l:null==w?void 0:w.windowId)&&void 0!==a?a:this.He;if(!0===this.de&&!function(t){return Ur(t)||Wr(t)||Vr(t)}(g))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(g)&&this.he++);2===g.type&&(this.he=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);const S=this.ae;this.ae=!0,p?this.Sn(!0):S||this.Sn();const x=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===g.type&&"$json_ld"===g.data.tag){let e;try{e=t?this.yn(t.location.href):void 0}catch(t){}g.data.href=e}if(this.Le>0||x&&Fr(g))return void this.oi(g,x,k,_);const{event:C,size:M}=x?Br(g):{event:g,size:Tn(g)};this.Kn(g,C,M,k,_)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.ke,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):rn}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.et.linkedFlagSeen=!0,this.jt(),this.En(),this.qt("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.jt(),this.En(),this.qt("sampling_overridden")}overrideTrigger(t){this.Ln(t),this.En()}li(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.yn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}jn(){this.ui&&(clearTimeout(this.ui),this.ui=void 0)}Jn(){this.ui||(this.ui=setTimeout(()=>{this.en()},2e3))}ci(){return this.$e!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Wr(t)&&!Vr(t))}di(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}hi(t){if("buffering"!==t)return Z(this.fi)||this._instance.register_for_session({[S]:[]}),void(this.fi=void 0);const e=this.di();if(0===e.length)return Z(this.fi)||this._instance.register_for_session({[S]:[]}),void(this.fi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.fi&&(this.fi=i,this._instance.register_for_session({[S]:e}),kr.info(`buffering: ${n}`))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.mi)&&_i.Et()}gi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,_i.At(this.un,this.Rt))}Fn(){if(this.Ae||!this.pi())return;this.Ae=!0;const t=_i.Dt(this.un);_i.Lt(this.un),V(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&X(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}en(t=!1){var e;if(this.jn(),this.ge)return this.Rt;if(this.ci())return this.Rt.size>943718.4?this.nn():(t&&this.gi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Qe(),r=this.status;if(this.hi(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.gi(),this.Jn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.li();$n(n).forEach(e=>{try{var n;null===(n=this.ze)||void 0===n||n.trackSize(e.sessionId,e.size),this.bi(D({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Si.LIB_NAME,$lib_version:Si.LIB_VERSION,$snapshot_host:t},this.me>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.me}:{}))}catch(t){kr.warn("could not capture snapshot chunk - skipping it",t)}}),Z(this.yi)||(_i.Lt(this.un),this.yi=void 0),null===(o=this.re)||void 0===o||o.onFlushComplete()}return this.nn()}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.de&&!this.ge&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.en(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.nn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.be||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.be||(this.be=!0,this.Rt=this.nn()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.ge||this.Jn())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Je(){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}si(){if(!this.Rt||0===this.Rt.data.length)return this.nn();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.nn():(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)}nn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}qt(t,e){this._instance.register_for_session({[R]:t}),kr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",D({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==_r.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}ai(t){const e=this.wi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.$n),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.en());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.He!==n;if(this.He=n,this.Xt=i,o||s){const t=o&&!1!==this.de;t&&(this.de="unknown"),this.We(t)}else if(e&&this.En(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this.Sn(),this.Rn()}}Ue(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,n,i,r,o,s,a,l,u,c,d,h,f;const v=null===(t=xr())||void 0===t||null===(e=t.getDeferredStylesheetStats)||void 0===e?void 0:e.call(t);return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wn,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Je,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(n=this.ze)||void 0===n?void 0:n.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Re,$snapshot_max_depth_exceeded:this.Se,$sdk_debug_replay_slowest_full_snapshot_ms:br(null===(i=this.Zn)||void 0===i?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:br(null===(r=this.Zn)||void 0===r?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null===(o=this.Zn)||void 0===o?void 0:o.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null===(s=this.Zn)||void 0===s?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null===(a=this.Zn)||void 0===a?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==v?void 0:v.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==v?void 0:v.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==v?void 0:v.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:br(null==v?void 0:v.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:br(null==v?void 0:v.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:br(null===(l=xr())||void 0===l||null===(u=l.getMutationCost)||void 0===u||null===(u=u.call(l))||void 0===u?void 0:u.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null===(c=xr())||void 0===c||null===(d=c.getDiscardedDurationSamples)||void 0===d?void 0:d.call(c),$sdk_debug_replay_throttled_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_unstringifiable_events_dropped:this.me,$sdk_debug_replay_rrweb_error:this.ke,$sdk_debug_replay_observer_init_failures:null===(h=xr())||void 0===h||null===(f=h.getObserverInitFailures)||void 0===f?void 0:f.call(h),[I]:!!this.se,[T]:this._e}}Nn(){var e;if(this.se)return;this._e=!0;const n={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 n)if("maskInputOptions"===t)n.maskInputOptions=D({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},i={};Z(t.mousemove)||(i.mousemove=t.mousemove),Z(t.mouseInteraction)||(i.mouseInteraction=t.mouseInteraction),n.sampling=i}else n[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==n.slimDOMOptions&&"all"!==n.slimDOMOptions&&(n.slimDOMOptions=D(D({},n.slimDOMOptions),{},{script:!0})),this.fn&&this.fn.enabled&&(n.recordCanvas=!0,n.sampling=D(D({},n.sampling),{},{canvas:this.fn.fps}),n.dataURLOptions={type:"image/webp",quality:this.fn.quality},n.canvasResolutionScale=this.hn,n.canvasMasking={configured:()=>{var t;return W(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(W(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,kr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.cn&&(n.maskAllInputs=null===(o=this.cn.maskAllInputs)||void 0===o||o,n.maskTextSelector=null!==(s=this.cn.maskTextSelector)&&void 0!==s?s:void 0,n.blockSelector=null!==(a=this.cn.blockSelector)&&void 0!==a?a:void 0,n.maskAllElementAttributes=null!==(l=this.cn.maskAllElementAttributes)&&void 0!==l&&l),n.maskAllElementAttributes&&n.maskAttributeFn&&(n.maskAttributeFn=void 0,this.Me||(this.Me=!0,kr.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.dn();const u=Cr();if(!u)return void kr.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 di(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`;kr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Tn,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.mn();if(this.se=u(D({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,kr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},n)),!this.se)return this.ke=!0,void kr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ke=!1,!0===(null==r?void 0:r.captureJsonLd)&&i&&(null==t?void 0:t.MutationObserver)&&!this.xn&&(this.xn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Qi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?Xi:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!gr(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 gr(t,e.blockClass,e.blockSelector)||gr(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=Xi,n){if(!t||t.length>Qi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>vr(t,e,r)):vr(i,e,r);if(r.exceeded||J(o)||U(o)&&(!o.length||o.some(J)))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(J(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 yr(t))a(e)};for(const n of t)if("childList"===n.type)pr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&pr(t)&&a(t)}else"attributes"===n.type&&pr(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()&&yr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{maskUrl:t=>this.yn(t),attributeFilter:n.attributeFilter,blockClass:n.blockClass,blockSelector:n.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:n.maskAllElementAttributes,maskAttributeFn:n.maskAttributeFn,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.kn()},emit:t=>this._n(t)}),this.Y.isCurrentUrlBlocked()&&this.xn.scan()),this.le=Date.now(),this.de=Y(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:n,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 Gr=["type"];var Qr=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}({}),Jr=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}({}),Yr=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),to=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}({}),eo=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 no(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var io={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},oo={};function so(t){if(oo[t])return oo[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 io?io[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 ro?ro[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 oo[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?(function(t){return no(t,"AppleWebKit")&&!no(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),oo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var ao=Object.create(null);function lo(t,e,n){var i;const r=ao[t],o=r[n];if(o)return o.call(e);const s=so(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]}ao.Node=Object.create(null),ao.ShadowRoot=Object.create(null),ao.MutationObserver=Object.create(null),ao.Element=Object.create(null);var uo,co={};function ho(t,e,n){const i=`${t}.${String(n)}`;if(co[i])return co[i].bind(e);const r=so(t)[n];return"function"!=typeof r?e[n]:(co[i]=r,r.bind(e))}function fo(){return so("MutationObserver").constructor}function vo(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 po={childNodes:t=>lo("Node",t,"childNodes"),parentNode:t=>lo("Node",t,"parentNode"),parentElement:t=>lo("Node",t,"parentElement"),textContent:t=>lo("Node",t,"textContent"),isConnected(t){if(void 0===uo){var e;const t=null===(e=Object.getOwnPropertyDescriptor(so("Node"),"isConnected"))||void 0===e?void 0:e.get;uo=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==uo?void 0:uo.call(t)},contains:(t,e)=>ho("Node",t,"contains")(e),getRootNode:t=>ho("Node",t,"getRootNode")(),host:t=>t&&"host"in t?lo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?lo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>ho("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>ho("Element",t,"querySelectorAll")(e),mutationObserver:fo,patch:vo};function mo(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var go=0;function yo(){go+=1}function bo(){return go}function wo(t,e){return(e!==go||t>6e4)&&!0}var ko=0,_o=0,So=0,xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Co=null,Mo=null,Io=[],To=0,Ro=0,$o={slowestBatchMs:0},Eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Ao(t){(ko+=1)>1||(xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Io=[],To=0,Mo=(t=>t&&t>0?t:null)(t),_o=mo(),So=go)}function Oo(){return 0===ko?Co||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(ko-=1)>0?xo:(xo.durationMs=mo()-_o,xo.deferredStylesheetCount=To,Eo.deferredCount+=To,Mo=null,wo(xo.durationMs,So)?xo:Co=xo)}function Lo(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+=Lo(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+=Lo(r,e,n+1))}}}catch(t){}}return i}function Po(t){if(0===ko)return;const e=Lo(t,null,0);xo.cssRuleCount+=e,Ro>0&&(xo.nonDeferrableCssRuleCount+=e)}function Do(t){Ro+=1;try{return t()}finally{Ro-=1}}function Fo(t){ko>0&&(xo.stylesheetMs+=t)}function No(t){if(0===ko||null===Mo)return!1;const e=xo.cssRuleCount-xo.nonDeferrableCssRuleCount;return e>=Mo||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Lo(e,n,0)}catch(t){return 0}}(t)>Mo}function qo(){const t=Io;return Io=[],t}function jo(){Eo.failedCount+=1}function Bo(t){t>0&&(Eo.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 zo(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 Uo(t){return t.nodeType===t.ELEMENT_NODE}function Wo(t){const e=t&&"host"in t&&"mode"in t&&po.host(t)||null;return Boolean(e&&"shadowRoot"in e&&po.shadowRoot(e)===t)}function Vo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Zo(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 Go(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 Qo=0;function Jo(t){const e=0===Qo,n=e?mo():0;Qo+=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),Zo(Array.from(e,t=>Ko(t,n)).join(""))}catch(t){return null}finally{Qo-=1,e&&Fo(mo()-n)}}function Ko(t,e){if(Yo(t)){let e;try{e=Jo(t.styleSheet)||Go(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ps(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ts(t)&&t.selectorText.includes(":")&&(n=Xo(n)),e?ps(n,e):n}}function Xo(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Yo(t){return"styleSheet"in t}function ts(t){return"selectorText"in t}var es=/^-?[A-Za-z_][\w-]*$/,ns=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function is(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||Go(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ps(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&&Yo(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(ts(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&&!es.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]?es.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":ns.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?ps(i,r):i,fixColons:"sheet"===n.kind&&ts(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&ts(n)&&n.selectorText.includes(":")&&(i=Xo(i)),t.parts.push(t.sheetHref?ps(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,!Yo(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=mo();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=Zo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{Fo(mo()-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 rs=class{constructor(){zo(this,"idNodeMap",new Map),zo(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)),Uo(t)){const e=po.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 os({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&ss(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function ss(t){return t.toLowerCase()}var as=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 ls({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&as.has(ss(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var us="__rrweb_original__";function cs(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ss(e):null}catch(t){return null}}var ds=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,hs=/^(?:[a-z+]+:)?\/\//i,fs=/^www\..*/i,vs=/^(data:)([^,]*),(.*)/i;function ps(t,e){return(t||"").replace(ds,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(hs.test(a)||fs.test(a))return`url(${l}${a}${l})`;if(vs.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=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var ms,gs,ys=new Map,bs=1,ws=new RegExp("[^a-z0-9-_:]");function ks(){return bs++}var _s=!1,Ss=/^[^ \t\n\r\u000c]+/,xs=/^[, \t\n\r\u000c]+/,Cs=new WeakMap;function Ms(t,e){return e&&""!==e.trim()?Is(t,e):e}function Is(t,e){let n=Cs.get(t);if(n||(n=t.createElement("a"),Cs.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Ts(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])){if("link"===e&&r){var s;const t=null===(s=r.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=Ms(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=ys.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(ys.size>=10){const t=ys.keys().next().value;void 0!==t&&ys.delete(t)}return ys.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),Ts(t,o)}if("image"===e)return Ts(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Ms(t,i);return"image"===e&&n.startsWith("data:")?Ts(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(xs),e.length>n;){let o=i(Ss);if(","===o.slice(-1))o=Ms(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Ms(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?ps(i,Is(t)):"object"===e&&"data"===n?Ms(t,i):i:Ms(t,i)}function $s(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===ss(e)}function Es(t){return"string"==typeof t&&ss(t).split(/\s+/).includes("stylesheet")}function As(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&As(po.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&As(po.parentNode(t),e,n)}function Os(t,e,n,i){let r;if(Uo(t)){if(r=t,!po.childNodes(r).length)return!1}else{if(null===po.parentElement(t))return!1;r=po.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(As(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 Ls(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ps=new Map;function Ds(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Fs(t){return null==t?"":t.toLowerCase()}var Ns=!1,qs=!1;function js(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:_=5e3,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:I=!1,depth:T=0,maxDepth:R=50}=e;let{needsMask:E}=e,{preserveWhiteSpace:A=!0}=e;if(T>=R)return qs=!0,Ns||(Ns=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${R}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;E||(E=Os(t,s,a,void 0===E)),ko>0&&(xo.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:eo.Document,childNodes:[],compatMode:t.compatMode}:{type:eo.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:eo.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=ss(t.tagName);return ws.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];$s(y,i.name)||(w[i.name]=Rs(n,y,ss(i.name),i.value,t,c))}if("link"===y&&o&&!g&&Es(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=Ds(n,i),!e&&i.includes(".css"))&&(e=Ds(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(No(e)?ko>0&&(Io.push(t),To+=1):i=Jo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||po.textContent(t)||"").trim().length){const e=Do(()=>Jo(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=os({element:t,type:cs(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=us in r?r[us]: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 S,x=!1;if("img"===y&&d){ms||(ms=n.createElement("canvas"),gs=ms.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>x?ls({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Ls(e,"load",s);try{ms.width=e.naturalWidth,ms.height=e.naturalHeight,gs.drawImage(e,0,0);const t=ms.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 C,M,I;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(I=n.defaultView)||void 0===I?void 0:I.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]=ls({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));x=!0;try{customElements.get(y)&&(S=!0)}catch(t){}return{type:eo.Element,tagName:y,attributes:w,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:S};var T}(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=po.parentNode(t),s=o&&o.tagName;let a=po.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(No(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Jo(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=ps(a,Is(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,po.parentElement(t)):a.replace(/[\S]/g,"*")),{type:eo.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:eo.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:eo.Comment,textContent:po.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:M,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===eo.Comment)return!0;if(t.type===eo.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&&(Fs(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fs(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Fs(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Fs(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Fs(t.attributes.property).match(/^(og|twitter|fb):/)||Fs(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fs(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Fs(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(Fs(t.attributes.name))||Fs(t.attributes.property).match(/^article:/)||Fs(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(Fs(t.attributes.name)))return!0}}return!1}(O,p)||!A&&O.type===eo.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ks();const P=Object.assign(O,{id:L});if(i.add(t,P),-2===L)return null;w&&w(t);let D=!l;if(P.type===eo.Element){D=D&&!P.needBlock,delete P.needBlock;const e=po.shadowRoot(t);e&&Vo(e)&&(P.isShadowHost=!0)}if((P.type===eo.Document||P.type===eo.Element)&&D){p.headWhitespace&&P.type===eo.Element&&"head"===P.tagName&&(A=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T+1,maxDepth:R};if(P.type===eo.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const n of Array.from(po.childNodes(t))){const t=js(n,e);t&&P.childNodes.push(t)}let I=null;if(Uo(t)&&(I=po.shadowRoot(t)))for(const t of Array.from(po.childNodes(I))){const n=js(t,e);n&&(Vo(I)&&(n.isShadow=!0),P.childNodes.push(n))}}const F=po.parentNode(t);if(F&&Wo(F)&&Vo(F)&&(P.isShadow=!0),P.type===eo.Element&&"iframe"===P.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),Ls(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?Ls(t,"load",s):(i=!0,Ls(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),Ls(t,"load",s)}}return t.addEventListener("load",s),()=>{Ls(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=js(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T+1,maxDepth:R});n&&k(t,n)}},_);null==S||S(t,e)}return P.type===eo.Element&&"link"===P.tagName&&Es(P.attributes.rel)&&function(e,l,S){if(Ps.has(e))return;let I;try{I=e.sheet}catch(t){return}if(I)return;const O=new AbortController;let L=!1;const P=()=>{if(!L){L=!0;try{(()=>{if(x){const e=js(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,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:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,depth:T,maxDepth:R});e&&x(t,e)}})()}finally{Ps.delete(e),O.abort()}}},D=setTimeout(P,S);O.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",P,{signal:O.signal,once:!0}),Ps.set(e,O)}(t,0,C),P}function Bs(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 Hs=class t{constructor(...t){zo(this,"parentElement",null),zo(this,"parentNode",null),zo(this,"ownerDocument",void 0),zo(this,"firstChild",null),zo(this,"lastChild",null),zo(this,"previousSibling",null),zo(this,"nextSibling",null),zo(this,"ELEMENT_NODE",1),zo(this,"TEXT_NODE",3),zo(this,"nodeType",void 0),zo(this,"nodeName",void 0),zo(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 zs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Us(n,t,e,i)}function Us(t,e,n,i){Ws(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Ws(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Vs(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Zs="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.",Gs={map:{},getId(){return console.warn(Zs),-1},getNode(){return console.warn(Zs),null},removeNodeFromMap(){console.warn(Zs)},has(){return console.warn(Zs),!1},reset(){console.warn(Zs)}};function Qs(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 Js(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e);return r.Object.defineProperty(t,e,i?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>Js(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Gs=new Proxy(Gs,{get(t,e,n){return"map"===e&&console.warn(Zs),Reflect.get(t,e,n)}}));var Ks=Date.now;function Xs(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=po.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=po.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 Ys(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ta(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ea(t){return t?t.nodeType===t.ELEMENT_NODE?t:po.parentElement(t):null}function na(t,e,n,i){if(!t)return!1;const r=ea(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(As(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 ia(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ra(t,e){if(Wo(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=po.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ra(i,e))}function oa(t){return Boolean(t.changedTouches)}function sa(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function aa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function la(t){return!!t&&(t instanceof Hs&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(po.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ks=()=>(new Date).getTime());var ua=class{constructor(){zo(this,"id",1),zo(this,"styleIDMap",new WeakMap),zo(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 ca(t){var e;let n=null;return"getRootNode"in t&&(null===(e=po.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&po.host(po.getRootNode(t))&&(n=po.host(po.getRootNode(t))),n}function da(t){const e=t.ownerDocument;if(!e)return!1;if(po.contains(e,t))return!0;const n=po.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=ca(n);)n=e;return n}(t);return po.contains(e,n)}(t)}function ha(t){return"__ln"in t}var fa,va=class{constructor(){zo(this,"length",0),zo(this,"head",null),zo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ha(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&ha(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},pa=(t,e)=>`${t}@${e}`,ma=class{constructor(){zo(this,"frozen",!1),zo(this,"locked",!1),zo(this,"texts",[]),zo(this,"attributes",[]),zo(this,"attributeMap",new WeakMap),zo(this,"generatedAttributes",new WeakMap),zo(this,"removes",[]),zo(this,"mapRemoves",new Set),zo(this,"movedMap",{}),zo(this,"addedSet",new Set),zo(this,"movedSet",new Set),zo(this,"droppedSet",new Set),zo(this,"removesSubTreeCache",new Set),zo(this,"mutationCb",void 0),zo(this,"blockClass",void 0),zo(this,"blockSelector",void 0),zo(this,"maskTextClass",void 0),zo(this,"maskTextSelector",void 0),zo(this,"inlineStylesheet",void 0),zo(this,"maskInputOptions",void 0),zo(this,"maskTextFn",void 0),zo(this,"maskInputFn",void 0),zo(this,"maskAllElementAttributes",void 0),zo(this,"maskAttributeFn",void 0),zo(this,"keepIframeSrcFn",void 0),zo(this,"recordCanvas",void 0),zo(this,"canvasMaskingConfigured",void 0),zo(this,"inlineImages",void 0),zo(this,"slimDOMOptions",void 0),zo(this,"dataURLOptions",void 0),zo(this,"doc",void 0),zo(this,"mirror",void 0),zo(this,"iframeManager",void 0),zo(this,"stylesheetManager",void 0),zo(this,"shadowDomManager",void 0),zo(this,"canvasManager",void 0),zo(this,"processedNodeManager",void 0),zo(this,"unattachedDoc",void 0),zo(this,"canvasManagerReleased",!1),zo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),zo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=mo(),e=bo();try{this.processBufferedMutations()}finally{n=mo()-t,i=e,ko>0||wo(n,null!=i?i:go)||n>$o.slowestBatchMs&&($o.slowestBatchMs=n)}var n,i}),zo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new va,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=po.parentNode(o);if(!a||!da(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Wo(a)?this.mirror.getId(ca(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=r)&&void 0!==s||(r={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{sa(t,this.mirror)&&this.iframeManager.addIframe(t),aa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),la(t)&&!na(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(po.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)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=js(o,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)ya(this.removesSubTreeCache,t)&&!this.movedSet.has(po.parentNode(t))||o(t);for(const t of this.addedSet)ba(this.droppedSet,t)||ya(this.removesSubTreeCache,t)?ba(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(po.parentNode(s.value)),n=i(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(po.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=po.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=po.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=po.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]=ls({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};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={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),zo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),zo(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(po.childNodes(t),t=>po.textContent(t)||"").join("");e.attributes.value=os({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:cs(t),value:n,maskInputFn:this.maskInputFn})}),zo(this,"processMutation",t=>{if(!ia(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=po.textContent(t.target);na(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Os(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ea(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=ss(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=cs(t);l=os({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(na(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"),!$s(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,ss(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(na(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=Wo(t.target)?this.mirror.getId(po.host(t.target)):this.mirror.getId(t.target);na(t.target,this.blockClass,this.blockSelector,!1)||ia(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ga(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ra(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[pa(n,i)]?ga(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Wo(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),po.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),zo(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(ia(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[pa(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!na(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=po.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(la(t)){const e=po.childNodes(po.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()}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){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),na(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?po.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?po.host(i):null}return!1}};function ga(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=po.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function ya(t,e,n){return 0!==t.size&&function(t,e){const n=po.parentNode(e);return!!n&&t.has(n)}(t,e)}function ba(t,e){if(0===t.size)return!1;let n=po.parentNode(e);for(;n;){if(t.has(n))return!0;n=po.parentNode(n)}return!1}function wa(t){fa=t}function ka(){fa=void 0}var _a=(t,e="rrweb")=>fa?(...n)=>{try{return t(...n)}catch(t){if(fa&&!0===fa(t,e))return;throw t}}:t,Sa=[];function xa(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 Ca(t,e){const n=new ma;let i;n.init(t);try{i=new(fo())(_a(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),Sa.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ma({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=xa(o);if(!a||na(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=Xs(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=[zs("scroll",_a(Qs(_a(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(zs("scrollend",_a(a),e)),()=>l.forEach(t=>t())}function Ia(t,e){for(let n=Sa.length-1;n>=0;n--){const i=Sa[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Sa.splice(n,1))}}var Ta=["INPUT","TEXTAREA","SELECT"],Ra=new WeakMap;function $a(t){return function t(e,n){if(Pa("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Pa("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Pa("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Pa("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 Ea(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Aa({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:po.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}}),_a(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Oa=new Set;function La(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=_a(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Sa.indexOf(r);-1!==t&&Sa.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Vs(o)}}),a=(t,e)=>{const n=_a(()=>{try{return e()}catch(e){throw Oa.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Ca(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=Qs(_a(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=_a(Qs(_a(t=>{const e=xa(t),{clientX:n,clientY:r}=oa(t)?t.changedTouches[0]:t;s||(s=Ks()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Ks()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Jr.Drag:t instanceof MouseEvent?Jr.MouseMove:Jr.TouchMove)}),r,{trailing:!1})),c=[zs("mousemove",u,n),zs("touchmove",u,n),zs("drag",u,n)];return _a(()=>{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=ss(o);const u=(e=>o=>{const s=xa(o);if(na(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 oa(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=oa(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;_a(t)(D({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(zs(s,u,e))}),_a(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ma(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return zs("resize",_a(Qs(_a(()=>{const e=Ys(),r=ta();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=xa(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=po.parentElement(n)),!n||!f||0>Ta.indexOf(f)||na(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=cs(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=os({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=Ra.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){Ra.set(e,i);const r=n.getId(e);_a(t)(D(D({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>zs(t,_a(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=>Js(t[0],t[1],{set(){_a(d)({target:this,isTrusted:!1})}},!1,v))),_a(()=>{Vs(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=_a(o=>Qs(_a(r=>{const s=xa(r);if(!s||na(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=[zs("play",s(to.Play),o),zs("pause",s(to.Pause),o),zs("seeked",s(to.Seeked),o),zs("volumechange",s(to.VolumeChange),o),zs("ratechange",s(to.RateChange),o)];return _a(()=>{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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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:_a((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}=Ea(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=Jo(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ea(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={};Da("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Da("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Da("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Da("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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ea(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...$a(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:_a((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ea(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...$a(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),_a(()=>{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",()=>Aa(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:_a((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}=Ea(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=$a(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:_a((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}=Ea(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=$a(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),_a(()=>{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=vo(e.fonts,"add",function(e){return function(n){return setTimeout(_a(()=>{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),_a(()=>{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=_a(()=>{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);na(o,i,r,!0)||na(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),zs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?vo(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 Pa(t){return void 0!==window[t]}function Da(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Fa=class{constructor(t){zo(this,"generateIdFn",void 0),zo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),zo(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}},Na=class{constructor(t){zo(this,"iframes",new WeakMap),zo(this,"crossOriginIframeMap",new WeakMap),zo(this,"crossOriginIframeMirror",new Fa(ks)),zo(this,"crossOriginIframeStyleMirror",void 0),zo(this,"crossOriginIframeRootIdMap",new WeakMap),zo(this,"mirror",void 0),zo(this,"mutationCb",void 0),zo(this,"wrappedEmit",void 0),zo(this,"loadListener",void 0),zo(this,"pageHideListener",void 0),zo(this,"stylesheetManager",void 0),zo(this,"recordCrossOriginIframes",void 0),zo(this,"messageHandler",void 0),zo(this,"nestedIframeListeners",new Map),zo(this,"attachedWindows",new WeakMap),zo(this,"attachedDocuments",new WeakMap),zo(this,"attachedIframes",new Map),zo(this,"loadListenerDisposers",new WeakMap),zo(this,"iframeElementsById",new Map),zo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Fa(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=>Ws(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Us(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);Ws(()=>{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)})}Ws(()=>{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 Qr.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:Qr.IncrementalSnapshot,data:{source:Jr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Qr.Meta:case Qr.Load:case Qr.DomContentLoaded:return!1;case Qr.Plugin:return e;case Qr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Qr.IncrementalSnapshot:switch(e.data.source){case Jr.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 Jr.Drag:case Jr.TouchMove:case Jr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Jr.ViewportResize:return!1;case Jr.MediaInteraction:case Jr.MouseInteraction:case Jr.Scroll:case Jr.CanvasMutation:case Jr.Input:return this.replaceIds(e.data,t,["id"]),e;case Jr.StyleSheetRule:case Jr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Jr.Font:return e;case Jr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Jr.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===eo.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&&(Us(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Us(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=>{Ws(()=>this.mirror.removeNodeFromMap(t))}),Ws(()=>Ia(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&&Us(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Us(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}},qa=class{constructor(t){zo(this,"shadowDoms",new WeakSet),zo(this,"mutationCb",void 0),zo(this,"scrollCb",void 0),zo(this,"bypassOptions",void 0),zo(this,"mirror",void 0),zo(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;this.shadowDoms.add(t);const r=null!==(n=null===(i=po.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:o,buffer:s}=Ca(D(D({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();const t=Sa.indexOf(s);-1!==t&&Sa.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:Ma(D(D({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(po.host(t))),this.restoreHandlers.push({doc:r,handler:Aa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:vo(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=po.shadowRoot(this);return o&&da(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},ja="skip-frame";function Ba(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 Ha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ua=0;64>Ua;Ua++)za[Ha.charCodeAt(Ua)]=Ua;var Wa=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Ha[n[e]>>2],r+=Ha[(3&n[e])<<4|n[e+1]>>4],r+=Ha[(15&n[e+1])<<2|n[e+2]>>6],r+=Ha[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},Va=!1,Za=new Map,Ga=(t,e,n)=>{if(!t||!Ka(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Za.get(t);return n||(n=new Map,Za.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 Qa(t,e,n,i){if(t instanceof Array)return t.map(t=>Qa(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:Wa(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Qa(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)?Va||(Va=!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:[Qa(t.data,e,n,i),t.width,t.height]}:Ka(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ga(t,e,n)}:t}var Ja=(t,e,n,i)=>t.map(t=>Qa(t,e,n,i)),Ka=(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]))},Xa=["webgl","webgl2"];function Ya(t){return"nodeType"in t}function tl(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 vo(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||Ya(o)&&na(o,e,n,!0))return i.call(this,r);Ya(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?D(D({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=vo(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!na(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&Xa.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 el(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=vo(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Ga(l,o,this),this.canvas&&"tagName"in this.canvas&&!na(this.canvas,i,r,!0)){let t;try{t=Ja(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=Js(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!na(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var nl='(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',il="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",nl],{type:"text/javascript;charset=utf-8"});function rl(t){let e;try{if(e=il&&(self.URL||self.webkitURL).createObjectURL(il),!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(nl),{name:null==t?void 0:t.name})}}var ol="A page CSP that omits blob: from worker-src or script-src blocks it";function sl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var al,ll,ul,cl=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){zo(this,"pendingCanvasMutations",new Map),zo(this,"rafStamps",{latestId:0,invokeId:null}),zo(this,"mirror",void 0),zo(this,"mutationCb",void 0),zo(this,"resetObservers",void 0),zo(this,"frozen",!1),zo(this,"locked",!1),zo(this,"rafIdTimestamp",null),zo(this,"rafIdFlush",null),zo(this,"refCount",0),zo(this,"torndown",!1),zo(this,"resetFrameDedup",null),zo(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 sl("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=tl(e,n,i,!0),l=new Map;let u;try{u=new rl}catch(t){return sl(`disabled because the encode worker did not start. ${ol}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,sl(`stopped because the encode worker failed. ${ol}`,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:Yr["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=>{na(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 ja}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ba))return ja;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,sl("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,sl("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=tl(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=vo(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return na(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Ja(s,e,this,r)}catch(t){return}t(this.canvas,{type:Yr["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Js(e.CanvasRenderingContext2D.prototype,a,{set(e){na(this.canvas,n,i,!0)||t(this.canvas,{type:Yr["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(...el(e.WebGLRenderingContext.prototype,Yr.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...el(e.WebGL2RenderingContext.prototype,Yr.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,Gr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},dl=class{constructor(t){var e;zo(this,"trackedLinkElements",new WeakSet),zo(this,"pendingDeferredSheets",new Set),zo(this,"mutationCb",void 0),zo(this,"adoptedStyleSheetCb",void 0),zo(this,"maskAllElementAttributes",void 0),zo(this,"maskAttributeFn",void 0),zo(this,"styleMirror",new ua),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=is(i))}catch(t){}if(!n||!i)return jo(),null;const r=n;let o=!1;const s={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=mo(),u=bo();let c=!0;try{if(o)return a=!0,jo(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const s=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(jo(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(jo(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),wo(d=mo()-l,null!=(h=u)?h:go)||(Eo.totalMs+=d,d>Eo.slowestSliceMs&&(Eo.slowestSliceMs=d))}var d,h},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:ls({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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=mo();try{Do(()=>{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{Fo(mo()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ps.forEach(t=>t.abort()),Ps.clear()}trackStylesheetInLinkElement(t){}},hl=class{constructor(){zo(this,"nodeMap",new WeakMap),zo(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(){}},fl=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var vl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(vl=t.contentWindow)||void 0===vl?void 0:vl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var pl=new rs,ml=new Set([Jr.Mutation,Jr.MediaInteraction,Jr.StyleSheetRule,Jr.CanvasMutation,Jr.Font,Jr.Log,Jr.StyleDeclaration,Jr.AdoptedStyleSheet]);function gl(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)}}function yl(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineStylesheetBudgetRules:h,maskAllInputs:f,maskInputOptions:v,slimDOMOptions:p,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y=!1,maskAttributeFn:b,hooks:w,packFn:k,sampling:_={},dataURLOptions:S={},canvasResolutionScale:x,canvasMasking:C,mousemoveWait:M,recordDOM:I=!0,recordCanvas:T=!1,recordCrossOriginIframes:R=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:O=!1,inlineImages:L=!1,plugins:P,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:N=new Set([]),attributeFilter:q,errorHandler:j}=t;wa(j);const B=D({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),H=!R||window.parent===window;let z=!1;if(!H)try{window.parent.document&&(z=!1)}catch(t){z=!0}if(H&&!n)throw new Error("emit function is required");if(!H&&!z)return()=>{};void 0!==M&&void 0===_.mousemove&&(_.mousemove=M),pl.reset();const U=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==v?v:{password:!0},W=Bs(void 0!==p&&p);let V;!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 G=new Map;let Q,J;const K=t=>{for(const e of P||[])e.eventProcessor&&(t=e.eventProcessor(t));return k&&!z&&(t=k(t)),t};al=(t,e)=>{var o;const s=t;if(s.timestamp=Ks(),!(null===(o=Sa[0])||void 0===o?void 0:o.isFrozen())||s.type===Qr.FullSnapshot||s.type===Qr.IncrementalSnapshot&&ml.has(s.data.source)||Sa.forEach(t=>t.unfreeze()),H)null==n||n(K(s),e);else if(z){const t={type:"rrweb",event:K(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(s.type===Qr.FullSnapshot)V=s,Z=0;else if(s.type===Qr.IncrementalSnapshot){if(s.data.source===Jr.Mutation&&s.data.isAttachIframe)return;Z++,(r&&Z>=r||i&&s.timestamp-V.timestamp>i)&&ll(!0)}};const X=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=pl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=nt.getIframeElementById(t);i&&n.has(i)?nt.forgetIframeId(t):(null==Q||Q(t),nt.removeIframeById(t))}),null==J||J(),nt.cleanupDetachedIframes()}al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Mutation},t)})},Y=t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Scroll},t)}),tt=t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.CanvasMutation},t)}),et=new dl({mutationCb:X,adoptedStyleSheetCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.AdoptedStyleSheet},t)}),maskAllElementAttributes:y,maskAttributeFn:b}),nt=new Na({mirror:pl,mutationCb:X,stylesheetManager:et,recordCrossOriginIframes:R,wrappedEmit:al});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:pl,crossOriginIframeMirror:nt.crossOriginIframeMirror,crossOriginIframeStyleMirror:nt.crossOriginIframeStyleMirror});const it=new hl,rt=null==C?void 0:C.configured;ul=new cl({recordCanvas:T,mutationCb:tt,win:window,blockClass:o,blockSelector:s,mirror:pl,sampling:_.canvas,dataURLOptions:B,resolutionScale:x,canvasMasking:C});const ot=new qa({mutationCb:X,scrollCb:Y,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:U,dataURLOptions:B,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,sampling:_,slimDOMOptions:W,iframeManager:nt,stylesheetManager:et,canvasManager:ul,keepIframeSrcFn:F,processedNodeManager:it,attributeFilter:q},mirror:pl});ll=(t=!1)=>{if(I){Ao(h);try{al({type:Qr.Meta,data:{href:window.location.href,width:ta(),height:Ys()}},t),null==e||e.cancel(),e=void 0,et.reset(),ot.init(),Sa.forEach(t=>t.lock());let n=null,i=[];try{n=function(t,e){const{mirror:n=new rs,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:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:M,inlineStylesheetBudgetRules:I}=e||{},T=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,R=Bs(m);Ao(I);try{return js(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:T,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:R,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:M})}finally{Oo()}}(document,{mirror:pl,blockClass:o,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:U,inlineStylesheetBudgetRules:h,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOM:W,dataURLOptions:B,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,onSerialize(t){sa(t,pl)&&nt.addIframe(t),aa(t,pl)&&et.trackLinkElement(t),la(t)&&ot.addShadowRoot(po.shadowRoot(t),document)},onIframeLoad(t,e){nt.attachIframe(t,e),ot.observeAttachShadow(t)},onIframeListenerRegistered(t,e){nt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){et.attachLinkElement(t,e)},keepIframeSrcFn:F})}finally{i=qo()}if(!n)return console.warn("Failed to snapshot the document");if(al({type:Qr.FullSnapshot,data:{node:n,initialOffset:Xs(window)}},t),Sa.forEach(t=>t.unlock()),ul.onFullSnapshot(),i.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&&Ws(()=>{s=e.beginDeferredLinkInlining(n,pl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Ws(()=>{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,Bo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=gl(d):n())};return r=gl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return;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);Bo(e),null==s||s.discard(),s=null}n()}}}(i,et,()=>{e===t&&(e=void 0)});e=t}R&&nt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&et.adoptStyleSheets(document.adoptedStyleSheets,pl.getId(document))}finally{Oo()}}};try{const t=[];t.push(zs("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(zs(e,yo,document));Q=e=>{const n=G.get(e);n&&(n.forEach(e=>{Ws(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),G.delete(e))},J=()=>{for(const[t]of G){const e=pl.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==Q||Q(t)}catch(e){null==Q||Q(t)}else null==Q||Q(t)}};const n=t=>{var e;return _a(La)({mutationCb:X,mousemoveCb:(t,e)=>al({type:Qr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.MouseInteraction},t)}),scrollCb:Y,viewportResizeCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.ViewportResize},t)}),inputCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Input},t)}),mediaInteractionCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.MediaInteraction},t)}),styleSheetRuleCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.StyleSheetRule},t)}),styleDeclarationCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.StyleDeclaration},t)}),canvasMutationCb:tt,fontCb:t=>al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Font},t)}),selectionCb(t){al({type:Qr.IncrementalSnapshot,data:D({source:Jr.Selection},t)})},customElementCb(t){al({type:Qr.IncrementalSnapshot,data:D({source:Jr.CustomElement},t)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:U,inlineStylesheet:d,sampling:_,recordDOM:I,recordCanvas:T,canvasMaskingConfigured:rt,inlineImages:L,userTriggeredOnInput:A,collectFonts:O,doc:t,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y,maskAttributeFn:b,keepIframeSrcFn:F,blockSelector:s,slimDOMOptions:W,dataURLOptions:B,mirror:pl,iframeManager:nt,stylesheetManager:et,shadowDomManager:ot,processedNodeManager:it,canvasManager:ul,ignoreCSSAttributes:N,attributeFilter:q,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>al({type:Qr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},w)};nt.addLoadListener(e=>{try{const i=pl.getId(e),r=n(e.contentDocument);if("function"==typeof r&&(t.push(r),-1!==i)){let t=G.get(i);t||(t=new Set,G.set(i,t)),t.add(r)}}catch(t){console.warn(t)}}),nt.addPageHideListener(t=>{const e=pl.getId(t);null==Q||Q(e),Ia(t)});let i=-1;const r=t=>al({type:Qr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),h=()=>{var t,e,n,o;const s=document,a=null!==(t=null!==(e=null!==(n=null!==(o=s.fullscreenElement)&&void 0!==o?o:s.webkitFullscreenElement)&&void 0!==n?n:s.mozFullScreenElement)&&void 0!==e?e:s.msFullscreenElement)&&void 0!==t?t:null,l=a?pl.getId(a):-1;l!==i&&(-1!==i&&r({id:i,enter:!1}),i=l,-1!==l&&r({id:l,enter:!0}))},f=()=>{ll();const e=n(document);"function"==typeof e&&t.push(e),t.push(zs("fullscreenchange",h)),t.push(zs("webkitfullscreenchange",h)),t.push(zs("mozfullscreenchange",h)),t.push(zs("MSFullscreenChange",h)),fl=!0};return["interactive","complete"].includes(document.readyState)?f():(t.push(zs("DOMContentLoaded",()=>{al({type:Qr.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&f()})),t.push(zs("load",()=>{al({type:Qr.Load,data:{}}),"load"===E&&f()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Vs(t),it.destroy(),nt.removeLoadListener(),nt.destroy(),G.clear(),ot.reset(),pl.reset(),fl=!1,ka()}}catch(t){console.warn(t)}}yl.addCustomEvent=(t,e)=>{if(!fl)throw new Error("please add custom event after start recording");al({type:Qr.Custom,data:{tag:t,payload:e}})},yl.freezePage=()=>{Sa.forEach(t=>t.freeze())},yl.takeFullSnapshot=t=>{if(!fl)throw new Error("please take full snapshot after start recording");ll(t)},yl.mirror=pl,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var bl=Object.create(null);function wl(t){return wl="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},wl(t)}function kl(t,e,n){return(e=function(t){var e=function(t){if("object"!=wl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}bl.Node=Object.create(null),bl.ShadowRoot=Object.create(null),bl.MutationObserver=Object.create(null),bl.Element=Object.create(null);var _l=class{constructor(t){kl(this,"fileName",void 0),kl(this,"functionName",void 0),kl(this,"lineNumber",void 0),kl(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}`}},Sl=/(^|@)\S+:\d+/,xl=/^\s*at .*(\S+:\d+|\(native\))/m,Cl=/^(eval@)?(\[native code])?$/,Ml={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(xl)?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(xl)},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 _l({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(Cl)},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 _l({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new _l({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 _l({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 _l({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(Sl)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new _l({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Il(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 Tl(t){return Array.isArray(t)}function Rl(t){return"object"==typeof t&&null!==t&&!Tl(t)}function $l(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Rl(t[i])&&$l(t[i],e-1))return!0;return!1}function El(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(Rl(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Rl(o)&&$l(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]=Tl(i)?Il(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 Al={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 Ol(t,e,n){const i=n?Object.assign({},Al,n):Al,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:Ml.parse(e.error).map(t=>t.toString()),payload:[El(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=[El(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[El("Uncaught (in promise)",i.stringifyOptions),El(e.reason,i.stringifyOptions)]),t({level:"error",trace:Ml.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=Ml.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>El(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[El("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 Ll=t=>({name:"rrweb/console@1",observer:Ol,options:t});const Pl=()=>{},Dl=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Fl(t,e,n){try{if(!(e in t))return Pl;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return W(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=Dl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=Dl(n)}}}catch(t){return Pl}}function Nl(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 ql=ue("[Recorder]"),jl=t=>"navigation"===t.entryType,Bl=t=>"resource"===t.entryType,Hl=()=>{};function zl(t,e){var n;return jl(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function Ul(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>zl(t,n)||Bl(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 Wl(t,e){return!!e&&(Y(e)||e[t])}function Vl(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 Zl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Gl({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:!!Vl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Zl))return!1;if(Y(e))return!0;if(U(e))return r(e);const o=e[t];return Y(o)?o:r(o)}function Ql(t,e,n,i,r){return Jl.apply(this,arguments)}function Jl(){return Jl=A(function*(t,e,n,i,r,o=0){if(o>10)return ql.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=>Bl(t)&&t.initiatorType===e&&(Z(i)||t.startTime>=i)&&(Z(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Ql(t,e,n,i,r,o+1))}),Jl.apply(this,arguments)}function Kl({body:t,options:e,url:n}){if(K(t))return null;const{hostname:i,isHostDenied:r}=Nl(n,e);if(r)return i+" is in deny list";if(G(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(tt(t))return function(t,e="&"){let n,i;const r=[];return ce(t,function(t,e){Z(t)||Z(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)}(t);if(V(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 Xl=t=>!J(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Yl(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=[D(D({},e?e.toJSON():{name:l}),{},{startTime:Z(s)?void 0:Math.round(s),endTime:Z(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(Xl(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 tu=["video/","audio/"];function eu(t){return V(t)&&W(t.getReader)&&W(t.tee)}const nu="[SessionReplay] Timeout while trying to read body",iu="[SessionReplay] Failed to read body";function ru(t){return`${iu}: ${t}`}function ou(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function su(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(nu),500);try{t.clone().text().then(t=>e(t),t=>e(ru(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(iu)}})}(t);const n=Ze(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(ou(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(nu),500);let l;try{l=t.clone()}catch(t){return void s(iu)}const u=l.body;if(!eu(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(ru(t)))}catch(t){s(iu)}return}try{i=u.getReader()}catch(t){return void s(iu)}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(ou(e));d+=i.byteLength,c.push(i)}t()}},t=>s(ru(t)))}()})}(t,n)}function au(){return au=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Nl(n,e);return r?Promise.resolve(i+" is in deny list"):su(t,e)}),au.apply(this,arguments)}function lu(){return lu=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=tu.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Nl(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return J(i)?su(t,e):Promise.resolve(i)}),lu.apply(this,arguments)}let uu=null;function cu(t,e,n){if(!("performance"in e))return()=>{};if(uu)return ql.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ge,n):Ge;let r=!0;const o=e=>{if(!r)return;const n=[];let o=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&o)return;const r=i.maskRequestFn(t);e||(o=!r||(t=>!!t&&nn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(D(D({},e),{},{requests:n}))},s=function(t,e,n){try{t({requests:Ul(e,n).flatMap(t=>Yl(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){ql.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!U(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=>jl(t)||Bl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Yl(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(o,e,i),a=i.recordHeaders||i.recordBody;if(!s&&!a)return r=!1,Hl;let l=()=>{},u=()=>{};return a&&(l=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Wl("request",n.recordHeaders),r=Wl("response",n.recordHeaders),o=Fl(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=>(Gl({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=Kl({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),Gl({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Kl({body:d.response,options:n,url:a})),Ql(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:Yl(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){ql.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(o,e,i),u=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Wl("request",n.recordHeaders),r=Wl("response",n.recordHeaders),o=Fl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return ql.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),!eu(null==a?void 0:a.body)&&Gl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return au.apply(this,arguments)}({r:l,options:n,url:s}))}catch(t){ql.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Vl(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),Gl({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return lu.apply(this,arguments)}({r:u,options:n,url:s}))}catch(t){ql.error("Failed to record fetch response for network capture",t)}return u}finally{Ql(e,"fetch",l.url,d,h).then(n=>{t({requests:Yl(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()}}(o,e,i)),uu=()=>{r=!1,null==s||s(),l(),u(),uu=null},uu}const du=t=>({name:"rrweb/network@1",observer:cu,options:t});var hu,fu,vu,pu,mu,gu,yu,bu,wu,ku,_u,Su,xu,Cu,Mu;a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ll,getRecordNetworkPlugin:du},a.__PosthogExtensions__.rrweb={record:yl,version:"v2",wasMaxDepthReached:()=>qs,resetMaxDepthState(){qs=!1,Ns=!1},getLastSnapshotCost:()=>Co,getMutationCost:()=>D({},$o),getObserverInitFailures:()=>Oa.size?Array.from(Oa):void 0,resetSnapshotCostState(){ko=0,_o=0,So=0,go=0,xo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Co=null,Mo=null,Io=[],To=0,Ro=0,$o={slowestBatchMs:0},Eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},a.rrweb={record:yl,version:"v2"},a.rrwebConsoleRecord={getRecordConsolePlugin:Ll},a.getRecordNetworkPlugin=du,a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initSessionRecording=(t,e)=>new Zr(t,e);var Iu,Tu,Ru,$u,Eu={},Au=[],Ou=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Lu=Array.isArray;function Pu(t,e){for(var n in e)t[n]=e[n];return t}function Du(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fu(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?hu.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 Nu(t,s,i,r,null)}function Nu(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?++vu:r,__i:-1,__u:0};return null==r&&null!=fu.vnode&&fu.vnode(o),o}function qu(t){return t.children}function ju(t,e){this.props=t,this.context=e}function Bu(t,e){if(null==e)return t.__?Bu(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?Bu(t):null}function Hu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Pu({},e);o.__v=e.__v+1,fu.vnode&&fu.vnode(o),Xu(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Bu(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,tc(i,o,r),e.__e=e.__=null,o.__e!=n&&zu(o)}}function zu(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}),zu(t)}function Uu(t){(!t.__d&&(t.__d=!0)&&pu.push(t)&&!Wu.__r++||mu!=fu.debounceRendering)&&((mu=fu.debounceRendering)||gu)(Wu)}function Wu(){try{for(var t,e=1;pu.length;)pu.length>e&&pu.sort(yu),t=pu.shift(),e=pu.length,Hu(t)}finally{pu.length=Wu.__r=0}}function Vu(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Au,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]=Nu(null,s,null,null,null):Lu(s)?s=t.__k[o]=Nu(qu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Nu(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=Gu(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=Bu(a)),ic(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]||Eu,f.__i=d,m=Xu(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&nc(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=Zu(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 Zu(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=Zu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Bu(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Gu(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 Qu(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Ou.test(e)?n:n+"px"}function Ju(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||Qu(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Qu(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(_u,"$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[ku]=i[ku]:(n[ku]=Su,t.addEventListener(e,o?Cu:xu,o)):t.removeEventListener(e,o?Cu:xu,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 Ku(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[wu])e[wu]=Su++;else if(n[ku]>e[wu])return;return n(fu.event?fu.event(e):e)}}}function Xu(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=fu.__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 ju(y,w),h.constructor=C,h.render=rc),$&&$.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=Pu({},h.__s)),Pu(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)}),Au.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=fu.__r,_=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Au.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>++_);h.state=h.__s,null!=h.getChildContext&&(i=Pu(Pu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),S=null!=c&&c.type===qu&&null==c.key?ec(c.props.children):c,a=Vu(t,Lu(S)?S:[S],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--;)Du(o[x]);Yu(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||Yu(e);fu.__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||Eu,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&&(fu.__m&&fu.__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&&hu.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||Ju(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||Ju(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=""),Vu("template"==e.type?t.content:t,Lu(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Bu(n,0),a,l),null!=o)for(u=o.length;u--;)Du(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])&&Ju(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&Ju(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=fu.diffed)&&c(e),128&e.__u?void 0:a}function Yu(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Yu))}function tc(t,e,n){for(var i=0;n.length>i;i++)nc(n[i],n[++i],n[++i]);fu.__c&&fu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){fu.__e(t,e.__v)}})}function ec(t){return"object"!=typeof t||null==t||t.__b>0?t:Lu(t)?t.map(ec):void 0!==t.constructor?null:Pu({},t)}function nc(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){fu.__e(t,n)}}function ic(t,e,n){var i,r;if(fu.unmount&&fu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||nc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){fu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&ic(i[r],e,n||"function"!=typeof t.type);n||Du(t.__e),t.__c=t.__=t.__e=void 0}function rc(t,e,n){return this.constructor(t,n)}function oc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),fu.__&&fu.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],Xu(e,t=(!i&&n||e).__k=Fu(qu,null,[t]),r||Eu,Eu,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?hu.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),tc(o,t,s),t.props.children=null}hu=Au.slice,fu={__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}},vu=0,ju.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Pu({},this.state);"function"==typeof t&&(t=t(Pu({},n),this.props)),t&&Pu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Uu(this))},ju.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Uu(this))},ju.prototype.render=qu,pu=[],gu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yu=function(t,e){return t.__v.__b-e.__v.__b},Wu.__r=0,bu=Math.random().toString(8),wu="__d"+bu,ku="__a"+bu,_u=/(PointerCapture)$|Capture$/i,Su=0,xu=Ku(!1),Cu=Ku(!0),Mu=0;var sc=0,ac=[],lc=fu,uc=lc.__b,cc=lc.__r,dc=lc.diffed,hc=lc.__c,fc=lc.unmount,vc=lc.__;function pc(t,e){lc.__h&&lc.__h(Tu,t,sc||e),sc=0;var n=Tu.__H||(Tu.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function mc(t){return sc=1,function(t,e){var n=pc(Iu++,2);if(n.t=t,!n.__c&&(n.__=[Ic(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=Tu,!Tu.__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};Tu.__f=!0;var r=Tu.shouldComponentUpdate,o=Tu.componentWillUpdate;Tu.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)},Tu.shouldComponentUpdate=i}return n.__N||n.__}(Ic,t)}function gc(t,e){var n=pc(Iu++,3);!lc.__s&&Mc(n.__H,e)&&(n.__=t,n.u=e,Tu.__H.__h.push(n))}function yc(t){return sc=5,bc(function(){return{current:t}},[])}function bc(t,e){var n=pc(Iu++,7);return Mc(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function wc(t){var e=Tu.context[t.__c],n=pc(Iu++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Tu)),e.props.value):t.__}function kc(){for(var t;t=ac.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(xc),e.__h.some(Cc),e.__h=[]}catch(n){e.__h=[],lc.__e(n,t.__v)}}}lc.__b=function(t){Tu=null,uc&&uc(t)},lc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vc&&vc(t,e)},lc.__r=function(t){cc&&cc(t),Iu=0;var e=(Tu=t.__c).__H;e&&(Ru===Tu?(e.__h=[],Tu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&kc(),Iu=0)),Ru=Tu},lc.diffed=function(t){dc&&dc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==ac.push(e)&&$u===lc.requestAnimationFrame||(($u=lc.requestAnimationFrame)||Sc)(kc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Ru=Tu=null},lc.__c=function(t,e){e.some(function(t){try{t.__h.some(xc),t.__h=t.__h.filter(function(t){return!t.__||Cc(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],lc.__e(n,t.__v)}}),hc&&hc(t,e)},lc.unmount=function(t){fc&&fc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{xc(t)}catch(t){e=t}}),n.__H=void 0,e&&lc.__e(e,n.__v))};var _c="function"==typeof requestAnimationFrame;function Sc(t){var e,n=function(){clearTimeout(i),_c&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);_c&&(e=requestAnimationFrame(n))}function xc(t){var e=Tu,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Tu=e}function Cc(t){var e=Tu;t.__c=t.__(),Tu=e}function Mc(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Ic(t,e){return"function"==typeof e?e(t):e}const Tc="tab",Rc="left",$c="center",Ec="right",Ac="next_to_trigger",Oc="popover",Lc="widget",Pc="external_survey",Dc="open",Fc="multiple_choice",Nc="single_choice",qc="rating",jc="end",Bc="always",Hc="$survey_id",zc="$survey_name",Uc="$survey_iteration",Wc="$survey_iteration_start_date",Vc="$survey_language",Zc=ue("[Surveys]");function Gc(t){return W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}const Qc=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,Jc=t=>Qc("seenSurvey_",t),Kc=t=>{try{const e=Jc(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Zc.error("Failed to persist survey seen state",t)}},Xc=[Oc,Lc,"api"],Yc=ue("[Stylesheet Loader]"),td=t,ed=i,nd="#020617",id={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:Ec,widgetType:Tc,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:nd,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},rd=[$c,Rc,Ec];function od(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 sd(t=id.backgroundColor){let e;"#"===t[0]&&(e=od(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=od(n)),!e)return nd;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?nd:"white"}return nd}const ad=(t,e,n)=>{const i=Md(t),r=ed.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=ed.createElement("div");((t,e,n)=>{const i=D(D({},id),n),r=t.style,o=!rd.includes(i.position)||e===Lc&&(null==n?void 0:n.widgetType)===Tc;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)||sd(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",sd(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||sd(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",sd(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)||sd(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 W(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||(Yc.error("prepare_external_dependency_stylesheet returned null"),null)})(ed,':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)}}',t);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||ed.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},ld=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l;i?Gc(i)&&(Kc(e),i.capture("survey sent",D(D(D({[zc]:e.name,[Hc]:e.id,[Uc]:e.current_iteration,[Wc]:e.current_iteration_start_date,sessionRecordingUrl:null===(l=i.get_session_replay_url)||void 0===l?void 0:l.call(i)},Ti({event:"sent",survey:e,responses:t,submissionId:n,completed:r,surveyLanguage:s,questionSnapshots:a})),o),{},{$set:{[$i(e,"responded")]:!0}})),r&&(td.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),Cd(e),i.reloadFeatureFlags())):Zc.error("[survey sent] event not captured, PostHog instance not found.")},ud=(t,e,n,i)=>{var r;return D({[zc]:e.name,[Hc]:e.id,[Uc]:e.current_iteration,[Wc]:e.current_iteration_start_date,sessionRecordingUrl:null===(r=i.get_session_replay_url)||void 0===r?void 0:r.call(i)},Ti({event:t,survey:e,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},cd=(t,e,n,i)=>{if(!e)return void Zc.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const r=Sd(t),o=r?r.surveyLanguage:i;e.capture("survey dismissed",D(D(D({},ud("dismissed",t,r,e)),o&&{[Vc]:o}),{},{$set:{[$i(t,"dismissed")]:!0}})),Cd(t),Kc(t),td.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},dd=(t,e)=>{if(!e)return void Zc.error("[survey abandoned] event not captured, PostHog instance not found.");const n=(t=>Qc("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(n))return}catch(t){return}const i=Sd(t);if(i){try{localStorage.setItem(n,"true")}catch(t){}e.capture("survey abandoned",ud("abandoned",t,i,e),{transport:"sendBeacon"})}},hd=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},fd=(t,e)=>{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=ji(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions;var n,i,r},vd=t=>function(t){var e;return Di(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||xd(t),pd=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,Uu(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"+Mu++,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}),md=()=>wc(pd),gd=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Pu({},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?hu.call(arguments,2):n),Nu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i});function yd(t,e){var n,i;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const r=me(e);if(!r)return!1;const o=[t.conditions.url],s=function(t){return null!=t?t:"icontains"}(null===(i=t.conditions)||void 0===i?void 0:i.urlMatchType);return qi[s](o,[r])}function bd(e){var i,r;return function(e,i){var r,s,a;if(!e||0===e.length)return!0;if(!o)return!1;const l=function(t,e){var n;const i=function(t){return _t.test(t)?ft:kt.test(t)?vt:wt.test(t)?pt:new RegExp(gt,"i").test(t)?gt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ht:St.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(mt,"i").test(t)?mt:/(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(lt).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":ct:new RegExp("(pda|Mobile)","i").test(t)?yt:new RegExp(ut,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?bt:""}(t);return i===dt||i===ct||"Kobo"===i||"Kindle Fire"===i||i===bt?ut:i===ft||i===pt||i===vt||i===gt?"Console":i===ht?"Wearable":i?lt:"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)?lt:ut:"Desktop";var r,o,s}(o,{userAgentDataPlatform:null==n||null===(r=n.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==n?void 0:n.maxTouchPoints,screenWidth:null==t||null===(s=t.screen)||void 0===s?void 0:s.width,screenHeight:null==t||null===(a=t.screen)||void 0===a?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return qi[null!=i?i:"icontains"](e,[l])}(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const wd=t=>Qc("inProgressSurvey_",t),kd={},_d=(t,e)=>{const n=wd(t);try{localStorage.setItem(n,JSON.stringify(e)),delete kd[n]}catch(t){Zc.error("Error setting in-progress survey state in localStorage",t),kd[n]=e}},Sd=t=>{const e=wd(t),n=kd[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Zc.error("Error getting in-progress survey state from localStorage",t)}return null},xd=t=>{const e=Sd(t);return!K(null==e?void 0:e.surveySubmissionId)},Cd=t=>{const e=wd(t);delete kd[e];try{localStorage.removeItem(e)}catch(t){Zc.error("Error clearing in-progress survey state from localStorage",t)}};function Md(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function Id(t,e=Ec,n){if(t===Pc)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 Rc:return{left:"30px"};case $c:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Lc&&n===Tc?"60px":"30px"}}}var Td=0;function Rd(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:--Td,__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 fu.vnode&&fu.vnode(u),u}const $d=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rd("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"})}),Ed=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rd("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"})}),Ad=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rd("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"})}),Od=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rd("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"})}),Ld=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rd("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"})}),Pd=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rd("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"})}),Dd=Rd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rd("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"})}),Fd=({fill:t="currentColor"}={})=>Rd("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:[Rd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Rd("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})]}),Nd=Rd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Rd("g",{"clip-path":"url(#clip0_2415_6911)",children:[Rd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Rd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Rd("g",{mask:"url(#mask0_2415_6911)",children:[Rd("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Rd("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Rd("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Rd("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Rd("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Rd("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Rd("defs",{children:Rd("clipPath",{id:"clip0_2415_6911",children:Rd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function qd({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Rd("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Nd]})}function jd({text:e,submitDisabled:n,appearance:i,onSubmit:r,link:o,onPreviewSubmit:s,skipSubmitButton:a,canGoBack:l,onBack:u}){const{isPreviewMode:c}=wc(pd),d=!!l&&!!u,h=!a&&Rd("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():r()},children:e});return Rd("div",{className:"bottom-section",children:[d?Rd("div",{className:"form-buttons form-buttons-with-back",children:[Rd("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Rd(qd,{urlParams:{utm_source:"survey-footer"}})]})}function Bd({question:t,forceDisableHtml:e,htmlFor:n}){return Rd("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Rd(t.type===Dc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&gd({component:Fu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function Hd({onClick:t}){const{isPreviewMode:e}=wc(pd);return Rd("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:Fd({fill:"black"})})}const zd=t;function Ud({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=wc(pd);return gc(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return fe(zd,"keydown",t),()=>{zd.removeEventListener("keydown",t)}},[o]),Rd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Rd(Hd,{onClick:()=>o()}),Rd("h3",{className:"thank-you-message-header",children:t}),e&&gd({component:Fu("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Rd(jd,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function Wd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=wc(pd);return Rd("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Rd(Hd,{onClick:()=>l()}),t&&Rd("h3",{className:"intro-screen-header",children:t}),e&&gd({component:Fu("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Rd(jd,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const Vd=t=>U(t)&&t.every(t=>G(t));function Zd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=md(),c=yc(null),[d,h]=mc(()=>G(s)?s:""),f=null==n?void 0:n.disableAutofocus;gc(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=bc(()=>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 F: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 N: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=re(t.validation,F),g=re(t.validation,N),y=bc(()=>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 Rd(qu,{children:[Rd("div",{className:"question-container",children:[Rd(Bd,{question:t,forceDisableHtml:e,htmlFor:v}),Rd("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&&Rd("div",{className:"validation-hint",children:y})]}),Rd(jd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function Gd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Rd(qu,{children:[Rd("div",{className:"question-container",children:Rd(Bd,{question:t,forceDisableHtml:e})}),Rd(jd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function Qd({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(()=>X(s)?s:U(s)&&s.length>0&&X(parseInt(s[0]))?parseInt(s[0]):G(s)&&X(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=md(),m=t=>p?o(t):r(t);return Rd(qu,{children:[Rd("div",{className:"question-container",children:[Rd(Bd,{question:t,forceDisableHtml:e}),Rd("div",{className:"rating-section",children:[Rd("div",{className:"rating-options",children:["emoji"===t.display&&Rd("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=eh[t.scale])||void 0===u?void 0:u.map((e,i)=>Rd("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&&Rd("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:nh(t.scale).map((e,r)=>Rd(Jd,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Rd("div",{className:"rating-text",children:[Rd("div",{children:t.lowerBoundLabel}),Rd("div",{children:t.upperBoundLabel})]})]})]}),Rd(jd,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:J(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Jd({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Rd("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function Kd({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=yc(null),c=bc(()=>(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=ji(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return J(i)||r.push(i),r})(t),[t]),[d,h]=mc(()=>((t,e)=>G(t)||Vd(t)?t:e===Nc?null:[])(s,t.type)),[f,v]=mc(()=>((t,e)=>{if(G(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Vd(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=md(),m=t.type===Nc,g=t.type===Fc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>D(D({},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=>D(D({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&U(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>D(D({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||_()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),v(t=>D(D({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},_=()=>!(t.optional||!J(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),S=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Rd(qu,{children:[Rd("div",{className:"question-container",children:[Rd(Bd,{question:t,forceDisableHtml:e}),Rd("fieldset",{className:"multiple-choice-options limit-height",children:[Rd("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:U(d)&&d.includes(e);return Rd("label",{className:r?"choice-option-open":"",children:[Rd("div",{className:"response-choice",children:[Rd("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Rd("span",{children:r?`${e}:`:e})]}),r&&Rd("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)})]})]}),Rd(jd,{text:t.buttonText||"Submit",submitDisabled:_(),appearance:i,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const Xd=[1,2,3,4,5],Yd=[1,2,3,4,5,6,7],th=[0,1,2,3,4,5,6,7,8,9,10],eh={2:[Pd,Dd],3:[Ad,Ed,$d],5:[Od,Ad,Ed,$d,Ld]};function nh(t){switch(t){case 5:default:return Xd;case 7:return Yd;case 10:return th}}const ih=ue("[Surveys]");function rh(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?jc:o;if(r.branching.type===jc)return jc;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===Nc){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];return Number.isInteger(e)?e:e===jc?jc:o}}else if(r.type===qc){var a;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const t=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(t)){const e=r.branching.responseValues[t];return Number.isInteger(e)?e:e===jc?jc:o}}return o}return ih.warn("Falling back to next question index due to unexpected branching type"),o}const oh=ue("[SurveyTranslations]");function sh(t,e){const n=function(t){return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Ei(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?Ei(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Ei(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:W(t.get_property)?t.get_property(y):void 0,locale:navigator.language||navigator.userLanguage},oh)}(e);if(!n)return oh.info("No user language detected"),{survey:t,language:null};const i=Pi(t,n,oh);return{survey:i.survey,language:i.matchedKey}}const ah=t,lh=i,uh="ph:show_survey_widget",ch="PHWidgetSurveyClickListener";function dh(t,e){try{const n=t.getBoundingClientRect(),i=ah.innerHeight,r=ah.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:id.zIndex}}catch(t){return Zc.warn("Failed to calculate trigger position:",t),null}}var hh=class{constructor(t){this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ii=null,this.Ti=!1,this.Ri=null,this.$i=null,this.Ei=null,this.Ai=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(b);if(t)for(const e of t)xd(e)&&dd(e,this._posthog)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l;if(!Gc(this._posthog))return;const{survey:u,language:c}=this.Oi(t);this.Ii=c,this.Ei=null,this.Li=e;const d=this.Pi(u,e);this.Di(d.id);const{properties:h,initialResponses:f}=null!=e?e:{},v=!(!f||0>=Object.keys(f).length)&&this.Fi(d,f,h,c);if(v&&!(null===(i=d.appearance)||void 0===i?void 0:i.displayThankYouMessage))return;this.Ni(d);let p={};if((null===(r=d.appearance)||void 0===r?void 0:r.position)===Ac&&(null===(o=d.appearance)||void 0===o?void 0:o.widgetSelector)){const t=lh.querySelector(d.appearance.widgetSelector);var m;t&&(p=dh(t,parseInt((null===(m=d.appearance)||void 0===m?void 0:m.maxWidth)||id.maxWidth))||{})}const g=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:y}=ad(d,this._posthog);this.Ci.set(y,y.host);const b={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.qi,properties:h,style:p,isSurveyCompleted:v,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:c};if(this.Ei=b,0>=g)return this.Ti=!0,oc(Rd(gh,D({},b)),y);const w=()=>{this.Ti=!0;const{survey:n,language:i}=this.Oi(t);this.Ii=i;const r=this.Pi(n,e),o=D(D({},b),{},{survey:r,surveyLanguage:i});this.Ei=o,oc(Rd(gh,D(D({},o),{},{survey:D(D({},r),{},{appearance:D(D({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),y)},k=()=>{if(!Gc(this._posthog)||!this.ji(d))return Zc.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.qi(d);w()},_=n?null===(a=this._posthog.surveys)||void 0===a||null===(a=a._surveyEventReceiver)||void 0===a||null===(l=a.getActivationTimestamp)||void 0===l?void 0:l.call(a,d.id):void 0,S=X(_)?Math.max(0,Date.now()-_):0,x=Math.max(0,1e3*g-S);if(0>=x)return k();const C=ah.setTimeout(()=>{this.ki.delete(d.id),k()},x);this.ki.set(d.id,C)},this.Bi=t=>{var e;const{survey:n,language:i}=this.Oi(t),{shadow:r,isNewlyCreated:o}=ad(n,this._posthog);this.Ci.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Tc&&this.xi.set(t.id,t),o&&oc(Rd(bh,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),r)},this.Hi=t=>{const e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(ch),this.Si.delete(t),Zc.info(`Removed click listener for survey ${t}`))},this.zi=t=>{this.Ui(t)||(this.Wi(t),this.Hi(t.id))},this.Vi=t=>{this.Ui(t)||(this.Wi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var e;const n=lh.querySelector(Md(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Zi=(t,e)=>{const n=lh.querySelector(e),i=this.Si.get(t.id);if(n){if(this.Bi(t),i){if(n===i.element)return;Zc.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.Hi(t.id)}if(!n.hasAttribute(ch)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Ac?dh(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||id.maxWidth)):{};ah.dispatchEvent(new CustomEvent(uh,{detail:{surveyId:t.id,position:r}}))};fe(n,"click",e),n.setAttribute(ch,"true"),this.Si.set(t.id,{element:n,listener:e,survey:t}),Zc.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.zi(t)},this.renderPopover=t=>{if(!Gc(this._posthog))return;const{survey:e,language:n}=this.Oi(t),{shadow:i}=ad(e,this._posthog);this.Ci.set(i,i.host),oc(Rd(gh,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.qi,surveyLanguage:n}),i)},this.renderSurvey=(t,e,n)=>{var i;if(!Gc(this._posthog))return;const{survey:r,language:o}=this.Oi(t);let s=!1;(null===(i=this._posthog.config)||void 0===i||null===(i=i.surveys)||void 0===i?void 0:i.prefillFromUrl)&&(s=this.Gi(r,o,n)),oc(Rd(gh,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this._posthog)||void 0===n||null===(n=n.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.ji(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{const e=Gc(this._posthog),n=t.filter(t=>e&&(t.type===Oc||t.type===Lc)),i=new Set(n.map(t=>t.id));for(const t of Array.from(this.ki.keys()))i.has(t)||this.cancelSurvey(t);const r=this.Qi(n),o=new Set,s=new Set;r.forEach(t=>{if(t.type===Lc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Tc)return s.add(t.id),void this.Bi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(o.add(t.id),this.Zi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}J(this.Ji)&&t.type===Oc&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.Si.forEach(({survey:t})=>{o.has(t.id)||this.zi(t)}),this.xi.forEach((t,e)=>{s.has(e)||this.Vi(t)})},t)},this.Ni=t=>{J(this.Ji)||Zc.error(`Survey ${this.Ji} already in focus. Cannot add survey ${t.id}.`),this.Ji=t.id},this.qi=t=>{this.Ji!==t.id&&Zc.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Di(t.id),this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0,this.Wi(t)},this._posthog=t,this.Ji=null,this.Ri=()=>this.Ki(),fe(ah,"languagechange",this.Ri),this.$i=t.onFeatureFlags(()=>this.Ki())}Ki(){if(J(this.Ji))return;const t=this._posthog.get_property(b),e=null==t?void 0:t.find(t=>t.id===this.Ji);if(!e)return;const{survey:n,language:i}=this.Oi(e);if(i===this.Ii)return;if(this.Ii=i,!this.Ti)return;const r=this.Pi(n,this.Li),{shadow:o}=ad(r,this._posthog);oc(Rd(gh,D(D({},this.Ei),{},{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.qi,surveyLanguage:i})),o)}get Xi(){var t,e,n;return null!==(t=null===(e=(n=this._posthog).getExtension)||void 0===e?void 0:e.call(n,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Pi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?D(D({},t),{},{appearance:D(D(D({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Di(t){const e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(Zc.info(`Cancelled pending survey ${t}`),this.Di(t),this.Ji===t&&(this.Ji=null,this.Ii=null,this.Ti=!1,this.Ei=null,this.Li=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(kd))delete kd[t]})()}setAutomaticDisplayDispose(t){this.Yi=t}dispose(){var t;null===(t=this.Yi)||void 0===t||t.call(this),this.Yi=void 0,this.Ri&&(ah.removeEventListener("languagechange",this.Ri),this.Ri=null),this.$i&&(this.$i(),this.$i=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Hi(e)),this.Ci.forEach((t,e)=>{oc(null,e),null==t||t.remove()}),this.Ci.clear(),this.xi.clear(),this.Ji=null}Qi(t){return t.sort((t,e)=>{var n,i;const r=xd(t),o=xd(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Bc,a=e.schedule===Bc;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)})}Oi(t){return sh(t,this._posthog)}Gi(t,e,n){if(this.Mi.has(t.id))return!1;const{params:i}=function(t){const e={};let n=!1;const i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:n};const r=i.split("&");for(const t of r){const[i,r]=t.split("=");if(!i||Z(r))continue;const o=decodeURIComponent(i),s=decodeURIComponent(r);if("auto_submit"===o&&"true"===s){n=!0;continue}const a=o.match(/^q(\d+)$/);if(a){const t=parseInt(a[1],10);e[t]||(e[t]=[]),e[t].push(s)}}return{params:e,autoSubmit:n}}(ah.location.search);if(0===Object.keys(i).length)return!1;Zc.info("[Survey Prefill] Detected URL prefill parameters");const r=this.tr(t,i,e);return!!r&&(this.er(t,r,n,e),this.Mi.add(t.id),r.isSurveyCompleted)}er(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&ld({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Fi(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Zc.info("[Survey] Processing initial responses");const o=this.tr(t,r,i);return!!o&&(this.er(t,o,n,i),o.isSurveyCompleted)}tr(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 Nc:{if(!t.choices||0===t.choices.length)return void le.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 le.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Fc:{if(!t.choices||0===t.choices.length)return void le.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 le.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&le.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case qc:{const e=parseInt(r[0],10),s=t.scale||10;if(isNaN(e)||0>e||e>s)return void le.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: 0-${s})`);n[o]=e;break}default:le.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){le.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return Zc.warn("[Survey Prefill] No valid responses after conversion"),null;const r=gi(),{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);Z(n[t])||(r[t]=n[t])}o.push(i);const s=rh(t,i,e.id?n[Mi(e.id)]:null);if(s===jc)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)),i),l=o>=t.questions.length;return _d(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:hd(t.questions),visitedIndices:a,surveyLanguage:n}),Zc.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Zc.error("[Survey Prefill] Error handling prefill:",t),null}}nr(t,e=void 0){if(!t)return!0;const n=this.Xi,i=!!(null==n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let r=!0;e&&(r=(null==n?void 0:n.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const o=i&&r;return o||this.ir(t),o}ir(t){var e;!this.Ai&&(null===(e=this._posthog.config)||void 0===e?void 0:e.advanced_disable_feature_flags)&&(this.Ai=!0,Zc.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.`))}rr(t){return!t.conditions||yd(t,this._posthog)&&bd(t)&&function(t){var e;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null==ed?void 0:ed.querySelector(t.conditions.selector))}(t)}sr(t){var e;return vd(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.Xi)||void 0===e?void 0:e.hasLoadedFlags)?(this.ir(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.nr(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(!Xc.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.nr(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.nr(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.sr(t);var s;return o.satisfied?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}(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays,wi.Ot("lastSeenSurveyDate"))?(t=>!!wi.Ot(Jc(t))&&!vd(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):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(){return Gc(this._posthog)?{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.ar(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ar(t){var e;if(!Di(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._posthog.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}lr(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.nr(e))}ji(t){return this.checkSurveyEligibility(t).eligible&&this.rr(t)&&this.ar(t)&&this.lr(t)}Wi(t){try{const e=lh.querySelector(Md(t,!0));(null==e?void 0:e.shadowRoot)&&(oc(null,e.shadowRoot),this.Ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Zc.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.qi,surveyInFocus:this.Ji,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Zi,sortSurveysByAppearanceDelay:this.Qi,checkFlags:this.lr.bind(this),isSurveyFeatureFlagEnabled:this.nr.bind(this),onLanguageChange:this.Ki.bind(this),currentLanguage:this.Ii,surveyIsRendered:this.Ti}}};function fh(t,e){if(!lh||!ah)return;const n=new hh(t);if(t.config.disable_surveys_automatic_display)return Zc.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===e)return Zc.info("There are no surveys to load or Surveys is disabled in the project settings."),n;let i;n.callSurveysAndEvaluateDisplayLogic(!0);const r=()=>{Z(i)&&(i=setInterval(()=>{n.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{Z(i)||(clearInterval(i),i=void 0)};r();const s=()=>{lh.hidden?o():(n.callSurveysAndEvaluateDisplayLogic(!1),r())};return fe(lh,"visibilitychange",s),n.setAutomaticDisplayDispose(()=>{o(),lh.removeEventListener("visibilitychange",s)}),n}function vh({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){gc(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Lc,s=yd(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===Tc&&o;if(!s)return Zc.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Zc.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};fe(ah,"popstate",s),fe(ah,"hashchange",s);const a=ah.history.pushState,l=ah.history.replaceState;return ah.history.pushState=function(...t){a.apply(this,t),s()},ah.history.replaceState=function(...t){l.apply(this,t),s()},()=>{ah.removeEventListener("popstate",s),ah.removeEventListener("hashchange",s),ah.history.pushState=a,ah.history.replaceState=l}},[i,t,e,n,r])}const ph=200;function mh(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 gh({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,M;const I=yc(null),T=Number.isInteger(r),{isPopupVisible:R,isSurveySent:E,hidePopupWithAnimation:A}=function(t,e,n,i,r,o,s,a,l){const[u,c]=mc(i||0===n||t.type===Pc),[d,h]=mc(!1),f=yc(!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 ${ph}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return gc(()=>{if(!e)return void Zc.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=()=>{if(yd(t,e)){var n;c(!0),ah.dispatchEvent(new Event("PHSurveyShown")),a||e.capture("survey shown",D(D({[zc]:t.name,[Hc]:t.id,[Uc]:t.current_iteration,[Wc]:t.current_iteration_start_date},l&&{[Vc]:l}),{},{sessionRecordingUrl:null===(n=e.get_session_replay_url)||void 0===n?void 0:n.call(e)}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};fe(ah,"PHSurveyClosed",p),fe(ah,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return Z(u)&&s(),()=>{Z(u)||clearTimeout(u),Z(r)||clearTimeout(r),ah.removeEventListener("PHSurveyClosed",p),ah.removeEventListener("PHSurveySent",o)}},[]),vh({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,T,o,s,I,f,v),O=E||r===t.questions.length||!0===h,[L,P]=mc(!1),F=bc(()=>!!Sd(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=T?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!L&&!F,j=bc(()=>{const e=Sd(t),i=(null==e?void 0:e.surveySubmissionId)||gi();return{isPreviewMode:T,previewPageIndex:r,onPopupSurveyDismissed(){v?cd(t,n,T,v):cd(t,n,T),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[T,r,s,n,t,u,a,l,d,v]);return R?Rd(pd.Provider,{value:j,children:Rd("div",{className:"ph-survey",style:D(D({},Id(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?Rd(Ud,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:t.appearance||id,onClose(){A(),c()}}):q?Rd(Wd,{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===(M=t.appearance)||void 0===M?void 0:M.introScreenDescriptionContentType,appearance:t.appearance||id,onStart:()=>P(!0)}):Rd(yh,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function yh({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=bc(()=>{const e=Sd(t);if(!e)return null;const n=X(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(Cd(t),null)},[t]),[s,a]=mc(()=>((null==o?void 0:o.responses)&&Zc.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}=wc(pd),[b,w]=mc(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=X(e)&&e>=0&&t.questions.length>e?e:0;return X(c)&&c>=0?c:n}),[k,_]=mc(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[S,x]=mc(()=>{var e;const n=Sd(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=bc(()=>hd(fd(t,o)),[t.id,o]),M=bc(()=>{if(!C||new Set(C).size!==C.length)return fd(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]);gc(()=>{!m||Z(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),T=M.at(b);return T?Rd("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Rd(Hd,{onClick(){d()}}),Rd("div",{className:"survey-box","data-question-index":b,children:[l&&Rd("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),wh({question:T,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||id,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{if(!n)return void Zc.error("onNextButtonClick called without a PostHog instance.");if(!Gc(n))return void u(!0);if(u(!1),!r)return void Zc.error("onNextButtonClick called without a questionId.");const{responses:o,questionSnapshots:l}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:D(D({},t),{},{[Mi(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?D(D({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:S},r,e,M[i]);a(o),x(l);const c=rh(t,i,e),d=c===jc,h=[...k,i];if(d||(_(h),w(c),_d(t,{surveySubmissionId:p,responses:o,lastQuestionIndex:c,questionOrder:hd(M),visitedIndices:h,surveyLanguage:y,questionSnapshots:l})),t.enable_partial_responses||d){const e=new Set(h.map(t=>{var e;return null===(e=M[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Mi(t))),i=Object.fromEntries(Object.entries(o).filter(([t])=>e.has(t)));ld({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:d,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:l})}})({res:e,displayQuestionIndex:b,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?s[Mi(T.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);_(n),w(e),_d(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:hd(M),visitedIndices:n,surveyLanguage:y,questionSnapshots:S})}})]})]}):null}function bh({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d;const[h,f]=mc(!0),[v,p]=mc(!1),[m,g]=mc({}),y=yc(void 0),b=()=>{(v||!n||i||Gc(n))&&p(!v)};if(gc(()=>{var e;if(!n)return void Zc.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});const r=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Zc.info(`Received show event for feedback button survey ${t.id}`),g(i.detail.position||{}),b())};return fe(ah,uh,r),()=>{Z(y.current)||(clearTimeout(y.current),y.current=void 0),ah.removeEventListener(uh,r)}},[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.widgetSelector,null===(a=t.appearance)||void 0===a?void 0:a.borderColor]),vh({survey:t,setSurveyVisible:f,posthog:n}),!h)return null;const w=()=>{t.schedule!==Bc&&f(!1),Z(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,p(!1)},200)};return Rd(qu,{children:["tab"===(null===(l=t.appearance)||void 0===l?void 0:l.widgetType)&&Rd("button",{className:"ph-survey-widget-tab "+("top"===(null===(u=t.appearance)||void 0===u?void 0:u.tabPosition)?"widget-tab-top":""),onClick:b,disabled:i,style:mh(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=t.appearance)||void 0===d?void 0:d.widgetLabel)||""}),v&&Rd(gh,{posthog:n,survey:t,forceDisableHtml:e,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:r})]})}const wh=({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 Dc:return Fu(Zd,D(D({},u),{},{question:t,key:t.id}));case"link":return Fu(Gd,D(D({},u),{},{question:t,key:t.id}));case qc:return Fu(Qd,D(D({},u),{},{question:t,key:t.id}));case Nc:case Fc:return Fu(Kd,D(D({},u),{},{question:t,key:t.id}));default:return Zc.error(`Unsupported question type: ${t.type}`),null}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.generateSurveys=fh,a.extendPostHogWithSurveys=fh;const kh=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},_h=1e4,Sh=(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),xh=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return Sh(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 Sh(e,JSON.stringify(t.slice(0,r)),n)},Ch=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Mh=(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}},Ih=(t,e,n)=>{if(!n.truncated)if(V(t)){if(n.seen.has(t))return void Mh(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Ih(t[i],e?`${e}.${i}`:i,n),n.truncated)return}catch(t){continue}}catch(t){}}else Mh(e,t,n)},Th=(t,e,n,i,r=!1,o)=>{if(!Ch(t))return!r||Sh(e,"null",n);if(J(t)||(t=>{try{return X(t)||Y(t)}catch(t){return!1}})(t))return Sh(e,JSON.stringify(t),n);if("string"==typeof t)return xh(t,e,n);if(!V(t)&&!U(t))return Sh(e,JSON.stringify(t),n);if(i.has(t))return xh("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return Th(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return xh(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return Sh(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 Th(s,e,n,i,r,o)}if(U(t)){if(!Sh(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!Sh(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!Th(o,e,n,i,!0))return!1}return Sh(e,"]",n)}if(!Sh(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{Ih(a,r,o)}catch(t){}if(!Ch(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(!Sh(e,l,n))return!1;const h=e.length,f=Th(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 Sh(e,"}",n)},Rh=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=V(t[0])?{result:{},keysRemaining:50,sizeRemaining:_h,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||Sh(n," ",i))&&Th(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)||{}}},$h={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Eh=t=>"canCapture"in t,Ah=t=>Eh(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0,Oh=(t,e,n)=>{if(Eh(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;W(r)&&r.call(e,n)};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.logs={initializeLogs(t){let e=t;const n=[],i={host:a.location.host};let r=!1;for(const t of Object.keys($h)){const o=n=>(...o)=>{let s=!1;try{const n=e;if(o.length>0&&!r&&n){const e=Ah(n);if(e){r=!0,s=!0;const{body:a,truncated:l,attributes:u}=Rh(o,_h),c=D(D({},i),l?{body_truncated:"true"}:{}),d={level:$h[t],body:a,attributes:D(D({"log.source":`console.${t}`},c),u)};Oh(n,e,d)}}}catch(t){}finally{s&&(r=!1),n.apply(a.console,o)}},s=a.console[t];n.push(Fl(a.console,t,t=>{const e=o(t);return e.__rrweb_original__=kh(s),e}))}return()=>{e=void 0,n.forEach(t=>t())}},replayConsoleBuffer(t,e){const n=Ah(t);if(n)for(const t of e)try{var i;const{body:e,truncated:r,attributes:o}=Rh(t.args,_h);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:$h[t.level],body:e,attributes:D(D({"log.source":`console.${t.level}`,host:a.location.host},r?{body_truncated:"true"}:{}),o)},t.context,t.occurredAtMs)}catch(t){}}},ue("[Error tracking]");const Lh=ue("[ExceptionAutocapture]"),Ph=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&&U(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 D(D({},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?D(D({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:Tt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(it(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 U(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 D(D({},v),{},{errors:m})},c=(n,i=0)=>D(D({},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 D(D({},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=G(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 nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!rt(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 et(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!!nt(t,"ErrorEvent")&&(null!=t.error||this.ur(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return D(D({},i),{},{stack:null!==(n=this.cr(t))&&void 0!==n?n:i.stack,synthetic:!0})}ur(t){return G(t.message)&&t.message.length>0}cr(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(G(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return it(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 rt(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(rt(t))return t.constructor.name;const e="name"in t?t.name:void 0;return G(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 G(t)&&!Q(t)&&Jt.indexOf(t)>=0}getStack(t){try{return G(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:G(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(it(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(Qt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return et(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=Bt.test(i)?i.replace(Bt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=zt(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(Zt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Wt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Ut(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++)Gt(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 D(D({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Ft,jt)),Dh=(t,e)=>{try{return t()}catch(t){return e}},Fh=(t,e)=>Dh(()=>t(e()),void 0),Nh=t=>Dh(()=>W(t)&&W(t.call),!1),qh=(t,e)=>Dh(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),jh=(t,e,n)=>{Dh(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),Dh(()=>{t[e]=n},void 0)},Bh=e=>{const n=t;n||Lh.info("window not available, cannot wrap onerror");const i=Dh(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return Fh(e,()=>Ph.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(G(t)&&G(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}})),!!Nh(i)&&null!==(n=i(...t))&&void 0!==n&&n},qh(n,"onerror"),()=>jh(n,"onerror",i)},Hh=(e,n=!1)=>{const i=t;i||Lh.info("window not available, cannot wrap onUnhandledRejection");const r=Dh(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return Fh(e,()=>Ph.buildFromUnknown(t,{mechanism:{handled:!1}})),Nh(r)?null!==(i=r(t))&&void 0!==i&&i:n},qh(i,"onunhandledrejection"),()=>jh(i,"onunhandledrejection",r)},zh={wrapOnError:Bh,wrapUnhandledRejection:Hh,wrapConsoleError(t){const e=console;e||Lh.info("console not available, cannot wrap console.error");const n=Dh(()=>e.error,void 0);return e.error=function(...e){Dh(()=>e.length>1&&G(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||Fh(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return Ph.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Nh(n)&&n(...e)},qh(e,"error"),()=>jh(e,"error",n)}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.errorWrappingFunctions=zh,a.posthogErrorWrappingFunctions=zh;const Uh=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!J(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){Lh.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){Lh.error("Failed to capture exception for a legacy client",t)}};Bh(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Hh(r,!0)};a.extendPostHogWithExceptionAutoCapture=Uh,a.extendPostHogWithExceptionAutocapture=Uh;const Wh="X-POSTHOG-SESSION-ID",Vh="X-POSTHOG-WINDOW-ID",Zh="X-POSTHOG-DISTINCT-ID",Gh=[Wh,Vh,Zh],Qh=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Jh=(t,e)=>({}.hasOwnProperty.call(t,e)),Kh=t=>"object"==typeof t&&!J(t)||W(t),Xh=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Yh=e=>{try{var n;return Xh(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}},tf=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(U(t)&&!t.includes(o))return!1;let s=!1;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Wh,t),r.set(Vh,e),s=!0}const a=(t=>W(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Zh,a),s=!0),s};a.__PosthogExtensions__=a.__PosthogExtensions__||{};const ef={_patchFetch:(e,n,i)=>Fl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=Yh(r);if(t)if(Xh(r)){const t=new Request(r,o);tf(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(Kh(o)?o.headers:void 0);if(tf(e,n,i,t,s)){const t=((t,e)=>{if(Z(t)||J(t))return{headers:e};if(!Kh(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)=>Jh(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>Jh(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),Qh.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&&Qh.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?D(D({},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)=>Fl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=Yh(o);d&&tf(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Gh.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};a.__PosthogExtensions__.tracingHeadersPatchFns=ef,a.postHogTracingHeadersPatchFns=ef,"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 nf=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 rf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},of=t=>{if("loading"===document.readyState)return"loading";const e=rf();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"},sf=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},af=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[sf(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},lf=new WeakMap;function uf(t,e){let n=lf.get(e);return n||(n=new WeakMap,lf.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let cf=-1;const df=()=>cf,hf=t=>{addEventListener("pageshow",e=>{e.persisted&&(cf=e.timeStamp,t(e))},!0)},ff=(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)))}},vf=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},pf=()=>{var t,e;return null!==(t=null===(e=rf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let mf=-1;const gf=new Set,yf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,bf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of gf)t();isFinite(mf)||(mf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",bf,!0))}},wf=(t=!1)=>{if(t&&(mf=1/0),0>mf){var e;const t=pf(),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;mf=null!=n?n:yf(),addEventListener("visibilitychange",bf,!0),addEventListener("prerenderingchange",bf,!0),hf(()=>{setTimeout(()=>{mf=yf()})})}return{get firstHiddenTime(){return mf},onHidden(t){gf.add(t)}}},kf=(t,e=-1,n,i=0,r,o,s)=>{const a=rf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>df()?a&&(document.prerendering||pf()>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}},_f=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},Sf=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},xf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},Cf=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Mf=class{constructor(){this.u=void 0}};const If=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Tf=[1800,3e3],Rf=(t,e={})=>{const n=Sf(e);If(()=>{const i=uf(e,Mf),r=wf();let o,s=kf("FCP");const a=_f(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-pf(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=ff(t,s,Tf,e.reportAllChanges),hf(n=>{s=kf("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,df()),o=ff(t,s,Tf,e.reportAllChanges),vf(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&_f(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&xf(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=kf("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=ff(t,s,Tf,e.reportAllChanges),o(!0)})},e)})},$f=[.1,.25],Ef=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],Af=(t,e={})=>{const n=uf(e=Object.assign({},e),nf),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=Ef(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:af(s);i.set(n,t)}}},((t,e={})=>{const n=wf();Rf(Cf(()=>{let i,r=kf("CLS",0);const o=uf(e,nf),s=(n,s,a,l,u)=>{r=kf("CLS",0,n,s,a,l,u),o.o=0,i=ff(t,r,$f,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"];Sf(e)&&c.push("soft-navigation");const d=_f(c,u);d&&(i=ff(t,r,$f,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),hf(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,df()),vf(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=Ef(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:of(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Of=(t,e={})=>{const n=uf(e=Object.assign({},e),Mf);Sf(e)&&(n.u=new Map),Rf(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:of(df())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=rf(),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:of(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 Lf=0,Pf=1/0,Df=0;const Ff=t=>{for(const e of t)e.interactionId&&(Pf=Math.min(Pf,e.interactionId),Df=Math.max(Df,e.interactionId),Lf=Df?(Df-Pf)/7+1:0)};let Nf;const qf=()=>{var t;return Nf?Lf:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var jf=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return qf()-this.h}D(){this.h=qf(),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 Bf=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=Cf(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})}},Hf=[200,500],zf=(t,e={})=>{const n=uf(e=Object.assign({},e),jf);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(Bf(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:af(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};_f(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=wf();If(()=>{var i;"interactionCount"in performance||Nf||(Nf=_f(["event"],Ff,{durationThreshold:0}));let r,o=kf("INP");const s=uf(e,jf),a=(n,i,a,l,u)=>{s.D(),o=kf("INP",-1,n,i,a,l,u),r=ff(t,o,Hf,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)=>{Bf(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Sf(e)&&d.push("soft-navigation");const h=_f(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=ff(t,o,Hf,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),hf(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,df())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:of(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:of(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 Uf=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 Wf=50;const Vf=[];_f(["resource"],t=>{for(const e of t)Vf.push(e),Vf.length>Wf&&Vf.shift()});const Zf=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Wf=e.resourceBufferSize);const n=uf(e,Uf),i=new WeakMap;Sf(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:af(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=Sf(e);If(()=>{let r,o=wf(),s=kf("LCP");const a=uf(e,Uf),l=(i,a,l,u,c)=>{s=kf("LCP",-1,i,a,l,u,c),r=ff(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=wf(!0))},u=t=>{var e;a.u&&t.navigationId&&xf(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-pf(),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=_f(d,c);if(h){r=ff(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Bf(()=>{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});hf(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,df()),r=ff(t,s,$,e.reportAllChanges),vf(()=>{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&&(Vf.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=rf(),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=D(D({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Gf=-1;const Qf=()=>Gf,Jf=t=>{addEventListener("pageshow",e=>{e.persisted&&(Gf=e.timeStamp,t(e))},!0)},Kf=(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)))}},Xf=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Yf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},tv=()=>{var t,e;return null!==(t=null===(e=Yf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let ev=-1;const nv=new Set,iv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,rv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of nv)t();isFinite(ev)||(ev="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",rv,!0))}},ov=(t=!1)=>{if(t&&(ev=1/0),0>ev){var e;const t=tv(),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;ev=null!=n?n:iv(),addEventListener("visibilitychange",rv,!0),addEventListener("prerenderingchange",rv,!0),Jf(()=>{setTimeout(()=>{ev=iv()})})}return{get firstHiddenTime(){return ev},onHidden(t){nv.add(t)}}},sv=(t,e=-1,n,i=0,r,o,s)=>{const a=Yf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Qf()?a&&(document.prerendering||tv()>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}},av=new WeakMap;function lv(t,e){let n=av.get(e);return n||(n=new WeakMap,av.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var uv=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 cv=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},dv=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},hv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},fv=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var vv=class{constructor(){this.l=void 0}};const pv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},mv=[1800,3e3],gv=(t,e={})=>{const n=dv(e);pv(()=>{const i=lv(e,vv),r=ov();let o,s=sv("FCP");const a=cv(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-tv(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=Kf(t,s,mv,e.reportAllChanges),Jf(n=>{s=sv("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Qf()),o=Kf(t,s,mv,e.reportAllChanges),Xf(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&cv(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&hv(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=sv("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=Kf(t,s,mv,e.reportAllChanges),o(!0)})},e)})},yv=[.1,.25],bv=(t,e={})=>{const n=ov();gv(fv(()=>{let i,r=sv("CLS",0);const o=lv(e,uv),s=(n,s,a,l,u)=>{r=sv("CLS",0,n,s,a,l,u),o.i=0,i=Kf(t,r,yv,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"];dv(e)&&c.push("soft-navigation");const d=cv(c,u);d&&(i=Kf(t,r,yv,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Jf(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Qf()),Xf(i)}),setTimeout(i))}))};let wv=0,kv=1/0,_v=0;const Sv=t=>{for(const e of t)e.interactionId&&(kv=Math.min(kv,e.interactionId),_v=Math.max(_v,e.interactionId),wv=_v?(_v-kv)/7+1:0)};let xv;const Cv=()=>{var t;return xv?wv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Mv=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Cv()-this.u}M(){this.u=Cv(),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 Iv=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=fv(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})}},Tv=[200,500],Rv=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=ov();pv(()=>{var i;"interactionCount"in performance||xv||(xv=cv(["event"],Sv,{durationThreshold:0}));let r,o=sv("INP");const s=lv(e,Mv),a=(n,i,a,l,u)=>{s.M(),o=sv("INP",-1,n,i,a,l,u),r=Kf(t,o,Tv,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)=>{Iv(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];dv(e)&&d.push("soft-navigation");const h=cv(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=Kf(t,o,Tv,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Jf(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Qf())}))})};var $v=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 Ev=[2500,4e3],Av=(t,e={})=>{let n=!1;const i=dv(e);pv(()=>{let r,o=ov(),s=sv("LCP");const a=lv(e,$v),l=(i,a,l,u,c)=>{s=sv("LCP",-1,i,a,l,u,c),r=Kf(t,s,Ev,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=ov(!0))},u=t=>{var e;a.l&&t.navigationId&&hv(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-tv(),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=cv(d,c);if(h){r=Kf(t,s,Ev,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Iv(()=>{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});Jf(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Qf()),r=Kf(t,s,Ev,e.reportAllChanges),Xf(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},Ov={onLCP:Zf,onCLS:Af,onFCP:Of,onINP:zf,withoutAttribution:{onLCP:Av,onCLS:bv,onFCP:gv,onINP:Rv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Ov,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Ov,a.postHogWebVitalsCallbacks=Ov;const Lv={onLCP:Av,onCLS:bv,onFCP:gv,onINP:Rv};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Lv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Lv,a.postHogWebVitalsCallbacks=Lv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Lv;const Pv={onLCP:Zf,onCLS:Af,onFCP:Of,onINP:zf,withoutAttribution:{onLCP:Av,onCLS:bv,onFCP:gv,onINP:Rv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Pv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Pv,a.postHogWebVitalsCallbacks=Pv;const Dv={onLCP:Av,onCLS:bv,onFCP:gv,onINP:Rv};function Fv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Nv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!ge(e));return e}function qv(e,{e:n,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:o,elementsChainAsString:s,disableCaptureUrlHashes:a}){var l,u;if(!ge(e))return{props:{}};const c=[e],d=new Set([e]);let h=e;for(;h.parentNode&&!ye(h,"body")&&1e3>c.length;){if(be(h.parentNode)){const t=h.parentNode.host;if(d.has(t))break;d.add(t),c.push(t),h=t;continue}if(!ge(h.parentNode))break;if(d.has(h.parentNode))break;d.add(h.parentNode),c.push(h.parentNode),h=h.parentNode}const f="click"===n.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(t=>ye(t,"button")||ye(t,"a")):-1;f>0&&(r=r||c.slice(0,f+1).some(t=>!Ae(t)||Oe(t)));const v=[],p={};let m,g=!1,y=!1;if(ce(c,t=>{const e=Ae(t);if(ye(t,"a")&&!i&&!(null==o?void 0:o.includes("href"))){const n=t.getAttribute("href");g=!!(e&&n&&Be(n))&&(a?xt(n):n)}q(ke(t),"ph-no-capture")&&(y=!0),v.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};xe.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Fv(1024,He(t)):Fv(1024,_e(t)));const a=ke(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),ce(t.attributes,function(n){var o;if((!Oe(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Be(n.value)&&(!G(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=we(t).join(" ")),s["attr__"+n.name]=Fv(1024,"href"===n.name&&r?xt(t):t)}});let l=1,u=1,c=t;for(;c=Nv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,i,r,o,a)),ce(function(t){if(!Ae(t))return{};const e={};return ce(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&&Be(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(p,e)||(p[e]=t)})}),y)return{props:{},explicitNoCapture:y};if(f>0&&(e=c[f],v.splice(0,f)),r||(v[0].$el_text=ye(e,"a")||ye(e,"button")?He(e):_e(e)),g){var b,w;v[0].attr__href=g;const e=null===(b=pe(g))||void 0===b?void 0:b.host,n=null==t||null===(w=t.location)||void 0===w?void 0:w.host;e&&n&&e!==n&&(m=g)}return{props:de((_=n.type,{$event_type:_,$ce_version:1}),s?{}:{$elements:v},{$elements_chain:(k=v,U(k)?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=D(D(D(D({},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 he(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ue(t.toString())]=Ue(e.toString())),i+=":",i+=he(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:We(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return he(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(k)):"")},(null===(l=v[0])||void 0===l?void 0:l.$el_text)?{$el_text:null===(u=v[0])||void 0===u?void 0:u.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},p),target:e};var k,_}a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Dv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Dv,a.postHogWebVitalsCallbacks=Dv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Dv,ue("[AutoCapture]");const jv={};function Bv(t,e){const n=Se(t);return n?D({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Hv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function zv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const Uv="canvas,video,audio,embed,object";function Wv(t,e){return X(t)&&t>=e}function Vv(t,e=1e3){return t>=0&&e>t?t:void 0}function Zv(t,e,n=1e3){return X(e)?Vv(t-e,n):void 0}var Gv=class{dr(t){var e,n,i,r,o,s,a,l;const u=this.hr((null==t?void 0:t.__onCapture)||this.vr.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.pr=new WeakSet,this.mr=!1,this.gr=[],this.yr=0,this.hr=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.br=()=>{clearTimeout(this.wr),this.wr=void 0,this.kr=void 0},this._r=t=>{if(this.Sr(t),this.br(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},n=null==i?void 0:i.getSelection();e.selectionInitiallyRelated="Range"===(null==n?void 0:n.type)&&this.Cr(n,e),this.kr=e}},this.Mr=t=>{J(t.relatedTarget)&&this.br()},this.Ir=t=>{const e=this.kr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(ge(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.wr=a.setTimeout(this.br,0)},this.Tr=t=>{this.Sr(t);const e=t,n=Bv(e,{type:"click"}),i=this.kr;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.Rr.selection_change_threshold_ms>0,this.br()),J(n)||this.$r(n)||this.Er(n),this.Ar()},this.Or=()=>{const t=Date.now();this.Lr=t,t%50==0&&this.gr.forEach(e=>{Z(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Pr=t=>{var e,n;const r=null==i?void 0:i.getSelection(),o=this.mr;this.mr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(ge(s)?s:s.parentElement),l=null==i?void 0:i.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=Re(Se(t))||Re(null!=a?a:null)||Re(null!==(n=u)&&void 0!==n?n:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.mr||c||d))return;const h=Date.now();this.Dr=h;const f=this.kr;if(f&&(o||this.mr||c)){const e=Se(t);let n;if(Re(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;Re(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.Fr(n,f):r&&(s||r.anchorNode)?this.Cr(r,f):o&&!this.mr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.gr.forEach(t=>{const e=h-t.timestamp;0>e||!Z(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.ln=()=>{"hidden"===(null==i?void 0:i.visibilityState)&&this.br();const t=Date.now();this.Nr=t,this.qr("visibilityChangedDelayMs",t)},this.jr=()=>{const t=Date.now();this.Br=t,this.qr("focusChangedDelayMs",t)},this.Hr=t=>{this.Sr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.zr=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.Ur=()=>{this.zr=void 0},this.Wr=t=>{var e;const n=this.zr;if(this.zr=void 0,Z(n)||this.yr>=this.Rr.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-n.x,a=o.clientY-n.y,l=s*s+a*a,u=this.Rr.swipe_threshold_px;if(u*u>l)return;if([this.Lr,this.Vr,this.Dr].some(t=>X(t)&&t>=n.timestamp))return;var c,d;if(this.Zr()&&(null!==(c=null==i||null===(d=i.elementsFromPoint)||void 0===d?void 0:d.call(i,n.x,n.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,Uv)}))return;const h=Bv(r,{type:"swipe",swipeDirection:Hv(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});J(h)||this.$r(h)||this.Er(h),this.Ar()},this.Rr=this.dr(e),this._onCapture=this.Rr.__onCapture}start(t){this.Gr(),this.Qr(),this.Jr(),this.Kr(),this.Xr(),this.Yr(t),this.Rr.capture_dead_swipes&&this.eo()}Yr(e){if(!this.no){const n=function(e){return function(e,n){const i=jv[e];if(i)return i;let r=n[e];if((t=>W(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return jv[e]=r.bind(n);const o=n.document;if(o&&W(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const l=t.contentWindow;var s,a;l&&l[e]&&(r=l[e],"MutationObserver"===e&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){le.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)}}return r&&W(r)?jv[e]=r.bind(n):r}("MutationObserver",e)}(a);this.no=new n(t=>{this.io(t)}),this.ro(e)}}ro(t){t&&this.no&&(this.pr.has(t)||(this.no.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.pr.add(t),this.oo(t)))}oo(t,e){var n,i;ge(t)&&t.shadowRoot&&this.ro(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.ro(r[t].shadowRoot)}Sr(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];ge(e)&&this.ro(e.shadowRoot)}}stop(){var t;null===(t=this.no)||void 0===t||t.disconnect(),this.no=void 0,this.pr=new WeakSet,a.removeEventListener("click",this.Tr,{capture:!0}),a.removeEventListener("mousedown",this._r,{capture:!0}),a.removeEventListener("mouseup",this.Ir,{capture:!0}),a.removeEventListener("mouseout",this.Mr,{capture:!0}),a.removeEventListener("dragstart",this.br,{capture:!0}),a.removeEventListener("pointercancel",this.br,{capture:!0}),a.removeEventListener("blur",this.br),this.br(),a.removeEventListener("scroll",this.Or,{capture:!0}),null==i||i.removeEventListener("selectionchange",this.Pr),a.removeEventListener("touchstart",this.Hr,{capture:!0}),a.removeEventListener("touchend",this.Wr,{capture:!0}),a.removeEventListener("touchcancel",this.Ur,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.ln),a.removeEventListener("blur",this.jr),a.removeEventListener("focus",this.jr),this.zr=void 0}io(t){const e=new Set;for(const i of t){var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.Vr=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];ge(i)&&!e.has(i)&&this.oo(i,e)}}}Gr(){fe(a,"click",this.Tr,{capture:!0}),fe(a,"mousedown",this._r,{capture:!0}),fe(a,"mouseup",this.Ir,{capture:!0}),fe(a,"mouseout",this.Mr,{capture:!0}),fe(a,"dragstart",this.br,{capture:!0}),fe(a,"pointercancel",this.br,{capture:!0}),fe(a,"blur",this.br)}Er(t){t.selectionChangedDelayMs=Zv(t.timestamp,this.Dr,this.Rr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Zv(t.timestamp,this.Nr),t.focusChangedDelayMs=Zv(t.timestamp,this.Br),this.gr.push(t)}Ar(){this.gr.length&&Z(this.so)&&(this.so=a.setTimeout(()=>{this.ao()},1e3))}Qr(){fe(a,"scroll",this.Or,{capture:!0})}Jr(){var t;this.mr="Range"===(null==i||null===(t=i.getSelection())||void 0===t?void 0:t.type),fe(i,"selectionchange",this.Pr)}Fr(t,e){const n=e.path[0];for(;t;){if(-1!==e.path.indexOf(t)||ge(n)&&n.contains(t))return!0;t=t.getRootNode().host}return!1}Cr(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0;if(i&&ge(n)&&i.startContainer.getRootNode()===n.getRootNode()){var r;if(!i.collapsed)return i.intersectsNode(n);const t=ge(i.startContainer)&&null!==(r=i.startContainer.childNodes[i.startOffset])&&void 0!==r?r:i.startContainer;return this.Fr(t,e)}return this.Fr(t.focusNode,e)||this.Fr(t.anchorNode,e)}Kr(){fe(i,"visibilitychange",this.ln)}Xr(){fe(a,"blur",this.jr),fe(a,"focus",this.jr)}qr(t,e){this.gr.forEach(n=>{const i=Vv(e-n.timestamp);X(i)&&(Z(n[t])||n[t]>i)&&(n[t]=i)})}eo(){fe(a,"touchstart",this.Hr,{capture:!0,passive:!0}),fe(a,"touchend",this.Wr,{capture:!0,passive:!0}),fe(a,"touchcancel",this.Ur,{capture:!0,passive:!0})}Zr(){const t=Z(this.lo)||X(this.Vr)&&this.Vr>this.lo;return(Z(this.uo)||t)&&(this.lo=Date.now(),this.uo=!!(null==i?void 0:i.querySelector(Uv))),!!this.uo}$r(t){return!t||("swipe"===t.type?this.co(t):this.do(t))}co(e){return!((!((n=e.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==n.id&&!(null===(i=n.closest)||void 0===i?void 0:i.call(n,".toolbar-global-fade-container")))&&!this.gr.some(t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp))&&!ye(e.node,"html")&&ge(e.node)&&function(e,n){var i;if(!t||$e(e))return!1;const r=Y(n)?Ie:null!==(i=null==n?void 0:n.css_selector_ignorelist)&&void 0!==i?i:Ie,{targetElementList:o}=Ee(e,!1);return!function(t,e){if(Z(e))return!0;for(const n of t)if(e.some(t=>Ce(n,t)))return!0;return!1}(o,r)}(e.node,{css_selector_ignorelist:this.Rr.css_selector_ignorelist}));var n,i}do(e){return!(this.Rr.capture_clicks_with_modifier_keys||(n=e.originalEvent,!(n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)))||!!this.co(e)||function(e){if(!t||$e(e))return!1;const{targetElementList:n}=Ee(e,!1);return n.some(t=>ye(t,"a"))}(e.node);var n}ao(){if(!this.gr.length)return;clearTimeout(this.so),this.so=void 0;const t=this.gr;this.gr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.Vr&&this.Vr>=n.timestamp?this.Vr-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Wv(n.scrollDelayMs,this.Rr.scroll_threshold_ms),i=Wv(n.selectionChangedDelayMs,this.Rr.selection_change_threshold_ms),r=Wv(n.mutationDelayMs,this.Rr.mutation_threshold_ms),o=Wv(n.absoluteDelayMs,1.1*this.Rr.mutation_threshold_ms),s=X(n.scrollDelayMs)&&this.Rr.scroll_threshold_ms>n.scrollDelayMs,a=X(n.mutationDelayMs)&&this.Rr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||X(n.selectionChangedDelayMs)&&this.Rr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=X(n.visibilityChangedDelayMs),c=X(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=zv(n);if("$dead_swipe"===e){if(this.yr>=this.Rr.max_dead_swipes_per_page_load)continue;this.yr++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.Vr,[`${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.Rr.mutation_threshold_ms>n.absoluteDelayMs&&this.gr.push(n)}this.Ar()}vr(t,e){const n=zv(t);this.instance.capture(n,D(D(D({},e),qv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rr.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)})}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Gv(t,e)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map