posthog-js 1.427.0 → 1.427.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.js.map +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/module.slim.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/src/utils/stack-overflow.d.ts +1 -0
- package/lib/package.json +1 -1
- package/lib/src/browser-surveys.js +1 -1
- package/lib/src/customizations/before-send.js +1 -1
- package/lib/src/customizations/posthogReduxLogger.js +4 -4
- package/lib/src/customizations/posthogReduxLogger.js.map +1 -1
- package/lib/src/entrypoints/array.full.es5.js +1 -1
- package/lib/src/entrypoints/exception-autocapture.js +31 -19
- package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
- package/lib/src/entrypoints/external-scripts-loader.js +3 -3
- package/lib/src/entrypoints/tracing-headers.js +5 -5
- package/lib/src/entrypoints/tracing-headers.js.map +1 -1
- package/lib/src/extensions/browser-client.js +1 -1
- package/lib/src/extensions/conversations/external/components/RichContent.js +1 -1
- package/lib/src/extensions/conversations/external/index.js +5 -5
- package/lib/src/extensions/conversations/external/url-utils.js +2 -2
- package/lib/src/extensions/exception-autocapture/index.js +14 -8
- package/lib/src/extensions/exception-autocapture/index.js.map +1 -1
- package/lib/src/extensions/replay/external/config.js +1 -1
- package/lib/src/extensions/replay/external/config.js.map +1 -1
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +5 -5
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
- package/lib/src/extensions/replay/external/network-plugin.js +11 -11
- package/lib/src/extensions/replay/external/network-plugin.js.map +1 -1
- package/lib/src/extensions/segment-integration.js +1 -1
- package/lib/src/posthog-core.js +23 -16
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-exceptions.js +7 -2
- package/lib/src/posthog-exceptions.js.map +1 -1
- package/lib/src/posthog-logs.js +1 -1
- package/lib/src/posthog-metrics.js +1 -1
- package/lib/src/posthog-surveys.js +1 -1
- package/lib/src/utils/stack-overflow.d.ts +1 -0
- package/lib/src/utils/stack-overflow.js +11 -0
- package/lib/src/utils/stack-overflow.js.map +1 -0
- package/lib/src/web-experiments.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,r=null==e?void 0:e.navigator,i=null==e?void 0:e.document,n=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:t;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=t?t:{};function u(t,e,r,i,n,a,o){try{var s=t[a](o),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(i,n)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var a=t.apply(e,r);function o(t){u(a,i,n,o,s,"next",t)}function s(t){u(a,i,n,o,s,"throw",t)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},h.apply(null,arguments)}var c={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},d={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16};function v(t,e){return-1!==t.indexOf(e)}var f=function(t){return t.trim()},p="min_length",g="max_length",m=Object.prototype,y=m.hasOwnProperty,b=m.toString,w=Array.isArray||function(t){return"[object Array]"===b.call(t)},k=t=>"function"==typeof t,_=t=>t===Object(t)&&!w(t),S=t=>void 0===t,x=t=>"[object String]"==b.call(t),C=t=>x(t)&&0===t.trim().length,M=t=>null===t,T=t=>S(t)||M(t),I=t=>"[object Number]"==b.call(t)&&t==t,R=t=>"[object Boolean]"===b.call(t),A=t=>t instanceof FormData;function E(t){return null===t||"object"!=typeof t}function L(t,e){return{}.toString.call(t)==="[object "+e+"]"}function O(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 D(t,Error)}}function P(t){return"u">typeof Event&&D(t,Event)}function D(t,e){try{return t instanceof e}catch(t){return!1}}function N(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),I(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):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: "+r+", fallback: "+n),N(null!=n?n:r,e,r,i))}class F{constructor(t){this.C={},this.I=t.I,this.R=N(t.bucketSize,0,100,t.A),this.O=N(t.refillRate,0,this.R,t.A),this.N=N(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}var q,j,B,H="Mobile",U="Android",z="Tablet",W=U+" "+z,V="iPad",Z="Apple Watch",G="BlackBerry",Q="Nintendo",J="PlayStation",Y="Xbox",K="Windows Phone",X="Nokia",tt="Ouya",et="Generic",rt=et+" "+H.toLowerCase(),it=et+" "+z.toLowerCase(),nt=new RegExp(Y,"i"),at=new RegExp(J+" \\w+","i"),ot=new RegExp(Q+" \\w+","i"),st=new RegExp(G+"|PlayBook|BB10","i");function ut(t){return t?t.split("#")[0]:t}function lt(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return B&&r.length===j||(j=r.length,B=r.reduce(((r,i)=>{q||(q={});var n=q[i];if(n)r[n[0]]=n[1];else for(var a=t(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=e[i];if(u&&l){r[u]=l,q[i]=[u,l];break}}return r}),{})),B}}var ht="?";function ct(t,e,r,i,n){var a={platform:t,filename:e,function:"<anonymous>"===r?ht:r,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return S(i)||(a.lineno=i),S(n)||(a.colno=n),a}var dt=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:ht,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,gt=(t,e)=>{var r=vt.exec(t);if(r)return ct(e,r[1],ht,+r[2],+r[3]);var i=ft.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=pt.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=dt(i[1]||ht,i[2]);return ct(e,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},mt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bt=(t,e)=>{var r=mt.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=yt.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||ht,o=dt(a,n);return ct(e,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},wt=/\(error: (.*)\)/;var kt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var _t=["fatal","error","warning","log","info","debug"];function St(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var xt,Ct="NativeGzipValidationError",Mt=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(Ct,"Native gzip produced invalid output: "+t)},Tt=function(){var t=l((function*(t,e){18>t.size&&Mt("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Mt("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(xt)return xt;xt=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;xt[t]=e>>>0}return xt})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Mt("invalid-crc");var a=e.length>>>0;n.getUint32(4,!0)!==a&&Mt("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function It(){return It=l((function*(t,e,r){void 0===e&&(e=!0);try{var i=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var t=l((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield Tt(u,i),u}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),It.apply(this,arguments)}function Rt(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var At={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},Et=function(e,r){var i=(void 0===r?{}:r).debugEnabled,n={q(r){if(t&&(At.DEBUG||t.POSTHOG_DEBUG||i)&&!S(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>Et(e+" "+t,r)};return n},Lt=Et("[PostHog.js]"),Ot=Lt.createLogger;function Pt(t,e){if(!T(t))if(w(t))t.forEach(e);else if(A(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)y.call(t,r)&&e(t[r],r)}function Dt(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}function Nt(t,e,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var Ft=["localhost","127.0.0.1"],qt=t=>{var e=null==i?void 0:i.createElement("a");return S(e)?null:(e.href=t,e)},jt=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Pt(t,(function(t,e){S(t)||S(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)};function Bt(e){var r,i=null==t||null==(r=t.location)?void 0:r.href;return S(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!k(i))return e;try{var n=i(e);return x(n)&&n?n:e}catch(t){return Lt.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}var Ht=1,Ut=3,$t=11;function zt(t){return!!t&&t.nodeType===Ht}function Wt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Vt(t){return!!t&&t.nodeType===$t&&zt(t.host)}var Zt=1e3;function Gt(t){return t?f(t).split(/\s+/):[]}function Qt(t){var 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 Gt(e)}function Jt(t){var e="";return re(t)&&!ie(t)&&t.childNodes&&t.childNodes.length&&Pt(t.childNodes,(function(t){var r;(function(t){return!!t&&t.nodeType===Ut})(t)&&t.textContent&&(e+=null!==(r=function(t){return T(t)?null:f(t).split(/(\s+)/).filter((t=>ce(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==r?r:"")})),f(e)}var Yt=["a","button","form","input","select","textarea","label"];function Kt(t){var e=t.parentNode;return!(!e||!zt(e))&&e}var Xt=[".ph-no-deadclick",".ph-no-capture"];var te=t=>!t||Wt(t,"html")||!zt(t),ee=(e,r)=>{if(!t||te(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[e],a=e;a.parentNode&&!Wt(a,"body");)if(Vt(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Kt(a);if(!o)break;if(Yt.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=t.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(t){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function re(t){for(var e=new Set,r=0,i=t;i.parentNode&&!Wt(i,"body");i=i.parentNode){if(r++>=Zt||e.has(i))return!1;e.add(i);var n=Qt(i);if(v(n,"ph-sensitive")||v(n,"ph-no-capture"))return!1}if(v(Qt(t),"ph-include"))return!0;var a=t.type||"";if(x(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!x(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function ie(t){return!!(Wt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Wt(t,"select")||Wt(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ne=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}))$"),ae=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,oe=[16,15,14,13],se=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),ue=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),le=/[0-9A-Za-z_]/;function he(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function ce(t,e){if(void 0===e&&(e=!0),T(t))return!1;if(x(t)){t=f(t);var r=e?ne.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(ae.lastIndex=0;e=ae.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of oe){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(ne.test(s)&&he(s))return!0}}}return!1}(t);if(r)return!1;var i=e?se.test(t):function(t){var e;for(ue.lastIndex=0;e=ue.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&le.test(r)&&le.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function de(t){var e=Jt(t);return ce(e=(e+" "+ve(t)).trim())?e:""}function ve(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pt(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Jt(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ve(t)).trim())}catch(t){Lt.error("[AutoCapture]",t)}})),e}function fe(t){return t.replace(/"|\\"/g,'\\"')}function pe(t){var e=t.attr__class;if(e)return w(e)?e:Gt(e)}var ge="[SessionRecording]",me="redacted",ye=1e6;function be(t){var e;return Math.min(ye,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ye)}var we={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:ye,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},ke=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],_e=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Se=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],xe=t=>{T(t)||Pt(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return ke.includes(e)||Se.some((t=>e.includes(t)))})(e)&&(t[e]=me)}))},Ce=["/s/","/e/","/i/"];function Me(t,e,r,i){if(T(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return x(n)&&(n=parseInt(n)),n>r?ge+" "+i+" body too large to record ("+n+" bytes)":t}function Te(t,e){if(T(t))return t;var r=t;return ce(r,!1)||(r=ge+" "+e+" body "+me),Pt(_e,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=ge+" "+e+" body "+me+" as might contain: "+t)})),r}var Ie=new WeakSet,Re="$session_recording_remote_config",Ae="$replay_sample_rate",Ee="$replay_override_sampling",Le="$replay_override_linked_flag",Oe="$replay_override_url_trigger",Pe="$replay_override_event_trigger",De="$session_is_sampled",Ne="$session_past_minimum_duration",Fe="$session_recording_url_trigger_activated_session",qe="$session_recording_event_trigger_activated_session",je="$posthog_sr_group_event_trigger_",Be="$posthog_sr_group_url_trigger_",He="$posthog_sr_group_sampling_",Ue="$debug_first_full_snapshot_timestamp",$e="$sess_rec_flush_size",ze="$stored_person_properties",We="$surveys",Ve="$sdk_debug_replay_pending_trigger_conditions",Ze="$sdk_debug_replay_remote_trigger_matching_config",Ge="disabled",Qe="sampled",Je="active",Ye="buffering",Ke="paused",Xe="rrweb_error",tr="trigger",er=tr+"_activated",rr=tr+"_pending",ir=tr+"_"+Ge;function nr(t,e,r,i,n,a){return 0===e?ir:(null==t?void 0:t.get_property(r?i+r:n))===a?er:rr}function ar(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function or(t){return t.includes(er)?er:t.includes(rr)?rr:ir}function sr(t){var e=new Set(t);switch(e.delete(ir),e.size){case 0:return ir;case 1:return Array.from(e)[0];default:return rr}}class ur{constructor(t){this.j=t}triggerStatus(t){return or(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return or(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class lr{constructor(t){this.j=t}triggerStatus(t){return sr(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return sr(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class hr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return er}stop(){}}var cr=t=>"sessionRecording"in t;class dr{constructor(t,e){this.B=[],this.H=[],this.U=new Map,this.$=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,r;this.B=(cr(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(cr(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.U.clear(),this.$.clear(),this.B))if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){Lt.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.$.has(e.url))try{this.$.set(e.url,new RegExp(e.url))}catch(t){Lt.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return nr(this._instance,this.B.length,this.V,Be,Fe,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Bt(this._instance);if(!t)return!1;try{return ar(t,this.H,this.$)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=Bt(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=ar(r,this.H,this.$);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=Bt(this._instance);if(n&&n!==this.W){this.W=n;var a=this.urlBlocked,o=ar(n,this.H,this.$);o&&!a?t():!o&&a&&e();var s=this.G(i)===er,u=ar(n,this.B,this.U);!s&&u&&r("url",n)}}stop(){this.W=""}}class vr{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=rr;return T(this.linkedFlag)&&(t=ir),this.linkedFlagSeen&&(t=er),t}onConfig(t,e){var r;if(this.linkedFlag=(cr(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!T(this.linkedFlag)&&!this.linkedFlagSeen){var i=x(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=x(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,r)=>{var a=!1;if(_(r)&&i in r){var o=r[i];a=R(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class fr{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(cr(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return nr(this._instance,this.Y.length,this.V,je,qe,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Y.length){var i=this.K(r)===er,n=this.Y.includes(t);!i&&n&&e("event",t)}}stop(){}}class pr{constructor(t,e,r){if(this._instance=t,this.group=e,this.X=new dr(t,e.id),this.tt=new fr(t,e.id),this.et=new vr(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.X.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var a=[this.tt,this.X,this.et];this.rt="any"===e.conditions.matchType?new ur(a):new lr(a)}else this.rt=new hr}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==rr?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===rr)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.X.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Be+this.group.id:je+this.group.id]:e})}stop(){this.X.stop(),this.tt.stop(),this.et.stop()}}function gr(t){if(t.rrwebError)return Xe;if(!t.receivedFlags)return Ye;if(!t.isRecordingEnabled)return Ge;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=!0===t.isSampled,r=new ur([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Qe:r===er?Je:r===rr?Ye:!1===t.isSampled?Ge:Je}function mr(t){if(t.rrwebError)return Xe;if(!t.receivedFlags)return Ye;if(!t.isRecordingEnabled)return Ge;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=new lr([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ir,i=R(t.isSampled);return r&&e===rr?Ye:r&&e===ir||i&&!t.isSampled?Ge:!0===t.isSampled?Qe:Je}function yr(){var t=[];return function(e,r){if(_(r)||w(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function br(t){var e=JSON.stringify(t,yr());return e?new Blob([e]).size:0}function wr(t){if(M(t))return 4;if(S(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(w(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=S(i)||M(i)?4:wr(i)}return e}var n=t,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];S(u)||(o||(a+=1),o=!1,a+=s.length+3+wr(u))}return a;default:return 0}}function kr(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[kr({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),kr({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var _r=Uint8Array,Sr=Uint16Array,xr=Uint32Array,Cr=new _r([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]),Mr=new _r([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]),Tr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ir=function(t,e){for(var r=new Sr(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new xr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Rr=Ir(Cr,2),Ar=Rr[1];Rr[0][28]=258,Ar[258]=28;for(var Er=Ir(Mr,0)[1],Lr=new Sr(32768),Or=0;32768>Or;++Or){var Pr=(43690&Or)>>>1|(21845&Or)<<1;Lr[Or]=((65280&(Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4))>>>8|(255&Pr)<<8)>>>1}var Dr=function(t,e,r){for(var i=t.length,n=0,a=new Sr(e);i>n;++n)++a[t[n]-1];var o,s=new Sr(e);for(n=0;e>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new Sr(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=s[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Lr[c]>>>u]=l}else for(o=new Sr(i),n=0;i>n;++n)o[n]=Lr[s[t[n]-1]++]>>>15-t[n];return o},Nr=new _r(288);for(Or=0;144>Or;++Or)Nr[Or]=8;for(Or=144;256>Or;++Or)Nr[Or]=9;for(Or=256;280>Or;++Or)Nr[Or]=7;for(Or=280;288>Or;++Or)Nr[Or]=8;var Fr=new _r(32);for(Or=0;32>Or;++Or)Fr[Or]=5;var qr=Dr(Nr,9,0),jr=Dr(Fr,5,0),Br=function(t){return(t/8>>0)+(7&t&&1)},Hr=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Sr?Sr:t instanceof xr?xr:_r)(r-e);return i.set(t.subarray(e,r)),i},Ur=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},$r=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},zr=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,a=r.slice();if(!n)return[new _r(0),0];if(1==n){var o=new _r(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new Sr(d+1),f=Wr(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(a.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=a[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=a[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new _r(v),f]},Wr=function(t,e,r){return-1==t.s?Math.max(Wr(t.l,e,r+1),Wr(t.r,e,r+1)):e[t.s]=r},Vr=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Sr(++e),i=0,n=t[0],a=1,o=function(t){r[i++]=t},s=1;e>=s;++s)if(t[s]==n&&s!=e)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=t[s]}return[r.subarray(0,i),e]},Zr=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Gr=function(t,e,r){var i=r.length,n=Br(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var a=0;i>a;++a)t[n+a+4]=r[a];return 8*(n+4+i)},Qr=function(t,e,r,i,n,a,o,s,u,l,h){Ur(e,h++,r),++n[256];for(var c=zr(n,15),d=c[0],v=c[1],f=zr(a,15),p=f[0],g=f[1],m=Vr(d),y=m[0],b=m[1],w=Vr(p),k=w[0],_=w[1],S=new Sr(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=zr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Tr[I-1]];--I);var R,A,E,L,O=l+5<<3,P=Zr(n,Nr)+Zr(a,Fr)+o,D=Zr(n,d)+Zr(a,p)+o+14+3*I+Zr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=O&&D>=O)return Gr(e,h,t.subarray(u,u+l));if(Ur(e,h,1+(P>D)),h+=2,P>D){R=Dr(d,v,0),A=d,E=Dr(p,g,0),L=p;var N=Dr(M,T,0);for(Ur(e,h,b-257),Ur(e,h+5,_-1),Ur(e,h+10,I-4),h+=14,x=0;I>x;++x)Ur(e,h+3*x,M[Tr[x]]);h+=3*I;for(var F=[y,k],q=0;2>q;++q){var j=F[q];for(x=0;j.length>x;++x)Ur(e,h,N[B=31&j[x]]),h+=M[B],B>15&&(Ur(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else R=qr,A=Nr,E=jr,L=Fr;for(x=0;s>x;++x)if(i[x]>255){var B;$r(e,h,R[257+(B=i[x]>>>18&31)]),h+=A[B+257],B>7&&(Ur(e,h,i[x]>>>23&31),h+=Cr[B]);var H=31&i[x];$r(e,h,E[H]),h+=L[H],H>3&&($r(e,h,i[x]>>>5&8191),h+=Mr[H])}else $r(e,h,R[i[x]]),h+=A[i[x]];return $r(e,h,R[256]),h+A[256]},Jr=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yr=function(){for(var t=new xr(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Kr=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Yr[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},Xr=function(t,e,r,i,n){return function(t,e,r,i,n,a){var o=t.length,s=new _r(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Gr(u,l,t.subarray(h,c)):(u[h]=true,l=Gr(u,l,t.subarray(h,o)))}else{for(var d=Jr[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Sr(32768),m=new Sr(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new xr(25e3),_=new Sr(288),S=new Sr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var R=w(h),A=32767&h,E=m[R];if(g[A]=E,m[R]=A,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Qr(t,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var P=2,D=0,N=f,F=A-E&32767;if(L>2&&R==w(h-F))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=F&&--N&&A!=E;){if(t[h+P]==t[h+P-F]){for(var H=0;B>H&&t[h+H]==t[h+H-F];++H);if(H>P){if(P=H,D=F,H>q)break;var U=Math.min(F,H-2),z=0;for(O=0;U>O;++O){var W=h-F+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,E=W)}}}F+=(A=E)-(E=g[A])+32768&32767}if(D){k[M++]=268435456|Ar[P]<<18|Er[D];var Z=31&Ar[P],G=31&Er[D];C+=Cr[Z]+Mr[G],++_[257+Z],++S[G],T=h+P,++x}else k[M++]=t[h],++_[t[h]]}}l=Qr(t,u,true,k,_,S,C,M,I,h-I,l)}return Hr(s,0,i+Br(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},ti=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ei=function(t,e){var r=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&&ti(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},ri=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ii(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class ni{constructor(t,e){var r,i,n,a;void 0===e&&(e={}),this.it={},this.nt=Date.now(),this.ot=-1/0,this.st=()=>{var t=Date.now(),e=t-this.nt;e>0?(this.ut=Math.min(this.ht,this.ut+e/1e3*this.ct),this.nt=t):this.nt=t},this.dt=t=>{if(!this.it[t]){var e,r;this.it[t]=!0;var i=this.vt(t);null==(e=(r=this.ft).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,a,o,s,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=t.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=t.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.yt(t.id);return!this.wt.consumeRateLimit(e[0])&&t}));var n,a,o=i-e.attributes.length;o>0&&(null==(n=(a=this.ft).onDroppedAttributeMutations)||n.call(a,o))}var s=this.bt(e);if(0!==s||r===s){if(this.kt)return t;this.st();var u,l,h=wr(t);return h>this.ut?(null==(u=(l=this.ft).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ut-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.ot));this.St=setTimeout((()=>{var t,e;this.St=void 0,this.ot=Date.now(),null==(t=(e=this.ft).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.ft=e,this.wt=new F({bucketSize:null!==(r=this.ft.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ft.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.dt,A:Lt}),this.ht=null!==(n=this.ft.bytesBucketSize)&&void 0!==n?n:0,this.ct=null!==(a=this.ft.bytesRefillRate)&&void 0!==a?a:25600,this.kt=!Number.isFinite(this.ht)||0>=this.ht,this.ut=this.ht;var o=this.ft.resyncIntervalMs;this.xt=I(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.it={},this.St&&(clearTimeout(this.St),this.St=void 0),this.ot=Date.now()}stop(){this.wt.stop(),this.reset(),this.ut=this.ht,this.nt=Date.now(),this.ot=-1/0}}At.DEBUG=!1,At.LIB_VERSION="1.427.0",At.LIB_NAME="web";class ai{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.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt($e,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct($e);return _(e=r)&&x(e.sessionId)&&I(e.size)&&r.sessionId===t?r.size:0}}function oi(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,Lt)}function si(t){return"$survey_response_"+t}function ui(t,e){if(!e)return null;var r=t[si(e)];return w(r)?[...r]:r}function li(t,e,r){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!S(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,a=ui(t,e.id);S(a)||(i[n]=a)}})),h({$survey_questions:e.questions.map((e=>{var i,n;return{id:e.id,question:null!==(i=null==r?void 0:r[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==i?i:e.question,response:ui(t,e.id)}}))},t,i)}function hi(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function ci(t){return"string"==typeof t&&t.trim()?t.trim():null}function di(t){return t.toLowerCase()}function vi(t,e,r){if(!t||!e)return null;var i=di(e),n=Object.keys(t).find((t=>di(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(t).find((t=>di(t)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function pi(t,e,r){var i,n=vi(t.translations,e,r),a=h({},t),o=!1;if(n){var s,u=null==(s=t.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),S(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of fi){var d=u[c];S(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(t){return fi.some((e=>!S(t[e])))})(u)&&(o=!0)}var v=t.questions.map((t=>function(t,e,r){var i,n=vi(t.translations,e,r);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(i=t.translations)?void 0:i[n];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var o=h({},t),s=!1;return S(a.question)||(o.question=a.question,s=!0),S(a.description)||(o.description=a.description,s=!0),S(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!S(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!S(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!S(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(t){return w(t.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:t,matchedKey:s?n:null,hasChanges:s}}(t,e,r))),f=v.map((t=>t.question)),p=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(i=v.find((t=>t.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+e)),{survey:a,matchedKey:o?n||g:null}}function gi(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}var mi=(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}},yi=t=>t.toLowerCase(),bi={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>mi(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!mi(e,t))))),icontains:(t,e)=>e.map(yi).some((e=>t.map(yi).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(yi).every((e=>t.map(yi).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},wi=new Set(["is_not","not_icontains","not_regex"]);function ki(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],a=t.operator||"exact";if(S(n)||M(n))return wi.has(a);var o=bi[a];return!!o&&!S(t.value)&&!M(t.value)&&o(w(t.value)?t.value.map(String):[String(t.value)],w(n)?n.map(String):[String(n)])}))}var _i=Ot("[SessionRecording]");function Si(t,e){return e?t:"!"+t}function xi(t,e){return t===e||t!=="!"+e&&null}class Ci{constructor(t,e,r,i,n,a,o){this.Tt=null,this.It=mr,this._instance=t,this.X=e,this.tt=r,this.et=i,this.Rt=n,this.At=a,this.Et=o}onRemoteConfig(t){this.Tt=I(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ur([this.tt,this.X]),this.It=gr):(this.Lt=new lr([this.tt,this.X]),this.It=mr),this._instance.register_for_session({[Ze]:t.triggerMatchType}),this.X.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,((t,e)=>{this.Rt("linked_flag_matched",{flag:t,variant:e}),this.Et()}))}getStatus(t){return this.It({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(t,e,r,i){this.X.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.Y.length&&T(this.Ot))return this.Ot=t((t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){_i.error("Could not activate event trigger",t)}})),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.Tt;if(!I(n))return null==(r=this._instance.persistence)||r.unregister(De),void(null==(i=this._instance.persistence)||i.unregister(Ae));var a=this._instance.get_property(De),o=this._instance.get_property(Ae),s=xi(a,t),u=I(o)&&o!==n,l=S(o)&&a===t,h=u||l||!R(s),c=h?oi(t,n):s;h&&(c?this.Rt("sampled"):_i.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[De]:Si(t,c),[Ae]:M(o)&&a===t?null:n})}ensureSamplingDecision(t){if(I(this.Tt)){var e=this._instance.get_property(De);R(xi(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(qe),null==(e=this._instance.persistence)||e.unregister(Fe),null==(r=this._instance.persistence)||r.unregister(De),null==(i=this._instance.persistence)||i.unregister(Ae),null==(n=this._instance.persistence)||n.unregister(Ne)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===rr}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===rr)).map((t=>t.label))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.X.stop(),this.et.stop()}}class Mi{constructor(t,e,r,i,n){this.Pt=[],this.Dt=new Map,this.Nt=!1,this._instance=t,this.X=e,this.Rt=r,this.Ft=i,this.Et=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[Ze]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.X.onConfig(t)):_i.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Xe;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Ge;var i=!1,n=!1;for(var a of e){var o=a.triggerStatus(t.sessionId);if(o===er){var s=a.group.id,u=r.get(s);S(u)?Lt.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===rr&&(i=!0)}return n?Qe:i?Ye:Ge}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Dt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;I(i)&&(M(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.X.checkUrlBlocklist(e,r);var a=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Et(e))}),t)};for(var o of this.Pt)a(o)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t((t=>{var r;if(this.Nt)return _i.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.jt(r,t.properties)){var a=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),o=i._instance.get_property(ze),s=a.some((e=>!e.properties||0===e.properties.length||ki(e.properties,t.properties,o)));s&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Et(n))}}),e)};for(var a of this.Pt)n(a)}catch(t){_i.error("Could not activate event trigger for trigger groups",t)}})),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,a=i.sampleRate,o=He+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(_(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==t,h=I(v)&&v!==a,u=d===t&&I(v)&&v===a&&R(f)?f:null}else u=s===t||null,l="string"==typeof s&&s!==t,c=s===t;var p=l||h||c||!R(u),g=p?oi(t+n,a):u;p&&this.Ft("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:g}),this.Dt.set(n,g),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:t,sampleRate:a,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(De),null==(e=this._instance.persistence)||e.unregister(Ae),null==(r=this._instance.persistence)||r.unregister(Ne),this.Pt)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(je+s),null==(a=this._instance.persistence)||a.unregister(Be+s),null==(o=this._instance.persistence)||o.unregister(He+s)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(t),o=!0===this.Dt.get(n);a&&e.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Pt)if(e.triggerStatus(t)===rr)return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap((e=>e.triggerStatusNoSideEffects(t)!==rr?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear(),this.X.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||ki(r,e,this._instance.get_property(ze))}qt(t){var e=this;this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear();var r=function(t){var r=new pr(e._instance,t,((r,i)=>{e.Rt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Et()}));e.Pt.push(r)};for(var i of t)r(i)}}var Ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ii=1e5,Ri="https://schema.org",Ai=[],Ei="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(" "),Li="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Oi="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(" "),Pi="Accommodation AdministrativeArea Country Place State".split(" "),Di={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:Li,publisher:Oi},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ai},Offer:{seller:Oi},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:Oi,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Oi,areaServed:Pi,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ai}},Ni={},Fi=[[Li,Ni],["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(" "),Di.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Di.Event],[Oi,Di.Organization],[Pi,Di.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Di.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),Ni]],qi="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ji(t,e){return y.call(t,e)?t[e]:void 0}function Bi(t){var e=typeof t;return M(t)||"string"===e||"number"===e||"boolean"===e}function Hi(t){return Bi(t)||w(t)&&t.every(Bi)?t:void 0}function Ui(t){if(y.call(Di,t))return Di[t];for(var e of Fi){var r=e[1];if(e[0].includes(t))return r}return qi.includes(t)?Ni:void 0}function $i(t,e){if(!_(t))return null;var r=ji(t,"@type"),i=function(t){return("string"==typeof t?[t]:w(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!Ui(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},a=Hi(ji(t,"@id"));for(var o of(S(a)||(n["@id"]=a),Ei)){var s=Hi(ji(t,o));S(s)||(n[o]=s)}for(var u of i){var l=Ui(u),h=function(){var e=ji(t,c),r=l[c];if(!0===r){var i=Hi(e);S(i)||(n[c]=i)}else if(w(e)){var a=e.map((t=>$i(t,r))).filter(_);a.length&&(n[c]=a)}else{var o=$i(e,r);o&&(n[c]=o)}};for(var c of Object.keys(l))h()}return n}function zi(t){if(!_(t))return null;var e=ji(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var r=$i(t);if(r)return h({"@context":Ri},r);var i=ji(t,"@graph");if(!w(i))return null;var n=i.map((t=>$i(t))).filter(_);return n.length?{"@context":Ri,"@graph":n}:null}function Wi(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Vi(t,e,r){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!!r&&t.matches(r)}catch(t){return!1}}function Zi(t){return Wi(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Wi)}function Gi(t){return S(t)?void 0:Math.round(t)}function Qi(t){return _(t)?t.network_timing:t}var Ji,Yi,Ki=943718.4,Xi="[SessionRecording]",tn=Ot(Xi),en=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],rn=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function nn(){var t;return null==s||null==(t=s.__PosthogExtensions__)?void 0:t.rrweb}function an(){var t;return null==(t=nn())?void 0:t.record}function on(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,yr())}}function sn(t){return ii(function(t,e){void 0===e&&(e={});var r=Kr(),i=t.length;r.p(t);var n=Xr(t,e,ri(e),8),a=n.length;return ei(n,e),ti(n,a-8,r.d()),ti(n,a-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new _r(t.length+(t.length>>>1)),n=0,a=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var s=new _r(n+8+(r-o<<1));s.set(i),i=s}var u=t.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Hr(i,0,n)}(on(t))))}function un(t){return ln.apply(this,arguments)}function ln(){return ln=l((function*(t){var e=on(t),r=yield function(t,e,r){return It.apply(this,arguments)}(e,At.DEBUG,{rethrow:!0});return ii(new Uint8Array(yield r.arrayBuffer()))})),ln.apply(this,arguments)}var hn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,cn=!1;function dn(t){return w(t)&&0===t.length?Ji=null!=Ji?Ji:sn([]):sn(t)}function vn(t){return fn.apply(this,arguments)}function fn(){return(fn=l((function*(t){return w(t)&&0===t.length?Ji||(Yi=null!=Yi?Yi:un([]).then((t=>(Ji=t,t))).catch((t=>{throw Ji=void 0,Yi=void 0,t}))):un(t)}))).apply(this,arguments)}function pn(t){return hn&&!cn&&function(t){return t.type===c.FullSnapshot||t.type===c.IncrementalSnapshot&&(t.data.source===d.Mutation||t.data.source===d.StyleSheetRule)}(t)}function gn(t){return{event:t,size:wr(t)}}function mn(t,e){return h({},t,{data:e,cv:"2024-10"})}function yn(t,e){return h({},t,{cv:"2024-10",data:h({},t.data,e)})}function bn(t){try{if(t.type===c.FullSnapshot)return gn(mn(t,sn(t.data)));if(t.type===c.IncrementalSnapshot&&t.data.source===d.Mutation)return gn(yn(t,{texts:dn(t.data.texts),attributes:dn(t.data.attributes),removes:dn(t.data.removes),adds:dn(t.data.adds)}));if(t.type===c.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return gn(yn(t,{adds:t.data.adds?sn(t.data.adds):void 0,removes:t.data.removes?sn(t.data.removes):void 0}))}catch(t){tn.error("could not compress event - will use uncompressed event",t)}return{event:t,size:br(t)}}function wn(){return wn=l((function*(t){try{if(t.type===c.FullSnapshot)return gn(mn(t,yield un(t.data)));if(t.type===c.IncrementalSnapshot&&t.data.source===d.Mutation){var e=yield Promise.all([vn(t.data.texts),vn(t.data.attributes),vn(t.data.removes),vn(t.data.adds)]);return gn(yn(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===c.IncrementalSnapshot&&t.data.source===d.StyleSheetRule){var r=yield Promise.all([t.data.adds?un(t.data.adds):void 0,t.data.removes?un(t.data.removes):void 0]);return gn(yn(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Ct})(e)&&(cn=!0),tn.error("could not compress event asynchronously - trying synchronous compression",e),bn(t)}return{event:t,size:br(t)}})),wn.apply(this,arguments)}function kn(t,e){return t.type===c.Custom&&t.data.tag===e}function _n(t){return kn(t,"sessionIdle")}function Sn(t){return kn(t,"$session_ending")}function xn(t){return kn(t,"$session_starting")}class Cn{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error(Xi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Ut(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get $t(){return xi(this._instance.get_property(De),this.sessionId)}get Tt(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return I(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Yt=!1,this.Kt=[],this.Xt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.ae=!1,this.oe=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,a;if(r&&(t!==this.Bt||e!==this.Ie)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(s&&this.Ft("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(o=this.Re)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ue),this.he=!1,null==(n=nn())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ft("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Xt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Xt;this.Xt="unknown",this.Ee(h)}s&&this.Ft("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(a=this.Vt)||a.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Ne])===this.Bt},this.Pe=()=>{var t,e;if(0===this.De.data.length)return null;var r=null==(t=this.De.data[0])?void 0:t.timestamp,i=null==(e=this.De.data[this.De.data.length-1])?void 0:e.timestamp;return I(r)&&I(i)?i-r:null},this.Ne=()=>{var t,e,r=this.Wt;if(!I(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Fe;return I(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,a=this.Pe();return!!M(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Ne]:this.Bt}),!1)},this.qe=()=>{this.status!==Ye?(this.ne&&this.ae&&this.je&&!this.oe&&(this.ne=!1),this.Be(),this.He()):this.Ue()},this.$e=()=>{this.qe()},this.ze=()=>{this.Ft("browser offline",{})},this.We=()=>{this.Ft("browser online",{})},this.Ve=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.je=!0),this.Ft("window "+i.visibilityState,{}))},this._instance=t,this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),n=r.windowId;this.Bt=r.sessionId,this.Ie=n,this.et=new vr(this._instance),this.X=new dr(this._instance),this.tt=new fr(this._instance),this.De=this.Ue(),this.Ht.sessionTimeoutMs>this.Ut||tn.warn("session_idle_threshold_ms ("+this.Ut+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new ai(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ze(){var t,e,r,i,n,a,o,s,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return S(c)&&S(d)&&S(v)&&S(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Ge(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!T(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!S(i)&&i!==n}));0!==i.length&&(this.de=!0,tn.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==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Qe(){var t;return N(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Ot("canvas recording resolution scale"),1)}get Je(){var t,e,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:N(h,0,12,Ot("canvas recording fps"),4),quality:N(c,0,1,Ot("canvas recording quality"),.4)}}get Ye(){var t,e=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Ke(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Qi(this._instance.config.capture_performance),u=Qi(null==i?void 0:i.capturePerformance),l=!!(R(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Xe(){var t,e,r=[],i=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;i&&this.Ye&&r.push(i());var a=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ke&&k(a))if(!Ft.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=k(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((t,e,r)=>{var i,n={payloadSizeLimitBytes:we.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...we.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...we.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,u=(i=be(n),t=>(null!=t&&t.requestBody&&(t.requestBody=Me(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=Me(t.responseBody,t.responseHeaders,i,"Response")),t)),l=e=>{return u(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=qt(t.name),a=0===e.indexOf("http")?null==(i=qt(e))?void 0:i.pathname:e;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Ce.some((t=>0===o.indexOf(t)))))return t}})((xe((i=e).requestHeaders),xe(i.responseHeaders),i),t.api_host,r));var i},c=k(t.session_recording.maskNetworkRequestFn);return c&&k(t.session_recording.maskCapturedNetworkRequestFn)&&Lt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:h({},e,{name:null==r?void 0:r.url})}),n.maskRequestFn=k(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=l(e);if(r){var i=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,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return T(n)&&i?(Ie.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!S(t))return t.requestBody=Te(t.requestBody,"Request"),t.responseBody=Te(t.responseBody,"Response"),t}(l(t)),h({},we,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ke,o)))}else tn.info("NetworkCapture not started because we are on localhost.");return r}tr(t){return this._instance.config.disable_capture_url_hashes?ut(t):t}er(t,e){void 0===e&&(e=!1);var r=e?ut(t):this.tr(t),i=this._instance.config.mask_personal_data_properties?[...Ti,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");w(c)&&(e.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}rr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ir(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Kt.length?this.Kt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):tn.warn("could not emit queued rrweb event.",e,t),!1}}Ft(t,e){return this.ir(rn((()=>an().addCustomEvent(t,e))))}nr(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Xt}ar(t){if(!this.nr())return!1;try{var e=an();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.er(e.origin+e.pathname+e.search);this.hr!==r&&(this.hr=r,this.Ft("$url_changed",{href:r}))}catch(t){}}cr(){if(this.Kt.length){var t=[...this.Kt];this.Kt=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}At(){return this.ir(rn((()=>an().takeFullSnapshot())))}get dr(){var t,e,r;if(null!=(t=this.Vt)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return I(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Xt){var t=this.dr;t&&(this.pr=setInterval((()=>{this.At()}),t))}}Et(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),tn.info("recording paused due to URL blocker"),this.Ft("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.At(),this.sr(),this.vr(),this.Ft("recording resumed",{reason:"left blocked url"}),tn.info("recording resumed"))}br(t,e){var r;if("event"===t&&this.gr(),!this.Yt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Yt=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?Fe:qe]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Et(),this.He(),this.Rt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Yt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(Re);if(t){var e;try{e=_(t)?t:JSON.parse(t)}catch(t){return void tn.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return tn.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(Re))}return e}}wr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var r,n,a=this.zt;if(a){this.isStarted||(this.ne=!1!==this.Xt&&!this.se,this.se=!1,this.ae=this.ne,this.oe=!1),this._e&&(this.kr(),this.Ue());var o=this.Ht.checkAndGetSessionAndWindowId(),s=o.windowId;this.Bt=o.sessionId,this.Ie=s,null==(r=this._instance.persistence)||r.unregister(Ue),null!=a&&a.endpoint&&(this.Zt=null==a?void 0:a.endpoint),this.Vt=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Mi(this._instance,this.X,this.Rt.bind(this),this.Ft.bind(this),this.Et.bind(this)):new Ci(this._instance,this.X,this.tt,this.et,this.Rt.bind(this),this.At.bind(this),this.Et.bind(this)),this.Vt.onRemoteConfig(a),null==(n=this.Ot)||n.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.br(t,e))),this.wr(Ee,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ee)})),this.wr(Le,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Le)})),this.wr(Pe,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Pe)})),this.wr(Oe,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Oe)})),this.Vt.makeSamplingDecisions(this.sessionId),this._r(),this.ue||(Nt(t,"beforeunload",this.qe),Nt(t,"pagehide",this.$e),Nt(t,"offline",this.ze),Nt(t,"online",this.We),Nt(i,"visibilitychange",this.Ve),!this.xe&&k(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&k(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",(()=>{this.Ae(),this.Xt="unknown",this.stop(),this.Me=this.Ht.onSessionId(((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)}))})):k(this.Ht.on)||tn.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),T(this.Se)&&(this.Se=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Ft("$pageview",{href:e})}}catch(t){tn.error("Could not add $pageview to rrweb session",t)}}))),this.status===Je&&this.Rt(e||"recording_initialized"))}else tn.info("remote config must be stored in persistence before recording can start")}Sr(){var e,r,n,a,o,s;null==t||t.removeEventListener("beforeunload",this.qe),null==t||t.removeEventListener("pagehide",this.$e),null==t||t.removeEventListener("offline",this.ze),null==t||t.removeEventListener("online",this.We),null==i||i.removeEventListener("visibilitychange",this.Ve),clearInterval(this.pr),this.Cr(),null==(e=this.Se)||e.call(this),this.Se=void 0,null==(r=this.Ot)||r.call(this),this.Ot=void 0,null==(n=this.xe)||n.call(this),this.xe=void 0,null==(a=this.Ce)||a.call(this),this.Ce=void 0,null==(o=this.Me)||o.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Mr(),this.kr()}kr(){this.ke+=1,this.be=[],this.we=0,this.Tr=void 0,this._e=!1}Mr(){var t,e,r;null==(t=this.Ir)||t.stop(),this.Kt=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Rr(){if(!this.Tr||0===this.we)return!1;if(this._e)return!0;this._e=!0;var t=this.ke;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.ke&&(this._e=!1,this.He(),this.Ue(),this.Sr(),tn.info("stopped"))})).catch((()=>{this._e=!1,this.Sr(),tn.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.He(),this.Ue(),this.Sr(),tn.info("stopped"))}Ee(t){this.Le=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=nn())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.ne=t,this.ae=!1}gr(){this.isStarted||(this.se=!0),this.ne&&(this.ne=!1,this.ae=!1,this.oe&&(this.oe=!1,this.At()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ue(),this.Mr()),this.Ue(),this.Sr(),tn.info("discarded")}Or(t,e,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==Ge?(this.Pr(t,i),this.Dr(a)):this.Ue()}Nr(){try{this.Fr()}catch(t){this.ce||(this.ce=!0,tn.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=nn())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||tn.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Pr(t,e){t.type!==c.FullSnapshot?t.type===c.IncrementalSnapshot&&(S(this.me)||this.me===e||this.ye===e||(this.ye=e,tn.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.At())):this.me=e}qr(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter((e=>e!==t))}jr(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Or(t.event,e,r,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?bn(t.event):{event:t.event,size:br(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Be(){[...this.be].forEach((t=>{this.Br(t)}))}Hr(t,e,r,i){var n=this,a={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:i,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=e?pn(t)?yield function(t){return wn.apply(this,arguments)}(t):bn(t):{event:t,size:br(t)};r=o.event,i=o.size}catch(e){tn.error("could not process queued compression event - will use uncompressed event",e),r=t,i=br(t)}n.jr(a,r,i)}finally{n.qr(a)}}));return function(){return r.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.cr(),t&&_(t))){if(t.type===c.Meta){var h=this.er(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(t,e))),!this.X.urlBlocked||function(t){return t.type===c.Custom&&"recording paused"===t.data.tag}(t)){var v,f,p;t.type===c.FullSnapshot&&(null!=(v=nn())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this.he=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(f=this.Ir)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ue]:t.timestamp},void 0));var g=t.type===c.FullSnapshot&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));g&&this.Ur();var m=this.Ir?this.Ir.throttleMutations(t):t;if(m){var y=function(t){var e=t;if(e&&_(e)&&6===e.type&&_(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]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),b=function(t){return Sn(t)?t.data.payload:null}(y),w=function(t){return xn(t)?t.data.payload:null}(y),k=function(t){return _n(t)?t.data.payload:null}(y);b||w?null!=b&&b.lastActivityTimestamp&&(y.timestamp=b.lastActivityTimestamp):null!=k&&k.sessionId||this.$r(y),t.type===c.FullSnapshot&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var S=null!==(i=null!==(n=null!==(a=null==b?void 0:b.currentSessionId)&&void 0!==a?a:null==w?void 0:w.nextSessionId)&&void 0!==n?n:null==k?void 0:k.sessionId)&&void 0!==i?i:this.Bt,x=null!==(o=null!==(s=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==s?s:null==k?void 0:k.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Xt||function(t){return _n(t)||Sn(t)||xn(t)}(y)){y.type===c.FullSnapshot&&(this.te=0),k&&(y.timestamp=k.lastActivityTimestamp+k.threshold);var C=this.Qt;this.Qt=!0,g?this.sr(!0):C||this.sr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||M&&pn(y))this.Hr(y,M,S,x);else{var T=M?bn(y):{event:y,size:br(y)};this.Or(y,T.event,T.size,S,x)}}else(function(t){return t.type===c.FullSnapshot||t.type===c.Meta||t.type===c.IncrementalSnapshot&&t.data.source!==d.CanvasMutation})(y)&&this.te++}else!0===this.Xt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.$t,rrwebError:this.ue,urlTriggerMatching:this.X,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Ge}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.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.At(),this.gr(),this.Rt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[De]:this.sessionId,[Ae]:null}),this.At(),this.gr(),this.Rt("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var e,r=null==t||null==(e=t.location)?void 0:e.href;if(!r)return;var i=this.er(r);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.He()}),2e3))}Vr(){return this.me!==this.De.sessionId&&0!==this.De.data.length&&this.De.data.every((t=>(null==t?void 0:t.type)===c.Custom&&!Sn(t)&&!xn(t)))}Zr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==Ye)return S(this.Qr)||this._instance.register_for_session({[Ve]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return S(this.Qr)||this._instance.register_for_session({[Ve]:[]}),void(this.Qr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Qr&&(this.Qr=i,this._instance.register_for_session({[Ve]:e}),tn.info("buffering: "+r))}He(){var t;if(this.Cr(),this.ne)return this.De;if(this.Vr())return this.De.size>Ki?this.Ue():this.De;var e=this.De;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Ne(),i=this.status;if(this.Gr(i),i===Ye||i===Ke||i===Ge||r)return this.Lr(),this.De;if(this.De!==e)return this.De;if(e.data.length>0){var n,a=this.zr();kr(e).forEach((t=>{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.Jr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:At.LIB_NAME,$lib_version:At.LIB_VERSION,$snapshot_host:a})})),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}Dr(t){var e,r=2+((null==(e=this.De)?void 0:e.data.length)||0),i=t.$session_id,n=this.De.sessionId!==i;if(n||!0!==this.Xt&&!this.ne&&this.De.size+t.$snapshot_bytes+r>Ki){var a=this.Bt;if(this.De=this.He(),this.Bt!==a)return;n&&this.De.data.length>0&&(this.De=this.Ue()),this.De.sessionId=i,this.De.windowId=t.$window_id}this.ne&&(this.oe||this.De.size+t.$snapshot_bytes+r>Ki)?this.oe||(this.oe=!0,this.De=this.Ue()):(this.De.size+=t.$snapshot_bytes,this.De.data.push(t.$snapshot_data),this.De.sizes.push(t.$snapshot_bytes),!0===this.Xt||this.ne||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Fe(){var t,e,r=null==(t=this.De)?void 0:t.data[(null==(e=this.De)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Ur(){if(!this.De||0===this.De.data.length)return this.Ue();for(var t=-1,e=this.De.data.length-1;e>=0;e--)if(this.De.data[e].type===c.Meta){t=e;break}return 0>t?this.Ue():(this.De.data=this.De.data.slice(t),this.De.sizes=this.De.sizes.slice(t),this.De.size=this.De.sizes.reduce(((t,e)=>t+e),0),this.De)}Ue(){return this.De={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.De}Rt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),tn.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ft("$recording_started",h({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==en.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Yr(t);e||!0===this.Xt||t.timestamp-this.Jt>this.Ut&&(this.Xt=!0,clearInterval(this.pr),this.Ft("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.Ut,bufferLength:this.De.data.length,bufferSize:this.De.size,sessionId:this.Bt,windowId:this.Ie}),this.He());var r=!1;if(e&&(this.Jt=t.timestamp,this.Xt)){var i="unknown"===this.Xt;this.Xt=!1,i||(this.Ft("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),a=n.windowId,o=n.sessionId,s=this.Bt!==o,u=this.Ie!==a;if(this.Ie=a,this.Bt=o,s||u){var l=s&&!1!==this.Xt;l&&(this.Xt="unknown"),this.Ee(l)}else if(e&&this.gr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&c&&this.At(),this.sr(),this.vr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,a,o,s,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=nn())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.De.data.length,$sdk_debug_replay_internal_buffer_size:this.De.size,$sdk_debug_current_session_duration:this.Fe,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:Gi(null==(r=this.Ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Gi(null==(i=this.Ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.Ar)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Gi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Gi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Gi(null==(s=nn())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=nn())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,$sdk_debug_rrweb_attached:!!this.Gt,$sdk_debug_rrweb_start_attempted:this.le}}_r(){var e;if(!this.Gt){this.le=!0;var r,n,a,o,s={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},u=this._instance.config.session_recording;for(var l of Object.entries(u||{})){var c=l[0],d=l[1];if(c in s)if("maskInputOptions"===c)s.maskInputOptions=h({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};S(v.mousemove)||(f.mousemove=v.mousemove),S(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),s.sampling=f}else s[c]=d}!0===(null==u?void 0:u.captureJsonLd)&&!0!==s.slimDOMOptions&&"all"!==s.slimDOMOptions&&(s.slimDOMOptions=h({},s.slimDOMOptions,{script:!0})),this.Je&&this.Je.enabled&&(s.recordCanvas=!0,s.sampling=h({},s.sampling,{canvas:this.Je.fps}),s.dataURLOptions={type:"image/webp",quality:this.Je.quality},s.canvasResolutionScale=this.Qe,s.canvasMasking={configured:()=>{var t;return k(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(k(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,tn.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ze&&(s.maskAllInputs=null===(r=this.Ze.maskAllInputs)||void 0===r||r,s.maskTextSelector=null!==(n=this.Ze.maskTextSelector)&&void 0!==n?n:void 0,s.blockSelector=null!==(a=this.Ze.blockSelector)&&void 0!==a?a:void 0,s.maskAllElementAttributes=null!==(o=this.Ze.maskAllElementAttributes)&&void 0!==o&&o),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ve||(this.ve=!0,tn.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.Ge();var p=an();if(p){this.Ir=null!==(e=this.Ir)&&void 0!==e?e:new ni(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";tn.info(r,{node:e}),this.log(Xi+" "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.re&&this.log(Xi+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.At()});var g=this.Xe();if(this.Gt=p(h({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,tn.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},s)),!this.Gt)return this.ue=!0,void tn.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==u?void 0:u.captureJsonLd)&&i&&null!=t&&t.MutationObserver&&!this.ur&&(this.ur=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),a=Ii,o=e=>{try{var o=n();if(!a||!1===o||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(Vi(r,e.blockClass,e.blockSelector)||Vi(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var s=function(t){if(!t||t.length>Ii)return null;try{var e=JSON.parse(t),r=w(e)?e.map(zi):zi(e);if(M(r)||w(r)&&(!r.length||r.some(M)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!s)return void i.delete(e);var u=s[0],l=s[1];if(M(o))return void i.set(e,l);if(i.get(e)!==l){if(l.length>a)return void(a=0);r.emit(u)&&(i.set(e,l),a-=l.length)}}catch(t){return}};try{var s=new e((t=>{try{if(!a||!1===n())return;var e=t=>{for(var e of Zi(t))o(e)};for(var r of t)if("childList"===r.type)Wi(r.target)&&o(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Wi(i)&&o(i)}else"attributes"===r.type&&Wi(r.target)&&o(r.target)}catch(t){return}}));return s.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),a&&!1!==n()&&Zi(t.documentElement).forEach((t=>{e&&i.delete(t),o(t)}))},stop(){return s.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{blockClass:s.blockClass,blockSelector:s.blockSelector,maskTextClass:s.maskTextClass,maskTextSelector:s.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.Jt=Date.now(),this.Xt=R(this.Xt)?this.Xt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Ft("$session_options",{sessionRecordingOptions:s,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Ft("$posthog_config",{config:this._instance.config})}else tn.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ft(t,e)}}var Mn=["type"],Tn=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}({}),In=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}({}),Rn=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}({}),An=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),En=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Ln=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}({}),On=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 Pn(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase();var Dn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Nn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Fn={};function qn(t){if(Fn[t])return Fn[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Dn?Dn[t]:void 0,n=Boolean(i&&i.every((t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))}))),a=t in Nn?Nn[t]:void 0,o=Boolean(a&&a.every((t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Fn[t]=e.prototype,e.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return e.prototype;var h=l[t].prototype;return h?(function(t){return Pn(t,"AppleWebKit")&&!Pn(t,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",t),u=!0),Fn[t]=h):r}catch(t){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var jn={};function Bn(t,e,r){var i,n=t+"."+String(r);if(jn[n])return jn[n].call(e);var a=qn(t),o=null===(i=Object.getOwnPropertyDescriptor(a,r))||void 0===i?void 0:i.get;return o?(jn[n]=o,o.call(e)):e[r]}var Hn={};function Un(t,e,r){var i=t+"."+String(r);if(Hn[i])return Hn[i].bind(e);var n=qn(t)[r];return"function"!=typeof n?e[r]:(Hn[i]=n,n.bind(e))}function $n(){return qn("MutationObserver").constructor}function zn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},a=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=a,()=>{if(t[e]!==a)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],o=r(i);o;){if(o.next===a)return void(o.next=n.next);o=r(i=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Wn={childNodes:t=>Bn("Node",t,"childNodes"),parentNode:t=>Bn("Node",t,"parentNode"),parentElement:t=>Bn("Node",t,"parentElement"),textContent:t=>Bn("Node",t,"textContent"),contains:(t,e)=>Un("Node",t,"contains")(e),getRootNode:t=>Un("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Bn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Bn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Un("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Un("Element",t,"querySelectorAll")(e),mutationObserver:$n,patch:zn},Vn=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Zn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Gn=0;function Qn(){Gn+=1}function Jn(){return Gn}function Yn(t,e){return e!==Gn||t>6e4}var Kn=0,Xn=0,ta=0,ea=Vn(),ra=null,ia=null,na=[],aa=0,oa=0,sa={slowestBatchMs:0},ua={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},la=t=>t&&t>0?t:null;function ha(t){(Kn+=1)>1||(ea=Vn(),na=[],aa=0,ia=la(t),Xn=Zn(),ta=Gn)}function ca(){return 0===Kn?ra||Vn():(Kn-=1)>0?ea:(ea.durationMs=Zn()-Xn,ea.deferredStylesheetCount=aa,ua.deferredCount+=aa,ia=null,Yn(ea.durationMs,ta)?ea:ra=ea)}var da=32;function va(t,e,r){var i=t.length;if(r>=da)return i;for(var n=0;t.length>n;n++){var a=t[n];try{var o=a.cssRules;if(o&&o.length)i+=va(o,e,r+1);else if(e&&a.styleSheet){var s=a.styleSheet;if(!e.has(s)){e.add(s);var u=s.rules||s.cssRules;u&&(i+=va(u,e,r+1))}}}catch(t){}}return i}function fa(t){if(0!==Kn){var e=va(t,null,0);ea.cssRuleCount+=e,oa>0&&(ea.nonDeferrableCssRuleCount+=e)}}function pa(t){oa+=1;try{return t()}finally{oa-=1}}function ga(t){Kn>0&&(ea.stylesheetMs+=t)}function ma(t){if(0===Kn||null===ia)return!1;var e=ea.cssRuleCount-ea.nonDeferrableCssRuleCount;return e>=ia||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),va(e,r,0)}catch(t){return 0}}(t)>ia}function ya(){ua.failedCount+=1}function ba(t){t>0&&(ua.abandonedCount+=t)}function wa(t){return wa="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},wa(t)}function ka(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=wa(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=wa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==wa(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _a(t){return t.nodeType===t.ELEMENT_NODE}function Sa(t){var e=t&&"host"in t&&"mode"in t&&Wn.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Wn.shadowRoot(e)===t)}function xa(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Ca(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 Ma(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var Ta=0;function Ia(t){var e=0===Ta,r=e?Zn():0;Ta+=1;try{var i=t.rules||t.cssRules;if(!i)return null;fa(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Ca(Array.from(i,(t=>Ra(t,n))).join(""))}catch(t){return null}finally{Ta-=1,e&&ga(Zn()-r)}}function Ra(t,e){if(Ea(t)){var r;try{r=Ia(t.styleSheet)||Ma(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return Za(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return La(t)&&t.selectorText.includes(":")&&(n=Aa(n)),e?Za(n,e):n}function Aa(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ea(t){return"styleSheet"in t}function La(t){return"selectorText"in t}var Oa=/^-?[A-Za-z_][\w-]*$/,Pa=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Da(t){var e=[],r=!1,i=null,n=new Map;function a(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void a(null)}var s=e[e.length-1];return s.parts.push(t),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=t);o(e[e.length-1],n.importRule,t)}function o(t,e,r){try{var i;try{i=r||Ma(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=Za(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){a(null)}}function s(t){var r=t.rules[t.index];if("sheet"===t.kind&&Ea(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(t,r,null)}if(!function(t,r){try{var i=function(t){var 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(La(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Oa.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var 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]?Oa.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Pa.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Za(i,n):i,fixColons:"sheet"===r.kind&&La(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var a=r.cssText;"sheet"===t.kind&&La(r)&&r.selectorText.includes(":")&&(a=Aa(a)),t.parts.push(t.sheetHref?Za(a,t.sheetHref):a),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;fa(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var a=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ea(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;fa(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(e,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(t){}};r.length>0;)i()}(a,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=Zn(),o=t>0?t:1;try{for(;!r&&o>0;){var u=e[e.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(t){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?Aa(h):h}else l=Ca(u.parts.join(""))}catch(t){}a(l)}}}catch(t){r=!0,i=null}finally{ga(Zn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var Na=class{constructor(){ka(this,"idNodeMap",new Map),ka(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.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){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),_a(t)){var r=Wn.shadowRoot(t);r&&this.removeNodeFromMap(r),"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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Fa(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,a=t.maskInputFn,o=t.value||"",s=n&&qa(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,e):"*".repeat(o.length)),o}function qa(t){return t.toLowerCase()}var ja=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 Ba(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,a=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==a&&a&&ja.has(qa(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var Ha="__rrweb_original__";function Ua(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?qa(e):null}catch(t){return null}}var $a=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,za=/^(?:[a-z+]+:)?\/\//i,Wa=/^www\..*/i,Va=/^(data:)([^,]*),(.*)/i;function Za(t,e){return(t||"").replace($a,((t,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return t;if(za.test(u)||Wa.test(u))return"url("+l+u+l+")";if(Va.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=e).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ga,Qa,Ja="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Ya=4096,Ka=1e5,Xa=10,to=new Map,eo=1,ro=new RegExp("[^a-z0-9-_:]");function io(){return eo++}var no=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/,oo=new WeakMap;function so(t,e){return e&&""!==e.trim()?uo(t,e):e}function uo(t,e){var r=oo.get(t);if(r||(r=t.createElement("a"),oo.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function lo(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Ja:t}(t,e.maxBase64ImageLength):t}function ho(t,e,r,i,n,a){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o,s=null===(o=n.sheet)||void 0===o?void 0:o.href;if(s)return s}var u=so(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(t,e,r,i){if(Ka>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Ya||t.naturalHeight>Ya)return e;var n=to.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=t.naturalWidth,a.height=t.naturalHeight;var o=a.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>s.length?s:e;if(to.size>=Xa){var l=to.keys().next().value;void 0!==l&&to.delete(l)}return to.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,a.type,a.quality)),lo(l,a)}if("image"===e)return lo(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=so(t,i);return"image"===e&&h.startsWith("data:")?lo(h,a):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(ao),e.length>r;){var a=i(no);if(","===a.slice(-1))a=so(t,a.substring(0,a.length-1)),n.push(a);else{var o="";a=so(t,a);for(var s=!1;;){var u=e.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?Za(i,uo(t)):"object"===e&&"data"===r?so(t,i):i:so(t,i)}function co(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function vo(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&vo(Wn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&vo(Wn.parentNode(t),e,r)}function fo(t,e,r,i){var n;if(_a(t)){if(!Wn.childNodes(n=t).length)return!1}else{if(null===Wn.parentElement(t))return!1;n=Wn.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(vo(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function po(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var go=new Map;function mo(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function yo(t){return null==t?"":t.toLowerCase()}var bo=!1,wo=!1;function ko(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.maskTextClass,s=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,c=void 0===h||h,d=e.maskInputOptions,v=void 0===d?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,w=e.dataURLOptions,k=void 0===w?{}:w,_=e.inlineImages,S=void 0!==_&&_,x=e.recordCanvas,C=void 0!==x&&x,M=e.canvasMaskingConfigured,T=e.onSerialize,I=e.onIframeLoad,R=e.iframeLoadTimeout,A=void 0===R?5e3:R,E=e.onIframeListenerRegistered,L=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,P=void 0===O?5e3:O,D=e.keepIframeSrcFn,N=void 0===D?()=>!1:D,F=e.newlyAddedElement,q=void 0!==F&&F,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?50:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return wo=!0,bo||(bo=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=fo(t,o,s,void 0===z)),Kn>0&&(ea.nodeCount+=1);var Z,G=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,a=e.needsMask,o=e.inlineStylesheet,s=e.maskInputOptions,u=void 0===s?{}:s,l=e.maskTextFn,h=e.maskInputFn,c=e.maskAllElementAttributes,d=void 0!==c&&c,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,w=e.newlyAddedElement,k=void 0!==w&&w,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:On.Document,childNodes:[],compatMode:t.compatMode}:{type:On.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:On.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,a=void 0===n?{}:n,o=e.maskInputFn,s=e.maskAllElementAttributes,u=void 0!==s&&s,l=e.maskAttributeFn,h=e.dataURLOptions,c=void 0===h?{}:h,d=e.inlineImages,v=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=qa(t.tagName);return ro.test(e)?"div":e}(t),k=new Set,_={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];co(w,C.name)||(_[C.name]=ho(r,w,qa(C.name),C.value,t,c))}if("link"===w&&i&&!b){var M=t.sheet;if(!M){var T=function(t){return t.href}(t);T&&!(M=mo(r,T))&&T.includes(".css")&&(M=mo(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;M&&(ma(M)?Kn>0&&(na.push(t),aa+=1):I=Ia(M)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===w&&t.sheet&&!(t.innerText||Wn.textContent(t)||"").trim().length){var R=pa((()=>Ia(t.sheet)));R&&(_._cssText=R)}if("input"===w||"textarea"===w||"select"===w){var A=t.value,E=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&A?_.value=Fa({element:t,type:Ua(t),tagName:w,value:A,maskInputOptions:a,maskInputFn:o}):E&&(_.checked=E)}if("option"===w&&(t.selected&&!a.select?_.selected=!0:delete _.selected),"dialog"===w&&t.open){try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}k.add("rr_open_mode")}if("canvas"===w&&v&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((Ha in n?n[Ha]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height,L!==O.toDataURL(c.type,c.quality)&&(_.rr_dataURL=L)}var P,D,N=!1;if("img"===w&&d){Ga||(Ga=r.createElement("canvas"),Qa=Ga.getContext("2d"));var F=t,q=F.currentSrc||F.getAttribute("src")||"<unknown-src>",j=F.crossOrigin,B=(e,r)=>N?Ba({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,H=()=>{po(F,"load",H);try{Ga.width=F.naturalWidth,Ga.height=F.naturalHeight,Qa.drawImage(F,0,0);var t=Ga.toDataURL(c.type,c.quality);_.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==F.crossOrigin)return F.crossOrigin="anonymous",void(F.complete&&0!==F.naturalWidth?H():F.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===F.crossOrigin&&(j?_.crossOrigin=B("crossOrigin",j):F.removeAttribute("crossorigin"))};F.complete&&0!==F.naturalWidth?H():F.addEventListener("load",H)}if("audio"===w||"video"===w){var U=_;U.rr_mediaState=t.paused?"paused":"played",k.add("rr_mediaState"),U.rr_mediaCurrentTime=t.currentTime,U.rr_mediaPlaybackRate=t.playbackRate,U.rr_mediaMuted=t.muted,U.rr_mediaLoop=t.loop,U.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),b){var z,W,V,Z=t.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,Y=Z.top,K=null===(z=r.defaultView)||void 0===z?void 0:z.getComputedStyle(t);_={class:_.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=r.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(Y+((null===(V=r.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},k.add("rr_width"),k.add("rr_height"),k.add("rr_left"),k.add("rr_top"),K&&(_.rr_position=K.position||"static",k.add("rr_position"),K.transform&&"none"!==K.transform&&(_.rr_transform=K.transform,k.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(_.rr_display=K.display,k.add("rr_display")))}if("iframe"!==w||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src),u||l)for(var X of Object.entries(_)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(_[tt]=Ba({element:t,name:tt,value:et,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:k.has(tt)}))}N=!0;try{customElements.get(w)&&(P=!0)}catch(t){}return{type:On.Element,tagName:w,attributes:_,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:P}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,a=Wn.parentNode(t),o=a&&a.tagName,s=Wn.textContent(t),u="STYLE"===o||void 0,l="SCRIPT"===o||void 0;if(u&&s){try{var h;if(t.nextSibling||t.previousSibling);else if(ma(a.sheet));else if(null===(h=a.sheet)||void 0===h?void 0:h.cssRules){var c=Ia(a.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(s=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}s=Za(s,uo(e.doc))}return l&&(s="SCRIPT_PLACEHOLDER"),!u&&!l&&s&&r&&(s=i?i(s,Wn.parentElement(t)):s.replace(/[\S]/g,"*")),{type:On.Text,textContent:s||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:On.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:On.Comment,textContent:Wn.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:N,newlyAddedElement:q});if(!G)return console.warn(t,"not serialized"),null;Z=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===On.Comment)return!0;if(t.type===On.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,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(yo(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===yo(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(yo(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&yo(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(yo(t.attributes.property).match(/^(og|twitter|fb):/)||yo(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===yo(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(yo(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(yo(t.attributes.name))||yo(t.attributes.property).match(/^article:/)||yo(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(yo(t.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===On.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?-2:io();var Q=Object.assign(G,{id:Z});if(i.add(t,Q),-2===Z)return null;T&&T(t);var J=!l;if(Q.type===On.Element){J=J&&!Q.needBlock,delete Q.needBlock;var Y=Wn.shadowRoot(t);Y&&xa(Y)&&(Q.isShadowHost=!0)}if((Q.type===On.Document||Q.type===On.Element)&&J){b.headWhitespace&&Q.type===On.Element&&"head"===Q.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B+1,maxDepth:U};if(Q.type===On.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Wn.childNodes(t))){var tt=ko(X,K);tt&&Q.childNodes.push(tt)}var et=null;if(_a(t)&&(et=Wn.shadowRoot(t)))for(var rt of Array.from(Wn.childNodes(et))){var it=ko(rt,K);it&&(xa(et)&&(it.isShadow=!0),Q.childNodes.push(it))}}var nt=Wn.parentNode(t);if(nt&&Sa(nt)&&xa(nt)&&(Q.isShadow=!0),Q.type===On.Element&&"iframe"===Q.tagName){var at=function(t,e,r){var i,n=()=>{},a=t.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),po(t,"load",h),t.addEventListener("load",o),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?po(t,"load",o):(s=!0,po(t,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),po(t,"load",o)}}return t.addEventListener("load",o),()=>{po(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=ko(e,{doc:e,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B+1,maxDepth:U});r&&I(t,r)}}),A);null==E||E(t,at)}return Q.type===On.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,u,l){if(!go.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var e=ko(t,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B,maxDepth:U});e&&L(t,e)}})()}finally{go.delete(e),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",w,{signal:d.signal,once:!0}),go.set(e,d)}}}(t,0,P),Q}function _o(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 So=class t{constructor(){ka(this,"parentElement",null),ka(this,"parentNode",null),ka(this,"ownerDocument",void 0),ka(this,"firstChild",null),ka(this,"lastChild",null),ka(this,"previousSibling",null),ka(this,"nextSibling",null),ka(this,"ELEMENT_NODE",1),ka(this,"TEXT_NODE",3),ka(this,"nodeType",void 0),ka(this,"nodeName",void 0),ka(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;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 xo(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Co(r,t,e,i)}function Co(t,e,r,i){Mo((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Mo(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var To="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.",Io={map:{},getId(){return console.error(To),-1},getNode(){return console.error(To),null},removeNodeFromMap(){console.error(To)},has(){return console.error(To),!1},reset(){console.error(To)}};function Ro(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function Ao(t,e,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(t){return}a.set.call(this,t)}}}),()=>Ao(t,e,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Io=new Proxy(Io,{get(t,e,r){return"map"===e&&console.error(To),Reflect.get(t,e,r)}}));var Eo=Date.now;function Lo(t){var e,r,i,n,a=t.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null===(e=Wn.parentElement(a.body))||void 0===e?void 0:e.scrollLeft)||(null==a||null===(r=a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null===(i=Wn.parentElement(a.body))||void 0===i?void 0:i.scrollTop)||(null==a||null===(n=a.body)||void 0===n?void 0:n.scrollTop)||0}}function Oo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Po(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Do(t){return t?t.nodeType===t.ELEMENT_NODE?t:Wn.parentElement(t):null}function No(t,e,r,i){if(!t)return!1;var n=Do(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(vo(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Fo(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function qo(t,e){if(Sa(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Wn.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||qo(i,e))}function jo(t){return Boolean(t.changedTouches)}function Bo(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ho(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Uo(t){return!!t&&(t instanceof So&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Wn.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Eo=()=>(new Date).getTime());var $o=class{constructor(){ka(this,"id",1),ka(this,"styleIDMap",new WeakMap),ka(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 zo(t){var e,r=null;return"getRootNode"in t&&(null===(e=Wn.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wn.host(Wn.getRootNode(t))&&(r=Wn.host(Wn.getRootNode(t))),r}function Wo(t){var e=t.ownerDocument;return!!e&&(Wn.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=zo(r);)r=e;return r}(t);return Wn.contains(e,r)}(t))}function Vo(t){return"__ln"in t}var Zo,Go=class{constructor(){ka(this,"length",0),ka(this,"head",null),ka(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Vo(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Vo(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}},Qo=(t,e)=>t+"@"+e,Jo=class{constructor(){ka(this,"frozen",!1),ka(this,"locked",!1),ka(this,"texts",[]),ka(this,"attributes",[]),ka(this,"attributeMap",new WeakMap),ka(this,"generatedAttributes",new WeakMap),ka(this,"removes",[]),ka(this,"mapRemoves",[]),ka(this,"movedMap",{}),ka(this,"addedSet",new Set),ka(this,"movedSet",new Set),ka(this,"droppedSet",new Set),ka(this,"removesSubTreeCache",new Set),ka(this,"mutationCb",void 0),ka(this,"blockClass",void 0),ka(this,"blockSelector",void 0),ka(this,"maskTextClass",void 0),ka(this,"maskTextSelector",void 0),ka(this,"inlineStylesheet",void 0),ka(this,"maskInputOptions",void 0),ka(this,"maskTextFn",void 0),ka(this,"maskInputFn",void 0),ka(this,"maskAllElementAttributes",void 0),ka(this,"maskAttributeFn",void 0),ka(this,"keepIframeSrcFn",void 0),ka(this,"recordCanvas",void 0),ka(this,"canvasMaskingConfigured",void 0),ka(this,"inlineImages",void 0),ka(this,"slimDOMOptions",void 0),ka(this,"dataURLOptions",void 0),ka(this,"doc",void 0),ka(this,"mirror",void 0),ka(this,"iframeManager",void 0),ka(this,"stylesheetManager",void 0),ka(this,"shadowDomManager",void 0),ka(this,"canvasManager",void 0),ka(this,"processedNodeManager",void 0),ka(this,"unattachedDoc",void 0),ka(this,"canvasManagerReleased",!1),ka(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),ka(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=Zn(),i=Jn();try{this.processBufferedMutations()}finally{t=Zn()-r,e=i,Kn>0||Yn(t,null!=e?e:Gn)||t>sa.slowestBatchMs&&(sa.slowestBatchMs=t)}}})),ka(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new Go,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var a=Wn.parentNode(n);if(a&&Wo(n)&&"TEXTAREA"!==a.tagName){var o=Sa(a)?this.mirror.getId(zo(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=ko(n,{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=>{Bo(t,this.mirror)&&this.iframeManager.addIframe(t),Ho(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Uo(t)&&!No(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Wn.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)}});u&&(t.push({parentId:o,nextId:s,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Ko(this.removesSubTreeCache,a)&&!this.movedSet.has(Wn.parentNode(a))||n(a);for(var o of this.addedSet)Xo(this.droppedSet,o)||Ko(this.removesSubTreeCache,o)?Xo(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(Wn.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(Wn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=Wn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Wn.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Wn.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var a,o=n[0],s=n[1];"string"!=typeof s&&null!==s||(e[o]=Ba({element:t.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(a=this.generatedAttributes.get(t.node))||void 0===a?void 0:a.has(o)}))}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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)})),ka(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),ka(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(Wn.childNodes(t),(t=>Wn.textContent(t)||"")).join("");e.attributes.value=Fa({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Ua(t),value:r,maskInputFn:this.maskInputFn})})),ka(this,"processMutation",(t=>{if(!Fo(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Wn.textContent(t.target);No(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:fo(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Do(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,a),s=a?i.getAttributeNS(a,n):t.target.getAttribute(n);if("value"===o){var u=i,l=Ua(u);s=Fa({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:s,maskInputFn:this.maskInputFn})}if(No(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;var h=this.attributeMap.get(t.target),c="IFRAME"===i.tagName&&"src"===o;if(c&&!this.keepIframeSrcFn(s)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!co(i.tagName,o)){var d,v=ho(this.doc,qa(i.tagName),qa(o),s,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(s)&&(o="rr_src"),h.attributes[o]=v,null===(d=this.generatedAttributes.get(t.target))||void 0===d||d.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(No(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=>{var r=this.mirror.getId(e),i=Sa(t.target)?this.mirror.getId(Wn.host(t.target)):this.mirror.getId(t.target);No(t.target,this.blockClass,this.blockSelector,!1)||Fo(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yo(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||qo(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Qo(r,i)]?Yo(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Sa(t.target)||!xa(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),Wn.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),ka(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(Fo(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Qo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);No(t,this.blockClass,this.blockSelector,!1)||(Wn.childNodes(t).forEach((t=>this.genAdds(t))),Uo(t)&&Wn.childNodes(Wn.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}};function Yo(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),Wn.childNodes(i).forEach((t=>r.push(t)))}}function Ko(t,e,r){return 0!==t.size&&function(t,e,r){var i=Wn.parentNode(e);return!!i&&t.has(i)}(t,e)}function Xo(t,e){if(0===t.size)return!1;for(var r=Wn.parentNode(e);r;){if(t.has(r))return!0;r=Wn.parentNode(r)}return!1}var ts=function(t,e){return void 0===e&&(e="rrweb"),Zo?function(){try{return t(...arguments)}catch(t){if(Zo&&!0===Zo(t,e))return;throw t}}:t},es=[];function rs(t){try{if("composedPath"in t){var 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 is(t,e){var r,i=new Jo;i.init(t);try{r=new($n())(ts(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),es.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function ns(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.sampling,s=new Map,u=t=>{var o=rs(t);if(o&&!No(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=Lo(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),e({id:h,x:u,y:l}))}},l=[xo("scroll",ts(Ro(ts((t=>u(t))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(xo("scrollend",ts(u),r)),()=>l.forEach((t=>t()))}function as(t,e){for(var r=es.length-1;r>=0;r--){var i=es[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),es.splice(r,1))}}}var os=["INPUT","TEXTAREA","SELECT"],ss=new WeakMap;function us(t){return function t(e,r){if(vs("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||vs("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||vs("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||vs("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ls(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var hs=5e3;function cs(t,e){var r,i,n,a=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Wn.host(e));var o="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,s=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&s?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null===(t=s.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=s.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{a.adoptStyleSheets(t,n)}catch(t){}return e}}),ts((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))):()=>{}}function ds(t,e){void 0===e&&(e={});var r,i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,a=t.scrollCb,o=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,c=t.canvasMutationCb,d=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),a(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),s(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var a=[],o=ts((()=>{if(i){i.destroy(),i.reset();var e=es.indexOf(i);-1!==e&&es.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),a.forEach((t=>t()))}));try{if(t.recordDOM){var s=is(t,t.doc);r=s.observer,i=s.buffer}if(a.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Ro(ts((t=>{var r=Date.now()-a;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],a=null})),s),h=ts(Ro(ts((t=>{var e=rs(t),r=jo(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=Eo()),u.push({x:i,y:o,id:n.getId(e),timeOffset:Eo()-a}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?In.Drag:t instanceof MouseEvent?In.MouseMove:In.TouchMove)})),o,{trailing:!1})),c=[xo("mousemove",h,i),xo("touchmove",h,i),xo("drag",h,i)];return ts((()=>{c.forEach((t=>t()))}))}(t)),a.push(function(t){var e=t.mouseInteractionCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(Rn).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t])).forEach((t=>{var o=qa(t),s=(t=>r=>{var o=rs(r);if(!No(o,n,a,!0)){var s=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":s=An.Mouse;break;case"touch":s=An.Touch;break;case"pen":s=An.Pen}s===An.Touch&&(Rn[t]===Rn.MouseDown?u="TouchStart":Rn[t]===Rn.MouseUp&&(u="TouchEnd"))}else jo(r)&&(s=An.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===An.Touch||u.startsWith("Mouse")&&s===An.Mouse)&&(s=null)):Rn[t]===Rn.Click&&(s=l,l=null);var c=jo(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;ts(e)(h({type:Rn[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(t);if(window.PointerEvent)switch(Rn[t]){case Rn.MouseDown:case Rn.MouseUp:o=o.replace("mouse","pointer");break;case Rn.TouchStart:case Rn.TouchEnd:return}u.push(xo(o,s,r))})),ts((()=>{u.forEach((t=>t()))}))}(t)),a.push(ns(t)),a.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,a=-1;return xo("resize",ts(Ro(ts((()=>{var t=Oo(),e=Po();n===t&&a===e||(r({width:Number(e),height:Number(t)}),n=t,a=e)})),200)),i)}(t,{win:n})),a.push(function(t){var e=t.inputCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.ignoreClass,s=t.ignoreSelector,u=t.maskInputOptions,l=t.maskInputFn,c=t.userTriggeredOnInput;function d(t){var e=rs(t),i=t.isTrusted,h=r.defaultView;if(!e||!h||e instanceof h.HTMLElement){var d=e&&e.tagName;if(e&&"OPTION"===d&&(e=Wn.parentElement(e)),e&&d&&os.indexOf(d)>=0&&!No(e,n,a,!0)&&!(e.classList.contains(o)||s&&e.matches(s))){var f=e.value,p=!1,g=Ua(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[d.toLowerCase()]||u[g])&&(f=Fa({element:e,maskInputOptions:u,tagName:d,type:g,value:f,maskInputFn:l})),v(e,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,r){var n=ss.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){ss.set(t,r);var a=i.getId(t);ts(e)(h({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>xo(t,ts(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>Ao(t[0],t[1],{set(){ts(d)({target:this,isTrusted:!1})}},!1,p)))),ts((()=>{f.forEach((t=>t()))}))}(t)),a.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,a=t.sampling,o=t.doc,s=ts((t=>Ro(ts((a=>{var o=rs(a);if(o&&!No(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;e({type:t,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[xo("play",s(Ln.Play),o),xo("pause",s(Ln.Pause),o),xo("seeked",s(Ln.Seeked),o),xo("volumechange",s(Ln.VolumeChange),o),xo("ratechange",s(Ln.RateChange),o)];return ts((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var u=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},a=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),a(t)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=e.get(o);l||e.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=t.setTimeout(f,hs),d||v?t.clearTimeout(c):r.add(c)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==c&&(t.clearTimeout(c),r.delete(c)),d?e&&n(u):(h.ready=!0,e||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(n);a.push(u.reset),a.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,a=e.win,o=e.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(t){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=ls(e,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(e,(()=>r({id:c,styleId:d,replace:s})),(()=>{var t=Ia(e);null!==t&&r({id:c,styleId:d,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};fs("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(fs("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),fs("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),fs("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((t=>{var e=t[0],a=t[1];d[e]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[e].insertRule,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e.parentStyleSheet);var l=ls(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...us(e),u];o.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e.parentStyleSheet);var l=ls(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...us(e),s];o.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),ts((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:n,mutationQueue:u})),a.push(cs(t,t.doc)),a.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,a=t.stylesheetManager,o=e.win,s=e.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:ts(((t,e,o)=>{var u,l=o[0],h=o[1],c=o[2],d=t.apply(e,o);if(n.has(l))return d;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=ls(v,i,a.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=us(e.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ts(((t,e,o)=>{var u,l=o[0],h=t.apply(e,o);if(n.has(l))return h;var c=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=ls(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=us(e.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),ts((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n,mutationQueue:u})),t.collectFonts&&a.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return a.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var s=zn(r.fonts,"add",(function(t){return function(r){return setTimeout(ts((()=>{var t=a.get(r);t&&(e(t),a.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),ts((()=>{n.forEach((t=>t()))}))}(t))}for(var l of(a.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,a=t.selectionCb,o=!0,s=ts((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),c=h.startContainer,d=h.startOffset,v=h.endContainer,f=h.endOffset;No(c,i,n,!0)||No(v,i,n,!0)||s.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}a({ranges:s})}}));return s(),xo("selectionchange",s)}(t)),a.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?zn(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))a.push(l.observer(l.callback,n,l.options))}catch(t){try{o()}catch(t){}throw t}return o}function vs(t){return void 0!==window[t]}function fs(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var ps=class{constructor(t){ka(this,"generateIdFn",void 0),ka(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ka(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),a=i||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),a.set(o,e)),o}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},gs=class{constructor(t){ka(this,"iframes",new WeakMap),ka(this,"crossOriginIframeMap",new WeakMap),ka(this,"crossOriginIframeMirror",new ps(io)),ka(this,"crossOriginIframeStyleMirror",void 0),ka(this,"crossOriginIframeRootIdMap",new WeakMap),ka(this,"mirror",void 0),ka(this,"mutationCb",void 0),ka(this,"wrappedEmit",void 0),ka(this,"loadListener",void 0),ka(this,"pageHideListener",void 0),ka(this,"stylesheetManager",void 0),ka(this,"recordCrossOriginIframes",void 0),ka(this,"messageHandler",void 0),ka(this,"nestedIframeListeners",new Map),ka(this,"attachedWindows",new WeakMap),ka(this,"attachedDocuments",new WeakMap),ka(this,"attachedIframes",new Map),ka(this,"loadListenerDisposers",new WeakMap),ka(this,"iframeElementsById",new Map),ka(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ps(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){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Mo(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Co(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=t.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);Mo((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(a)}))}Mo((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null===(r=this.loadListener)||void 0===r||r.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case Tn.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Tn.IncrementalSnapshot,data:{source:In.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Tn.Meta:case Tn.Load:case Tn.DomContentLoaded:return!1;case Tn.Plugin:return e;case Tn.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Tn.IncrementalSnapshot:switch(e.data.source){case In.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 In.Drag:case In.TouchMove:case In.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case In.ViewportResize:return!1;case In.MediaInteraction:case In.MouseInteraction:case In.Scroll:case In.CanvasMutation:case In.Input:return this.replaceIds(e.data,t,["id"]),e;case In.StyleSheetRule:case In.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case In.Font:return e;case In.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case In.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===On.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Co(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Co(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((t=>{Mo((()=>this.mirror.removeNodeFromMap(t)))})),Mo((()=>as(r,a))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Co(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Co(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),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}},ms=class{constructor(t){ka(this,"shadowDoms",new WeakSet),ka(this,"mutationCb",void 0),ka(this,"scrollCb",void 0),ka(this,"bypassOptions",void 0),ka(this,"mirror",void 0),ka(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 r,i;if(xa(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(r=null===(i=Wn.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==r?r:e,a=is(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var t=es.indexOf(s);-1!==t&&es.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:ns(h({},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(Wn.host(t))),this.restoreHandlers.push({doc:n,handler:cs({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){var r=this;this.restoreHandlers.push({doc:e,handler:zn(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),a=Wn.shadowRoot(this);return a&&Wo(this)&&r.addShadowRoot(a,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},ys="skip-frame";function bs(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ks="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_s=0;64>_s;_s++)ks[ws.charCodeAt(_s)]=_s;var Ss=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=ws[r[e]>>2],n+=ws[(3&r[e])<<4|r[e+1]>>4],n+=ws[(15&r[e+1])<<2|r[e+2]>>6],n+=ws[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},xs=new Map,Cs=(t,e,r)=>{if(t&&(Is(t,e)||"object"==typeof t)){var i=function(t,e){var r=xs.get(t);return r||xs.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Ms(t,e,r,i){return t instanceof Array?t.map((t=>Ms(t,e,r,i))):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Ss(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Ms(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ms(t.data,e,r,i),t.width,t.height]}:Is(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Cs(t,e,r)}:t}var Ts=(t,e,r,i)=>t.map((t=>Ms(t,e,r,i))),Is=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Rs=["webgl","webgl2"];function As(t){return"nodeType"in t}function Es(t,e,r,i){var n=[];try{if(i){var a=function(t,e,r){var i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return zn(i.prototype,"configure",(function(i){return function(n){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||As(a)&&No(a,e,r,!0))return i.call(this,n);As(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(t,e,r);a&&n.push(a)}var o=zn(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var a=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!No(this,e,r,!0)&&("__context"in this||(this.__context=a),i&&Rs.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ls(t,e,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=zn(t,u,(function(t){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(Cs(c,a,this),this.canvas&&"tagName"in this.canvas&&!No(this.canvas,i,n,!0)){var d=Ts(l,a,this,o);r(this.canvas,{type:e,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=Ao(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!No(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var Os='(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',Ps="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Os],{type:"text/javascript;charset=utf-8"});function Ds(t){var e;try{if(!(e=Ps&&(self.URL||self.webkitURL).createObjectURL(Ps)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Os),{name:null==t?void 0:t.name})}}var Ns,Fs,qs,js=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){ka(this,"pendingCanvasMutations",new Map),ka(this,"rafStamps",{latestId:0,invokeId:null}),ka(this,"mirror",void 0),ka(this,"mutationCb",void 0),ka(this,"resetObservers",void 0),ka(this,"frozen",!1),ka(this,"locked",!1),ka(this,"rafIdTimestamp",null),ka(this,"rafIdFlush",null),ka(this,"refCount",0),ka(this,"torndown",!1),ka(this,"resetFrameDedup",null),ka(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)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,a=t.blockSelector,o=t.recordCanvas,s=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,r,i,n){var a=this;if("OffscreenCanvas"in e){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Es(e,r,i,!0),h=new Map;try{o=new Ds}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:En["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/t,f=0,p=t=>{var u,g;c||(f&&v>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{No(t,r,i,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),u).forEach(function(){var t=l((function*(t){var e=a.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,u=t.getContext(t.__context);if(null==u||null===(r=u.isContextLost)||void 0===r?void 0:r.call(u))return void h.set(e,!1);!1===(null==u||null===(i=u.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,c=t.clientHeight||t.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(t,e,r,i,n,a){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return ys}if(void 0!==o){if(!Array.isArray(o)||!o.every(bs))return ys;var s=r/n,u=i/a;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*s),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*s)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(n.canvasMasking,t,d,v,l,c);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:e,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(d),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Es(t,e,r,!1),a=function(t,e,r,i,n){var a=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=zn(e.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return No(this.canvas,r,i,!0)||setTimeout((()=>{var r=Ts(u,e,this,n);t(this.canvas,{type:En["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=Ao(e.CanvasRenderingContext2D.prototype,o,{set(e){No(this.canvas,r,i,!0)||t(this.canvas,{type:En["2D"],property:o,args:[e],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var a=[];return void 0!==e.WebGLRenderingContext&&a.push(...Ls(e.WebGLRenderingContext.prototype,En.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&a.push(...Ls(e.WebGL2RenderingContext.prototype,En.WebGL2,t,r,i,e,n)),()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Mn);return e}));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}},Bs=class{constructor(t){var e;ka(this,"trackedLinkElements",new WeakSet),ka(this,"pendingDeferredSheets",new Set),ka(this,"mutationCb",void 0),ka(this,"adoptedStyleSheetCb",void 0),ka(this,"maskAllElementAttributes",void 0),ka(this,"maskAttributeFn",void 0),ka(this,"styleMirror",new $o),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;var r=null,i=null;try{(i=t.sheet)&&(r=Da(i))}catch(t){}if(!r||!i)return ya(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Zn(),c=Jn(),d=!0;try{if(a)return s=!0,ya(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(ya(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(ya(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),Yn(u=Zn()-h,null!=(l=c)?l:Gn)||(ua.totalMs+=u,u>ua.slowestSliceMs&&(ua.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Ba({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],a=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var a=r.styleMirror.add(t);e=a;var o=Zn();try{pa((()=>{try{var e=t.rules||t.cssRules;e&&fa(e)}catch(t){}n.push({styleId:a,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Ra(e,t.href),index:r})))})}))}finally{ga(Zn()-o)}}i.styleIds.push(e)};for(var o of t)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),go.forEach((t=>t.abort())),go.clear()}trackStylesheetInLinkElement(t){}},Hs=class{constructor(){ka(this,"nodeMap",new WeakMap),ka(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}},Us=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var $s,zs=document.createElement("iframe");document.body.appendChild(zs),Array.from=(null===($s=zs.contentWindow)||void 0===$s?void 0:$s.Array.from)||Array.from,document.body.removeChild(zs)}}catch(t){console.debug("Unable to override Array.from",t)}var Ws=new Na,Vs=new Set([In.Mutation,In.MediaInteraction,In.StyleSheetRule,In.CanvasMutation,In.Font,In.Log,In.StyleDeclaration,In.AdoptedStyleSheet]);function Zs(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Gs(t){var e;void 0===t&&(t={});var r=t,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,R=r.maskAttributeFn,A=r.hooks,E=r.packFn,L=r.sampling,O=void 0===L?{}:L,P=r.dataURLOptions,D=void 0===P?{}:P,N=r.canvasResolutionScale,F=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,z=r.recordCrossOriginIframes,W=void 0!==z&&z,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,G=r.userTriggeredOnInput,Q=void 0!==G&&G,J=r.collectFonts,Y=void 0!==J&&J,K=r.inlineImages,X=void 0!==K&&K,tt=r.plugins,et=r.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=r.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,at=r.attributeFilter;Zo=r.errorHandler;var ot=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),st=!W||window.parent===window,ut=!1;if(!st)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(st&&!i)throw new Error("emit function is required");if(!st&&!ut)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Ws.reset();var lt,ht=!0===_?{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!==S?S:{password:!0},ct=_o(void 0!==x&&x);!function(t){void 0===t&&(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)}();var dt,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};Ns=(t,e)=>{var r,o=t;if(o.timestamp=Eo(),!(null===(r=es[0])||void 0===r?void 0:r.isFrozen())||o.type===Tn.FullSnapshot||o.type===Tn.IncrementalSnapshot&&Vs.has(o.data.source)||es.forEach((t=>t.unfreeze())),st)null==i||i(gt(o),e);else if(ut){var s={type:"rrweb",event:gt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(s,"*")}if(o.type===Tn.FullSnapshot)lt=o,ft=0;else if(o.type===Tn.IncrementalSnapshot){if(o.data.source===In.Mutation&&o.data.isAttachIframe)return;ft++,(a&&ft>=a||n&&o.timestamp-lt.timestamp>n)&&Fs(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var i of t.adds){var n=Ws.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=kt.getIframeElementById(i);n&&r.has(n)?kt.forgetIframeId(i):(null==dt||dt(i),kt.removeIframeById(i))}})),null==vt||vt(),kt.cleanupDetachedIframes()}Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Mutation},t)})},yt=t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Scroll},t)}),bt=t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.CanvasMutation},t)}),wt=new Bs({mutationCb:mt,adoptedStyleSheetCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:R}),kt=new gs({mirror:Ws,mutationCb:mt,stylesheetManager:wt,recordCrossOriginIframes:W,wrappedEmit:Ns});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:Ws,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new Hs,xt=null==F?void 0:F.configured;qs=new js({recordCanvas:U,mutationCb:bt,win:window,blockClass:s,blockSelector:l,mirror:Ws,sampling:O.canvas,dataURLOptions:ot,resolutionScale:N,canvasMasking:F});var Ct=new ms({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:ct,iframeManager:kt,stylesheetManager:wt,canvasManager:qs,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:at},mirror:Ws});Fs=function(t){if(void 0===t&&(t=!1),B){ha(k);try{Ns({type:Tn.Meta,data:{href:window.location.href,width:Po(),height:Oo()}},t),null==e||e.cancel(),e=void 0,wt.reset(),Ct.init(),es.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new Na:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,R=r.preserveWhiteSpace,A=r.onSerialize,E=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,P=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,F=void 0===N?()=>!1:N,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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===k?{password:!0}:k,H=_o(void 0!==T&&T);ha(j);try{return ko(t,{doc:t,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:R,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:P,stylesheetLoadTimeout:D,keepIframeSrcFn:F,newlyAddedElement:!1,maxDepth:q})}finally{ca()}}(document,{mirror:Ws,blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,slimDOM:ct,dataURLOptions:ot,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Bo(t,Ws)&&kt.addIframe(t),Ho(t,Ws)&&wt.trackLinkElement(t),Uo(t)&&Ct.addShadowRoot(Wn.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){wt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{a=na,na=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(Ns({type:Tn.FullSnapshot,data:{node:i,initialOffset:Lo(window)}},t),es.forEach((t=>t.unlock())),qs.onFullSnapshot(),r.length){var n=function(t,e,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||t.length>a,u=()=>{var r=t[a];t[a]=null,a+=1,r&&Mo((()=>{o=e.beginDeferredLinkInlining(r,Ws.getId(r))}))},l=()=>{if(o){var t=o,e=!0;Mo((()=>{e=t.advance(200)})),e&&(o=null)}},h=t=>{if(n=null,!i){var e=0;do{try{o||u(),l()}catch(t){null==o||o.discard(),o=null,ba(1)}e+=1}while(!i&&s()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(s()?n=Zs(h):r())}};return n=Zs(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;s()&&50>e;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-e)c.discard(),o=null,h+=1;else{try{l()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;t.length>v;v++)null!==t[v]&&(d+=1);ba(d),null==o||o.discard(),o=null}r()}}}}(r,wt,(()=>{e===n&&(e=void 0)}));e=n}W&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&wt.adoptStyleSheets(document.adoptedStyleSheets,Ws.getId(document))}finally{ca()}var a}};try{var Mt=[];for(var Tt of(Mt.push(xo("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Mt.push(xo(Tt,Qn,document));dt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Mo(t);var e=Mt.indexOf(t);-1!==e&&Mt.splice(e,1)})),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=Ws.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var It=t=>{var e;return ts(ds)({mutationCb:mt,mousemoveCb:(t,e)=>Ns({type:Tn.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.ViewportResize},t)}),inputCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Input},t)}),mediaInteractionCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.MediaInteraction},t)}),styleSheetRuleCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.StyleSheetRule},t)}),styleDeclarationCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Font},t)}),selectionCb(t){Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Selection},t)})},customElementCb(t){Ns({type:Tn.IncrementalSnapshot,data:h({source:In.CustomElement},t)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:Y,doc:t,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:R,keepIframeSrcFn:rt,blockSelector:l,slimDOMOptions:ct,dataURLOptions:ot,mirror:Ws,iframeManager:kt,stylesheetManager:wt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:qs,ignoreCSSAttributes:nt,attributeFilter:at,plugins:(null==tt||null===(e=tt.filter((t=>t.observer)))||void 0===e?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ns({type:Tn.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},A)};kt.addLoadListener((t=>{try{var e=Ws.getId(t),r=It(t.contentDocument);if("function"==typeof r&&(Mt.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),kt.addPageHideListener((t=>{var e=Ws.getId(t);null==dt||dt(e),as(t)}));var Rt=-1,At=t=>Ns({type:Tn.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,a=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=a?Ws.getId(a):-1;o!==Rt&&(-1!==Rt&&At({id:Rt,enter:!1}),Rt=o,-1!==o&&At({id:o,enter:!0}))},Lt=()=>{Fs();var t=It(document);"function"==typeof t&&Mt.push(t),Mt.push(xo("fullscreenchange",Et)),Mt.push(xo("webkitfullscreenchange",Et)),Mt.push(xo("mozfullscreenchange",Et)),Mt.push(xo("MSFullscreenChange",Et)),Us=!0};return["interactive","complete"].includes(document.readyState)?Lt():(Mt.push(xo("DOMContentLoaded",(()=>{Ns({type:Tn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Lt()}))),Mt.push(xo("load",(()=>{Ns({type:Tn.Load,data:{}}),"load"===Z&&Lt()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Mt.forEach((t=>Mo(t))),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),Ws.reset(),Us=!1,Zo=void 0}}catch(t){console.warn(t)}}function Qs(t){return Qs="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},Qs(t)}function Js(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Qs(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Qs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Qs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Gs.addCustomEvent=(t,e)=>{if(!Us)throw new Error("please add custom event after start recording");Ns({type:Tn.Custom,data:{tag:t,payload:e}})},Gs.freezePage=()=>{es.forEach((t=>t.freeze()))},Gs.takeFullSnapshot=t=>{if(!Us)throw new Error("please take full snapshot after start recording");Fs(t)},Gs.mirror=Ws,"Mobile".toLowerCase(),"Tablet".toLowerCase();var Ys=class{constructor(t){Js(this,"fileName",void 0),Js(this,"functionName",void 0),Js(this,"lineNumber",void 0),Js(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},Ks=/(^|@)\S+:\d+/,Xs=/^\s*at .*(\S+:\d+|\(native\))/m,tu=/^(eval@)?(\[native code])?$/,eu={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Xs)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(Xs)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Ys({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(tu)}),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 Ys({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ys({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Ys({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Ys({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ks)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Ys({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ru(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function iu(t){return Array.isArray(t)}function nu(t){return"object"==typeof t&&null!==t&&!iu(t)}function au(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(nu(t[i])&&au(t[i],e-1))return!0;return!1}function ou(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(nu(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||nu(o)&&au(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var u in e){var l=e[u];s[u]=iu(l)?ru(l.length?l[0]:null):l}return s}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 su={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 uu(t,e,r){var i,n=r?Object.assign({},su,r):su,a=n.logger;if(!a)return()=>{};i="string"==typeof a?e[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:eu.parse(e.error).map((t=>t.toString())),payload:[ou(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[ou("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[ou("Uncaught (in promise)",n.stringifyOptions),ou(e.reason,n.stringifyOptions)]),t({level:"error",trace:eu.parse(r).map((t=>t.toString())),payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?function(e,a,u){try{if(!(a in e))return()=>{};var l=e[a],h={next:l},c=(e=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=eu.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>ou(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[ou("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{s=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[a]=c,()=>{if(e[a]!==c)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[a],i=t(r);i;){if(i.next===c)return void(i.next=h.next);i=t(r=i.next)}else e[a]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var lu=t=>({name:"rrweb/console@1",observer:uu,options:t}),hu=t=>"u">typeof Document&&t instanceof Document,cu=()=>{},du=t=>{var e;if(k(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function vu(t,e,r){try{if(!(e in t))return cu;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return k(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],a=du(r);a;){if(a.next===n)return void(a.next=i.next);a=du(r=a.next)}else t[e]=i.next}}catch(t){return cu}}function fu(t,e){var r,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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of e.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var pu=Ot("[Recorder]"),gu=t=>"navigation"===t.entryType,mu=t=>"resource"===t.entryType;function yu(t,e){return!!e&&(R(e)||e[t])}function bu(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var wu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ku(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!bu(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(wu))return!1;if(R(r))return!0;if(w(r))return n(r);var a=r[e];return R(a)?a:n(a)}function _u(t,e,r,i,n,a){return Su.apply(this,arguments)}function Su(){return Su=l((function*(t,e,r,i,n,a){if(void 0===a&&(a=0),a>10)return pu.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var a=t.length-1;a>=0;a-=1)if(mu(o=t[a])&&o.initiatorType===e&&(S(i)||o.startTime>=i)&&(S(n)||n>=o.startTime))return t[a];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*a))),_u(t,e,r,i,n,a+1))})),Su.apply(this,arguments)}function xu(t){var e=t.body,r=t.options,i=t.url;if(T(e))return null;var n=fu(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(x(e))return e;if(hu(e))return e.textContent;if(A(e))return jt(e);if(_(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Cu=t=>!M(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Mu(t){var e=t.entry,r=t.method,i=t.status,n=t.networkRequest,a=t.isInitial,o=t.start,s=t.end,u=t.url,l=t.initiatorType;o=e?e.startTime:o,s=e?e.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},e?e.toJSON():{name:u},{startTime:S(o)?void 0:Math.round(o),endTime:S(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(Cu(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Tu=["video/","audio/"];function Iu(t){return _(t)&&k(t.getReader)&&k(t.tee)}var Ru=500,Au="[SessionReplay] Timeout while trying to read body",Eu="[SessionReplay] Failed to read body";function Lu(t){return Eu+": "+t}function Ou(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Pu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Au)),Ru);try{t.clone().text().then((t=>e(t)),(t=>e(Lu(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Eu)}}))}(t);var r=be(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Ou(r)):function(t,e){return new Promise((r=>{var i,n=!1;function a(){try{var t;null==(t=i)||t.cancel().catch((()=>{}))}catch(t){}}function o(t){n||(n=!0,clearTimeout(u),a(),r(t))}var s,u=setTimeout((()=>o(Au)),Ru);try{s=t.clone()}catch(t){return void o(Eu)}var l=s.body;if(Iu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void o(Eu)}var h=[],c=0;!function t(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>e)return void o(Ou(e));c+=s.byteLength,h.push(s)}t()}}),(t=>o(Lu(t))))}()}else try{s.text().then((t=>o(t)),(t=>o(Lu(t))))}catch(t){o(Eu)}}))}(t,r)}function Du(){return Du=l((function*(t){var e=t.r,r=t.options,i=fu(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Pu(e,r)})),Du.apply(this,arguments)}function Nu(){return Nu=l((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Tu.some((t=>null==a?void 0:a.startsWith(t)));if(a&&o)return"Content-Type "+a+" is not supported";var s=fu(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return M(i)?Pu(e,r):Promise.resolve(i)})),Nu.apply(this,arguments)}var Fu=null;function qu(t,e,r){if(!("performance"in e))return()=>{};if(Fu)return pu.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},we,r):we,n=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var a=i.maskRequestFn(t);e||(n=!a||(t=>!!t&&Ie.has(t))(a)),a&&r.push(a)}})),r.length>0&&t(h({},e,{requests:r}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>gu(t)||mu(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Mu({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>gu(t)||mu(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Mu({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,e,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=yu("request",r.recordHeaders),n=yu("response",r.recordHeaders),a=vu(e.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},g={},m=c.setRequestHeader.bind(c);c.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=t=>(ku({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=xu({body:t,options:r,url:s})),d=e.performance.now(),y(t));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=e.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ku({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=xu({body:c.response,options:r,url:s})),_u(e,"xmlhttprequest",f.url,d,v).then((e=>{var r=Mu({entry:e,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(t){pu.error("Failed to instrument XHR for network capture",t)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,e,i),s=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=yu("request",r.recordHeaders),n=yu("response",r.recordHeaders),a=vu(e,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(t){return pu.error("Failed to instrument fetch for network capture",t),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),i&&(d.requestHeaders=v),!Iu(null==s?void 0:s.body)&&ku({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return Du.apply(this,arguments)}({r:u,options:r,url:o}))}catch(t){pu.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=bu(o)?yield a(u):yield a(o,s),c=e.performance.now();try{var f={};l.headers.forEach(((t,e)=>{f[e]=t})),n&&(d.responseHeaders=f),ku({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return Nu.apply(this,arguments)}({r:l,options:r,url:o}))}catch(t){pu.error("Failed to record fetch response for network capture",t)}return l}finally{_u(e,"fetch",u.url,h,c).then((e=>{var r,i=Mu({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(n,e,i)),Fu=()=>{a(),o(),s(),Fu=null}}var ju=t=>({name:"rrweb/network@1",observer:qu,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:lu,getRecordNetworkPlugin:ju},s.__PosthogExtensions__.rrweb={record:Gs,version:"v2",wasMaxDepthReached:()=>wo,resetMaxDepthState(){wo=!1,bo=!1},getLastSnapshotCost:()=>ra,getMutationCost:()=>h({},sa),resetSnapshotCostState(){Kn=0,Xn=0,ta=0,Gn=0,ea=Vn(),ra=null,ia=null,na=[],aa=0,oa=0,sa={slowestBatchMs:0},ua={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Gs,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:lu},s.getRecordNetworkPlugin=ju,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Cn(t,e);var Bu,Hu,Uu,$u,zu,Wu,Vu,Zu,Gu,Qu,Ju,Yu,Ku,Xu,tl,el={},rl=[],il=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nl=Array.isArray;function al(t,e){for(var r in e)t[r]=e[r];return t}function ol(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function sl(t,e,r){var i,n,a,o={};for(a in e)"key"==a?i=e[a]:"ref"==a?n=e[a]:o[a]=e[a];if(arguments.length>2&&(o.children=arguments.length>3?Bu.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===o[a]&&(o[a]=t.defaultProps[a]);return ul(t,o,i,n,null)}function ul(t,e,r,i,n){var a={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Uu:n,__i:-1,__u:0};return null==n&&null!=Hu.vnode&&Hu.vnode(a),a}function ll(t){return t.children}function hl(t,e){this.props=t,this.context=e}function cl(t,e){if(null==e)return t.__?cl(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?cl(t):null}function dl(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],a=al({},e);a.__v=e.__v+1,Hu.vnode&&Hu.vnode(a),_l(t.__P,a,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?cl(e):r,!!(32&e.__u),n),a.__v=e.__v,a.__.__k[a.__i]=a,xl(i,a,n),e.__e=e.__=null,a.__e!=r&&vl(a)}}function vl(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})),vl(t)}function fl(t){(!t.__d&&(t.__d=!0)&&$u.push(t)&&!pl.__r++||zu!=Hu.debounceRendering)&&((zu=Hu.debounceRendering)||Wu)(pl)}function pl(){try{for(var t,e=1;$u.length;)$u.length>e&&$u.sort(Vu),t=$u.shift(),e=$u.length,dl(t)}finally{$u.length=pl.__r=0}}function gl(t,e,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||rl,b=e.length;for(u=function(t,e,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),a=0;n>a;a++)null!=(o=e[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[a]=ul(null,o,null,null,null):nl(o)?o=t.__k[a]=ul(ll,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[a]=ul(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[a]=o,u=a+d,o.__=t,o.__b=t.__b+1,s=null,-1!=(l=o.__i=yl(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=cl(s)),Tl(s,s));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||el,v.__i=c,g=_l(t,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ml(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?(u=ml(v,u,t,m),m&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function ml(t,e,r,i){var n,a;if("function"==typeof t.type){for(n=t.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=t,e=ml(n[a],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=cl(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function yl(t,e,r,i){var n,a,o,s=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||e.length>a;)if(null!=(l=e[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function bl(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||il.test(e)?r:r+"px"}function wl(t,e,r,i,n){var a,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||bl(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||bl(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])a=e!=(e=e.replace(Ju,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=r,r?i?r[Qu]=i[Qu]:(r[Qu]=Yu,t.addEventListener(e,a?Xu:Ku,a)):t.removeEventListener(e,a?Xu:Ku,a);else{if("http://www.w3.org/2000/svg"==n)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==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function kl(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Gu])e[Gu]=Yu++;else if(r[Qu]>e[Gu])return;return r(Hu.event?Hu.event(e):e)}}}function _l(t,e,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=e.__e=r.__e]),(h=Hu.__b)&&h(e);t:if("function"==typeof C){c=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=e.__c=r.__c).__=d.__E:(b?e.__c=d=new C(y,w):(e.__c=d=new hl(y,w),d.constructor=C,d.render=Il),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=al({},d.__s)),al(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=e,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),e.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){e.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),rl.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,g)}))}if(d.context=w,d.props=y,d.__P=t,d.__e=!1,k=Hu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),rl.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=al(al({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===ll&&null==h.key?Cl(h.props.children):h,s=gl(t,nl(S)?S:[S],e,r,i,n,a,o,s,u,l),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(t){if(o.length=c,e.__v=null,u||null!=a)if(t.then){for(e.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),e.__e=s}else{if(null!=a)for(x=a.length;x--;)ol(a[x]);Sl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||Sl(e);Hu.__e(t,e,r)}}else null==a&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=function(t,e,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,g=r.props||el,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,a[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),s&&(Hu.__m&&Hu.__m(e,a),s=!1),a=null}if(null==y)g===m||s&&t.data==m||(t.data=m);else{if(a="textarea"==y&&null!=m.defaultValue?null:a&&Bu.call(t.childNodes),!s&&null!=a)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)v=g[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in m||"value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m||wl(t,l,null,v,n);for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||g[l]===v||wl(t,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),gl("template"==e.type?t.content:t,nl(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&cl(r,0),s,u),null!=a)for(l=a.length;l--;)ol(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&wl(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&wl(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,a,o,u,l);return(h=Hu.diffed)&&h(e),128&e.__u?void 0:s}function Sl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Sl))}function xl(t,e,r){for(var i=0;r.length>i;i++)Ml(r[i],r[++i],r[++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 Cl(t){return"object"!=typeof t||null==t||t.__b>0?t:nl(t)?t.map(Cl):void 0!==t.constructor?null:al({},t)}function Ml(t,e,r){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,r)}}function Tl(t,e,r){var i,n;if(Hu.unmount&&Hu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ml(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(n=0;i.length>n;n++)i[n]&&Tl(i[n],e,r||"function"!=typeof t.type);r||ol(t.__e),t.__c=t.__=t.__e=void 0}function Il(t,e,r){return this.constructor(t,r)}function Rl(t,e,r){var i,n,a;e==document&&(e=document.documentElement),Hu.__&&Hu.__(t,e),i=e.__k,n=[],a=[],_l(e,t=e.__k=sl(ll,null,[t]),i||el,el,e.namespaceURI,i?null:e.firstChild?Bu.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,a),xl(n,t,a),t.props.children=null}Bu=rl.slice,Hu={__e(t,e,r,i){for(var n,a,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Uu=0,hl.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=al({},this.state),"function"==typeof t&&(t=t(al({},r),this.props)),t&&al(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),fl(this))},hl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fl(this))},hl.prototype.render=ll,$u=[],Wu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vu=function(t,e){return t.__v.__b-e.__v.__b},pl.__r=0,Zu=Math.random().toString(8),Gu="__d"+Zu,Qu="__a"+Zu,Ju=/(PointerCapture)$|Capture$/i,Yu=0,Ku=kl(!1),Xu=kl(!0),tl=0;var Al,El,Ll,Ol,Pl=0,Dl=[],Nl=Hu,Fl=Nl.__b,ql=Nl.__r,jl=Nl.diffed,Bl=Nl.__c,Hl=Nl.unmount,Ul=Nl.__;function $l(t,e){Nl.__h&&Nl.__h(El,t,Pl||e),Pl=0;var r=El.__H||(El.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function zl(t){return Pl=1,function(t,e,r){var i=$l(Al++,2);if(i.t=t,!i.__c&&(i.__=[eh(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=El,!El.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),a){var s=a.call(this,t,e,r);return n?s||o:s}return!n||o};El.__f=!0;var a=El.shouldComponentUpdate,o=El.componentWillUpdate;El.componentWillUpdate=function(t,e,r){if(this.__e){var i=a;a=void 0,n(t,e,r),a=i}o&&o.call(this,t,e,r)},El.shouldComponentUpdate=n}return i.__N||i.__}(eh,t)}function Wl(t,e){var r=$l(Al++,3);!Nl.__s&&th(r.__H,e)&&(r.__=t,r.u=e,El.__H.__h.push(r))}function Vl(t){return Pl=5,Zl((function(){return{current:t}}),[])}function Zl(t,e){var r=$l(Al++,7);return th(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Gl(t){var e=El.context[t.__c],r=$l(Al++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(El)),e.props.value):t.__}function Ql(){for(var t;t=Dl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Kl),e.__h.some(Xl),e.__h=[]}catch(r){e.__h=[],Nl.__e(r,t.__v)}}}Nl.__b=function(t){El=null,Fl&&Fl(t)},Nl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ul&&Ul(t,e)},Nl.__r=function(t){ql&&ql(t),Al=0;var e=(El=t.__c).__H;e&&(Ll===El?(e.__h=[],El.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Ql(),Al=0)),Ll=El},Nl.diffed=function(t){jl&&jl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Dl.push(e)&&Ol===Nl.requestAnimationFrame||((Ol=Nl.requestAnimationFrame)||Yl)(Ql)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ll=El=null},Nl.__c=function(t,e){e.some((function(t){try{t.__h.some(Kl),t.__h=t.__h.filter((function(t){return!t.__||Xl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Nl.__e(r,t.__v)}})),Bl&&Bl(t,e)},Nl.unmount=function(t){Hl&&Hl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{Kl(t)}catch(t){e=t}})),r.__H=void 0,e&&Nl.__e(e,r.__v))};var Jl="function"==typeof requestAnimationFrame;function Yl(t){var e,r=function(){clearTimeout(i),Jl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Jl&&(e=requestAnimationFrame(r))}function Kl(t){var e=El,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),El=e}function Xl(t){var e=El;t.__c=t.__(),El=e}function th(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function eh(t,e){return"function"==typeof e?e(t):e}var rh={Tab:"tab",Selector:"selector"},ih={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},nh={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ah={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},oh={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},sh={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},uh="always",lh={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},hh={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},ch=Ot("[Surveys]"),dh=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),vh=t=>dh("seenSurvey_",t),fh=t=>{try{var e=vh(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){ch.error("Failed to persist survey seen state",t)}},ph=[ah.Popover,ah.Widget,ah.API];Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return I(t)&&isFinite(t)&&Math.floor(t)===t});class gh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new gh(n)}toString(){for(var t="",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 gh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class mh{generate(){var t=this.generateOrAbort();if(!S(t))return t;this.Kr=0;var e=this.generateOrAbort();if(S(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Kr)this.Kr=t,this.Xr();else{if(this.Kr>=t+1e4)return;this.ti++,this.ti>4398046511103&&(this.Kr++,this.Xr())}return gh.fromFieldsV7(this.Kr,Math.trunc(this.ti/Math.pow(2,30)),this.ti&Math.pow(2,30)-1,this.ei.nextUint32())}Xr(){this.ti=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Kr=0,this.ti=0,this.ei=new wh}}var yh,bh=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!S(t.crypto)&&crypto.getRandomValues&&(bh=t=>crypto.getRandomValues(t));class wh{nextUint32(){return this.De.length>this.ri||(bh(this.De),this.ri=0),this.De[this.ri++]}constructor(){this.De=new Uint32Array(8),this.ri=1/0}}var kh=()=>_h().toString(),_h=()=>(yh||(yh=new mh)).generate(),Sh=null,xh={ii(){if(!M(Sh))return Sh;var e=!0;if(S(t))e=!1;else try{var r="__mplssupport__";xh.ni(r,"xyz"),'"xyz"'!==xh.ai(r)&&(e=!1),xh.oi(r)}catch(t){e=!1}return e||Lt.error("localStorage unsupported; falling back to cookie store"),Sh=e,e},si(t){Lt.error("localStorage error: "+t)},ai(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){xh.si(t)}return null},ui(t){try{return JSON.parse(xh.ai(t))||{}}catch(t){}return null},ni(e,r){try{return null==t||t.localStorage.setItem(e,JSON.stringify(r)),!0}catch(t){xh.si(t)}return!1},oi(e){try{null==t||t.localStorage.removeItem(e)}catch(t){xh.si(t)}}},Ch=Ot("[Stylesheet Loader]"),Mh=t,Th=i,Ih="#020617",Rh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:ih.Right,widgetType:rh.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ih,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Ah=[ih.Center,ih.Left,ih.Right];function Eh(t){if(t.startsWith("#")){var 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 Lh(t){var e;void 0===t&&(t=Rh.backgroundColor),"#"===t[0]&&(e=Eh(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=Eh(r)),!e)return Ih;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?Ih:"white"}return Ih}var Oh=(t,e,r)=>{var i=Xh(t),n=Th.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=Th.createElement("div");((t,e,r)=>{var i=h({},Rh,r),n=t.style,a=!Ah.includes(i.position)||e===ah.Widget&&(null==r?void 0:r.widgetType)===rh.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var 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)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||Lh(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Lh(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Lh(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",Lh(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||Lh(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,t.type,t.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return k(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Ch.error("prepare_external_dependency_stylesheet returned null"),null)})(Th,':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(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return Th.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},Ph=t=>{var e=t.responses,r=t.survey,i=t.surveySubmissionId,n=t.posthog,a=t.isSurveyCompleted,o=t.properties,s=t.surveyLanguage,u=t.questionSnapshots;n?(fh(r),n.capture(lh.SENT,h({[hh.SURVEY_NAME]:r.name,[hh.SURVEY_ID]:r.id,[hh.SURVEY_ITERATION]:r.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[hh.SURVEY_SUBMISSION_ID]:i,[hh.SURVEY_COMPLETED]:a},s&&{[hh.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},li(e,r,u),o,{$set:{[hi(r,"responded")]:!0}})),a&&(Mh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Kh(r),n.reloadFeatureFlags())):ch.error("[survey sent] event not captured, PostHog instance not found.")},Dh=(t,e,r)=>{return h({[hh.SURVEY_NAME]:t.name,[hh.SURVEY_ID]:t.id,[hh.SURVEY_ITERATION]:t.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[hh.SURVEY_PARTIALLY_COMPLETED]:(i=null==e?void 0:e.responses,void 0===i&&(i={}),Object.values(i).some((t=>!T(t))))},(null==e?void 0:e.surveyLanguage)&&{[hh.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[hh.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},li(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var i},Nh=(t,e,r,i)=>{if(e){if(!r){var n=Jh(t),a=n?n.surveyLanguage:i;e.capture(lh.DISMISSED,h({},Dh(t,n,e),a&&{[hh.SURVEY_LANGUAGE]:a},{$set:{[hi(t,"dismissed")]:!0}})),Kh(t),fh(t),Mh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else ch.error("[survey dismissed] event not captured, PostHog instance not found.")},Fh=(t,e)=>{if(e){var r=(t=>dh("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Jh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(lh.ABANDONED,Dh(t,i,e),{transport:"sendBeacon"})}}else ch.error("[survey abandoned] event not captured, PostHog instance not found.")},qh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),jh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Bh=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Hh=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(r=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var r=new Map(t.questions.map((t=>[t.id,t]))),i=[];for(var n of e){var a=r.get(n);if(!a)return null;i.push(a)}return i})(t,e.questionOrder))&&void 0!==r?r:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?jh(t.questions,qh(t.questions)):t.questions;var r},Uh=t=>function(t){var e;return gi(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}(t)||Yh(t),$h=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,fl(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+tl++,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}),zh=()=>Gl($h),Wh=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,a,o,s=al({},t.props);for(a in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?n=e[a]:s[a]=void 0===e[a]&&null!=o?o[a]:e[a];return arguments.length>2&&(s.children=arguments.length>3?Bu.call(arguments,2):r),ul(t.type,s,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Vh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Bt(e);if(!n)return!1;var a=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return bi[o](a,[n])}function Zh(e){var i,n;return function(e,i){var n,o,s;if(!e||0===e.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==t||null==(o=t.screen)?void 0:o.width,screenHeight:null==t||null==(s=t.screen)?void 0:s.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},(v=function(t){return ot.test(t)?Q:at.test(t)?J:nt.test(t)?Y:new RegExp(tt,"i").test(t)?tt:new RegExp("("+K+"|WPDesktop)","i").test(t)?K:/iPad/.test(t)?V:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Z:st.test(t)?G:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(X,"i").test(t)?X:/(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(H).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)?U:W:new RegExp("(pda|"+H+")","i").test(t)?rt:new RegExp(z,"i").test(t)&&!new RegExp(z+" pc","i").test(t)?it:""}(a))===V||v===W||"Kobo"===v||"Kindle Fire"===v||v===it?z:v===Q||v===Y||v===J||v===tt?"Console":v===Z?"Wearable":v?H:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?H:z:"Desktop");return bi[null!=i?i:"icontains"](e,[f])}(null==(i=e.conditions)?void 0:i.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}var Gh=t=>dh("inProgressSurvey_",t),Qh=(t,e)=>{try{localStorage.setItem(Gh(t),JSON.stringify(e))}catch(t){ch.error("Error setting in-progress survey state in localStorage",t)}},Jh=t=>{try{var e=localStorage.getItem(Gh(t));if(e)return JSON.parse(e)}catch(t){ch.error("Error getting in-progress survey state from localStorage",t)}return null},Yh=t=>{var e=Jh(t);return!T(null==e?void 0:e.surveySubmissionId)},Kh=t=>{try{localStorage.removeItem(Gh(t))}catch(t){ch.error("Error clearing in-progress survey state from localStorage",t)}};function Xh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function tc(t,e,r){if(void 0===e&&(e=ih.Right),t===ah.ExternalSurvey)return{};switch(e){case ih.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ih.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ih.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ih.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ih.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ih.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ih.Left:return{left:"30px"};case ih.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===ah.Widget&&r===rh.Tab?"60px":"30px"}}}var ec=0;function rc(t,e,r,i,n,a){e||(e={});var o,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?o=e[s]:u[s]=e[s];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ec,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof t&&(o=t.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return Hu.vnode&&Hu.vnode(l),l}var ic=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),nc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),ac=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),oc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),sc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),uc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rc("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"})}),lc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rc("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"})}),hc=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return rc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[rc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),rc("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:r})]})},cc=rc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rc("g",{"clip-path":"url(#clip0_2415_6911)",children:[rc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:rc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),rc("g",{mask:"url(#mask0_2415_6911)",children:[rc("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"}),rc("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"}),rc("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"}),rc("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"}),rc("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"}),rc("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"})]})]}),rc("defs",{children:rc("clipPath",{id:"clip0_2415_6911",children:rc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function dc(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return rc("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",cc]})}function vc(e){var r=e.text,i=e.submitDisabled,n=e.appearance,a=e.onSubmit,o=e.link,s=e.onPreviewSubmit,u=e.skipSubmitButton,l=e.canGoBack,h=e.onBack,c=Gl($h).isPreviewMode,d=!!l&&!!h,v=!u&&rc("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():a()},children:r});return rc("div",{className:"bottom-section",children:[d?rc("div",{className:"form-buttons form-buttons-with-back",children:[rc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&rc(dc,{urlParams:{utm_source:"survey-footer"}})]})}function fc(t){var e=t.question,r=t.forceDisableHtml;return rc("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[rc(e.type===oh.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Wh({component:sl("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function pc(t){return rc("button",{className:"form-cancel",onClick:t.onClick,disabled:Gl($h).isPreviewMode,"aria-label":"Close survey",type:"button",children:hc({fill:"black"})})}rc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:rc("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var gc=t;function mc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,a=t.appearance,o=t.onClose,s=Gl($h).isPopup;return Wl((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Nt(gc,"keydown",t),()=>{gc.removeEventListener("keydown",t)}}),[o]),rc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&rc(pc,{onClick:()=>o()}),rc("h3",{className:"thank-you-message-header",children:e}),r&&Wh({component:sl("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&rc(vc,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function yc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,a=t.appearance,o=t.onStart,s=Gl($h),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return rc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&rc(pc,{onClick:()=>l()}),e&&rc("h3",{className:"intro-screen-header",children:e}),r&&Wh({component:sl("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),rc(vc,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var bc=t=>w(t)&&t.every((t=>x(t)));function wc(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,a=t.onPreviewSubmit,o=t.displayQuestionIndex,s=t.initialValue,u=t.canGoBack,l=t.onBack,h=zh().isPreviewMode,c=Vl(null),d=zl((()=>x(s)?s:"")),v=d[0],f=d[1],m=null==i?void 0:i.disableAutofocus;Wl((()=>{m||setTimeout((()=>{var t;h||null==(t=c.current)||t.focus()}),100)}),[h,m]);var y="surveyQuestion"+o,b=Zl((()=>function(t,e,r){var i,n,a=t.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case p:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case g:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),w=Rt(e.validation,p),k=Rt(e.validation,g),_=Zl((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(v.trim())},C=()=>{b||a(v.trim())};return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:e,forceDisableHtml:r,htmlFor:y}),rc("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||b||(t.preventDefault(),h?C():S())},value:v}),_&&rc("div",{className:"validation-hint",children:_})]}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:C,canGoBack:u,onBack:l})]})}function kc(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,a=t.canGoBack,o=t.onBack;return rc(ll,{children:[rc("div",{className:"question-container",children:rc(fc,{question:e,forceDisableHtml:t.forceDisableHtml})}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function _c(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,a=t.appearance,o=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=r.scale,d=10===r.scale?0:1,v=zl((()=>I(u)?u:w(u)&&u.length>0&&I(parseInt(u[0]))?parseInt(u[0]):x(u)&&I(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=zh().isPreviewMode,y=t=>m?s(t):o(t);return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:r,forceDisableHtml:i}),rc("div",{className:"rating-section",children:[rc("div",{className:"rating-options",children:["emoji"===r.display&&rc("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Ic[r.scale])?void 0:e.map(((t,e)=>rc("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&rc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Rc(r.scale).map(((t,e)=>rc(Sc,{displayQuestionIndex:n,active:f===t,appearance:a,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&rc("div",{className:"rating-text",children:[rc("div",{children:r.lowerBoundLabel}),rc("div",{children:r.upperBoundLabel})]})]})]}),rc(vc,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:M(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function Sc(t){var e=t.num,r=t.setActiveNumber;return rc("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function xc(t){var e=t.question,r=t.forceDisableHtml,i=t.displayQuestionIndex,n=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,s=t.initialValue,u=t.canGoBack,l=t.onBack,c=Vl(null),d=Zl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=jh(e,qh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=zl((()=>((t,e)=>x(t)||bc(t)?t:e===oh.SingleChoice?null:[])(s,e.type))),f=v[0],p=v[1],g=zl((()=>((t,e)=>{if(x(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(bc(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),m=g[0],y=g[1],b=zh().isPreviewMode,k=e.type===oh.SingleChoice,_=e.type===oh.MultipleChoice,S=e.skipSubmitButton&&k&&!e.hasOpenChoice,C=(t,e)=>{if(e){var r=!m.isSelected;return y((t=>h({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),k&&p(""),void(r&&setTimeout((()=>{var t;return null==(t=c.current)?void 0:t.focus()}),75))}if(k)return p(t),y((t=>h({},t,{isSelected:!1,inputValue:""}))),void(S&&(a(t),b&&o(t)));_&&w(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},T=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>h({},t,{inputValue:e}))),k&&p(e)},I=t=>{t.stopPropagation(),"Enter"!==t.key||R()||(t.preventDefault(),A()),"Escape"===t.key&&(t.preventDefault(),y((t=>h({},t,{isSelected:!1,inputValue:""}))),k&&p(null))},R=()=>!(e.optional||!M(f)&&(!w(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),A=()=>{m.isSelected&&_?w(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:e,forceDisableHtml:r}),rc("fieldset",{className:"multiple-choice-options limit-height",children:[rc("legend",{className:"sr-only",children:_?" Select all that apply":" Select one"}),d.map(((t,r)=>{var n=!!e.hasOpenChoice&&r===e.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?m.isSelected:k?f===t:w(f)&&f.includes(t);return rc("label",{className:n?"choice-option-open":"",children:[rc("div",{className:"response-choice",children:[rc("input",{type:k?"radio":"checkbox",name:a,checked:s,onChange:()=>C(t,n),id:a,"aria-controls":o}),rc("span",{children:n?t+":":t})]}),n&&rc("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:m.inputValue,onKeyDown:I,onInput:T,onClick(e){m.isSelected||C(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:R(),appearance:n,onSubmit:A,onPreviewSubmit:A,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Cc=[1,2,3,4,5],Mc=[1,2,3,4,5,6,7],Tc=[0,1,2,3,4,5,6,7,8,9,10],Ic={2:[uc,lc],3:[ac,nc,ic],5:[oc,ac,nc,ic,sc]};function Rc(t){switch(t){case 5:default:return Cc;case 7:return Mc;case 10:return Tc}}var Ac=Ot("[Surveys]");function Ec(t,e,r){var i,n=t.questions[e],a=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?sh.End:a;if(n.branching.type===sh.End)return sh.End;if(n.branching.type===sh.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===sh.ResponseBased){if(n.type===oh.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===sh.End?sh.End:a}}else if(n.type===oh.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=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")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===sh.End?sh.End:a}}return a}return Ac.warn("Falling back to next question index due to unexpected branching type"),a}var Lc=Ot("[SurveyTranslations]");function Oc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=ci(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var a=function(t){return t&&"object"==typeof t&&"language"in t?ci(t.language):null}(r);if(a)return null==e||e.info("Using person property language: "+a),a;var o=ci(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:k(t.get_property)?t.get_property(ze):void 0,locale:navigator.language||navigator.userLanguage},Lc)}(e);if(!r)return Lc.info("No user language detected"),{survey:t,language:null};var i=pi(t,r,Lc);return{survey:i.survey,language:i.matchedKey}}var Pc=-1,Dc=t,Nc=i,Fc="ph:show_survey_widget",qc="PHWidgetSurveyClickListener";function jc(t,e){try{var r=t.getBoundingClientRect(),i=Dc.innerHeight,n=Dc.innerWidth,a=r.left+r.width/2-e/2;a+e>n-20&&(a=n-e-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Rh.zIndex}}catch(t){return ch.warn("Failed to calculate trigger position:",t),null}}class Bc{constructor(t){var e=this;this.li=new Map,this.hi=new Map,this.ci=new Map,this.di=new Set,this.vi=null,this.fi=!1,this.pi=null,this.gi=null,this.mi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(We);if(t)for(var e of t)Yh(e)&&Fh(e,this._posthog)},this.handlePopoverSurvey=function(t,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=e.yi(t),v=d.survey,f=d.language;e.vi=f,e.mi=null,e.bi=r;var p=e.wi(v,r);e.ki(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Si(p,y,m,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){e.xi(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===ih.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=Nc.querySelector(p.appearance.widgetSelector);_&&(w=jc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Rh.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=Oh(p,e._posthog).shadow;e.ci.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ci,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(e.mi=C,0>=S)return e.fi=!0,Rl(rc(Wc,h({},C)),x);var M=()=>{if(!e.Mi(p))return ch.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ci(p);(()=>{e.fi=!0;var i=e.yi(t),n=i.survey,a=i.language;e.vi=a;var o=e.wi(n,r),s=h({},C,{survey:o,surveyLanguage:a});e.mi=s,Rl(rc(Wc,h({},s,{survey:h({},o,{appearance:h({},o.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},T=c?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,R=I(T)?Math.max(0,Date.now()-T):0,A=Math.max(0,1e3*S-R);if(0>=A)return M();var E=Dc.setTimeout((()=>{e.li.delete(p.id),M()}),A);e.li.set(p.id,E)}},this.Ti=t=>{var e=this.yi(t),r=e.survey,i=e.language,n=Oh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.ci.set(a,a.host),o&&Rl(rc(Zc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),a)},this.Ii=t=>{var e=this.hi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(qc),this.hi.delete(t),ch.info("Removed click listener for survey "+t))},this.Ri=t=>{this.Ai(t)||(this.Ei(t),this.Ii(t.id))},this.Ai=t=>{try{var e,r=Nc.querySelector(Xh(t,!0));return!(null==r||null==(e=r.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Li=(t,e)=>{var r=Nc.querySelector(e),i=this.hi.get(t.id);if(r){if(this.Ti(t),i){if(r===i.element)return;ch.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ii(t.id)}if(!r.hasAttribute(qc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===ih.NextToTrigger?jc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Rh.maxWidth)):{};Dc.dispatchEvent(new CustomEvent(Fc,{detail:{surveyId:t.id,position:n}}))};Nt(r,"click",n),r.setAttribute(qc,"true"),this.hi.set(t.id,{element:r,listener:n,survey:t}),ch.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Ri(t)},this.renderPopover=t=>{var e=this.yi(t),r=e.survey,i=e.language,n=Oh(r,this._posthog).shadow;this.ci.set(n,n.host),Rl(rc(Wc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Ci,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.yi(t),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.Oi(a,o,r)),Rl(rc(Wc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ci,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.Mi(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===ah.Popover||t.type===ah.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.li.keys()))i.has(n)||e.cancelSurvey(n);var a=e.Pi(r),o=new Set;a.forEach((t=>{if(t.type===ah.Widget){var r,i,n,a;if((null==(r=t.appearance)?void 0:r.widgetType)===rh.Tab)return void e.Ti(t);(null==(i=t.appearance)?void 0:i.widgetType)===rh.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Li(t,null==(a=t.appearance)?void 0:a.widgetSelector))}M(e.Di)&&t.type===ah.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.hi.forEach((t=>{var r=t.survey;o.has(r.id)||e.Ri(r)}))}),t)},this.xi=t=>{M(this.Di)||ch.error("Survey "+this.Di+" already in focus. Cannot add survey "+t.id+"."),this.Di=t.id},this.Ci=t=>{this.Di!==t.id&&ch.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.ki(t.id),this.Di=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0,this.Ei(t)},this._posthog=t,this.Di=null,this.pi=()=>this.Ni(),Nt(Dc,"languagechange",this.pi),this.gi=t.onFeatureFlags((()=>this.Ni()))}Ni(){if(!M(this.Di)){var t=this._posthog.get_property(We),e=null==t?void 0:t.find((t=>t.id===this.Di));if(e){var r=this.yi(e),i=r.survey,n=r.language;if(n!==this.vi&&(this.vi=n,this.fi)){var a=this.wi(i,this.bi),o=Oh(a,this._posthog).shadow;Rl(rc(Wc,h({},this.mi,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ci,surveyLanguage:n})),o)}}}}get Fi(){var t,e,r;return null!==(t=null==(e=(r=this._posthog).getExtension)?void 0:e.call(r,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}wi(t,e){return null!=e&&e.position||null!=e&&e.selector?h({},t,{appearance:h({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}ki(t){var e=this.li.get(t);e&&(clearTimeout(e),this.li.delete(t))}cancelSurvey(t){this.li.has(t)&&(ch.info("Cancelled pending survey "+t),this.ki(t),this.Di===t&&(this.Di=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0))}setAutomaticDisplayDispose(t){this.qi=t}dispose(){var t;null==(t=this.qi)||t.call(this),this.qi=void 0,this.pi&&(Dc.removeEventListener("languagechange",this.pi),this.pi=null),this.gi&&(this.gi(),this.gi=null),this.li.forEach(((t,e)=>this.ki(e))),this.hi.forEach(((t,e)=>this.Ii(e))),this.ci.forEach(((t,e)=>{Rl(null,e),null==t||t.remove()})),this.ci.clear(),this.Di=null}Pi(t){return t.sort(((t,e)=>{var r,i,n=Yh(t),a=Yh(e);if(n&&!a)return-1;if(!n&&a)return 1;var o=t.schedule===uh,s=e.schedule===uh;return o&&!s?1:!o&&s?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}yi(t){return Oc(t,this._posthog)}Oi(t,e,r){if(this.di.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!S(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);e[d]||(e[d]=[]),e[d].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(Dc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;ch.info("[Survey Prefill] Detected URL prefill parameters");var a=this.ji(t,n,e);return!!a&&(this.Bi(t,a,r,e),this.di.add(t.id),a.isSurveyCompleted)}Bi(t,e,r,i){var n=e.responses,a=e.submissionId,o=e.isSurveyCompleted,s=e.skippedResponses;(Object.keys(s).length>0&&t.enable_partial_responses||o)&&Ph({responses:o?n:s,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,properties:r,surveyLanguage:i})}Si(t,e,r,i){var n={};for(var a of Object.entries(e)){var o=a[1];n[parseInt(a[0])]=w(o)?o.map(String):[String(o)]}ch.info("[Survey] Processing initial responses");var s=this.ji(t,n,i);return!!s&&(this.Bi(t,s,r,i),s.isSurveyCompleted)}ji(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],a=si(t.id);try{switch(t.type){case oh.SingleChoice:if(!t.choices||0===t.choices.length)return void Lt.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Lt.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=t.choices[o];break;case oh.MultipleChoice:if(!t.choices||0===t.choices.length)return void Lt.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===s.length)return void Lt.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((e=>t.choices[e])))];s.length>u.length&&Lt.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case oh.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Lt.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Lt.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Lt.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return ch.warn("[Survey Prefill] No valid responses after conversion"),null;var n=kh(),a=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},a=[],o=t.questions.length+1,s=0;t.questions.length>i&&o>s&&(s++,e.includes(i));){var u=t.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=si(u.id);S(r[l])||(n[l]=r[l])}a.push(i);var h=Ec(t,i,u.id?r[si(u.id)]:null);if(h===sh.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(t,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=o.skippedIndices,h=s>=t.questions.length;return Qh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,questionOrder:Bh(t.questions),visitedIndices:l,surveyLanguage:r}),ch.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:h,skippedResponses:u}}catch(t){return ch.error("[Survey Prefill] Error handling prefill:",t),null}}Hi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=this.Fi,i=!(null==r||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==r?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),i&&n}Ui(t){return!t.conditions||Vh(t,this._posthog)&&Zh(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Th||!Th.querySelector(t.conditions.selector))}(t)}$i(t){var e;return Uh(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.Fi)&&e.hasLoadedFlags?{satisfied:this.Hi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,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(!ph.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.Hi(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.Hi(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.$i(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,xh.ai("lastSeenSurveyDate"))?(t=>!!xh.ai(vh(t))&&!Uh(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!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.zi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}zi(t){var e;if(!gi(t)&&!function(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}Wi(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.Hi(e)}))}Mi(t){return this.checkSurveyEligibility(t).eligible&&this.Ui(t)&&this.zi(t)&&this.Wi(t)}Ei(t){try{var e=Nc.querySelector(Xh(t,!0));null!=e&&e.shadowRoot&&(Rl(null,e.shadowRoot),this.ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){ch.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.xi,removeSurveyFromFocus:this.Ci,surveyInFocus:this.Di,surveyTimeouts:this.li,handleWidget:this.Ti,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Li,sortSurveysByAppearanceDelay:this.Pi,checkFlags:this.Wi.bind(this),isSurveyFeatureFlagEnabled:this.Hi.bind(this),onLanguageChange:this.Ni.bind(this),currentLanguage:this.vi,surveyIsRendered:this.fi}}}function Hc(t,e){if(Nc&&Dc){var r,i=new Bc(t);if(t.config.disable_surveys_automatic_display)return ch.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return ch.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{S(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{S(r)||(clearInterval(r),r=void 0)};n();var o=()=>{Nc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Nt(Nc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),Nc.removeEventListener("visibilitychange",o)})),i}}function Uc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,a=t.isPreviewMode,o=void 0!==a&&a,s=t.posthog;Wl((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===ah.Widget,a=Vh(e,s),o=(null==(t=e.appearance)?void 0:t.widgetType)===rh.Tab&&r;if(!a)return ch.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(ch.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Nt(Dc,"popstate",r),Nt(Dc,"hashchange",r);var a=Dc.history.pushState,u=Dc.history.replaceState;return Dc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];a.apply(this,e),r()},Dc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];u.apply(this,e),r()},()=>{Dc.removeEventListener("popstate",r),Dc.removeEventListener("hashchange",r),Dc.history.pushState=a,Dc.history.replaceState=u}}}),[o,e,i,n,s])}var $c=200;function zc(t){switch(void 0===t&&(t=nh.Right),t){case nh.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case nh.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case nh.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Wc(t){var e,r,i,n,a,o,s,u,l,c,d,v,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,w=t.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=t.isPopup,x=void 0===_||_,C=t.onPreviewSubmit,M=void 0===C?()=>{}:C,T=t.onPreviewBack,I=void 0===T?()=>{}:T,R=t.onPopupSurveyDismissed,A=void 0===R?()=>{}:R,E=t.onCloseConfirmationMessage,L=void 0===E?()=>{}:E,O=t.properties,P=t.isSurveyCompleted,D=t.skipShownEvent,N=t.surveyLanguage,F=Vl(null),q=Number.isInteger(b),j=null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(t,e,r,i,n,a,o,s,u){var l=zl(i||0===r||t.type===ah.ExternalSurvey),c=l[0],d=l[1],v=zl(!1),f=v[0],p=v[1],g=Vl(!1),m=()=>{var e=()=>{a&&n(t),d(!1)};if(!g.current){var r=null==o?void 0:o.current;r?(g.current=!0,r.style.transition="opacity "+$c+"ms ease-out",r.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),$c+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Wl((()=>{if(e){if(!i){var n,a=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(Vh(t,e)){d(!0),Dc.dispatchEvent(new Event("PHSurveyShown")),s||e.capture(lh.SHOWN,h({[hh.SURVEY_NAME]:t.name,[hh.SURVEY_ID]:t.id,[hh.SURVEY_ITERATION]:t.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[hh.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Nt(Dc,"PHSurveyClosed",y),Nt(Dc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return S(l)&&o(),()=>{S(l)||clearTimeout(l),S(n)||clearTimeout(n),Dc.removeEventListener("PHSurveyClosed",y),Dc.removeEventListener("PHSurveySent",a)}}}else ch.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Uc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:e}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,j,q,k,x,F,D,N),H=B.isPopupVisible,U=B.hidePopupWithAnimation,z=B.isSurveySent||b===f.questions.length||!0===P,W=zl(!1),V=W[0],Z=W[1],G=Zl((()=>!!Jh(f)),[f]),Q=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),J=q?b===Pc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&Q&&!V&&!G,Y=Zl((()=>{var t=Jh(f),e=(null==t?void 0:t.surveySubmissionId)||kh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){N?Nh(f,g,q,N):Nh(f,g,q),A()},isPopup:x||!1,surveySubmissionId:e,onPreviewSubmit:M,onPreviewBack:I,posthog:g,properties:O,surveyLanguage:N}}),[q,b,x,g,f,A,M,I,O,N]);return H?rc($h.Provider,{value:Y,children:rc("div",{className:"ph-survey",style:h({},tc(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:F,children:z?rc(mc,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||Rh,onClose(){U(),L()}}):J?rc(yc,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||Rh,onStart:()=>Z(!0)}):rc(Vc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Vc(t){var e,r,i=t.survey,n=t.forceDisableHtml,a=t.posthog,o=Zl((()=>{var t=Jh(i);if(!t)return null;var e=I(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&i.questions.length>t.lastQuestionIndex?t:(Kh(i),null)}),[i]),s=zl((()=>(null!=o&&o.responses&&ch.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=Gl($h),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,g=c.onPreviewBack,m=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=zl((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=I(t)&&t>=0&&i.questions.length>t?t:0;return I(d)&&d>=0?d:e})),_=k[0],x=k[1],C=zl((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&i.questions.length>t))})),M=C[0],T=C[1],R=zl((()=>{var t,e=Jh(i);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),A=R[0],E=R[1],L=Zl((()=>Bh(Hh(i,o))),[i.id,o]),O=Zl((()=>{if(!L||new Set(L).size!==L.length)return Hh(i,o);var t=new Map(i.questions.map((t=>[t.id,t]))),e=L.map((e=>t.get(e))).filter((t=>!!t));return e.length===L.length?e:i.questions}),[L,i.questions,i,o]);Wl((()=>{!y||S(d)||0>d||x(d)}),[d,y]);var P=!(null==(e=i.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:M.length>0),D=O.at(_);return D?rc("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&rc(pc,{onClick(){v()}}),rc("div",{className:"survey-box","data-question-index":_,children:Gc({question:D,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||Rh,onSubmit:t=>(t=>{var e=t.res,r=t.displayQuestionIndex,n=t.questionId;if(a)if(n){var o=si(n),s=h({},u,{[o]:e});l(s);var c=O[r],d=null!=c&&c.id?h({},A,{[c.id]:c.question}):A;E(d);var v=Ec(i,r,e),f=v===sh.End,p=[...M,r];if(f||(T(p),x(v),Qh(i,{surveySubmissionId:m,responses:s,lastQuestionIndex:v,questionOrder:Bh(O),visitedIndices:p,surveyLanguage:w,questionSnapshots:d})),i.enable_partial_responses||f){var g=new Set(p.map((t=>{var e;return null==(e=O[t])?void 0:e.id})).filter((t=>!!t)).map((t=>si(t)))),y=Object.fromEntries(Object.entries(s).filter((t=>g.has(t[0]))));Ph({responses:y,survey:i,surveySubmissionId:m,isSurveyCompleted:f,posthog:a,properties:b,surveyLanguage:w,questionSnapshots:d})}}else ch.error("onNextButtonClick called without a questionId.");else ch.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:_,questionId:D.id}),onPreviewSubmit:p,initialValue:D.id?u[si(D.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==M.length){var t=M[M.length-1],e=M.slice(0,-1);T(e),x(t),Qh(i,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Bh(O),visitedIndices:e,surveyLanguage:w,questionSnapshots:A})}}})})]}):null}function Zc(t){var e,r,i,n,a,o,s,u=t.survey,l=t.forceDisableHtml,h=t.posthog,c=t.readOnly,d=t.surveyLanguage,v=zl(!0),f=v[0],p=v[1],g=zl(!1),m=g[0],y=g[1],b=zl({}),w=b[0],k=b[1],_=Vl(void 0),x=()=>{y(!m)};if(Wl((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&k({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(ch.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),x())};return Nt(Dc,Fc,e),()=>{S(_.current)||(clearTimeout(_.current),_.current=void 0),Dc.removeEventListener(Fc,e)}}}else ch.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Uc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var C=()=>{u.schedule!==uh&&p(!1),S(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return rc(ll,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&rc("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===nh.Top?"widget-tab-top":""),onClick:x,disabled:c,style:zc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&rc(Wc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:d})]})}var Gc=t=>{var e=t.question,r=t.onSubmit,i=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){i(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case oh.Open:return sl(wc,h({},n,{question:e,key:e.id}));case oh.Link:return sl(kc,h({},n,{question:e,key:e.id}));case oh.Rating:return sl(_c,h({},n,{question:e,key:e.id}));case oh.SingleChoice:case oh.MultipleChoice:return sl(xc,h({},n,{question:e,key:e.id}));default:return ch.error("Unsupported question type: "+e.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=Hc,s.extendPostHogWithSurveys=Hc;var Qc=1e4,Jc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Yc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Jc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(t.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?a=o-1:n=o}return Jc(e,JSON.stringify(t.slice(0,n)),r)},Kc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Xc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},td=(t,e,r)=>{if(!r.truncated)if(_(t)){if(r.seen.has(t))return void Xc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(td(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Xc(e,t,r)},ed=function(t,e,r,i,n,a){if(void 0===n&&(n=!1),!Kc(t))return!n||Jc(e,"null",r);if(M(t)||(t=>{try{return I(t)||R(t)}catch(t){return!1}})(t))return Jc(e,JSON.stringify(t),r);if("string"==typeof t)return Yc(t,e,r);if(!_(t)&&!w(t))return Jc(e,JSON.stringify(t),r);if(i.has(t))return Yc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(k(o))return ed(o.call(t),e,r,i,n)}catch(t){}try{var s={}.toString.call(t);if("[object String]"===s)return Yc(String(t.valueOf()),e,r);if("[object Number]"===s||"[object Boolean]"===s)return Jc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var u={};try{for(var l in t)({}).hasOwnProperty.call(t,l)&&(u[l]=t[l])}catch(t){}try{u.name=t.name}catch(t){}try{u.message=t.message}catch(t){}try{u.stack=t.stack}catch(t){}return ed(u,e,r,i,n,a)}if(w(t)){if(!Jc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Jc(e,",",r))return!1;var c=void 0;try{c=t[h]}catch(t){c=void 0}if(!ed(c,e,r,i,!0))return!1}return Jc(e,"]",r)}if(!Jc(e,"{",r))return!1;var d=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(a)try{td(f,v,a)}catch(t){}if(Kc(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Jc(e,p,r))return!1;var b=e.length,S=ed(f,e,r,i,!1),x=r.truncated;if(e.length!==b){if(d=!1,!S)return!1}else if(e.length=g,r.remaining=m,r.truncated=S?y:x,!S)return!1}}}catch(t){}return Jc(e,"}",r)},rd=(t,e)=>{for(var r=[],i={remaining:e,truncated:!1},n=_(t[0])?{result:{},keysRemaining:50,sizeRemaining:Qc,truncated:!1,seen:new WeakSet([t[0]])}:void 0,a=0;t.length>a&&(0>=a||Jc(r," ",i))&&ed(t[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},id={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},nd=t=>"canCapture"in t,ad=t=>nd(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0;s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(t){var e=t,r=[],i={host:s.location.host},n=!1,a=function(t){var a=s.console[t];r.push(vu(s.console,t,(r=>{var o=(r=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{var c=e;if(u.length>0&&!n&&c){var d=ad(c);if(d){n=!0,a=!0;var v=rd(u,Qc),f=v.body,p=v.attributes,g=h({},i,v.truncated?{body_truncated:"true"}:{});((t,e,r)=>{if(nd(t))e.captureConsoleLog(r);else{var i=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var r=Number(e[1]),i=Number(e[2]);if(r>=392&&419>=r)return 410===r?i>4?i>10?void 0:"de":"le":418===r?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===r?i>2?void 0:"vi":410>r?"le":"he"}})(t.version),n=i?e[i]:void 0;k(n)&&n.call(e,r)}})(c,d,{level:id[t],body:f,attributes:h({"log.source":"console."+t},g,p)})}}}catch(t){}finally{a&&(n=!1),r.apply(s.console,u)}})(r);return o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(a),o})))};for(var o of Object.keys(id))a(o);return()=>{e=void 0,r.forEach((t=>t()))}},replayConsoleBuffer(t,e){var r=ad(t);if(r)for(var i of e)try{var n=rd(i.args,Qc);null==r.captureBufferedConsoleLog||r.captureBufferedConsoleLog({level:id[i.level],body:n.body,attributes:h({"log.source":"console."+i.level,host:s.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},i.context,i.occurredAtMs)}catch(t){}}},Ot("[Error tracking]");var od=Ot("[ExceptionAutocapture]"),sd=new class{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(t){var e=this;return l((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&w(r.stacktrace.frames)&&(r.stacktrace.frames=yield e.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,i;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),h({},t,{cause:r,stack:i})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return l((function*(){var r=t;for(var i of e.modifiers)r=yield i(r);return r}))()}convertToExceptionList(t,e){var r,i,n,a={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(i=e.handled)||void 0===i||i,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var o=[a];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,h({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:lt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return h({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>i(t,r),next:t=>i(t,r+1)})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=x(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?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){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return L(t,"DOMException")}isDOMError(t){return L(t,"DOMError")}},new class{match(t){return L(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!P(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return E(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.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!!L(t,"ErrorEvent")&&(null!=t.error||this.Vi(t))}coerce(t,e){var r;if(null!=t.error)return e.apply(t.error);var i=e.apply(t.message);return h({},i,{stack:null!==(r=this.Zi(t))&&void 0!==r?r:i.stack,synthetic:!0})}Vi(t){return x(t.message)&&t.message.length>0}Zi(t){var e,r,i=t,n=null!==(e=i.lineno)&&void 0!==e?e:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(x(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(t){return O(t)}coerce(t,e){var r,i=this.getStack(t),n=void 0===i;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:null==(r=e.syntheticException)?void 0:r.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}},new class{match(t){return P(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+St(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(P(t))return t.constructor.name;var e="name"in t?t.name:void 0;return x(e)&&!C(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var 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;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+St(t)}isSeverityLevel(t){return x(t)&&!C(t)&&_t.indexOf(t)>=0}getStack(t){try{return x(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:x(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(O(r))return r}}getObjectClassName(t){try{var 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 r,i=this.getInfos(t),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(kt);return i&&(e=i[1],r=i[2]),[e,r]}},new class{match(t){return E(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];return function(e,i){void 0===i&&(i=0);for(var n=[],a=e.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=wt.test(s)?s.replace(wt,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,t);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map((t=>{return h({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||ht});var r}))}(n)}}("web:javascript",gt,bt)),ud=e=>{var r=t;r||od.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var t,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];var o=sd.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4];if(null!=a)return a;if(x(e)&&x(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return e(o),!!k(i)&&null!==(t=i(...n))&&void 0!==t&&t},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onerror)||delete t.__POSTHOG_INSTRUMENTED__,r.onerror=i}},ld=function(e,r){void 0===r&&(r=!1);var i=t;i||od.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(t){var i,a=sd.buildFromUnknown(t,{mechanism:{handled:!1}});return e(a),k(n)?null!==(i=n(t))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},hd={wrapOnError:ud,wrapUnhandledRejection:ld,wrapConsoleError(t){var e=console;e||od.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),s=sd.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(s),k(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=hd,s.posthogErrorWrappingFunctions=hd;var cd=(t,e)=>{if(k(null==t?void 0:t.capture)){var r=null==e?void 0:e.autocaptureExceptions,i=!M(r)&&"object"==typeof r&&w(r.errors_to_ignore)?r.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){od.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){od.error("Failed to capture exception for a legacy client",t)}};ud((t=>{i.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),ld(n,!0)}};s.extendPostHogWithExceptionAutoCapture=cd,s.extendPostHogWithExceptionAutocapture=cd;var dd="X-POSTHOG-SESSION-ID",vd="X-POSTHOG-WINDOW-ID",fd="X-POSTHOG-DISTINCT-ID",pd=[dd,vd,fd],gd=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],md=(t,e)=>({}.hasOwnProperty.call(t,e)),yd=t=>"object"==typeof t&&!M(t)||k(t),bd=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),wd=e=>{try{var r;return bd(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(r=t.location)?void 0:r.href).toString()}catch(t){return}},kd=(t,e,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(w(t)&&!t.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(dd,s.sessionId),n.set(vd,u),o=!0}var l=(t=>k(t)?t():t)(e);return l&&"$posthog_cookieless"!==l&&(n.set(fd,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var _d={_patchFetch:(e,r,i)=>vu(t,"fetch",(t=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=wd(n);if(u)if(bd(n)){var l=new Request(n,a);kd(e,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(yd(a)?a.headers:void 0);if(kd(e,r,i,u,c)){var d=((t,e)=>{if(S(t)||M(t))return{headers:e};if(yd(t)){var r=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),i}return new Proxy({headers:e},{get:(t,e)=>md(t,e)?Reflect.get(t,e):Reflect.get(r,e,r),has:(t,e)=>md(t,e)||e in r,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(r).forEach((t=>e.add(t))),gd.forEach((t=>{t in r&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&gd.includes(e)&&e in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,e,r)}};var n=Reflect.getOwnPropertyDescriptor(r,e);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(t){s=o}return t.apply(this,s)})),_patchXHR:(e,r,i)=>vu(t.XMLHttpRequest.prototype,"open",(t=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=wd(a);c&&kd(e,r,i,c,h);var d=t.call(l,n,a,o,s,u);return pd.forEach((t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=_d,s.postHogTracingHeadersPatchFns=_d,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var r=this.length-1;r>=0;r--){var i=this[r];if(t.call(e,i,r,this))return i}},writable:!0,enumerable:!1,configurable:!0});let Sd=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var xd=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cd=t=>{if("loading"===document.readyState)return"loading";var e=xd();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"},Md=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Td=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,a=n.id?"#"+n.id:[Md(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+a.length>99)return e||a;if(e=e?a+">"+e:a,n.id)break;t=n.parentNode}}catch(t){}return e},Id=new WeakMap;function Rd(t,e){var r=Id.get(e);return r||(r=new WeakMap,Id.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var Ad=-1,Ed=()=>Ad,Ld=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ad=e.timeStamp,t(e))}),!0)},Od=(t,e,r,i)=>{var n,a;return o=>{e.value>=0&&(o||i)&&((a=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=a,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Pd=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Dd=()=>{var t,e;return null!==(t=null==(e=xd())?void 0:e.activationStart)&&void 0!==t?t:0},Nd=-1,Fd=new Set,qd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,jd=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Fd)e();isFinite(Nd)||(Nd="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",jd,!0))}},Bd=function(t){if(void 0===t&&(t=!1),t&&(Nd=1/0),0>Nd){var e,r=Dd(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;Nd=null!=i?i:qd(),addEventListener("visibilitychange",jd,!0),addEventListener("prerenderingchange",jd,!0),Ld((()=>{setTimeout((()=>{Nd=qd()}))}))}return{get firstHiddenTime(){return Nd},onHidden(t){Fd.add(t)}}},Hd=function(t,e,r,i,n,a,o){void 0===e&&(e=-1),void 0===i&&(i=0);var s=xd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Ed()?s&&(document.prerendering||Dd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Ud=function(t,e,r){void 0===r&&(r={});try{var i=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(i.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();i.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(t){}},$d=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},zd=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Wd=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Vd{constructor(){this.u=void 0}}var Zd,Gd=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Qd=[1800,3e3],Jd=function(t,e){void 0===e&&(e={});var r=$d(e);Gd((()=>{var i,n=Rd(e,Vd),a=Bd(),o=Hd("FCP"),s=Ud(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),a.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Dd(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));s&&(i=Od(t,o,Qd,e.reportAllChanges),Ld((r=>{o=Hd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ed()),i=Od(t,o,Qd,e.reportAllChanges),Pd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Ud(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&zd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Hd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Od(t,o,Qd,e.reportAllChanges))(!0)}))}),e)}))},Yd=[.1,.25],Kd=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Xd=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Sd),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=Kd(t.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==e.generateTarget?void 0:e.generateTarget(a))&&void 0!==o?o:Td(a);i.set(n,s)}}},function(t,e){void 0===e&&(e={});var r=Bd();Jd(Wd((()=>{var i,n=Hd("CLS",0),a=Rd(e,Sd),o=(r,o,s,u,l)=>{n=Hd("CLS",0,r,o,s,u,l),a.o=0,i=Od(t,n,Yd,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(t)},u=t=>{s(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?a.l(e):u(e);s()},h=["layout-shift"];$d(e)&&h.push("soft-navigation");var c=Ud(h,l);c&&(i=Od(t,n,Yd,e.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),Ld((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ed()),Pd(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var a=Kd(n.sources);a&&(e={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Cd(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},tv=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Vd);$d(e)&&(r.u=new Map),Jd((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Cd(Ed())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=xd(),n=t.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:a,firstByteToFCP:t.value-a,loadState:Cd(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(t.navigationId);s&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:s})}return Object.assign(t,{attribution:e})})(e))}),e)},ev=0,rv=1/0,iv=0,nv=t=>{for(var e of t)e.interactionId&&(rv=Math.min(rv,e.interactionId),iv=Math.max(iv,e.interactionId),ev=iv?(iv-rv)/7+1:0)},av=()=>{var t;return Zd?ev:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let ov=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return av()-this.h}D(){this.h=av(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>r.k){var n;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):(this.p.set((i={id:t.interactionId,entries:[t],k:t.duration}).id,i),this.v.push(i)),this.v.sort(((t,e)=>e.k-t.k)),this.v.length>10){var a=this.v.splice(10);for(var o of a)this.p.delete(o.id)}null==(n=this.M)||n.call(this,i)}}}};var sv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Wd(t),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},uv=[200,500],lv=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),ov),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(sv(c),u=!0)},c=()=>{var t=new Set(r.v.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((r,i)=>i>=e||t.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((t=>t.startTime>a||s.has(t))),u=!1};r.m=t=>{var r,i=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),e.includeProcessedEventEntries&&r.entries.push(t);break}}r||n.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&o.set(t,r),l()},r.M=t=>{if(!s.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Td(i);s.set(t,a)}else{var o,u=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;u&&s.set(t,u)}}};var d=(t,e)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=t){if(n.startTime>e)break;r.push(n)}return r};Ud(["long-animation-frame"],(t=>{i=i.concat(t),l()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Bd();Gd((()=>{var i;"interactionCount"in performance||Zd||(Zd=Ud(["event"],nv,{durationThreshold:0}));var n,a=Hd("INP"),o=Rd(e,ov),s=(r,i,s,u,l)=>{o.D(),a=Hd("INP",-1,r,i,s,u,l),n=Od(t,a,uv,e.reportAllChanges)},u=()=>{var t=o.S(a.navigationType);t&&t.k!==a.value&&(a.value=t.k,a.entries=t.entries,n())},l=t=>{u(),n(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),sv((()=>{for(var r of t)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),e&&n(!0)}))},d=["event","first-input"];$d(e)&&d.push("soft-navigation");var v=Ud(d,c,h({},e,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));n=Od(t,a,uv,e.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),Ld((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ed())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Cd(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var i=t.entries[0],n=o.get(i),a=Math.max(n.processingStart,i.startTime),u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),c=d(i.startTime,l),v=r.p.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:Cd(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,a,o=t.inputDelay,s=t.processingDuration,u=0,l=0,h=0,c=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-g,l+=g,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(t.longestScript={entry:n,subpart:a,intersectingDuration:c}),t.totalScriptDuration=u,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)};let hv=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],cv=50,dv=[];Ud(["resource"],(t=>{for(var e of t)dv.push(e),dv.length>cv&&dv.shift()}));var vv=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(cv=e.resourceBufferSize);var r=Rd(e,hv),i=new WeakMap;$d(e)&&(r.u=new Map),r.m=t=>{var r=t.element;if(r){var n,a=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Td(r);i.set(t,a)}else t.id&&i.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=$d(e);Gd((()=>{var n,a=Bd(),o=Hd("LCP"),s=Rd(e,hv),u=(i,s,u,l,h)=>{o=Hd("LCP",-1,i,s,u,l,h),n=Od(t,o,$,e.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Bd(!0))},l=t=>{s.u&&t.navigationId&&zd(s.u,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-Dd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Ud(c,h);if(d){n=Od(t,o,$,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;sv((()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Ld((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ed()),n=Od(t,o,$,e.reportAllChanges),Pd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,a,o,s,u,l,c=t.entries.at(-1),d=c.url&&(dv.findLast((t=>t.name===c.url))||performance.getEntriesByType("resource").findLast((t=>t.name===c.url)));e.target=i.get(c),e.lcpEntry=c,c.url&&(e.url=c.url),d&&(e.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(a=l=xd())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=t.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(t.navigationId)),l){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=h({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:l})}}return Object.assign(t,{attribution:e})})(e))}),e)},fv=-1,pv=()=>fv,gv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fv=e.timeStamp,t(e))}),!0)},mv=(t,e,r,i)=>{var n,a;return o=>{e.value>=0&&(o||i)&&((a=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=a,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},yv=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},bv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},wv=()=>{var t,e;return null!==(t=null==(e=bv())?void 0:e.activationStart)&&void 0!==t?t:0},kv=-1,_v=new Set,Sv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _v)e();isFinite(kv)||(kv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xv,!0))}},Cv=function(t){if(void 0===t&&(t=!1),t&&(kv=1/0),0>kv){var e,r=wv(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;kv=null!=i?i:Sv(),addEventListener("visibilitychange",xv,!0),addEventListener("prerenderingchange",xv,!0),gv((()=>{setTimeout((()=>{kv=Sv()}))}))}return{get firstHiddenTime(){return kv},onHidden(t){_v.add(t)}}},Mv=function(t,e,r,i,n,a,o){void 0===e&&(e=-1),void 0===i&&(i=0);var s=bv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>pv()?s&&(document.prerendering||wv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Tv=new WeakMap;function Iv(t,e){var r=Tv.get(e);return r||(r=new WeakMap,Tv.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Rv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Av=function(t,e,r){void 0===r&&(r={});try{var i=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(i.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();i.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(t){}},Ev=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Lv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Ov=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Pv{constructor(){this.l=void 0}}var Dv,Nv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Fv=[1800,3e3],qv=function(t,e){void 0===e&&(e={});var r=Ev(e);Nv((()=>{var i,n=Iv(e,Pv),a=Cv(),o=Mv("FCP"),s=Av(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),a.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-wv(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));s&&(i=mv(t,o,Fv,e.reportAllChanges),gv((r=>{o=Mv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),i=mv(t,o,Fv,e.reportAllChanges),yv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Av(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&Lv(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Mv("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=mv(t,o,Fv,e.reportAllChanges))(!0)}))}),e)}))},jv=[.1,.25],Bv=function(t,e){void 0===e&&(e={});var r=Cv();qv(Ov((()=>{var i,n=Mv("CLS",0),a=Iv(e,Rv),o=(r,o,s,u,l)=>{n=Mv("CLS",0,r,o,s,u,l),a.i=0,i=mv(t,n,jv,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(t)},u=t=>{s(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?a.h(e):u(e);s()},h=["layout-shift"];Ev(e)&&h.push("soft-navigation");var c=Av(h,l);c&&(i=mv(t,n,jv,e.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),gv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pv()),yv(i)})),setTimeout(i))})))},Hv=0,Uv=1/0,$v=0,zv=t=>{for(var e of t)e.interactionId&&(Uv=Math.min(Uv,e.interactionId),$v=Math.max($v,e.interactionId),Hv=$v?($v-Uv)/7+1:0)},Wv=()=>{var t;return Dv?Hv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class Vv{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Wv()-this.u}M(){this.u=Wv(),this.v.length=0,this.m.clear()}L(t){var e=this._(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>r.P){var n;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):(this.m.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.v.push(i)),this.v.sort(((t,e)=>e.P-t.P)),this.v.length>10){var a=this.v.splice(10);for(var o of a)this.m.delete(o.id)}null==(n=this.T)||n.call(this,i)}}}}var Zv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Ov(t),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Gv=[200,500],Qv=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Cv();Nv((()=>{var i;"interactionCount"in performance||Dv||(Dv=Av(["event"],zv,{durationThreshold:0}));var n,a=Mv("INP"),o=Iv(e,Vv),s=(r,i,s,u,l)=>{o.M(),a=Mv("INP",-1,r,i,s,u,l),n=mv(t,a,Gv,e.reportAllChanges)},u=()=>{var t=o.L(a.navigationType);t&&t.P!==a.value&&(a.value=t.P,a.entries=t.entries,n())},l=t=>{u(),n(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),Zv((()=>{for(var r of t)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),e&&n(!0)}))},d=["event","first-input"];Ev(e)&&d.push("soft-navigation");var v=Av(d,c,h({},e,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));n=mv(t,a,Gv,e.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),gv((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv())})))}))}};class Jv{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var Yv=[2500,4e3],Kv=function(t,e){void 0===e&&(e={});var r=!1,i=Ev(e);Nv((()=>{var n,a=Cv(),o=Mv("LCP"),s=Iv(e,Jv),u=(i,s,u,l,h)=>{o=Mv("LCP",-1,i,s,u,l,h),n=mv(t,o,Yv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Cv(!0))},l=t=>{s.l&&t.navigationId&&Lv(s.l,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-wv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Av(c,h);if(d){n=mv(t,o,Yv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;Zv((()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});gv((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),n=mv(t,o,Yv,e.reportAllChanges),yv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},Xv={onLCP:vv,onCLS:Xd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Kv,onCLS:Bv,onFCP:qv,onINP:Qv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Xv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Xv,s.postHogWebVitalsCallbacks=Xv;var tf={onLCP:Kv,onCLS:Bv,onFCP:qv,onINP:Qv};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=tf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=tf,s.postHogWebVitalsCallbacks=tf,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>tf;var ef={onLCP:vv,onCLS:Xd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Kv,onCLS:Bv,onFCP:qv,onINP:Qv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=ef,s.__PosthogExtensions__.postHogWebVitalsCallbacks=ef,s.postHogWebVitalsCallbacks=ef;var rf={onLCP:Kv,onCLS:Bv,onFCP:qv,onINP:Qv};function nf(t,e){return e.length>t?e.slice(0,t)+"...":e}function af(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!zt(e));return e}function of(e,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!zt(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!Wt(f,"body")&&Zt>c.length;)if(Vt(f.parentNode)){var p=f.parentNode.host;if(d.has(p))break;d.add(p),c.push(p),f=p}else{if(!zt(f.parentNode))break;if(d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var g,m=[],y={},b=!1,k=!1;if(Pt(c,(t=>{var e=re(t);if(Wt(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&ce(r))&&(l?ut(r):r)}v(Qt(t),"ph-no-capture")&&(k=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var a=t.tagName.toLowerCase(),o={tag_name:a};Yt.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?nf(1024,de(t)):nf(1024,Jt(t)));var s=Qt(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),Pt(t.attributes,(function(r){var a;if((!ie(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&ce(r.value)&&(!x(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Gt(s).join(" ")),o["attr__"+r.name]=nf(1024,"href"===r.name&&n?ut(s):s)}}));for(var u=1,l=1,h=t;h=af(h);)u++,h.tagName===t.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(t,o,s,u,l));var i=function(t){if(!re(t))return{};var e={};return Pt(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&ce(i)&&(e[r]=i)}})),e}(t);Pt(i,((t,e)=>{({}).hasOwnProperty.call(y,e)||(y[e]=t)}))})),k)return{props:{},explicitNoCapture:k};if(s||(m[0].$el_text=Wt(e,"a")||Wt(e,"button")?de(e):Jt(e)),b){var _,S;m[0].attr__href=b;var C=null==(_=qt(b))?void 0:_.host,M=null==t||null==(S=t.location)?void 0:S.host;C&&M&&C!==M&&(g=b)}var T,I=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(t[a]=n[a]);return t}({$event_type:a.type,$ce_version:1},{$elements:m},{$elements_chain:(T=m,w(T)?function(t){var e=t.map((t=>{var e,r,i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))i+="."+n.replace(/"/g,"");var a=h({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Dt(a).sort(((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0]))).forEach((t=>{var e=t[1];return o[fe(t[0].toString())]=fe(e.toString())})),(i+=":")+Dt(o).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:pe(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(T)):"")},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},g&&"click"===a.type?{$external_click_url:g}:{},y);return{props:I}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=rf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=rf,s.postHogWebVitalsCallbacks=rf,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>rf,Ot("[AutoCapture]");var sf={};function uf(e,r){var i=sf[e];if(i)return i;var n=r[e];if((t=>k(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return sf[e]=n.bind(r);var a=r.document;if(a&&k(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return v(t,"AppleWebKit")&&!v(t,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(t){Lt.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&k(n)?sf[e]=n.bind(r):n}function lf(t,e){var r=function(t){var e;return S(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}(t);return r?h({node:r,originalEvent:t,timestamp:Date.now()},e):null}function hf(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function cf(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var df="canvas,video,audio,embed,object",vf=1e3;function ff(t,e){return I(t)&&t>=e}function pf(t){return t>=0&&vf>t?t:void 0}function gf(t,e){return e?pf(t-e):void 0}class mf{Gi(t){var e,r,i,n,a,o,s,u,l=this.Qi((null==t?void 0:t.__onCapture)||this.Ji.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==t?void 0:t.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,e){this.Yi=[],this.Ki=0,this.Qi=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.Xi=t=>{var e=lf(t,{type:"click"});M(e)||this.tn(e)||this.en(e),this.rn()},this.nn=()=>{var t=Date.now();this.an=t,t%50==0&&this.Yi.forEach((e=>{S(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.sn=()=>{this.un=Date.now()},this.Ve=()=>{var t=Date.now();this.ln=t,this.hn("visibilityChangedDelayMs",t)},this.cn=()=>{var t=Date.now();this.dn=t,this.hn("focusChangedDelayMs",t)},this.vn=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.fn=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.pn=()=>{this.fn=void 0},this.gn=t=>{var e,r=this.fn;if(this.fn=void 0,!S(r)&&this.mn.max_dead_swipes_per_page_load>this.Ki){var n=t,a=null==(e=n.changedTouches)?void 0:e[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.mn.swipe_threshold_px;if(u>=l*l&&![this.an,this.yn,this.un].some((t=>I(t)&&t>=r.timestamp))){var h;if(this.bn()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(df))))return;var c=lf(n,{type:"swipe",swipeDirection:hf(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});M(c)||this.tn(c)||this.en(c),this.rn()}}}},this.instance=t,this.mn=this.Gi(e),this._onCapture=this.mn.__onCapture}start(t){this.wn(),this.kn(),this._n(),this.Sn(),this.xn(),this.Cn(t),this.mn.capture_dead_swipes&&this.Mn()}Cn(t){if(!this.Tn){var e=function(t){return uf("MutationObserver",t)}(s);this.Tn=new e((t=>{this.In(t)})),this.Tn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Tn)||t.disconnect(),this.Tn=void 0,s.removeEventListener("click",this.Xi),s.removeEventListener("scroll",this.nn,{capture:!0}),s.removeEventListener("selectionchange",this.sn),s.removeEventListener("touchstart",this.vn,{capture:!0}),s.removeEventListener("touchend",this.gn,{capture:!0}),s.removeEventListener("touchcancel",this.pn,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.Ve),s.removeEventListener("blur",this.cn),s.removeEventListener("focus",this.cn),this.fn=void 0}In(t){this.yn=Date.now()}wn(){Nt(s,"click",this.Xi)}en(t){t.visibilityChangedDelayMs=gf(t.timestamp,this.ln),t.focusChangedDelayMs=gf(t.timestamp,this.dn),this.Yi.push(t)}rn(){this.Yi.length&&S(this.Rn)&&(this.Rn=s.setTimeout((()=>{this.An()}),1e3))}kn(){Nt(s,"scroll",this.nn,{capture:!0})}_n(){Nt(s,"selectionchange",this.sn)}Sn(){Nt(i,"visibilitychange",this.Ve)}xn(){Nt(s,"blur",this.cn),Nt(s,"focus",this.cn)}hn(t,e){this.Yi.forEach((r=>{var i=pf(e-r.timestamp);I(i)&&(S(r[t])||r[t]>i)&&(r[t]=i)}))}Mn(){Nt(s,"touchstart",this.vn,{capture:!0,passive:!0}),Nt(s,"touchend",this.gn,{capture:!0,passive:!0}),Nt(s,"touchcancel",this.pn,{capture:!0,passive:!0})}bn(){var t=S(this.En)||I(this.yn)&&this.yn>this.En;return(S(this.Ln)||t)&&(this.En=Date.now(),this.Ln=!(null==i||!i.querySelector(df))),!!this.Ln}tn(t){return!t||("swipe"===t.type?this.On(t):this.Pn(t))}On(e){if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.Yi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!Wt(e.node,"html")&&zt(e.node)&&function(e,r){var i;if(!t||te(e))return!1;var n=R(r)?Xt:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:Xt;return!function(t,e){if(S(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}(ee(e).targetElementList,n)}(e.node,{css_selector_ignorelist:this.mn.css_selector_ignorelist}))}Pn(e){return!(this.mn.capture_clicks_with_modifier_keys||(r=e.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.On(e)||(i=e.node,!(!t||te(i))&&ee(i).targetElementList.some((t=>Wt(t,"a"))));var r,i}An(){if(this.Yi.length){clearTimeout(this.Rn),this.Rn=void 0;var t=this.Yi;for(var e of(this.Yi=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.yn&&this.yn>=e.timestamp?this.yn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.un&&this.un>=e.timestamp?this.un-e.timestamp:void 0;var i=ff(e.scrollDelayMs,this.mn.scroll_threshold_ms),n=ff(e.selectionChangedDelayMs,this.mn.selection_change_threshold_ms),a=ff(e.mutationDelayMs,this.mn.mutation_threshold_ms),o=ff(e.absoluteDelayMs,1.1*this.mn.mutation_threshold_ms),s=I(e.scrollDelayMs)&&this.mn.scroll_threshold_ms>e.scrollDelayMs,u=I(e.mutationDelayMs)&&this.mn.mutation_threshold_ms>e.mutationDelayMs,l=I(e.selectionChangedDelayMs)&&this.mn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=I(e.visibilityChangedDelayMs),c=I(e.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=cf(e);if("$dead_swipe"===d){if(this.Ki>=this.mn.max_dead_swipes_per_page_load)continue;this.Ki++}this._onCapture(e,{[d+"_last_mutation_timestamp"]:this.yn,[d+"_event_timestamp"]:e.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.mn.mutation_threshold_ms>e.absoluteDelayMs&&this.Yi.push(e)}this.rn()}}Ji(t,e){var r=cf(t);this.instance.capture(r,h({},e,of(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.mn.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:t.scrollDelayMs,[r+"_mutation_delay_ms"]:t.mutationDelayMs,[r+"_absolute_delay_ms"]:t.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new mf(t,e)}();
|
|
1
|
+
!function(){"use strict";var t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,r=null==e?void 0:e.navigator,i=null==e?void 0:e.document,n=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:t;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=t?t:{};function u(t,e,r,i,n,a,o){try{var s=t[a](o),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(i,n)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var a=t.apply(e,r);function o(t){u(a,i,n,o,s,"next",t)}function s(t){u(a,i,n,o,s,"throw",t)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},h.apply(null,arguments)}var c={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},d={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16};function v(t,e){return-1!==t.indexOf(e)}var f=function(t){return t.trim()},p="min_length",g="max_length",m=Object.prototype,y=m.hasOwnProperty,b=m.toString,w=Array.isArray||function(t){return"[object Array]"===b.call(t)},k=t=>"function"==typeof t,_=t=>t===Object(t)&&!w(t),S=t=>void 0===t,x=t=>"[object String]"==b.call(t),C=t=>x(t)&&0===t.trim().length,M=t=>null===t,T=t=>S(t)||M(t),I=t=>"[object Number]"==b.call(t)&&t==t,R=t=>"[object Boolean]"===b.call(t),A=t=>t instanceof FormData;function E(t){return null===t||"object"!=typeof t}function L(t,e){return{}.toString.call(t)==="[object "+e+"]"}function O(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 D(t,Error)}}function P(t){return"u">typeof Event&&D(t,Event)}function D(t,e){try{return t instanceof e}catch(t){return!1}}function N(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),I(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):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: "+r+", fallback: "+n),N(null!=n?n:r,e,r,i))}class F{constructor(t){this.C={},this.I=t.I,this.R=N(t.bucketSize,0,100,t.A),this.O=N(t.refillRate,0,this.R,t.A),this.N=N(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}var q,j,B,H="Mobile",U="Android",z="Tablet",W=U+" "+z,V="iPad",Z="Apple Watch",G="BlackBerry",Q="Nintendo",J="PlayStation",Y="Xbox",K="Windows Phone",X="Nokia",tt="Ouya",et="Generic",rt=et+" "+H.toLowerCase(),it=et+" "+z.toLowerCase(),nt=new RegExp(Y,"i"),at=new RegExp(J+" \\w+","i"),ot=new RegExp(Q+" \\w+","i"),st=new RegExp(G+"|PlayBook|BB10","i");function ut(t){return t?t.split("#")[0]:t}function lt(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return B&&r.length===j||(j=r.length,B=r.reduce(((r,i)=>{q||(q={});var n=q[i];if(n)r[n[0]]=n[1];else for(var a=t(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=e[i];if(u&&l){r[u]=l,q[i]=[u,l];break}}return r}),{})),B}}var ht="?";function ct(t,e,r,i,n){var a={platform:t,filename:e,function:"<anonymous>"===r?ht:r,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return S(i)||(a.lineno=i),S(n)||(a.colno=n),a}var dt=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:ht,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,gt=(t,e)=>{var r=vt.exec(t);if(r)return ct(e,r[1],ht,+r[2],+r[3]);var i=ft.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=pt.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=dt(i[1]||ht,i[2]);return ct(e,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},mt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bt=(t,e)=>{var r=mt.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=yt.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||ht,o=dt(a,n);return ct(e,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},wt=/\(error: (.*)\)/;var kt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var _t=["fatal","error","warning","log","info","debug"];function St(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var xt,Ct="NativeGzipValidationError",Mt=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(Ct,"Native gzip produced invalid output: "+t)},Tt=function(){var t=l((function*(t,e){18>t.size&&Mt("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Mt("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(xt)return xt;xt=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;xt[t]=e>>>0}return xt})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Mt("invalid-crc");var a=e.length>>>0;n.getUint32(4,!0)!==a&&Mt("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function It(){return It=l((function*(t,e,r){void 0===e&&(e=!0);try{var i=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var t=l((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield Tt(u,i),u}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),It.apply(this,arguments)}function Rt(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var At={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},Et=function(e,r){var i=(void 0===r?{}:r).debugEnabled,n={q(r){if(t&&(At.DEBUG||t.POSTHOG_DEBUG||i)&&!S(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>Et(e+" "+t,r)};return n},Lt=Et("[PostHog.js]"),Ot=Lt.createLogger;function Pt(t,e){if(!T(t))if(w(t))t.forEach(e);else if(A(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)y.call(t,r)&&e(t[r],r)}function Dt(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}function Nt(t,e,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var Ft=["localhost","127.0.0.1"],qt=t=>{var e=null==i?void 0:i.createElement("a");return S(e)?null:(e.href=t,e)},jt=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Pt(t,(function(t,e){S(t)||S(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)};function Bt(e){var r,i=null==t||null==(r=t.location)?void 0:r.href;return S(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!k(i))return e;try{var n=i(e);return x(n)&&n?n:e}catch(t){return Lt.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}var Ht=1,Ut=3,$t=11;function zt(t){return!!t&&t.nodeType===Ht}function Wt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Vt(t){return!!t&&t.nodeType===$t&&zt(t.host)}var Zt=1e3;function Gt(t){return t?f(t).split(/\s+/):[]}function Qt(t){var 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 Gt(e)}function Jt(t){var e="";return re(t)&&!ie(t)&&t.childNodes&&t.childNodes.length&&Pt(t.childNodes,(function(t){var r;(function(t){return!!t&&t.nodeType===Ut})(t)&&t.textContent&&(e+=null!==(r=function(t){return T(t)?null:f(t).split(/(\s+)/).filter((t=>ce(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==r?r:"")})),f(e)}var Yt=["a","button","form","input","select","textarea","label"];function Kt(t){var e=t.parentNode;return!(!e||!zt(e))&&e}var Xt=[".ph-no-deadclick",".ph-no-capture"];var te=t=>!t||Wt(t,"html")||!zt(t),ee=(e,r)=>{if(!t||te(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[e],a=e;a.parentNode&&!Wt(a,"body");)if(Vt(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Kt(a);if(!o)break;if(Yt.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=t.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(t){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function re(t){for(var e=new Set,r=0,i=t;i.parentNode&&!Wt(i,"body");i=i.parentNode){if(r++>=Zt||e.has(i))return!1;e.add(i);var n=Qt(i);if(v(n,"ph-sensitive")||v(n,"ph-no-capture"))return!1}if(v(Qt(t),"ph-include"))return!0;var a=t.type||"";if(x(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!x(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function ie(t){return!!(Wt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Wt(t,"select")||Wt(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ne=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}))$"),ae=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,oe=[16,15,14,13],se=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),ue=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),le=/[0-9A-Za-z_]/;function he(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function ce(t,e){if(void 0===e&&(e=!0),T(t))return!1;if(x(t)){t=f(t);var r=e?ne.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(ae.lastIndex=0;e=ae.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of oe){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(ne.test(s)&&he(s))return!0}}}return!1}(t);if(r)return!1;var i=e?se.test(t):function(t){var e;for(ue.lastIndex=0;e=ue.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&le.test(r)&&le.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function de(t){var e=Jt(t);return ce(e=(e+" "+ve(t)).trim())?e:""}function ve(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pt(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Jt(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ve(t)).trim())}catch(t){Lt.error("[AutoCapture]",t)}})),e}function fe(t){return t.replace(/"|\\"/g,'\\"')}function pe(t){var e=t.attr__class;if(e)return w(e)?e:Gt(e)}var ge="[SessionRecording]",me="redacted",ye=1e6;function be(t){var e;return Math.min(ye,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ye)}var we={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:ye,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},ke=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],_e=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Se=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],xe=t=>{T(t)||Pt(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return ke.includes(e)||Se.some((t=>e.includes(t)))})(e)&&(t[e]=me)}))},Ce=["/s/","/e/","/i/"];function Me(t,e,r,i){if(T(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return x(n)&&(n=parseInt(n)),n>r?ge+" "+i+" body too large to record ("+n+" bytes)":t}function Te(t,e){if(T(t))return t;var r=t;return ce(r,!1)||(r=ge+" "+e+" body "+me),Pt(_e,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=ge+" "+e+" body "+me+" as might contain: "+t)})),r}var Ie=new WeakSet,Re="$session_recording_remote_config",Ae="$replay_sample_rate",Ee="$replay_override_sampling",Le="$replay_override_linked_flag",Oe="$replay_override_url_trigger",Pe="$replay_override_event_trigger",De="$session_is_sampled",Ne="$session_past_minimum_duration",Fe="$session_recording_url_trigger_activated_session",qe="$session_recording_event_trigger_activated_session",je="$posthog_sr_group_event_trigger_",Be="$posthog_sr_group_url_trigger_",He="$posthog_sr_group_sampling_",Ue="$debug_first_full_snapshot_timestamp",$e="$sess_rec_flush_size",ze="$stored_person_properties",We="$surveys",Ve="$sdk_debug_replay_pending_trigger_conditions",Ze="$sdk_debug_replay_remote_trigger_matching_config",Ge="disabled",Qe="sampled",Je="active",Ye="buffering",Ke="paused",Xe="rrweb_error",tr="trigger",er=tr+"_activated",rr=tr+"_pending",ir=tr+"_"+Ge;function nr(t,e,r,i,n,a){return 0===e?ir:(null==t?void 0:t.get_property(r?i+r:n))===a?er:rr}function ar(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function or(t){return t.includes(er)?er:t.includes(rr)?rr:ir}function sr(t){var e=new Set(t);switch(e.delete(ir),e.size){case 0:return ir;case 1:return Array.from(e)[0];default:return rr}}class ur{constructor(t){this.j=t}triggerStatus(t){return or(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return or(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class lr{constructor(t){this.j=t}triggerStatus(t){return sr(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return sr(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class hr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return er}stop(){}}var cr=t=>"sessionRecording"in t;class dr{constructor(t,e){this.B=[],this.H=[],this.U=new Map,this.$=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,r;this.B=(cr(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(cr(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.U.clear(),this.$.clear(),this.B))if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){Lt.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.$.has(e.url))try{this.$.set(e.url,new RegExp(e.url))}catch(t){Lt.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return nr(this._instance,this.B.length,this.V,Be,Fe,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Bt(this._instance);if(!t)return!1;try{return ar(t,this.H,this.$)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=Bt(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=ar(r,this.H,this.$);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=Bt(this._instance);if(n&&n!==this.W){this.W=n;var a=this.urlBlocked,o=ar(n,this.H,this.$);o&&!a?t():!o&&a&&e();var s=this.G(i)===er,u=ar(n,this.B,this.U);!s&&u&&r("url",n)}}stop(){this.W=""}}class vr{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=rr;return T(this.linkedFlag)&&(t=ir),this.linkedFlagSeen&&(t=er),t}onConfig(t,e){var r;if(this.linkedFlag=(cr(t)?_(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!T(this.linkedFlag)&&!this.linkedFlagSeen){var i=x(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=x(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,r)=>{var a=!1;if(_(r)&&i in r){var o=r[i];a=R(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class fr{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(cr(t)?_(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return nr(this._instance,this.Y.length,this.V,je,qe,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Y.length){var i=this.K(r)===er,n=this.Y.includes(t);!i&&n&&e("event",t)}}stop(){}}class pr{constructor(t,e,r){if(this._instance=t,this.group=e,this.X=new dr(t,e.id),this.tt=new fr(t,e.id),this.et=new vr(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.X.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var a=[this.tt,this.X,this.et];this.rt="any"===e.conditions.matchType?new ur(a):new lr(a)}else this.rt=new hr}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==rr?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===rr)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.X.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Be+this.group.id:je+this.group.id]:e})}stop(){this.X.stop(),this.tt.stop(),this.et.stop()}}function gr(t){if(t.rrwebError)return Xe;if(!t.receivedFlags)return Ye;if(!t.isRecordingEnabled)return Ge;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=!0===t.isSampled,r=new ur([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Qe:r===er?Je:r===rr?Ye:!1===t.isSampled?Ge:Je}function mr(t){if(t.rrwebError)return Xe;if(!t.receivedFlags)return Ye;if(!t.isRecordingEnabled)return Ge;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=new lr([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ir,i=R(t.isSampled);return r&&e===rr?Ye:r&&e===ir||i&&!t.isSampled?Ge:!0===t.isSampled?Qe:Je}function yr(){var t=[];return function(e,r){if(_(r)||w(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function br(t){var e=JSON.stringify(t,yr());return e?new Blob([e]).size:0}function wr(t){if(M(t))return 4;if(S(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(w(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=S(i)||M(i)?4:wr(i)}return e}var n=t,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];S(u)||(o||(a+=1),o=!1,a+=s.length+3+wr(u))}return a;default:return 0}}function kr(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[kr({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),kr({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var _r=Uint8Array,Sr=Uint16Array,xr=Uint32Array,Cr=new _r([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]),Mr=new _r([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]),Tr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ir=function(t,e){for(var r=new Sr(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new xr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Rr=Ir(Cr,2),Ar=Rr[1];Rr[0][28]=258,Ar[258]=28;for(var Er=Ir(Mr,0)[1],Lr=new Sr(32768),Or=0;32768>Or;++Or){var Pr=(43690&Or)>>>1|(21845&Or)<<1;Lr[Or]=((65280&(Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4))>>>8|(255&Pr)<<8)>>>1}var Dr=function(t,e,r){for(var i=t.length,n=0,a=new Sr(e);i>n;++n)++a[t[n]-1];var o,s=new Sr(e);for(n=0;e>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new Sr(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=s[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Lr[c]>>>u]=l}else for(o=new Sr(i),n=0;i>n;++n)o[n]=Lr[s[t[n]-1]++]>>>15-t[n];return o},Nr=new _r(288);for(Or=0;144>Or;++Or)Nr[Or]=8;for(Or=144;256>Or;++Or)Nr[Or]=9;for(Or=256;280>Or;++Or)Nr[Or]=7;for(Or=280;288>Or;++Or)Nr[Or]=8;var Fr=new _r(32);for(Or=0;32>Or;++Or)Fr[Or]=5;var qr=Dr(Nr,9,0),jr=Dr(Fr,5,0),Br=function(t){return(t/8>>0)+(7&t&&1)},Hr=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Sr?Sr:t instanceof xr?xr:_r)(r-e);return i.set(t.subarray(e,r)),i},Ur=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},$r=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},zr=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,a=r.slice();if(!n)return[new _r(0),0];if(1==n){var o=new _r(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new Sr(d+1),f=Wr(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(a.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=a[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=a[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new _r(v),f]},Wr=function(t,e,r){return-1==t.s?Math.max(Wr(t.l,e,r+1),Wr(t.r,e,r+1)):e[t.s]=r},Vr=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Sr(++e),i=0,n=t[0],a=1,o=function(t){r[i++]=t},s=1;e>=s;++s)if(t[s]==n&&s!=e)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=t[s]}return[r.subarray(0,i),e]},Zr=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Gr=function(t,e,r){var i=r.length,n=Br(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var a=0;i>a;++a)t[n+a+4]=r[a];return 8*(n+4+i)},Qr=function(t,e,r,i,n,a,o,s,u,l,h){Ur(e,h++,r),++n[256];for(var c=zr(n,15),d=c[0],v=c[1],f=zr(a,15),p=f[0],g=f[1],m=Vr(d),y=m[0],b=m[1],w=Vr(p),k=w[0],_=w[1],S=new Sr(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=zr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Tr[I-1]];--I);var R,A,E,L,O=l+5<<3,P=Zr(n,Nr)+Zr(a,Fr)+o,D=Zr(n,d)+Zr(a,p)+o+14+3*I+Zr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=O&&D>=O)return Gr(e,h,t.subarray(u,u+l));if(Ur(e,h,1+(P>D)),h+=2,P>D){R=Dr(d,v,0),A=d,E=Dr(p,g,0),L=p;var N=Dr(M,T,0);for(Ur(e,h,b-257),Ur(e,h+5,_-1),Ur(e,h+10,I-4),h+=14,x=0;I>x;++x)Ur(e,h+3*x,M[Tr[x]]);h+=3*I;for(var F=[y,k],q=0;2>q;++q){var j=F[q];for(x=0;j.length>x;++x)Ur(e,h,N[B=31&j[x]]),h+=M[B],B>15&&(Ur(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else R=qr,A=Nr,E=jr,L=Fr;for(x=0;s>x;++x)if(i[x]>255){var B;$r(e,h,R[257+(B=i[x]>>>18&31)]),h+=A[B+257],B>7&&(Ur(e,h,i[x]>>>23&31),h+=Cr[B]);var H=31&i[x];$r(e,h,E[H]),h+=L[H],H>3&&($r(e,h,i[x]>>>5&8191),h+=Mr[H])}else $r(e,h,R[i[x]]),h+=A[i[x]];return $r(e,h,R[256]),h+A[256]},Jr=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yr=function(){for(var t=new xr(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Kr=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Yr[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},Xr=function(t,e,r,i,n){return function(t,e,r,i,n,a){var o=t.length,s=new _r(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Gr(u,l,t.subarray(h,c)):(u[h]=true,l=Gr(u,l,t.subarray(h,o)))}else{for(var d=Jr[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Sr(32768),m=new Sr(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new xr(25e3),_=new Sr(288),S=new Sr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var R=w(h),A=32767&h,E=m[R];if(g[A]=E,m[R]=A,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Qr(t,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var P=2,D=0,N=f,F=A-E&32767;if(L>2&&R==w(h-F))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=F&&--N&&A!=E;){if(t[h+P]==t[h+P-F]){for(var H=0;B>H&&t[h+H]==t[h+H-F];++H);if(H>P){if(P=H,D=F,H>q)break;var U=Math.min(F,H-2),z=0;for(O=0;U>O;++O){var W=h-F+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,E=W)}}}F+=(A=E)-(E=g[A])+32768&32767}if(D){k[M++]=268435456|Ar[P]<<18|Er[D];var Z=31&Ar[P],G=31&Er[D];C+=Cr[Z]+Mr[G],++_[257+Z],++S[G],T=h+P,++x}else k[M++]=t[h],++_[t[h]]}}l=Qr(t,u,true,k,_,S,C,M,I,h-I,l)}return Hr(s,0,i+Br(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},ti=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ei=function(t,e){var r=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&&ti(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},ri=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ii(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class ni{constructor(t,e){var r,i,n,a;void 0===e&&(e={}),this.it={},this.nt=Date.now(),this.ot=-1/0,this.st=()=>{var t=Date.now(),e=t-this.nt;e>0?(this.ut=Math.min(this.ht,this.ut+e/1e3*this.ct),this.nt=t):this.nt=t},this.dt=t=>{if(!this.it[t]){var e,r;this.it[t]=!0;var i=this.vt(t);null==(e=(r=this.ft).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,a,o,s,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=t.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=t.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.yt(t.id);return!this.wt.consumeRateLimit(e[0])&&t}));var n,a,o=i-e.attributes.length;o>0&&(null==(n=(a=this.ft).onDroppedAttributeMutations)||n.call(a,o))}var s=this.bt(e);if(0!==s||r===s){if(this.kt)return t;this.st();var u,l,h=wr(t);return h>this.ut?(null==(u=(l=this.ft).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ut-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.ot));this.St=setTimeout((()=>{var t,e;this.St=void 0,this.ot=Date.now(),null==(t=(e=this.ft).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.ft=e,this.wt=new F({bucketSize:null!==(r=this.ft.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ft.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.dt,A:Lt}),this.ht=null!==(n=this.ft.bytesBucketSize)&&void 0!==n?n:0,this.ct=null!==(a=this.ft.bytesRefillRate)&&void 0!==a?a:25600,this.kt=!Number.isFinite(this.ht)||0>=this.ht,this.ut=this.ht;var o=this.ft.resyncIntervalMs;this.xt=I(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.it={},this.St&&(clearTimeout(this.St),this.St=void 0),this.ot=Date.now()}stop(){this.wt.stop(),this.reset(),this.ut=this.ht,this.nt=Date.now(),this.ot=-1/0}}At.DEBUG=!1,At.LIB_VERSION="1.427.2",At.LIB_NAME="web";class ai{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.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt($e,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct($e);return _(e=r)&&x(e.sessionId)&&I(e.size)&&r.sessionId===t?r.size:0}}function oi(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,Lt)}function si(t){return"$survey_response_"+t}function ui(t,e){if(!e)return null;var r=t[si(e)];return w(r)?[...r]:r}function li(t,e,r){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!S(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,a=ui(t,e.id);S(a)||(i[n]=a)}})),h({$survey_questions:e.questions.map((e=>{var i,n;return{id:e.id,question:null!==(i=null==r?void 0:r[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==i?i:e.question,response:ui(t,e.id)}}))},t,i)}function hi(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function ci(t){return"string"==typeof t&&t.trim()?t.trim():null}function di(t){return t.toLowerCase()}function vi(t,e,r){if(!t||!e)return null;var i=di(e),n=Object.keys(t).find((t=>di(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(t).find((t=>di(t)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function pi(t,e,r){var i,n=vi(t.translations,e,r),a=h({},t),o=!1;if(n){var s,u=null==(s=t.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),S(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of fi){var d=u[c];S(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(t){return fi.some((e=>!S(t[e])))})(u)&&(o=!0)}var v=t.questions.map((t=>function(t,e,r){var i,n=vi(t.translations,e,r);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(i=t.translations)?void 0:i[n];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var o=h({},t),s=!1;return S(a.question)||(o.question=a.question,s=!0),S(a.description)||(o.description=a.description,s=!0),S(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!S(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!S(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!S(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(t){return w(t.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:t,matchedKey:s?n:null,hasChanges:s}}(t,e,r))),f=v.map((t=>t.question)),p=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(i=v.find((t=>t.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+e)),{survey:a,matchedKey:o?n||g:null}}function gi(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}var mi=(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}},yi=t=>t.toLowerCase(),bi={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>mi(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!mi(e,t))))),icontains:(t,e)=>e.map(yi).some((e=>t.map(yi).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(yi).every((e=>t.map(yi).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},wi=new Set(["is_not","not_icontains","not_regex"]);function ki(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],a=t.operator||"exact";if(S(n)||M(n))return wi.has(a);var o=bi[a];return!!o&&!S(t.value)&&!M(t.value)&&o(w(t.value)?t.value.map(String):[String(t.value)],w(n)?n.map(String):[String(n)])}))}var _i=Ot("[SessionRecording]");function Si(t,e){return e?t:"!"+t}function xi(t,e){return t===e||t!=="!"+e&&null}class Ci{constructor(t,e,r,i,n,a,o){this.Tt=null,this.It=mr,this._instance=t,this.X=e,this.tt=r,this.et=i,this.Rt=n,this.At=a,this.Et=o}onRemoteConfig(t){this.Tt=I(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ur([this.tt,this.X]),this.It=gr):(this.Lt=new lr([this.tt,this.X]),this.It=mr),this._instance.register_for_session({[Ze]:t.triggerMatchType}),this.X.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,((t,e)=>{this.Rt("linked_flag_matched",{flag:t,variant:e}),this.Et()}))}getStatus(t){return this.It({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(t,e,r,i){this.X.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.Y.length&&T(this.Ot))return this.Ot=t((t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){_i.error("Could not activate event trigger",t)}})),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.Tt;if(!I(n))return null==(r=this._instance.persistence)||r.unregister(De),void(null==(i=this._instance.persistence)||i.unregister(Ae));var a=this._instance.get_property(De),o=this._instance.get_property(Ae),s=xi(a,t),u=I(o)&&o!==n,l=S(o)&&a===t,h=u||l||!R(s),c=h?oi(t,n):s;h&&(c?this.Rt("sampled"):_i.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[De]:Si(t,c),[Ae]:M(o)&&a===t?null:n})}ensureSamplingDecision(t){if(I(this.Tt)){var e=this._instance.get_property(De);R(xi(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(qe),null==(e=this._instance.persistence)||e.unregister(Fe),null==(r=this._instance.persistence)||r.unregister(De),null==(i=this._instance.persistence)||i.unregister(Ae),null==(n=this._instance.persistence)||n.unregister(Ne)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===rr}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===rr)).map((t=>t.label))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.X.stop(),this.et.stop()}}class Mi{constructor(t,e,r,i,n){this.Pt=[],this.Dt=new Map,this.Nt=!1,this._instance=t,this.X=e,this.Rt=r,this.Ft=i,this.Et=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[Ze]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.X.onConfig(t)):_i.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Xe;if(t.urlTriggerMatching.urlBlocked)return Ke;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Ge;var i=!1,n=!1;for(var a of e){var o=a.triggerStatus(t.sessionId);if(o===er){var s=a.group.id,u=r.get(s);S(u)?Lt.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===rr&&(i=!0)}return n?Qe:i?Ye:Ge}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Dt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;I(i)&&(M(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.X.checkUrlBlocklist(e,r);var a=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Et(e))}),t)};for(var o of this.Pt)a(o)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t((t=>{var r;if(this.Nt)return _i.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.jt(r,t.properties)){var a=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),o=i._instance.get_property(ze),s=a.some((e=>!e.properties||0===e.properties.length||ki(e.properties,t.properties,o)));s&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Et(n))}}),e)};for(var a of this.Pt)n(a)}catch(t){_i.error("Could not activate event trigger for trigger groups",t)}})),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,a=i.sampleRate,o=He+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(_(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==t,h=I(v)&&v!==a,u=d===t&&I(v)&&v===a&&R(f)?f:null}else u=s===t||null,l="string"==typeof s&&s!==t,c=s===t;var p=l||h||c||!R(u),g=p?oi(t+n,a):u;p&&this.Ft("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:g}),this.Dt.set(n,g),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:t,sampleRate:a,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(De),null==(e=this._instance.persistence)||e.unregister(Ae),null==(r=this._instance.persistence)||r.unregister(Ne),this.Pt)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(je+s),null==(a=this._instance.persistence)||a.unregister(Be+s),null==(o=this._instance.persistence)||o.unregister(He+s)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(t),o=!0===this.Dt.get(n);a&&e.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Pt)if(e.triggerStatus(t)===rr)return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap((e=>e.triggerStatusNoSideEffects(t)!==rr?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear(),this.X.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||ki(r,e,this._instance.get_property(ze))}qt(t){var e=this;this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear();var r=function(t){var r=new pr(e._instance,t,((r,i)=>{e.Rt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Et()}));e.Pt.push(r)};for(var i of t)r(i)}}var Ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ii=1e5,Ri="https://schema.org",Ai=[],Ei="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(" "),Li="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Oi="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(" "),Pi="Accommodation AdministrativeArea Country Place State".split(" "),Di={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:Li,publisher:Oi},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ai},Offer:{seller:Oi},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:Oi,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Oi,areaServed:Pi,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ai}},Ni={},Fi=[[Li,Ni],["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(" "),Di.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Di.Event],[Oi,Di.Organization],[Pi,Di.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Di.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),Ni]],qi="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ji(t,e){return y.call(t,e)?t[e]:void 0}function Bi(t){var e=typeof t;return M(t)||"string"===e||"number"===e||"boolean"===e}function Hi(t){return Bi(t)||w(t)&&t.every(Bi)?t:void 0}function Ui(t){if(y.call(Di,t))return Di[t];for(var e of Fi){var r=e[1];if(e[0].includes(t))return r}return qi.includes(t)?Ni:void 0}function $i(t,e){if(!_(t))return null;var r=ji(t,"@type"),i=function(t){return("string"==typeof t?[t]:w(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!Ui(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},a=Hi(ji(t,"@id"));for(var o of(S(a)||(n["@id"]=a),Ei)){var s=Hi(ji(t,o));S(s)||(n[o]=s)}for(var u of i){var l=Ui(u),h=function(){var e=ji(t,c),r=l[c];if(!0===r){var i=Hi(e);S(i)||(n[c]=i)}else if(w(e)){var a=e.map((t=>$i(t,r))).filter(_);a.length&&(n[c]=a)}else{var o=$i(e,r);o&&(n[c]=o)}};for(var c of Object.keys(l))h()}return n}function zi(t){if(!_(t))return null;var e=ji(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var r=$i(t);if(r)return h({"@context":Ri},r);var i=ji(t,"@graph");if(!w(i))return null;var n=i.map((t=>$i(t))).filter(_);return n.length?{"@context":Ri,"@graph":n}:null}function Wi(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Vi(t,e,r){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!!r&&t.matches(r)}catch(t){return!1}}function Zi(t){return Wi(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Wi)}function Gi(t){return S(t)?void 0:Math.round(t)}function Qi(t){return _(t)?t.network_timing:t}var Ji,Yi,Ki=943718.4,Xi="[SessionRecording]",tn=Ot(Xi),en=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],rn=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function nn(){var t;return null==s||null==(t=s.__PosthogExtensions__)?void 0:t.rrweb}function an(){var t;return null==(t=nn())?void 0:t.record}function on(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,yr())}}function sn(t){return ii(function(t,e){void 0===e&&(e={});var r=Kr(),i=t.length;r.p(t);var n=Xr(t,e,ri(e),8),a=n.length;return ei(n,e),ti(n,a-8,r.d()),ti(n,a-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new _r(t.length+(t.length>>>1)),n=0,a=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var s=new _r(n+8+(r-o<<1));s.set(i),i=s}var u=t.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Hr(i,0,n)}(on(t))))}function un(t){return ln.apply(this,arguments)}function ln(){return ln=l((function*(t){var e=on(t),r=yield function(t,e,r){return It.apply(this,arguments)}(e,At.DEBUG,{rethrow:!0});return ii(new Uint8Array(yield r.arrayBuffer()))})),ln.apply(this,arguments)}var hn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,cn=!1;function dn(t){return w(t)&&0===t.length?Ji=null!=Ji?Ji:sn([]):sn(t)}function vn(t){return fn.apply(this,arguments)}function fn(){return(fn=l((function*(t){return w(t)&&0===t.length?Ji||(Yi=null!=Yi?Yi:un([]).then((t=>(Ji=t,t))).catch((t=>{throw Ji=void 0,Yi=void 0,t}))):un(t)}))).apply(this,arguments)}function pn(t){return hn&&!cn&&function(t){return t.type===c.FullSnapshot||t.type===c.IncrementalSnapshot&&(t.data.source===d.Mutation||t.data.source===d.StyleSheetRule)}(t)}function gn(t){return{event:t,size:wr(t)}}function mn(t,e){return h({},t,{data:e,cv:"2024-10"})}function yn(t,e){return h({},t,{cv:"2024-10",data:h({},t.data,e)})}function bn(t){try{if(t.type===c.FullSnapshot)return gn(mn(t,sn(t.data)));if(t.type===c.IncrementalSnapshot&&t.data.source===d.Mutation)return gn(yn(t,{texts:dn(t.data.texts),attributes:dn(t.data.attributes),removes:dn(t.data.removes),adds:dn(t.data.adds)}));if(t.type===c.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return gn(yn(t,{adds:t.data.adds?sn(t.data.adds):void 0,removes:t.data.removes?sn(t.data.removes):void 0}))}catch(t){tn.error("could not compress event - will use uncompressed event",t)}return{event:t,size:br(t)}}function wn(){return wn=l((function*(t){try{if(t.type===c.FullSnapshot)return gn(mn(t,yield un(t.data)));if(t.type===c.IncrementalSnapshot&&t.data.source===d.Mutation){var e=yield Promise.all([vn(t.data.texts),vn(t.data.attributes),vn(t.data.removes),vn(t.data.adds)]);return gn(yn(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===c.IncrementalSnapshot&&t.data.source===d.StyleSheetRule){var r=yield Promise.all([t.data.adds?un(t.data.adds):void 0,t.data.removes?un(t.data.removes):void 0]);return gn(yn(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Ct})(e)&&(cn=!0),tn.error("could not compress event asynchronously - trying synchronous compression",e),bn(t)}return{event:t,size:br(t)}})),wn.apply(this,arguments)}function kn(t,e){return t.type===c.Custom&&t.data.tag===e}function _n(t){return kn(t,"sessionIdle")}function Sn(t){return kn(t,"$session_ending")}function xn(t){return kn(t,"$session_starting")}class Cn{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error(Xi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Ut(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get $t(){return xi(this._instance.get_property(De),this.sessionId)}get Tt(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return I(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Yt=!1,this.Kt=[],this.Xt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.ae=!1,this.oe=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,a;if(r&&(t!==this.Bt||e!==this.Ie)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(s&&this.Ft("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(o=this.Re)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ue),this.he=!1,null==(n=nn())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ft("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Xt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Xt;this.Xt="unknown",this.Ee(h)}s&&this.Ft("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(a=this.Vt)||a.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Ne])===this.Bt},this.Pe=()=>{var t,e;if(0===this.De.data.length)return null;var r=null==(t=this.De.data[0])?void 0:t.timestamp,i=null==(e=this.De.data[this.De.data.length-1])?void 0:e.timestamp;return I(r)&&I(i)?i-r:null},this.Ne=()=>{var t,e,r=this.Wt;if(!I(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Fe;return I(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,a=this.Pe();return!!M(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Ne]:this.Bt}),!1)},this.qe=()=>{this.status!==Ye?(this.ne&&this.ae&&this.je&&!this.oe&&(this.ne=!1),this.Be(),this.He()):this.Ue()},this.$e=()=>{this.qe()},this.ze=()=>{this.Ft("browser offline",{})},this.We=()=>{this.Ft("browser online",{})},this.Ve=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.je=!0),this.Ft("window "+i.visibilityState,{}))},this._instance=t,this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),n=r.windowId;this.Bt=r.sessionId,this.Ie=n,this.et=new vr(this._instance),this.X=new dr(this._instance),this.tt=new fr(this._instance),this.De=this.Ue(),this.Ht.sessionTimeoutMs>this.Ut||tn.warn("session_idle_threshold_ms ("+this.Ut+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new ai(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ze(){var t,e,r,i,n,a,o,s,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return S(c)&&S(d)&&S(v)&&S(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Ge(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!T(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!S(i)&&i!==n}));0!==i.length&&(this.de=!0,tn.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==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Qe(){var t;return N(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Ot("canvas recording resolution scale"),1)}get Je(){var t,e,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:N(h,0,12,Ot("canvas recording fps"),4),quality:N(c,0,1,Ot("canvas recording quality"),.4)}}get Ye(){var t,e=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Ke(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Qi(this._instance.config.capture_performance),u=Qi(null==i?void 0:i.capturePerformance),l=!!(R(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Xe(){var t,e,r=[],i=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;i&&this.Ye&&r.push(i());var a=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ke&&k(a))if(!Ft.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=k(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((t,e,r)=>{var i,n={payloadSizeLimitBytes:we.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...we.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...we.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,u=(i=be(n),t=>(null!=t&&t.requestBody&&(t.requestBody=Me(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=Me(t.responseBody,t.responseHeaders,i,"Response")),t)),l=e=>{return u(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=qt(t.name),a=0===e.indexOf("http")?null==(i=qt(e))?void 0:i.pathname:e;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Ce.some((t=>0===o.indexOf(t)))))return t}})((xe((i=e).requestHeaders),xe(i.responseHeaders),i),t.api_host,r));var i},c=k(t.session_recording.maskNetworkRequestFn);return c&&k(t.session_recording.maskCapturedNetworkRequestFn)&&Lt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:h({},e,{name:null==r?void 0:r.url})}),n.maskRequestFn=k(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=l(e);if(r){var i=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,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return T(n)&&i?(Ie.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!S(t))return t.requestBody=Te(t.requestBody,"Request"),t.responseBody=Te(t.responseBody,"Response"),t}(l(t)),h({},we,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ke,o)))}else tn.info("NetworkCapture not started because we are on localhost.");return r}tr(t){return this._instance.config.disable_capture_url_hashes?ut(t):t}er(t,e){void 0===e&&(e=!1);var r=e?ut(t):this.tr(t),i=this._instance.config.mask_personal_data_properties?[...Ti,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");w(c)&&(e.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}rr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ir(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Kt.length?this.Kt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):tn.warn("could not emit queued rrweb event.",e,t),!1}}Ft(t,e){return this.ir(rn((()=>an().addCustomEvent(t,e))))}nr(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Xt}ar(t){if(!this.nr())return!1;try{var e=an();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.er(e.origin+e.pathname+e.search);this.hr!==r&&(this.hr=r,this.Ft("$url_changed",{href:r}))}catch(t){}}cr(){if(this.Kt.length){var t=[...this.Kt];this.Kt=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}At(){return this.ir(rn((()=>an().takeFullSnapshot())))}get dr(){var t,e,r;if(null!=(t=this.Vt)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return I(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Xt){var t=this.dr;t&&(this.pr=setInterval((()=>{this.At()}),t))}}Et(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),tn.info("recording paused due to URL blocker"),this.Ft("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.At(),this.sr(),this.vr(),this.Ft("recording resumed",{reason:"left blocked url"}),tn.info("recording resumed"))}br(t,e){var r;if("event"===t&&this.gr(),!this.Yt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Yt=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?Fe:qe]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Et(),this.He(),this.Rt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Yt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(Re);if(t){var e;try{e=_(t)?t:JSON.parse(t)}catch(t){return void tn.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return tn.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(Re))}return e}}wr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var r,n,a=this.zt;if(a){this.isStarted||(this.ne=!1!==this.Xt&&!this.se,this.se=!1,this.ae=this.ne,this.oe=!1),this._e&&(this.kr(),this.Ue());var o=this.Ht.checkAndGetSessionAndWindowId(),s=o.windowId;this.Bt=o.sessionId,this.Ie=s,null==(r=this._instance.persistence)||r.unregister(Ue),null!=a&&a.endpoint&&(this.Zt=null==a?void 0:a.endpoint),this.Vt=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Mi(this._instance,this.X,this.Rt.bind(this),this.Ft.bind(this),this.Et.bind(this)):new Ci(this._instance,this.X,this.tt,this.et,this.Rt.bind(this),this.At.bind(this),this.Et.bind(this)),this.Vt.onRemoteConfig(a),null==(n=this.Ot)||n.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.br(t,e))),this.wr(Ee,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ee)})),this.wr(Le,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Le)})),this.wr(Pe,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Pe)})),this.wr(Oe,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Oe)})),this.Vt.makeSamplingDecisions(this.sessionId),this._r(),this.ue||(Nt(t,"beforeunload",this.qe),Nt(t,"pagehide",this.$e),Nt(t,"offline",this.ze),Nt(t,"online",this.We),Nt(i,"visibilitychange",this.Ve),!this.xe&&k(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&k(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",(()=>{this.Ae(),this.Xt="unknown",this.stop(),this.Me=this.Ht.onSessionId(((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)}))})):k(this.Ht.on)||tn.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),T(this.Se)&&(this.Se=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Ft("$pageview",{href:e})}}catch(t){tn.error("Could not add $pageview to rrweb session",t)}}))),this.status===Je&&this.Rt(e||"recording_initialized"))}else tn.info("remote config must be stored in persistence before recording can start")}Sr(){var e,r,n,a,o,s;null==t||t.removeEventListener("beforeunload",this.qe),null==t||t.removeEventListener("pagehide",this.$e),null==t||t.removeEventListener("offline",this.ze),null==t||t.removeEventListener("online",this.We),null==i||i.removeEventListener("visibilitychange",this.Ve),clearInterval(this.pr),this.Cr(),null==(e=this.Se)||e.call(this),this.Se=void 0,null==(r=this.Ot)||r.call(this),this.Ot=void 0,null==(n=this.xe)||n.call(this),this.xe=void 0,null==(a=this.Ce)||a.call(this),this.Ce=void 0,null==(o=this.Me)||o.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Mr(),this.kr()}kr(){this.ke+=1,this.be=[],this.we=0,this.Tr=void 0,this._e=!1}Mr(){var t,e,r;null==(t=this.Ir)||t.stop(),this.Kt=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Rr(){if(!this.Tr||0===this.we)return!1;if(this._e)return!0;this._e=!0;var t=this.ke;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.ke&&(this._e=!1,this.He(),this.Ue(),this.Sr(),tn.info("stopped"))})).catch((()=>{this._e=!1,this.Sr(),tn.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.He(),this.Ue(),this.Sr(),tn.info("stopped"))}Ee(t){this.Le=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=nn())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.ne=t,this.ae=!1}gr(){this.isStarted||(this.se=!0),this.ne&&(this.ne=!1,this.ae=!1,this.oe&&(this.oe=!1,this.At()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ue(),this.Mr()),this.Ue(),this.Sr(),tn.info("discarded")}Or(t,e,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==Ge?(this.Pr(t,i),this.Dr(a)):this.Ue()}Nr(){try{this.Fr()}catch(t){this.ce||(this.ce=!0,tn.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=nn())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||tn.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Pr(t,e){t.type!==c.FullSnapshot?t.type===c.IncrementalSnapshot&&(S(this.me)||this.me===e||this.ye===e||(this.ye=e,tn.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.At())):this.me=e}qr(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter((e=>e!==t))}jr(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Or(t.event,e,r,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?bn(t.event):{event:t.event,size:br(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Be(){[...this.be].forEach((t=>{this.Br(t)}))}Hr(t,e,r,i){var n=this,a={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:i,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=e?pn(t)?yield function(t){return wn.apply(this,arguments)}(t):bn(t):{event:t,size:br(t)};r=o.event,i=o.size}catch(e){tn.error("could not process queued compression event - will use uncompressed event",e),r=t,i=br(t)}n.jr(a,r,i)}finally{n.qr(a)}}));return function(){return r.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.cr(),t&&_(t))){if(t.type===c.Meta){var h=this.er(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(t,e))),!this.X.urlBlocked||function(t){return t.type===c.Custom&&"recording paused"===t.data.tag}(t)){var v,f,p;t.type===c.FullSnapshot&&(null!=(v=nn())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this.he=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(f=this.Ir)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ue]:t.timestamp},void 0));var g=t.type===c.FullSnapshot&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));g&&this.Ur();var m=this.Ir?this.Ir.throttleMutations(t):t;if(m){var y=function(t){var e=t;if(e&&_(e)&&6===e.type&&_(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]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),b=function(t){return Sn(t)?t.data.payload:null}(y),w=function(t){return xn(t)?t.data.payload:null}(y),k=function(t){return _n(t)?t.data.payload:null}(y);b||w?null!=b&&b.lastActivityTimestamp&&(y.timestamp=b.lastActivityTimestamp):null!=k&&k.sessionId||this.$r(y),t.type===c.FullSnapshot&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var S=null!==(i=null!==(n=null!==(a=null==b?void 0:b.currentSessionId)&&void 0!==a?a:null==w?void 0:w.nextSessionId)&&void 0!==n?n:null==k?void 0:k.sessionId)&&void 0!==i?i:this.Bt,x=null!==(o=null!==(s=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==s?s:null==k?void 0:k.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Xt||function(t){return _n(t)||Sn(t)||xn(t)}(y)){y.type===c.FullSnapshot&&(this.te=0),k&&(y.timestamp=k.lastActivityTimestamp+k.threshold);var C=this.Qt;this.Qt=!0,g?this.sr(!0):C||this.sr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||M&&pn(y))this.Hr(y,M,S,x);else{var T=M?bn(y):{event:y,size:br(y)};this.Or(y,T.event,T.size,S,x)}}else(function(t){return t.type===c.FullSnapshot||t.type===c.Meta||t.type===c.IncrementalSnapshot&&t.data.source!==d.CanvasMutation})(y)&&this.te++}else!0===this.Xt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.$t,rrwebError:this.ue,urlTriggerMatching:this.X,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Ge}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.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.At(),this.gr(),this.Rt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[De]:this.sessionId,[Ae]:null}),this.At(),this.gr(),this.Rt("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var e,r=null==t||null==(e=t.location)?void 0:e.href;if(!r)return;var i=this.er(r);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.He()}),2e3))}Vr(){return this.me!==this.De.sessionId&&0!==this.De.data.length&&this.De.data.every((t=>(null==t?void 0:t.type)===c.Custom&&!Sn(t)&&!xn(t)))}Zr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==Ye)return S(this.Qr)||this._instance.register_for_session({[Ve]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return S(this.Qr)||this._instance.register_for_session({[Ve]:[]}),void(this.Qr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Qr&&(this.Qr=i,this._instance.register_for_session({[Ve]:e}),tn.info("buffering: "+r))}He(){var t;if(this.Cr(),this.ne)return this.De;if(this.Vr())return this.De.size>Ki?this.Ue():this.De;var e=this.De;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Ne(),i=this.status;if(this.Gr(i),i===Ye||i===Ke||i===Ge||r)return this.Lr(),this.De;if(this.De!==e)return this.De;if(e.data.length>0){var n,a=this.zr();kr(e).forEach((t=>{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.Jr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:At.LIB_NAME,$lib_version:At.LIB_VERSION,$snapshot_host:a})})),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}Dr(t){var e,r=2+((null==(e=this.De)?void 0:e.data.length)||0),i=t.$session_id,n=this.De.sessionId!==i;if(n||!0!==this.Xt&&!this.ne&&this.De.size+t.$snapshot_bytes+r>Ki){var a=this.Bt;if(this.De=this.He(),this.Bt!==a)return;n&&this.De.data.length>0&&(this.De=this.Ue()),this.De.sessionId=i,this.De.windowId=t.$window_id}this.ne&&(this.oe||this.De.size+t.$snapshot_bytes+r>Ki)?this.oe||(this.oe=!0,this.De=this.Ue()):(this.De.size+=t.$snapshot_bytes,this.De.data.push(t.$snapshot_data),this.De.sizes.push(t.$snapshot_bytes),!0===this.Xt||this.ne||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Fe(){var t,e,r=null==(t=this.De)?void 0:t.data[(null==(e=this.De)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Ur(){if(!this.De||0===this.De.data.length)return this.Ue();for(var t=-1,e=this.De.data.length-1;e>=0;e--)if(this.De.data[e].type===c.Meta){t=e;break}return 0>t?this.Ue():(this.De.data=this.De.data.slice(t),this.De.sizes=this.De.sizes.slice(t),this.De.size=this.De.sizes.reduce(((t,e)=>t+e),0),this.De)}Ue(){return this.De={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.De}Rt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),tn.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ft("$recording_started",h({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==en.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Yr(t);e||!0===this.Xt||t.timestamp-this.Jt>this.Ut&&(this.Xt=!0,clearInterval(this.pr),this.Ft("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.Ut,bufferLength:this.De.data.length,bufferSize:this.De.size,sessionId:this.Bt,windowId:this.Ie}),this.He());var r=!1;if(e&&(this.Jt=t.timestamp,this.Xt)){var i="unknown"===this.Xt;this.Xt=!1,i||(this.Ft("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),a=n.windowId,o=n.sessionId,s=this.Bt!==o,u=this.Ie!==a;if(this.Ie=a,this.Bt=o,s||u){var l=s&&!1!==this.Xt;l&&(this.Xt="unknown"),this.Ee(l)}else if(e&&this.gr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&c&&this.At(),this.sr(),this.vr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,a,o,s,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=nn())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.De.data.length,$sdk_debug_replay_internal_buffer_size:this.De.size,$sdk_debug_current_session_duration:this.Fe,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:Gi(null==(r=this.Ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Gi(null==(i=this.Ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.Ar)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Gi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Gi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Gi(null==(s=nn())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=nn())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,$sdk_debug_rrweb_attached:!!this.Gt,$sdk_debug_rrweb_start_attempted:this.le}}_r(){var e;if(!this.Gt){this.le=!0;var r,n,a,o,s={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},u=this._instance.config.session_recording;for(var l of Object.entries(u||{})){var c=l[0],d=l[1];if(c in s)if("maskInputOptions"===c)s.maskInputOptions=h({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};S(v.mousemove)||(f.mousemove=v.mousemove),S(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),s.sampling=f}else s[c]=d}!0===(null==u?void 0:u.captureJsonLd)&&!0!==s.slimDOMOptions&&"all"!==s.slimDOMOptions&&(s.slimDOMOptions=h({},s.slimDOMOptions,{script:!0})),this.Je&&this.Je.enabled&&(s.recordCanvas=!0,s.sampling=h({},s.sampling,{canvas:this.Je.fps}),s.dataURLOptions={type:"image/webp",quality:this.Je.quality},s.canvasResolutionScale=this.Qe,s.canvasMasking={configured:()=>{var t;return k(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(k(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,tn.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ze&&(s.maskAllInputs=null===(r=this.Ze.maskAllInputs)||void 0===r||r,s.maskTextSelector=null!==(n=this.Ze.maskTextSelector)&&void 0!==n?n:void 0,s.blockSelector=null!==(a=this.Ze.blockSelector)&&void 0!==a?a:void 0,s.maskAllElementAttributes=null!==(o=this.Ze.maskAllElementAttributes)&&void 0!==o&&o),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ve||(this.ve=!0,tn.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.Ge();var p=an();if(p){this.Ir=null!==(e=this.Ir)&&void 0!==e?e:new ni(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";tn.info(r,{node:e}),this.log(Xi+" "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.re&&this.log(Xi+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.At()});var g=this.Xe();if(this.Gt=p(h({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,tn.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},s)),!this.Gt)return this.ue=!0,void tn.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==u?void 0:u.captureJsonLd)&&i&&null!=t&&t.MutationObserver&&!this.ur&&(this.ur=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),a=Ii,o=e=>{try{var o=n();if(!a||!1===o||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(Vi(r,e.blockClass,e.blockSelector)||Vi(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var s=function(t){if(!t||t.length>Ii)return null;try{var e=JSON.parse(t),r=w(e)?e.map(zi):zi(e);if(M(r)||w(r)&&(!r.length||r.some(M)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!s)return void i.delete(e);var u=s[0],l=s[1];if(M(o))return void i.set(e,l);if(i.get(e)!==l){if(l.length>a)return void(a=0);r.emit(u)&&(i.set(e,l),a-=l.length)}}catch(t){return}};try{var s=new e((t=>{try{if(!a||!1===n())return;var e=t=>{for(var e of Zi(t))o(e)};for(var r of t)if("childList"===r.type)Wi(r.target)&&o(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Wi(i)&&o(i)}else"attributes"===r.type&&Wi(r.target)&&o(r.target)}catch(t){return}}));return s.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),a&&!1!==n()&&Zi(t.documentElement).forEach((t=>{e&&i.delete(t),o(t)}))},stop(){return s.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{blockClass:s.blockClass,blockSelector:s.blockSelector,maskTextClass:s.maskTextClass,maskTextSelector:s.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.Jt=Date.now(),this.Xt=R(this.Xt)?this.Xt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Ft("$session_options",{sessionRecordingOptions:s,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Ft("$posthog_config",{config:this._instance.config})}else tn.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ft(t,e)}}var Mn=["type"],Tn=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}({}),In=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}({}),Rn=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}({}),An=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),En=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Ln=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}({}),On=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 Pn(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase();var Dn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Nn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Fn={};function qn(t){if(Fn[t])return Fn[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Dn?Dn[t]:void 0,n=Boolean(i&&i.every((t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))}))),a=t in Nn?Nn[t]:void 0,o=Boolean(a&&a.every((t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Fn[t]=e.prototype,e.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return e.prototype;var h=l[t].prototype;return h?(function(t){return Pn(t,"AppleWebKit")&&!Pn(t,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",t),u=!0),Fn[t]=h):r}catch(t){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var jn={};function Bn(t,e,r){var i,n=t+"."+String(r);if(jn[n])return jn[n].call(e);var a=qn(t),o=null===(i=Object.getOwnPropertyDescriptor(a,r))||void 0===i?void 0:i.get;return o?(jn[n]=o,o.call(e)):e[r]}var Hn={};function Un(t,e,r){var i=t+"."+String(r);if(Hn[i])return Hn[i].bind(e);var n=qn(t)[r];return"function"!=typeof n?e[r]:(Hn[i]=n,n.bind(e))}function $n(){return qn("MutationObserver").constructor}function zn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},a=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=a,()=>{if(t[e]!==a)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],o=r(i);o;){if(o.next===a)return void(o.next=n.next);o=r(i=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Wn={childNodes:t=>Bn("Node",t,"childNodes"),parentNode:t=>Bn("Node",t,"parentNode"),parentElement:t=>Bn("Node",t,"parentElement"),textContent:t=>Bn("Node",t,"textContent"),contains:(t,e)=>Un("Node",t,"contains")(e),getRootNode:t=>Un("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Bn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Bn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Un("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Un("Element",t,"querySelectorAll")(e),mutationObserver:$n,patch:zn},Vn=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Zn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Gn=0;function Qn(){Gn+=1}function Jn(){return Gn}function Yn(t,e){return e!==Gn||t>6e4}var Kn=0,Xn=0,ta=0,ea=Vn(),ra=null,ia=null,na=[],aa=0,oa=0,sa={slowestBatchMs:0},ua={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},la=t=>t&&t>0?t:null;function ha(t){(Kn+=1)>1||(ea=Vn(),na=[],aa=0,ia=la(t),Xn=Zn(),ta=Gn)}function ca(){return 0===Kn?ra||Vn():(Kn-=1)>0?ea:(ea.durationMs=Zn()-Xn,ea.deferredStylesheetCount=aa,ua.deferredCount+=aa,ia=null,Yn(ea.durationMs,ta)?ea:ra=ea)}var da=32;function va(t,e,r){var i=t.length;if(r>=da)return i;for(var n=0;t.length>n;n++){var a=t[n];try{var o=a.cssRules;if(o&&o.length)i+=va(o,e,r+1);else if(e&&a.styleSheet){var s=a.styleSheet;if(!e.has(s)){e.add(s);var u=s.rules||s.cssRules;u&&(i+=va(u,e,r+1))}}}catch(t){}}return i}function fa(t){if(0!==Kn){var e=va(t,null,0);ea.cssRuleCount+=e,oa>0&&(ea.nonDeferrableCssRuleCount+=e)}}function pa(t){oa+=1;try{return t()}finally{oa-=1}}function ga(t){Kn>0&&(ea.stylesheetMs+=t)}function ma(t){if(0===Kn||null===ia)return!1;var e=ea.cssRuleCount-ea.nonDeferrableCssRuleCount;return e>=ia||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),va(e,r,0)}catch(t){return 0}}(t)>ia}function ya(){ua.failedCount+=1}function ba(t){t>0&&(ua.abandonedCount+=t)}function wa(t){return wa="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},wa(t)}function ka(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=wa(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=wa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==wa(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _a(t){return t.nodeType===t.ELEMENT_NODE}function Sa(t){var e=t&&"host"in t&&"mode"in t&&Wn.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Wn.shadowRoot(e)===t)}function xa(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Ca(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 Ma(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var Ta=0;function Ia(t){var e=0===Ta,r=e?Zn():0;Ta+=1;try{var i=t.rules||t.cssRules;if(!i)return null;fa(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Ca(Array.from(i,(t=>Ra(t,n))).join(""))}catch(t){return null}finally{Ta-=1,e&&ga(Zn()-r)}}function Ra(t,e){if(Ea(t)){var r;try{r=Ia(t.styleSheet)||Ma(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return Za(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return La(t)&&t.selectorText.includes(":")&&(n=Aa(n)),e?Za(n,e):n}function Aa(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ea(t){return"styleSheet"in t}function La(t){return"selectorText"in t}var Oa=/^-?[A-Za-z_][\w-]*$/,Pa=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Da(t){var e=[],r=!1,i=null,n=new Map;function a(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void a(null)}var s=e[e.length-1];return s.parts.push(t),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=t);o(e[e.length-1],n.importRule,t)}function o(t,e,r){try{var i;try{i=r||Ma(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=Za(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){a(null)}}function s(t){var r=t.rules[t.index];if("sheet"===t.kind&&Ea(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(t,r,null)}if(!function(t,r){try{var i=function(t){var 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(La(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Oa.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var 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]?Oa.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Pa.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Za(i,n):i,fixColons:"sheet"===r.kind&&La(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var a=r.cssText;"sheet"===t.kind&&La(r)&&r.selectorText.includes(":")&&(a=Aa(a)),t.parts.push(t.sheetHref?Za(a,t.sheetHref):a),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;fa(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var a=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ea(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;fa(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(e,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(t){}};r.length>0;)i()}(a,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=Zn(),o=t>0?t:1;try{for(;!r&&o>0;){var u=e[e.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(t){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?Aa(h):h}else l=Ca(u.parts.join(""))}catch(t){}a(l)}}}catch(t){r=!0,i=null}finally{ga(Zn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var Na=class{constructor(){ka(this,"idNodeMap",new Map),ka(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.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){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),_a(t)){var r=Wn.shadowRoot(t);r&&this.removeNodeFromMap(r),"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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Fa(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,a=t.maskInputFn,o=t.value||"",s=n&&qa(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,e):"*".repeat(o.length)),o}function qa(t){return t.toLowerCase()}var ja=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 Ba(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,a=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==a&&a&&ja.has(qa(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var Ha="__rrweb_original__";function Ua(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?qa(e):null}catch(t){return null}}var $a=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,za=/^(?:[a-z+]+:)?\/\//i,Wa=/^www\..*/i,Va=/^(data:)([^,]*),(.*)/i;function Za(t,e){return(t||"").replace($a,((t,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return t;if(za.test(u)||Wa.test(u))return"url("+l+u+l+")";if(Va.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=e).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ga,Qa,Ja="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Ya=4096,Ka=1e5,Xa=10,to=new Map,eo=1,ro=new RegExp("[^a-z0-9-_:]");function io(){return eo++}var no=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/,oo=new WeakMap;function so(t,e){return e&&""!==e.trim()?uo(t,e):e}function uo(t,e){var r=oo.get(t);if(r||(r=t.createElement("a"),oo.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function lo(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Ja:t}(t,e.maxBase64ImageLength):t}function ho(t,e,r,i,n,a){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o,s=null===(o=n.sheet)||void 0===o?void 0:o.href;if(s)return s}var u=so(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(t,e,r,i){if(Ka>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Ya||t.naturalHeight>Ya)return e;var n=to.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=t.naturalWidth,a.height=t.naturalHeight;var o=a.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>s.length?s:e;if(to.size>=Xa){var l=to.keys().next().value;void 0!==l&&to.delete(l)}return to.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,a.type,a.quality)),lo(l,a)}if("image"===e)return lo(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=so(t,i);return"image"===e&&h.startsWith("data:")?lo(h,a):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(ao),e.length>r;){var a=i(no);if(","===a.slice(-1))a=so(t,a.substring(0,a.length-1)),n.push(a);else{var o="";a=so(t,a);for(var s=!1;;){var u=e.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?Za(i,uo(t)):"object"===e&&"data"===r?so(t,i):i:so(t,i)}function co(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function vo(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&vo(Wn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&vo(Wn.parentNode(t),e,r)}function fo(t,e,r,i){var n;if(_a(t)){if(!Wn.childNodes(n=t).length)return!1}else{if(null===Wn.parentElement(t))return!1;n=Wn.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(vo(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function po(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var go=new Map;function mo(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function yo(t){return null==t?"":t.toLowerCase()}var bo=!1,wo=!1;function ko(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.maskTextClass,s=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,c=void 0===h||h,d=e.maskInputOptions,v=void 0===d?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,w=e.dataURLOptions,k=void 0===w?{}:w,_=e.inlineImages,S=void 0!==_&&_,x=e.recordCanvas,C=void 0!==x&&x,M=e.canvasMaskingConfigured,T=e.onSerialize,I=e.onIframeLoad,R=e.iframeLoadTimeout,A=void 0===R?5e3:R,E=e.onIframeListenerRegistered,L=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,P=void 0===O?5e3:O,D=e.keepIframeSrcFn,N=void 0===D?()=>!1:D,F=e.newlyAddedElement,q=void 0!==F&&F,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?50:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return wo=!0,bo||(bo=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=fo(t,o,s,void 0===z)),Kn>0&&(ea.nodeCount+=1);var Z,G=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,a=e.needsMask,o=e.inlineStylesheet,s=e.maskInputOptions,u=void 0===s?{}:s,l=e.maskTextFn,h=e.maskInputFn,c=e.maskAllElementAttributes,d=void 0!==c&&c,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,w=e.newlyAddedElement,k=void 0!==w&&w,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:On.Document,childNodes:[],compatMode:t.compatMode}:{type:On.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:On.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,a=void 0===n?{}:n,o=e.maskInputFn,s=e.maskAllElementAttributes,u=void 0!==s&&s,l=e.maskAttributeFn,h=e.dataURLOptions,c=void 0===h?{}:h,d=e.inlineImages,v=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=qa(t.tagName);return ro.test(e)?"div":e}(t),k=new Set,_={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];co(w,C.name)||(_[C.name]=ho(r,w,qa(C.name),C.value,t,c))}if("link"===w&&i&&!b){var M=t.sheet;if(!M){var T=function(t){return t.href}(t);T&&!(M=mo(r,T))&&T.includes(".css")&&(M=mo(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;M&&(ma(M)?Kn>0&&(na.push(t),aa+=1):I=Ia(M)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===w&&t.sheet&&!(t.innerText||Wn.textContent(t)||"").trim().length){var R=pa((()=>Ia(t.sheet)));R&&(_._cssText=R)}if("input"===w||"textarea"===w||"select"===w){var A=t.value,E=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&A?_.value=Fa({element:t,type:Ua(t),tagName:w,value:A,maskInputOptions:a,maskInputFn:o}):E&&(_.checked=E)}if("option"===w&&(t.selected&&!a.select?_.selected=!0:delete _.selected),"dialog"===w&&t.open){try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}k.add("rr_open_mode")}if("canvas"===w&&v&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((Ha in n?n[Ha]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height,L!==O.toDataURL(c.type,c.quality)&&(_.rr_dataURL=L)}var P,D,N=!1;if("img"===w&&d){Ga||(Ga=r.createElement("canvas"),Qa=Ga.getContext("2d"));var F=t,q=F.currentSrc||F.getAttribute("src")||"<unknown-src>",j=F.crossOrigin,B=(e,r)=>N?Ba({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,H=()=>{po(F,"load",H);try{Ga.width=F.naturalWidth,Ga.height=F.naturalHeight,Qa.drawImage(F,0,0);var t=Ga.toDataURL(c.type,c.quality);_.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==F.crossOrigin)return F.crossOrigin="anonymous",void(F.complete&&0!==F.naturalWidth?H():F.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===F.crossOrigin&&(j?_.crossOrigin=B("crossOrigin",j):F.removeAttribute("crossorigin"))};F.complete&&0!==F.naturalWidth?H():F.addEventListener("load",H)}if("audio"===w||"video"===w){var U=_;U.rr_mediaState=t.paused?"paused":"played",k.add("rr_mediaState"),U.rr_mediaCurrentTime=t.currentTime,U.rr_mediaPlaybackRate=t.playbackRate,U.rr_mediaMuted=t.muted,U.rr_mediaLoop=t.loop,U.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),b){var z,W,V,Z=t.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,Y=Z.top,K=null===(z=r.defaultView)||void 0===z?void 0:z.getComputedStyle(t);_={class:_.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=r.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(Y+((null===(V=r.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},k.add("rr_width"),k.add("rr_height"),k.add("rr_left"),k.add("rr_top"),K&&(_.rr_position=K.position||"static",k.add("rr_position"),K.transform&&"none"!==K.transform&&(_.rr_transform=K.transform,k.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(_.rr_display=K.display,k.add("rr_display")))}if("iframe"!==w||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src),u||l)for(var X of Object.entries(_)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(_[tt]=Ba({element:t,name:tt,value:et,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:k.has(tt)}))}N=!0;try{customElements.get(w)&&(P=!0)}catch(t){}return{type:On.Element,tagName:w,attributes:_,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:P}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,a=Wn.parentNode(t),o=a&&a.tagName,s=Wn.textContent(t),u="STYLE"===o||void 0,l="SCRIPT"===o||void 0;if(u&&s){try{var h;if(t.nextSibling||t.previousSibling);else if(ma(a.sheet));else if(null===(h=a.sheet)||void 0===h?void 0:h.cssRules){var c=Ia(a.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(s=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}s=Za(s,uo(e.doc))}return l&&(s="SCRIPT_PLACEHOLDER"),!u&&!l&&s&&r&&(s=i?i(s,Wn.parentElement(t)):s.replace(/[\S]/g,"*")),{type:On.Text,textContent:s||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:On.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:On.Comment,textContent:Wn.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:N,newlyAddedElement:q});if(!G)return console.warn(t,"not serialized"),null;Z=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===On.Comment)return!0;if(t.type===On.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,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(yo(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===yo(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(yo(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&yo(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(yo(t.attributes.property).match(/^(og|twitter|fb):/)||yo(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===yo(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(yo(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(yo(t.attributes.name))||yo(t.attributes.property).match(/^article:/)||yo(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(yo(t.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===On.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?-2:io();var Q=Object.assign(G,{id:Z});if(i.add(t,Q),-2===Z)return null;T&&T(t);var J=!l;if(Q.type===On.Element){J=J&&!Q.needBlock,delete Q.needBlock;var Y=Wn.shadowRoot(t);Y&&xa(Y)&&(Q.isShadowHost=!0)}if((Q.type===On.Document||Q.type===On.Element)&&J){b.headWhitespace&&Q.type===On.Element&&"head"===Q.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B+1,maxDepth:U};if(Q.type===On.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Wn.childNodes(t))){var tt=ko(X,K);tt&&Q.childNodes.push(tt)}var et=null;if(_a(t)&&(et=Wn.shadowRoot(t)))for(var rt of Array.from(Wn.childNodes(et))){var it=ko(rt,K);it&&(xa(et)&&(it.isShadow=!0),Q.childNodes.push(it))}}var nt=Wn.parentNode(t);if(nt&&Sa(nt)&&xa(nt)&&(Q.isShadow=!0),Q.type===On.Element&&"iframe"===Q.tagName){var at=function(t,e,r){var i,n=()=>{},a=t.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),po(t,"load",h),t.addEventListener("load",o),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?po(t,"load",o):(s=!0,po(t,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),po(t,"load",o)}}return t.addEventListener("load",o),()=>{po(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=ko(e,{doc:e,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B+1,maxDepth:U});r&&I(t,r)}}),A);null==E||E(t,at)}return Q.type===On.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,u,l){if(!go.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var e=ko(t,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:z,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:N,depth:B,maxDepth:U});e&&L(t,e)}})()}finally{go.delete(e),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",w,{signal:d.signal,once:!0}),go.set(e,d)}}}(t,0,P),Q}function _o(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 So=class t{constructor(){ka(this,"parentElement",null),ka(this,"parentNode",null),ka(this,"ownerDocument",void 0),ka(this,"firstChild",null),ka(this,"lastChild",null),ka(this,"previousSibling",null),ka(this,"nextSibling",null),ka(this,"ELEMENT_NODE",1),ka(this,"TEXT_NODE",3),ka(this,"nodeType",void 0),ka(this,"nodeName",void 0),ka(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;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 xo(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Co(r,t,e,i)}function Co(t,e,r,i){Mo((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Mo(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var To="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.",Io={map:{},getId(){return console.error(To),-1},getNode(){return console.error(To),null},removeNodeFromMap(){console.error(To)},has(){return console.error(To),!1},reset(){console.error(To)}};function Ro(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function Ao(t,e,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(t){return}a.set.call(this,t)}}}),()=>Ao(t,e,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Io=new Proxy(Io,{get(t,e,r){return"map"===e&&console.error(To),Reflect.get(t,e,r)}}));var Eo=Date.now;function Lo(t){var e,r,i,n,a=t.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null===(e=Wn.parentElement(a.body))||void 0===e?void 0:e.scrollLeft)||(null==a||null===(r=a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null===(i=Wn.parentElement(a.body))||void 0===i?void 0:i.scrollTop)||(null==a||null===(n=a.body)||void 0===n?void 0:n.scrollTop)||0}}function Oo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Po(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Do(t){return t?t.nodeType===t.ELEMENT_NODE?t:Wn.parentElement(t):null}function No(t,e,r,i){if(!t)return!1;var n=Do(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(vo(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Fo(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function qo(t,e){if(Sa(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Wn.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||qo(i,e))}function jo(t){return Boolean(t.changedTouches)}function Bo(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ho(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Uo(t){return!!t&&(t instanceof So&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Wn.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Eo=()=>(new Date).getTime());var $o=class{constructor(){ka(this,"id",1),ka(this,"styleIDMap",new WeakMap),ka(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 zo(t){var e,r=null;return"getRootNode"in t&&(null===(e=Wn.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wn.host(Wn.getRootNode(t))&&(r=Wn.host(Wn.getRootNode(t))),r}function Wo(t){var e=t.ownerDocument;return!!e&&(Wn.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=zo(r);)r=e;return r}(t);return Wn.contains(e,r)}(t))}function Vo(t){return"__ln"in t}var Zo,Go=class{constructor(){ka(this,"length",0),ka(this,"head",null),ka(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Vo(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Vo(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}},Qo=(t,e)=>t+"@"+e,Jo=class{constructor(){ka(this,"frozen",!1),ka(this,"locked",!1),ka(this,"texts",[]),ka(this,"attributes",[]),ka(this,"attributeMap",new WeakMap),ka(this,"generatedAttributes",new WeakMap),ka(this,"removes",[]),ka(this,"mapRemoves",[]),ka(this,"movedMap",{}),ka(this,"addedSet",new Set),ka(this,"movedSet",new Set),ka(this,"droppedSet",new Set),ka(this,"removesSubTreeCache",new Set),ka(this,"mutationCb",void 0),ka(this,"blockClass",void 0),ka(this,"blockSelector",void 0),ka(this,"maskTextClass",void 0),ka(this,"maskTextSelector",void 0),ka(this,"inlineStylesheet",void 0),ka(this,"maskInputOptions",void 0),ka(this,"maskTextFn",void 0),ka(this,"maskInputFn",void 0),ka(this,"maskAllElementAttributes",void 0),ka(this,"maskAttributeFn",void 0),ka(this,"keepIframeSrcFn",void 0),ka(this,"recordCanvas",void 0),ka(this,"canvasMaskingConfigured",void 0),ka(this,"inlineImages",void 0),ka(this,"slimDOMOptions",void 0),ka(this,"dataURLOptions",void 0),ka(this,"doc",void 0),ka(this,"mirror",void 0),ka(this,"iframeManager",void 0),ka(this,"stylesheetManager",void 0),ka(this,"shadowDomManager",void 0),ka(this,"canvasManager",void 0),ka(this,"processedNodeManager",void 0),ka(this,"unattachedDoc",void 0),ka(this,"canvasManagerReleased",!1),ka(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),ka(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=Zn(),i=Jn();try{this.processBufferedMutations()}finally{t=Zn()-r,e=i,Kn>0||Yn(t,null!=e?e:Gn)||t>sa.slowestBatchMs&&(sa.slowestBatchMs=t)}}})),ka(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new Go,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var a=Wn.parentNode(n);if(a&&Wo(n)&&"TEXTAREA"!==a.tagName){var o=Sa(a)?this.mirror.getId(zo(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=ko(n,{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=>{Bo(t,this.mirror)&&this.iframeManager.addIframe(t),Ho(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Uo(t)&&!No(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Wn.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)}});u&&(t.push({parentId:o,nextId:s,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Ko(this.removesSubTreeCache,a)&&!this.movedSet.has(Wn.parentNode(a))||n(a);for(var o of this.addedSet)Xo(this.droppedSet,o)||Ko(this.removesSubTreeCache,o)?Xo(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(Wn.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(Wn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=Wn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Wn.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Wn.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var a,o=n[0],s=n[1];"string"!=typeof s&&null!==s||(e[o]=Ba({element:t.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(a=this.generatedAttributes.get(t.node))||void 0===a?void 0:a.has(o)}))}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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)})),ka(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),ka(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(Wn.childNodes(t),(t=>Wn.textContent(t)||"")).join("");e.attributes.value=Fa({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Ua(t),value:r,maskInputFn:this.maskInputFn})})),ka(this,"processMutation",(t=>{if(!Fo(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Wn.textContent(t.target);No(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:fo(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Do(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,a),s=a?i.getAttributeNS(a,n):t.target.getAttribute(n);if("value"===o){var u=i,l=Ua(u);s=Fa({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:s,maskInputFn:this.maskInputFn})}if(No(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;var h=this.attributeMap.get(t.target),c="IFRAME"===i.tagName&&"src"===o;if(c&&!this.keepIframeSrcFn(s)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!co(i.tagName,o)){var d,v=ho(this.doc,qa(i.tagName),qa(o),s,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(s)&&(o="rr_src"),h.attributes[o]=v,null===(d=this.generatedAttributes.get(t.target))||void 0===d||d.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(No(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=>{var r=this.mirror.getId(e),i=Sa(t.target)?this.mirror.getId(Wn.host(t.target)):this.mirror.getId(t.target);No(t.target,this.blockClass,this.blockSelector,!1)||Fo(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Yo(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||qo(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Qo(r,i)]?Yo(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Sa(t.target)||!xa(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),Wn.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),ka(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(Fo(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Qo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);No(t,this.blockClass,this.blockSelector,!1)||(Wn.childNodes(t).forEach((t=>this.genAdds(t))),Uo(t)&&Wn.childNodes(Wn.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}};function Yo(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),Wn.childNodes(i).forEach((t=>r.push(t)))}}function Ko(t,e,r){return 0!==t.size&&function(t,e,r){var i=Wn.parentNode(e);return!!i&&t.has(i)}(t,e)}function Xo(t,e){if(0===t.size)return!1;for(var r=Wn.parentNode(e);r;){if(t.has(r))return!0;r=Wn.parentNode(r)}return!1}var ts=function(t,e){return void 0===e&&(e="rrweb"),Zo?function(){try{return t(...arguments)}catch(t){if(Zo&&!0===Zo(t,e))return;throw t}}:t},es=[];function rs(t){try{if("composedPath"in t){var 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 is(t,e){var r,i=new Jo;i.init(t);try{r=new($n())(ts(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),es.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function ns(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.sampling,s=new Map,u=t=>{var o=rs(t);if(o&&!No(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=Lo(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),e({id:h,x:u,y:l}))}},l=[xo("scroll",ts(Ro(ts((t=>u(t))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(xo("scrollend",ts(u),r)),()=>l.forEach((t=>t()))}function as(t,e){for(var r=es.length-1;r>=0;r--){var i=es[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),es.splice(r,1))}}}var os=["INPUT","TEXTAREA","SELECT"],ss=new WeakMap;function us(t){return function t(e,r){if(vs("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||vs("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||vs("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||vs("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ls(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var hs=5e3;function cs(t,e){var r,i,n,a=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Wn.host(e));var o="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,s=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&s?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null===(t=s.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=s.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{a.adoptStyleSheets(t,n)}catch(t){}return e}}),ts((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))):()=>{}}function ds(t,e){void 0===e&&(e={});var r,i,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,a=t.scrollCb,o=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,c=t.canvasMutationCb,d=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),a(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),s(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var a=[],o=ts((()=>{if(i){i.destroy(),i.reset();var e=es.indexOf(i);-1!==e&&es.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),a.forEach((t=>t()))}));try{if(t.recordDOM){var s=is(t,t.doc);r=s.observer,i=s.buffer}if(a.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Ro(ts((t=>{var r=Date.now()-a;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],a=null})),s),h=ts(Ro(ts((t=>{var e=rs(t),r=jo(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=Eo()),u.push({x:i,y:o,id:n.getId(e),timeOffset:Eo()-a}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?In.Drag:t instanceof MouseEvent?In.MouseMove:In.TouchMove)})),o,{trailing:!1})),c=[xo("mousemove",h,i),xo("touchmove",h,i),xo("drag",h,i)];return ts((()=>{c.forEach((t=>t()))}))}(t)),a.push(function(t){var e=t.mouseInteractionCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(Rn).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t])).forEach((t=>{var o=qa(t),s=(t=>r=>{var o=rs(r);if(!No(o,n,a,!0)){var s=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":s=An.Mouse;break;case"touch":s=An.Touch;break;case"pen":s=An.Pen}s===An.Touch&&(Rn[t]===Rn.MouseDown?u="TouchStart":Rn[t]===Rn.MouseUp&&(u="TouchEnd"))}else jo(r)&&(s=An.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===An.Touch||u.startsWith("Mouse")&&s===An.Mouse)&&(s=null)):Rn[t]===Rn.Click&&(s=l,l=null);var c=jo(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;ts(e)(h({type:Rn[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(t);if(window.PointerEvent)switch(Rn[t]){case Rn.MouseDown:case Rn.MouseUp:o=o.replace("mouse","pointer");break;case Rn.TouchStart:case Rn.TouchEnd:return}u.push(xo(o,s,r))})),ts((()=>{u.forEach((t=>t()))}))}(t)),a.push(ns(t)),a.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,a=-1;return xo("resize",ts(Ro(ts((()=>{var t=Oo(),e=Po();n===t&&a===e||(r({width:Number(e),height:Number(t)}),n=t,a=e)})),200)),i)}(t,{win:n})),a.push(function(t){var e=t.inputCb,r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.ignoreClass,s=t.ignoreSelector,u=t.maskInputOptions,l=t.maskInputFn,c=t.userTriggeredOnInput;function d(t){var e=rs(t),i=t.isTrusted,h=r.defaultView;if(!e||!h||e instanceof h.HTMLElement){var d=e&&e.tagName;if(e&&"OPTION"===d&&(e=Wn.parentElement(e)),e&&d&&os.indexOf(d)>=0&&!No(e,n,a,!0)&&!(e.classList.contains(o)||s&&e.matches(s))){var f=e.value,p=!1,g=Ua(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[d.toLowerCase()]||u[g])&&(f=Fa({element:e,maskInputOptions:u,tagName:d,type:g,value:f,maskInputFn:l})),v(e,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,r){var n=ss.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){ss.set(t,r);var a=i.getId(t);ts(e)(h({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>xo(t,ts(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>Ao(t[0],t[1],{set(){ts(d)({target:this,isTrusted:!1})}},!1,p)))),ts((()=>{f.forEach((t=>t()))}))}(t)),a.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,a=t.sampling,o=t.doc,s=ts((t=>Ro(ts((a=>{var o=rs(a);if(o&&!No(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;e({type:t,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[xo("play",s(Ln.Play),o),xo("pause",s(Ln.Pause),o),xo("seeked",s(Ln.Seeked),o),xo("volumechange",s(Ln.VolumeChange),o),xo("ratechange",s(Ln.RateChange),o)];return ts((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var u=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},a=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),a(t)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=e.get(o);l||e.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=t.setTimeout(f,hs),d||v?t.clearTimeout(c):r.add(c)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==c&&(t.clearTimeout(c),r.delete(c)),d?e&&n(u):(h.ready=!0,e||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(n);a.push(u.reset),a.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,a=e.win,o=e.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(t){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=ls(e,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(e,(()=>r({id:c,styleId:d,replace:s})),(()=>{var t=Ia(e);null!==t&&r({id:c,styleId:d,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e);var l=ls(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(e,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};fs("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(fs("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),fs("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),fs("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((t=>{var e=t[0],a=t[1];d[e]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[e].insertRule,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e.parentStyleSheet);var l=ls(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...us(e),u];o.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:ts(((t,e,a)=>{var s=a[0],u=t.apply(e,a);n.onCssomSheetMutation(e.parentStyleSheet);var l=ls(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...us(e),s];o.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),ts((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:n,mutationQueue:u})),a.push(cs(t,t.doc)),a.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,a=t.stylesheetManager,o=e.win,s=e.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:ts(((t,e,o)=>{var u,l=o[0],h=o[1],c=o[2],d=t.apply(e,o);if(n.has(l))return d;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=ls(v,i,a.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=us(e.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ts(((t,e,o)=>{var u,l=o[0],h=t.apply(e,o);if(n.has(l))return h;var c=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=ls(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=us(e.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),ts((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n,mutationQueue:u})),t.collectFonts&&a.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return a.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var s=zn(r.fonts,"add",(function(t){return function(r){return setTimeout(ts((()=>{var t=a.get(r);t&&(e(t),a.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),ts((()=>{n.forEach((t=>t()))}))}(t))}for(var l of(a.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,a=t.selectionCb,o=!0,s=ts((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),c=h.startContainer,d=h.startOffset,v=h.endContainer,f=h.endOffset;No(c,i,n,!0)||No(v,i,n,!0)||s.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}a({ranges:s})}}));return s(),xo("selectionchange",s)}(t)),a.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?zn(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))a.push(l.observer(l.callback,n,l.options))}catch(t){try{o()}catch(t){}throw t}return o}function vs(t){return void 0!==window[t]}function fs(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var ps=class{constructor(t){ka(this,"generateIdFn",void 0),ka(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ka(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),a=i||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),a.set(o,e)),o}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},gs=class{constructor(t){ka(this,"iframes",new WeakMap),ka(this,"crossOriginIframeMap",new WeakMap),ka(this,"crossOriginIframeMirror",new ps(io)),ka(this,"crossOriginIframeStyleMirror",void 0),ka(this,"crossOriginIframeRootIdMap",new WeakMap),ka(this,"mirror",void 0),ka(this,"mutationCb",void 0),ka(this,"wrappedEmit",void 0),ka(this,"loadListener",void 0),ka(this,"pageHideListener",void 0),ka(this,"stylesheetManager",void 0),ka(this,"recordCrossOriginIframes",void 0),ka(this,"messageHandler",void 0),ka(this,"nestedIframeListeners",new Map),ka(this,"attachedWindows",new WeakMap),ka(this,"attachedDocuments",new WeakMap),ka(this,"attachedIframes",new Map),ka(this,"loadListenerDisposers",new WeakMap),ka(this,"iframeElementsById",new Map),ka(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ps(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){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Mo(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Co(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=t.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);Mo((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(a)}))}Mo((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null===(r=this.loadListener)||void 0===r||r.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case Tn.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Tn.IncrementalSnapshot,data:{source:In.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Tn.Meta:case Tn.Load:case Tn.DomContentLoaded:return!1;case Tn.Plugin:return e;case Tn.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Tn.IncrementalSnapshot:switch(e.data.source){case In.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 In.Drag:case In.TouchMove:case In.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case In.ViewportResize:return!1;case In.MediaInteraction:case In.MouseInteraction:case In.Scroll:case In.CanvasMutation:case In.Input:return this.replaceIds(e.data,t,["id"]),e;case In.StyleSheetRule:case In.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case In.Font:return e;case In.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case In.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===On.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Co(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Co(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((t=>{Mo((()=>this.mirror.removeNodeFromMap(t)))})),Mo((()=>as(r,a))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Co(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Co(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),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}},ms=class{constructor(t){ka(this,"shadowDoms",new WeakSet),ka(this,"mutationCb",void 0),ka(this,"scrollCb",void 0),ka(this,"bypassOptions",void 0),ka(this,"mirror",void 0),ka(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 r,i;if(xa(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(r=null===(i=Wn.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==r?r:e,a=is(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var t=es.indexOf(s);-1!==t&&es.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:ns(h({},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(Wn.host(t))),this.restoreHandlers.push({doc:n,handler:cs({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){var r=this;this.restoreHandlers.push({doc:e,handler:zn(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),a=Wn.shadowRoot(this);return a&&Wo(this)&&r.addShadowRoot(a,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},ys="skip-frame";function bs(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ks="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_s=0;64>_s;_s++)ks[ws.charCodeAt(_s)]=_s;var Ss=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=ws[r[e]>>2],n+=ws[(3&r[e])<<4|r[e+1]>>4],n+=ws[(15&r[e+1])<<2|r[e+2]>>6],n+=ws[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},xs=new Map,Cs=(t,e,r)=>{if(t&&(Is(t,e)||"object"==typeof t)){var i=function(t,e){var r=xs.get(t);return r||xs.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Ms(t,e,r,i){return t instanceof Array?t.map((t=>Ms(t,e,r,i))):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Ss(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Ms(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ms(t.data,e,r,i),t.width,t.height]}:Is(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Cs(t,e,r)}:t}var Ts=(t,e,r,i)=>t.map((t=>Ms(t,e,r,i))),Is=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Rs=["webgl","webgl2"];function As(t){return"nodeType"in t}function Es(t,e,r,i){var n=[];try{if(i){var a=function(t,e,r){var i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return zn(i.prototype,"configure",(function(i){return function(n){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||As(a)&&No(a,e,r,!0))return i.call(this,n);As(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(t,e,r);a&&n.push(a)}var o=zn(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var a=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!No(this,e,r,!0)&&("__context"in this||(this.__context=a),i&&Rs.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ls(t,e,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=zn(t,u,(function(t){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(Cs(c,a,this),this.canvas&&"tagName"in this.canvas&&!No(this.canvas,i,n,!0)){var d=Ts(l,a,this,o);r(this.canvas,{type:e,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=Ao(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!No(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var Os='(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',Ps="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Os],{type:"text/javascript;charset=utf-8"});function Ds(t){var e;try{if(!(e=Ps&&(self.URL||self.webkitURL).createObjectURL(Ps)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Os),{name:null==t?void 0:t.name})}}var Ns,Fs,qs,js=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){ka(this,"pendingCanvasMutations",new Map),ka(this,"rafStamps",{latestId:0,invokeId:null}),ka(this,"mirror",void 0),ka(this,"mutationCb",void 0),ka(this,"resetObservers",void 0),ka(this,"frozen",!1),ka(this,"locked",!1),ka(this,"rafIdTimestamp",null),ka(this,"rafIdFlush",null),ka(this,"refCount",0),ka(this,"torndown",!1),ka(this,"resetFrameDedup",null),ka(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)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,a=t.blockSelector,o=t.recordCanvas,s=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,r,i,n){var a=this;if("OffscreenCanvas"in e){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Es(e,r,i,!0),h=new Map;try{o=new Ds}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:En["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/t,f=0,p=t=>{var u,g;c||(f&&v>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{No(t,r,i,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),u).forEach(function(){var t=l((function*(t){var e=a.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,u=t.getContext(t.__context);if(null==u||null===(r=u.isContextLost)||void 0===r?void 0:r.call(u))return void h.set(e,!1);!1===(null==u||null===(i=u.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,c=t.clientHeight||t.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(t,e,r,i,n,a){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return ys}if(void 0!==o){if(!Array.isArray(o)||!o.every(bs))return ys;var s=r/n,u=i/a;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*s),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*s)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(n.canvasMasking,t,d,v,l,c);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:e,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(d),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Es(t,e,r,!1),a=function(t,e,r,i,n){var a=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=zn(e.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return No(this.canvas,r,i,!0)||setTimeout((()=>{var r=Ts(u,e,this,n);t(this.canvas,{type:En["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=Ao(e.CanvasRenderingContext2D.prototype,o,{set(e){No(this.canvas,r,i,!0)||t(this.canvas,{type:En["2D"],property:o,args:[e],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var a=[];return void 0!==e.WebGLRenderingContext&&a.push(...Ls(e.WebGLRenderingContext.prototype,En.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&a.push(...Ls(e.WebGL2RenderingContext.prototype,En.WebGL2,t,r,i,e,n)),()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Mn);return e}));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}},Bs=class{constructor(t){var e;ka(this,"trackedLinkElements",new WeakSet),ka(this,"pendingDeferredSheets",new Set),ka(this,"mutationCb",void 0),ka(this,"adoptedStyleSheetCb",void 0),ka(this,"maskAllElementAttributes",void 0),ka(this,"maskAttributeFn",void 0),ka(this,"styleMirror",new $o),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;var r=null,i=null;try{(i=t.sheet)&&(r=Da(i))}catch(t){}if(!r||!i)return ya(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Zn(),c=Jn(),d=!0;try{if(a)return s=!0,ya(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(ya(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(ya(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),Yn(u=Zn()-h,null!=(l=c)?l:Gn)||(ua.totalMs+=u,u>ua.slowestSliceMs&&(ua.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Ba({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],a=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var a=r.styleMirror.add(t);e=a;var o=Zn();try{pa((()=>{try{var e=t.rules||t.cssRules;e&&fa(e)}catch(t){}n.push({styleId:a,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Ra(e,t.href),index:r})))})}))}finally{ga(Zn()-o)}}i.styleIds.push(e)};for(var o of t)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),go.forEach((t=>t.abort())),go.clear()}trackStylesheetInLinkElement(t){}},Hs=class{constructor(){ka(this,"nodeMap",new WeakMap),ka(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}},Us=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var $s,zs=document.createElement("iframe");document.body.appendChild(zs),Array.from=(null===($s=zs.contentWindow)||void 0===$s?void 0:$s.Array.from)||Array.from,document.body.removeChild(zs)}}catch(t){console.debug("Unable to override Array.from",t)}var Ws=new Na,Vs=new Set([In.Mutation,In.MediaInteraction,In.StyleSheetRule,In.CanvasMutation,In.Font,In.Log,In.StyleDeclaration,In.AdoptedStyleSheet]);function Zs(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Gs(t){var e;void 0===t&&(t={});var r=t,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,R=r.maskAttributeFn,A=r.hooks,E=r.packFn,L=r.sampling,O=void 0===L?{}:L,P=r.dataURLOptions,D=void 0===P?{}:P,N=r.canvasResolutionScale,F=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,z=r.recordCrossOriginIframes,W=void 0!==z&&z,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,G=r.userTriggeredOnInput,Q=void 0!==G&&G,J=r.collectFonts,Y=void 0!==J&&J,K=r.inlineImages,X=void 0!==K&&K,tt=r.plugins,et=r.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=r.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,at=r.attributeFilter;Zo=r.errorHandler;var ot=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),st=!W||window.parent===window,ut=!1;if(!st)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(st&&!i)throw new Error("emit function is required");if(!st&&!ut)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Ws.reset();var lt,ht=!0===_?{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!==S?S:{password:!0},ct=_o(void 0!==x&&x);!function(t){void 0===t&&(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)}();var dt,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};Ns=(t,e)=>{var r,o=t;if(o.timestamp=Eo(),!(null===(r=es[0])||void 0===r?void 0:r.isFrozen())||o.type===Tn.FullSnapshot||o.type===Tn.IncrementalSnapshot&&Vs.has(o.data.source)||es.forEach((t=>t.unfreeze())),st)null==i||i(gt(o),e);else if(ut){var s={type:"rrweb",event:gt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(s,"*")}if(o.type===Tn.FullSnapshot)lt=o,ft=0;else if(o.type===Tn.IncrementalSnapshot){if(o.data.source===In.Mutation&&o.data.isAttachIframe)return;ft++,(a&&ft>=a||n&&o.timestamp-lt.timestamp>n)&&Fs(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var i of t.adds){var n=Ws.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=kt.getIframeElementById(i);n&&r.has(n)?kt.forgetIframeId(i):(null==dt||dt(i),kt.removeIframeById(i))}})),null==vt||vt(),kt.cleanupDetachedIframes()}Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Mutation},t)})},yt=t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Scroll},t)}),bt=t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.CanvasMutation},t)}),wt=new Bs({mutationCb:mt,adoptedStyleSheetCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:R}),kt=new gs({mirror:Ws,mutationCb:mt,stylesheetManager:wt,recordCrossOriginIframes:W,wrappedEmit:Ns});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:Ws,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new Hs,xt=null==F?void 0:F.configured;qs=new js({recordCanvas:U,mutationCb:bt,win:window,blockClass:s,blockSelector:l,mirror:Ws,sampling:O.canvas,dataURLOptions:ot,resolutionScale:N,canvasMasking:F});var Ct=new ms({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:ct,iframeManager:kt,stylesheetManager:wt,canvasManager:qs,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:at},mirror:Ws});Fs=function(t){if(void 0===t&&(t=!1),B){ha(k);try{Ns({type:Tn.Meta,data:{href:window.location.href,width:Po(),height:Oo()}},t),null==e||e.cancel(),e=void 0,wt.reset(),Ct.init(),es.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new Na:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,R=r.preserveWhiteSpace,A=r.onSerialize,E=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,P=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,F=void 0===N?()=>!1:N,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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===k?{password:!0}:k,H=_o(void 0!==T&&T);ha(j);try{return ko(t,{doc:t,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:R,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:P,stylesheetLoadTimeout:D,keepIframeSrcFn:F,newlyAddedElement:!1,maxDepth:q})}finally{ca()}}(document,{mirror:Ws,blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,slimDOM:ct,dataURLOptions:ot,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Bo(t,Ws)&&kt.addIframe(t),Ho(t,Ws)&&wt.trackLinkElement(t),Uo(t)&&Ct.addShadowRoot(Wn.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){wt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{a=na,na=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(Ns({type:Tn.FullSnapshot,data:{node:i,initialOffset:Lo(window)}},t),es.forEach((t=>t.unlock())),qs.onFullSnapshot(),r.length){var n=function(t,e,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||t.length>a,u=()=>{var r=t[a];t[a]=null,a+=1,r&&Mo((()=>{o=e.beginDeferredLinkInlining(r,Ws.getId(r))}))},l=()=>{if(o){var t=o,e=!0;Mo((()=>{e=t.advance(200)})),e&&(o=null)}},h=t=>{if(n=null,!i){var e=0;do{try{o||u(),l()}catch(t){null==o||o.discard(),o=null,ba(1)}e+=1}while(!i&&s()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(s()?n=Zs(h):r())}};return n=Zs(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;s()&&50>e;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-e)c.discard(),o=null,h+=1;else{try{l()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;t.length>v;v++)null!==t[v]&&(d+=1);ba(d),null==o||o.discard(),o=null}r()}}}}(r,wt,(()=>{e===n&&(e=void 0)}));e=n}W&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&wt.adoptStyleSheets(document.adoptedStyleSheets,Ws.getId(document))}finally{ca()}var a}};try{var Mt=[];for(var Tt of(Mt.push(xo("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Mt.push(xo(Tt,Qn,document));dt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Mo(t);var e=Mt.indexOf(t);-1!==e&&Mt.splice(e,1)})),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=Ws.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var It=t=>{var e;return ts(ds)({mutationCb:mt,mousemoveCb:(t,e)=>Ns({type:Tn.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.ViewportResize},t)}),inputCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Input},t)}),mediaInteractionCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.MediaInteraction},t)}),styleSheetRuleCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.StyleSheetRule},t)}),styleDeclarationCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Font},t)}),selectionCb(t){Ns({type:Tn.IncrementalSnapshot,data:h({source:In.Selection},t)})},customElementCb(t){Ns({type:Tn.IncrementalSnapshot,data:h({source:In.CustomElement},t)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:Y,doc:t,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:R,keepIframeSrcFn:rt,blockSelector:l,slimDOMOptions:ct,dataURLOptions:ot,mirror:Ws,iframeManager:kt,stylesheetManager:wt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:qs,ignoreCSSAttributes:nt,attributeFilter:at,plugins:(null==tt||null===(e=tt.filter((t=>t.observer)))||void 0===e?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ns({type:Tn.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},A)};kt.addLoadListener((t=>{try{var e=Ws.getId(t),r=It(t.contentDocument);if("function"==typeof r&&(Mt.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),kt.addPageHideListener((t=>{var e=Ws.getId(t);null==dt||dt(e),as(t)}));var Rt=-1,At=t=>Ns({type:Tn.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,a=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=a?Ws.getId(a):-1;o!==Rt&&(-1!==Rt&&At({id:Rt,enter:!1}),Rt=o,-1!==o&&At({id:o,enter:!0}))},Lt=()=>{Fs();var t=It(document);"function"==typeof t&&Mt.push(t),Mt.push(xo("fullscreenchange",Et)),Mt.push(xo("webkitfullscreenchange",Et)),Mt.push(xo("mozfullscreenchange",Et)),Mt.push(xo("MSFullscreenChange",Et)),Us=!0};return["interactive","complete"].includes(document.readyState)?Lt():(Mt.push(xo("DOMContentLoaded",(()=>{Ns({type:Tn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Lt()}))),Mt.push(xo("load",(()=>{Ns({type:Tn.Load,data:{}}),"load"===Z&&Lt()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Mt.forEach((t=>Mo(t))),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),Ws.reset(),Us=!1,Zo=void 0}}catch(t){console.warn(t)}}function Qs(t){return Qs="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},Qs(t)}function Js(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Qs(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Qs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Qs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Gs.addCustomEvent=(t,e)=>{if(!Us)throw new Error("please add custom event after start recording");Ns({type:Tn.Custom,data:{tag:t,payload:e}})},Gs.freezePage=()=>{es.forEach((t=>t.freeze()))},Gs.takeFullSnapshot=t=>{if(!Us)throw new Error("please take full snapshot after start recording");Fs(t)},Gs.mirror=Ws,"Mobile".toLowerCase(),"Tablet".toLowerCase();var Ys=class{constructor(t){Js(this,"fileName",void 0),Js(this,"functionName",void 0),Js(this,"lineNumber",void 0),Js(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},Ks=/(^|@)\S+:\d+/,Xs=/^\s*at .*(\S+:\d+|\(native\))/m,tu=/^(eval@)?(\[native code])?$/,eu={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Xs)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(Xs)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Ys({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(tu)}),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 Ys({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ys({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Ys({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Ys({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ks)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Ys({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ru(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function iu(t){return Array.isArray(t)}function nu(t){return"object"==typeof t&&null!==t&&!iu(t)}function au(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(nu(t[i])&&au(t[i],e-1))return!0;return!1}function ou(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(nu(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||nu(o)&&au(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var u in e){var l=e[u];s[u]=iu(l)?ru(l.length?l[0]:null):l}return s}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 su={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 uu(t,e,r){var i,n=r?Object.assign({},su,r):su,a=n.logger;if(!a)return()=>{};i="string"==typeof a?e[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:eu.parse(e.error).map((t=>t.toString())),payload:[ou(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[ou("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[ou("Uncaught (in promise)",n.stringifyOptions),ou(e.reason,n.stringifyOptions)]),t({level:"error",trace:eu.parse(r).map((t=>t.toString())),payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?function(e,a,u){try{if(!(a in e))return()=>{};var l=e[a],h={next:l},c=(e=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=eu.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>ou(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[ou("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{s=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[a]=c,()=>{if(e[a]!==c)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[a],i=t(r);i;){if(i.next===c)return void(i.next=h.next);i=t(r=i.next)}else e[a]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var lu=t=>({name:"rrweb/console@1",observer:uu,options:t}),hu=t=>"u">typeof Document&&t instanceof Document,cu=()=>{},du=t=>{var e;if(k(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function vu(t,e,r){try{if(!(e in t))return cu;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return k(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],a=du(r);a;){if(a.next===n)return void(a.next=i.next);a=du(r=a.next)}else t[e]=i.next}}catch(t){return cu}}function fu(t,e){var r,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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of e.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var pu=Ot("[Recorder]"),gu=t=>"navigation"===t.entryType,mu=t=>"resource"===t.entryType;function yu(t,e){return!!e&&(R(e)||e[t])}function bu(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var wu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ku(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!bu(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(wu))return!1;if(R(r))return!0;if(w(r))return n(r);var a=r[e];return R(a)?a:n(a)}function _u(t,e,r,i,n,a){return Su.apply(this,arguments)}function Su(){return Su=l((function*(t,e,r,i,n,a){if(void 0===a&&(a=0),a>10)return pu.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var a=t.length-1;a>=0;a-=1)if(mu(o=t[a])&&o.initiatorType===e&&(S(i)||o.startTime>=i)&&(S(n)||n>=o.startTime))return t[a];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*a))),_u(t,e,r,i,n,a+1))})),Su.apply(this,arguments)}function xu(t){var e=t.body,r=t.options,i=t.url;if(T(e))return null;var n=fu(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(x(e))return e;if(hu(e))return e.textContent;if(A(e))return jt(e);if(_(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Cu=t=>!M(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Mu(t){var e=t.entry,r=t.method,i=t.status,n=t.networkRequest,a=t.isInitial,o=t.start,s=t.end,u=t.url,l=t.initiatorType;o=e?e.startTime:o,s=e?e.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},e?e.toJSON():{name:u},{startTime:S(o)?void 0:Math.round(o),endTime:S(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(Cu(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Tu=["video/","audio/"];function Iu(t){return _(t)&&k(t.getReader)&&k(t.tee)}var Ru=500,Au="[SessionReplay] Timeout while trying to read body",Eu="[SessionReplay] Failed to read body";function Lu(t){return Eu+": "+t}function Ou(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Pu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Au)),Ru);try{t.clone().text().then((t=>e(t)),(t=>e(Lu(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Eu)}}))}(t);var r=be(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Ou(r)):function(t,e){return new Promise((r=>{var i,n=!1;function a(){try{var t;null==(t=i)||t.cancel().catch((()=>{}))}catch(t){}}function o(t){n||(n=!0,clearTimeout(u),a(),r(t))}var s,u=setTimeout((()=>o(Au)),Ru);try{s=t.clone()}catch(t){return void o(Eu)}var l=s.body;if(Iu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void o(Eu)}var h=[],c=0;!function t(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>e)return void o(Ou(e));c+=s.byteLength,h.push(s)}t()}}),(t=>o(Lu(t))))}()}else try{s.text().then((t=>o(t)),(t=>o(Lu(t))))}catch(t){o(Eu)}}))}(t,r)}function Du(){return Du=l((function*(t){var e=t.r,r=t.options,i=fu(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Pu(e,r)})),Du.apply(this,arguments)}function Nu(){return Nu=l((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Tu.some((t=>null==a?void 0:a.startsWith(t)));if(a&&o)return"Content-Type "+a+" is not supported";var s=fu(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return M(i)?Pu(e,r):Promise.resolve(i)})),Nu.apply(this,arguments)}var Fu=null;function qu(t,e,r){if(!("performance"in e))return()=>{};if(Fu)return pu.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},we,r):we,n=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var a=i.maskRequestFn(t);e||(n=!a||(t=>!!t&&Ie.has(t))(a)),a&&r.push(a)}})),r.length>0&&t(h({},e,{requests:r}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>gu(t)||mu(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Mu({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>gu(t)||mu(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Mu({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,e,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=yu("request",r.recordHeaders),n=yu("response",r.recordHeaders),a=vu(e.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},g={},m=c.setRequestHeader.bind(c);c.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=t=>(ku({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=xu({body:t,options:r,url:s})),d=e.performance.now(),y(t));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=e.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ku({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=xu({body:c.response,options:r,url:s})),_u(e,"xmlhttprequest",f.url,d,v).then((e=>{var r=Mu({entry:e,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(t){pu.error("Failed to instrument XHR for network capture",t)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,e,i),s=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=yu("request",r.recordHeaders),n=yu("response",r.recordHeaders),a=vu(e,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(t){return pu.error("Failed to instrument fetch for network capture",t),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),i&&(d.requestHeaders=v),!Iu(null==s?void 0:s.body)&&ku({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return Du.apply(this,arguments)}({r:u,options:r,url:o}))}catch(t){pu.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=bu(o)?yield a(u):yield a(o,s),c=e.performance.now();try{var f={};l.headers.forEach(((t,e)=>{f[e]=t})),n&&(d.responseHeaders=f),ku({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return Nu.apply(this,arguments)}({r:l,options:r,url:o}))}catch(t){pu.error("Failed to record fetch response for network capture",t)}return l}finally{_u(e,"fetch",u.url,h,c).then((e=>{var r,i=Mu({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(n,e,i)),Fu=()=>{a(),o(),s(),Fu=null}}var ju=t=>({name:"rrweb/network@1",observer:qu,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:lu,getRecordNetworkPlugin:ju},s.__PosthogExtensions__.rrweb={record:Gs,version:"v2",wasMaxDepthReached:()=>wo,resetMaxDepthState(){wo=!1,bo=!1},getLastSnapshotCost:()=>ra,getMutationCost:()=>h({},sa),resetSnapshotCostState(){Kn=0,Xn=0,ta=0,Gn=0,ea=Vn(),ra=null,ia=null,na=[],aa=0,oa=0,sa={slowestBatchMs:0},ua={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Gs,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:lu},s.getRecordNetworkPlugin=ju,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Cn(t,e);var Bu,Hu,Uu,$u,zu,Wu,Vu,Zu,Gu,Qu,Ju,Yu,Ku,Xu,tl,el={},rl=[],il=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nl=Array.isArray;function al(t,e){for(var r in e)t[r]=e[r];return t}function ol(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function sl(t,e,r){var i,n,a,o={};for(a in e)"key"==a?i=e[a]:"ref"==a?n=e[a]:o[a]=e[a];if(arguments.length>2&&(o.children=arguments.length>3?Bu.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===o[a]&&(o[a]=t.defaultProps[a]);return ul(t,o,i,n,null)}function ul(t,e,r,i,n){var a={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Uu:n,__i:-1,__u:0};return null==n&&null!=Hu.vnode&&Hu.vnode(a),a}function ll(t){return t.children}function hl(t,e){this.props=t,this.context=e}function cl(t,e){if(null==e)return t.__?cl(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?cl(t):null}function dl(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],a=al({},e);a.__v=e.__v+1,Hu.vnode&&Hu.vnode(a),_l(t.__P,a,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?cl(e):r,!!(32&e.__u),n),a.__v=e.__v,a.__.__k[a.__i]=a,xl(i,a,n),e.__e=e.__=null,a.__e!=r&&vl(a)}}function vl(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})),vl(t)}function fl(t){(!t.__d&&(t.__d=!0)&&$u.push(t)&&!pl.__r++||zu!=Hu.debounceRendering)&&((zu=Hu.debounceRendering)||Wu)(pl)}function pl(){try{for(var t,e=1;$u.length;)$u.length>e&&$u.sort(Vu),t=$u.shift(),e=$u.length,dl(t)}finally{$u.length=pl.__r=0}}function gl(t,e,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||rl,b=e.length;for(u=function(t,e,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),a=0;n>a;a++)null!=(o=e[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[a]=ul(null,o,null,null,null):nl(o)?o=t.__k[a]=ul(ll,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[a]=ul(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[a]=o,u=a+d,o.__=t,o.__b=t.__b+1,s=null,-1!=(l=o.__i=yl(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=cl(s)),Tl(s,s));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||el,v.__i=c,g=_l(t,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ml(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?(u=ml(v,u,t,m),m&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function ml(t,e,r,i){var n,a;if("function"==typeof t.type){for(n=t.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=t,e=ml(n[a],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=cl(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function yl(t,e,r,i){var n,a,o,s=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||e.length>a;)if(null!=(l=e[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function bl(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||il.test(e)?r:r+"px"}function wl(t,e,r,i,n){var a,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||bl(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||bl(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])a=e!=(e=e.replace(Ju,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=r,r?i?r[Qu]=i[Qu]:(r[Qu]=Yu,t.addEventListener(e,a?Xu:Ku,a)):t.removeEventListener(e,a?Xu:Ku,a);else{if("http://www.w3.org/2000/svg"==n)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==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function kl(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Gu])e[Gu]=Yu++;else if(r[Qu]>e[Gu])return;return r(Hu.event?Hu.event(e):e)}}}function _l(t,e,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=e.__e=r.__e]),(h=Hu.__b)&&h(e);t:if("function"==typeof C){c=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=e.__c=r.__c).__=d.__E:(b?e.__c=d=new C(y,w):(e.__c=d=new hl(y,w),d.constructor=C,d.render=Il),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=al({},d.__s)),al(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=e,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),e.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){e.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),rl.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,g)}))}if(d.context=w,d.props=y,d.__P=t,d.__e=!1,k=Hu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),rl.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=al(al({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===ll&&null==h.key?Cl(h.props.children):h,s=gl(t,nl(S)?S:[S],e,r,i,n,a,o,s,u,l),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(t){if(o.length=c,e.__v=null,u||null!=a)if(t.then){for(e.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),e.__e=s}else{if(null!=a)for(x=a.length;x--;)ol(a[x]);Sl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||Sl(e);Hu.__e(t,e,r)}}else null==a&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=function(t,e,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,g=r.props||el,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,a[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),s&&(Hu.__m&&Hu.__m(e,a),s=!1),a=null}if(null==y)g===m||s&&t.data==m||(t.data=m);else{if(a="textarea"==y&&null!=m.defaultValue?null:a&&Bu.call(t.childNodes),!s&&null!=a)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)v=g[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in m||"value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m||wl(t,l,null,v,n);for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||g[l]===v||wl(t,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),gl("template"==e.type?t.content:t,nl(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&cl(r,0),s,u),null!=a)for(l=a.length;l--;)ol(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&wl(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&wl(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,a,o,u,l);return(h=Hu.diffed)&&h(e),128&e.__u?void 0:s}function Sl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Sl))}function xl(t,e,r){for(var i=0;r.length>i;i++)Ml(r[i],r[++i],r[++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 Cl(t){return"object"!=typeof t||null==t||t.__b>0?t:nl(t)?t.map(Cl):void 0!==t.constructor?null:al({},t)}function Ml(t,e,r){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,r)}}function Tl(t,e,r){var i,n;if(Hu.unmount&&Hu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ml(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(n=0;i.length>n;n++)i[n]&&Tl(i[n],e,r||"function"!=typeof t.type);r||ol(t.__e),t.__c=t.__=t.__e=void 0}function Il(t,e,r){return this.constructor(t,r)}function Rl(t,e,r){var i,n,a;e==document&&(e=document.documentElement),Hu.__&&Hu.__(t,e),i=e.__k,n=[],a=[],_l(e,t=e.__k=sl(ll,null,[t]),i||el,el,e.namespaceURI,i?null:e.firstChild?Bu.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,a),xl(n,t,a),t.props.children=null}Bu=rl.slice,Hu={__e(t,e,r,i){for(var n,a,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Uu=0,hl.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=al({},this.state),"function"==typeof t&&(t=t(al({},r),this.props)),t&&al(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),fl(this))},hl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fl(this))},hl.prototype.render=ll,$u=[],Wu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vu=function(t,e){return t.__v.__b-e.__v.__b},pl.__r=0,Zu=Math.random().toString(8),Gu="__d"+Zu,Qu="__a"+Zu,Ju=/(PointerCapture)$|Capture$/i,Yu=0,Ku=kl(!1),Xu=kl(!0),tl=0;var Al,El,Ll,Ol,Pl=0,Dl=[],Nl=Hu,Fl=Nl.__b,ql=Nl.__r,jl=Nl.diffed,Bl=Nl.__c,Hl=Nl.unmount,Ul=Nl.__;function $l(t,e){Nl.__h&&Nl.__h(El,t,Pl||e),Pl=0;var r=El.__H||(El.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function zl(t){return Pl=1,function(t,e,r){var i=$l(Al++,2);if(i.t=t,!i.__c&&(i.__=[eh(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=El,!El.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),a){var s=a.call(this,t,e,r);return n?s||o:s}return!n||o};El.__f=!0;var a=El.shouldComponentUpdate,o=El.componentWillUpdate;El.componentWillUpdate=function(t,e,r){if(this.__e){var i=a;a=void 0,n(t,e,r),a=i}o&&o.call(this,t,e,r)},El.shouldComponentUpdate=n}return i.__N||i.__}(eh,t)}function Wl(t,e){var r=$l(Al++,3);!Nl.__s&&th(r.__H,e)&&(r.__=t,r.u=e,El.__H.__h.push(r))}function Vl(t){return Pl=5,Zl((function(){return{current:t}}),[])}function Zl(t,e){var r=$l(Al++,7);return th(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Gl(t){var e=El.context[t.__c],r=$l(Al++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(El)),e.props.value):t.__}function Ql(){for(var t;t=Dl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Kl),e.__h.some(Xl),e.__h=[]}catch(r){e.__h=[],Nl.__e(r,t.__v)}}}Nl.__b=function(t){El=null,Fl&&Fl(t)},Nl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ul&&Ul(t,e)},Nl.__r=function(t){ql&&ql(t),Al=0;var e=(El=t.__c).__H;e&&(Ll===El?(e.__h=[],El.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Ql(),Al=0)),Ll=El},Nl.diffed=function(t){jl&&jl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Dl.push(e)&&Ol===Nl.requestAnimationFrame||((Ol=Nl.requestAnimationFrame)||Yl)(Ql)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ll=El=null},Nl.__c=function(t,e){e.some((function(t){try{t.__h.some(Kl),t.__h=t.__h.filter((function(t){return!t.__||Xl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Nl.__e(r,t.__v)}})),Bl&&Bl(t,e)},Nl.unmount=function(t){Hl&&Hl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{Kl(t)}catch(t){e=t}})),r.__H=void 0,e&&Nl.__e(e,r.__v))};var Jl="function"==typeof requestAnimationFrame;function Yl(t){var e,r=function(){clearTimeout(i),Jl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Jl&&(e=requestAnimationFrame(r))}function Kl(t){var e=El,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),El=e}function Xl(t){var e=El;t.__c=t.__(),El=e}function th(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function eh(t,e){return"function"==typeof e?e(t):e}var rh={Tab:"tab",Selector:"selector"},ih={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},nh={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ah={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},oh={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},sh={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},uh="always",lh={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},hh={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},ch=Ot("[Surveys]"),dh=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),vh=t=>dh("seenSurvey_",t),fh=t=>{try{var e=vh(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){ch.error("Failed to persist survey seen state",t)}},ph=[ah.Popover,ah.Widget,ah.API];Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return I(t)&&isFinite(t)&&Math.floor(t)===t});class gh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new gh(n)}toString(){for(var t="",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 gh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class mh{generate(){var t=this.generateOrAbort();if(!S(t))return t;this.Kr=0;var e=this.generateOrAbort();if(S(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Kr)this.Kr=t,this.Xr();else{if(this.Kr>=t+1e4)return;this.ti++,this.ti>4398046511103&&(this.Kr++,this.Xr())}return gh.fromFieldsV7(this.Kr,Math.trunc(this.ti/Math.pow(2,30)),this.ti&Math.pow(2,30)-1,this.ei.nextUint32())}Xr(){this.ti=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Kr=0,this.ti=0,this.ei=new wh}}var yh,bh=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!S(t.crypto)&&crypto.getRandomValues&&(bh=t=>crypto.getRandomValues(t));class wh{nextUint32(){return this.De.length>this.ri||(bh(this.De),this.ri=0),this.De[this.ri++]}constructor(){this.De=new Uint32Array(8),this.ri=1/0}}var kh=()=>_h().toString(),_h=()=>(yh||(yh=new mh)).generate(),Sh=null,xh={ii(){if(!M(Sh))return Sh;var e=!0;if(S(t))e=!1;else try{var r="__mplssupport__";xh.ni(r,"xyz"),'"xyz"'!==xh.ai(r)&&(e=!1),xh.oi(r)}catch(t){e=!1}return e||Lt.error("localStorage unsupported; falling back to cookie store"),Sh=e,e},si(t){Lt.error("localStorage error: "+t)},ai(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){xh.si(t)}return null},ui(t){try{return JSON.parse(xh.ai(t))||{}}catch(t){}return null},ni(e,r){try{return null==t||t.localStorage.setItem(e,JSON.stringify(r)),!0}catch(t){xh.si(t)}return!1},oi(e){try{null==t||t.localStorage.removeItem(e)}catch(t){xh.si(t)}}},Ch=Ot("[Stylesheet Loader]"),Mh=t,Th=i,Ih="#020617",Rh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:ih.Right,widgetType:rh.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ih,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Ah=[ih.Center,ih.Left,ih.Right];function Eh(t){if(t.startsWith("#")){var 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 Lh(t){var e;void 0===t&&(t=Rh.backgroundColor),"#"===t[0]&&(e=Eh(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=Eh(r)),!e)return Ih;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?Ih:"white"}return Ih}var Oh=(t,e,r)=>{var i=Xh(t),n=Th.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=Th.createElement("div");((t,e,r)=>{var i=h({},Rh,r),n=t.style,a=!Ah.includes(i.position)||e===ah.Widget&&(null==r?void 0:r.widgetType)===rh.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var 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)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||Lh(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Lh(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Lh(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",Lh(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||Lh(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,t.type,t.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return k(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Ch.error("prepare_external_dependency_stylesheet returned null"),null)})(Th,':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(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return Th.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},Ph=t=>{var e=t.responses,r=t.survey,i=t.surveySubmissionId,n=t.posthog,a=t.isSurveyCompleted,o=t.properties,s=t.surveyLanguage,u=t.questionSnapshots;n?(fh(r),n.capture(lh.SENT,h({[hh.SURVEY_NAME]:r.name,[hh.SURVEY_ID]:r.id,[hh.SURVEY_ITERATION]:r.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[hh.SURVEY_SUBMISSION_ID]:i,[hh.SURVEY_COMPLETED]:a},s&&{[hh.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},li(e,r,u),o,{$set:{[hi(r,"responded")]:!0}})),a&&(Mh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Kh(r),n.reloadFeatureFlags())):ch.error("[survey sent] event not captured, PostHog instance not found.")},Dh=(t,e,r)=>{return h({[hh.SURVEY_NAME]:t.name,[hh.SURVEY_ID]:t.id,[hh.SURVEY_ITERATION]:t.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[hh.SURVEY_PARTIALLY_COMPLETED]:(i=null==e?void 0:e.responses,void 0===i&&(i={}),Object.values(i).some((t=>!T(t))))},(null==e?void 0:e.surveyLanguage)&&{[hh.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[hh.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},li(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var i},Nh=(t,e,r,i)=>{if(e){if(!r){var n=Jh(t),a=n?n.surveyLanguage:i;e.capture(lh.DISMISSED,h({},Dh(t,n,e),a&&{[hh.SURVEY_LANGUAGE]:a},{$set:{[hi(t,"dismissed")]:!0}})),Kh(t),fh(t),Mh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else ch.error("[survey dismissed] event not captured, PostHog instance not found.")},Fh=(t,e)=>{if(e){var r=(t=>dh("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Jh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(lh.ABANDONED,Dh(t,i,e),{transport:"sendBeacon"})}}else ch.error("[survey abandoned] event not captured, PostHog instance not found.")},qh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),jh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Bh=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Hh=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(r=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var r=new Map(t.questions.map((t=>[t.id,t]))),i=[];for(var n of e){var a=r.get(n);if(!a)return null;i.push(a)}return i})(t,e.questionOrder))&&void 0!==r?r:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?jh(t.questions,qh(t.questions)):t.questions;var r},Uh=t=>function(t){var e;return gi(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}(t)||Yh(t),$h=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,fl(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+tl++,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}),zh=()=>Gl($h),Wh=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,a,o,s=al({},t.props);for(a in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?n=e[a]:s[a]=void 0===e[a]&&null!=o?o[a]:e[a];return arguments.length>2&&(s.children=arguments.length>3?Bu.call(arguments,2):r),ul(t.type,s,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Vh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Bt(e);if(!n)return!1;var a=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return bi[o](a,[n])}function Zh(e){var i,n;return function(e,i){var n,o,s;if(!e||0===e.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==t||null==(o=t.screen)?void 0:o.width,screenHeight:null==t||null==(s=t.screen)?void 0:s.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},(v=function(t){return ot.test(t)?Q:at.test(t)?J:nt.test(t)?Y:new RegExp(tt,"i").test(t)?tt:new RegExp("("+K+"|WPDesktop)","i").test(t)?K:/iPad/.test(t)?V:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Z:st.test(t)?G:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(X,"i").test(t)?X:/(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(H).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)?U:W:new RegExp("(pda|"+H+")","i").test(t)?rt:new RegExp(z,"i").test(t)&&!new RegExp(z+" pc","i").test(t)?it:""}(a))===V||v===W||"Kobo"===v||"Kindle Fire"===v||v===it?z:v===Q||v===Y||v===J||v===tt?"Console":v===Z?"Wearable":v?H:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?H:z:"Desktop");return bi[null!=i?i:"icontains"](e,[f])}(null==(i=e.conditions)?void 0:i.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}var Gh=t=>dh("inProgressSurvey_",t),Qh=(t,e)=>{try{localStorage.setItem(Gh(t),JSON.stringify(e))}catch(t){ch.error("Error setting in-progress survey state in localStorage",t)}},Jh=t=>{try{var e=localStorage.getItem(Gh(t));if(e)return JSON.parse(e)}catch(t){ch.error("Error getting in-progress survey state from localStorage",t)}return null},Yh=t=>{var e=Jh(t);return!T(null==e?void 0:e.surveySubmissionId)},Kh=t=>{try{localStorage.removeItem(Gh(t))}catch(t){ch.error("Error clearing in-progress survey state from localStorage",t)}};function Xh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function tc(t,e,r){if(void 0===e&&(e=ih.Right),t===ah.ExternalSurvey)return{};switch(e){case ih.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ih.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ih.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ih.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ih.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ih.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ih.Left:return{left:"30px"};case ih.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===ah.Widget&&r===rh.Tab?"60px":"30px"}}}var ec=0;function rc(t,e,r,i,n,a){e||(e={});var o,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?o=e[s]:u[s]=e[s];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ec,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof t&&(o=t.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return Hu.vnode&&Hu.vnode(l),l}var ic=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),nc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),ac=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),oc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),sc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:rc("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"})}),uc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rc("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"})}),lc=rc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:rc("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"})}),hc=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return rc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[rc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),rc("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:r})]})},cc=rc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rc("g",{"clip-path":"url(#clip0_2415_6911)",children:[rc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:rc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),rc("g",{mask:"url(#mask0_2415_6911)",children:[rc("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"}),rc("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"}),rc("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"}),rc("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"}),rc("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"}),rc("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"})]})]}),rc("defs",{children:rc("clipPath",{id:"clip0_2415_6911",children:rc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function dc(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return rc("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",cc]})}function vc(e){var r=e.text,i=e.submitDisabled,n=e.appearance,a=e.onSubmit,o=e.link,s=e.onPreviewSubmit,u=e.skipSubmitButton,l=e.canGoBack,h=e.onBack,c=Gl($h).isPreviewMode,d=!!l&&!!h,v=!u&&rc("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():a()},children:r});return rc("div",{className:"bottom-section",children:[d?rc("div",{className:"form-buttons form-buttons-with-back",children:[rc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&rc(dc,{urlParams:{utm_source:"survey-footer"}})]})}function fc(t){var e=t.question,r=t.forceDisableHtml;return rc("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[rc(e.type===oh.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Wh({component:sl("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function pc(t){return rc("button",{className:"form-cancel",onClick:t.onClick,disabled:Gl($h).isPreviewMode,"aria-label":"Close survey",type:"button",children:hc({fill:"black"})})}rc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:rc("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var gc=t;function mc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,a=t.appearance,o=t.onClose,s=Gl($h).isPopup;return Wl((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Nt(gc,"keydown",t),()=>{gc.removeEventListener("keydown",t)}}),[o]),rc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&rc(pc,{onClick:()=>o()}),rc("h3",{className:"thank-you-message-header",children:e}),r&&Wh({component:sl("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&rc(vc,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function yc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,a=t.appearance,o=t.onStart,s=Gl($h),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return rc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&rc(pc,{onClick:()=>l()}),e&&rc("h3",{className:"intro-screen-header",children:e}),r&&Wh({component:sl("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),rc(vc,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var bc=t=>w(t)&&t.every((t=>x(t)));function wc(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,a=t.onPreviewSubmit,o=t.displayQuestionIndex,s=t.initialValue,u=t.canGoBack,l=t.onBack,h=zh().isPreviewMode,c=Vl(null),d=zl((()=>x(s)?s:"")),v=d[0],f=d[1],m=null==i?void 0:i.disableAutofocus;Wl((()=>{m||setTimeout((()=>{var t;h||null==(t=c.current)||t.focus()}),100)}),[h,m]);var y="surveyQuestion"+o,b=Zl((()=>function(t,e,r){var i,n,a=t.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case p:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case g:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),w=Rt(e.validation,p),k=Rt(e.validation,g),_=Zl((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(v.trim())},C=()=>{b||a(v.trim())};return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:e,forceDisableHtml:r,htmlFor:y}),rc("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||b||(t.preventDefault(),h?C():S())},value:v}),_&&rc("div",{className:"validation-hint",children:_})]}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:C,canGoBack:u,onBack:l})]})}function kc(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,a=t.canGoBack,o=t.onBack;return rc(ll,{children:[rc("div",{className:"question-container",children:rc(fc,{question:e,forceDisableHtml:t.forceDisableHtml})}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function _c(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,a=t.appearance,o=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=r.scale,d=10===r.scale?0:1,v=zl((()=>I(u)?u:w(u)&&u.length>0&&I(parseInt(u[0]))?parseInt(u[0]):x(u)&&I(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=zh().isPreviewMode,y=t=>m?s(t):o(t);return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:r,forceDisableHtml:i}),rc("div",{className:"rating-section",children:[rc("div",{className:"rating-options",children:["emoji"===r.display&&rc("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Ic[r.scale])?void 0:e.map(((t,e)=>rc("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&rc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Rc(r.scale).map(((t,e)=>rc(Sc,{displayQuestionIndex:n,active:f===t,appearance:a,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&rc("div",{className:"rating-text",children:[rc("div",{children:r.lowerBoundLabel}),rc("div",{children:r.upperBoundLabel})]})]})]}),rc(vc,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:M(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function Sc(t){var e=t.num,r=t.setActiveNumber;return rc("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function xc(t){var e=t.question,r=t.forceDisableHtml,i=t.displayQuestionIndex,n=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,s=t.initialValue,u=t.canGoBack,l=t.onBack,c=Vl(null),d=Zl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=jh(e,qh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=zl((()=>((t,e)=>x(t)||bc(t)?t:e===oh.SingleChoice?null:[])(s,e.type))),f=v[0],p=v[1],g=zl((()=>((t,e)=>{if(x(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(bc(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),m=g[0],y=g[1],b=zh().isPreviewMode,k=e.type===oh.SingleChoice,_=e.type===oh.MultipleChoice,S=e.skipSubmitButton&&k&&!e.hasOpenChoice,C=(t,e)=>{if(e){var r=!m.isSelected;return y((t=>h({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),k&&p(""),void(r&&setTimeout((()=>{var t;return null==(t=c.current)?void 0:t.focus()}),75))}if(k)return p(t),y((t=>h({},t,{isSelected:!1,inputValue:""}))),void(S&&(a(t),b&&o(t)));_&&w(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},T=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>h({},t,{inputValue:e}))),k&&p(e)},I=t=>{t.stopPropagation(),"Enter"!==t.key||R()||(t.preventDefault(),A()),"Escape"===t.key&&(t.preventDefault(),y((t=>h({},t,{isSelected:!1,inputValue:""}))),k&&p(null))},R=()=>!(e.optional||!M(f)&&(!w(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),A=()=>{m.isSelected&&_?w(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return rc(ll,{children:[rc("div",{className:"question-container",children:[rc(fc,{question:e,forceDisableHtml:r}),rc("fieldset",{className:"multiple-choice-options limit-height",children:[rc("legend",{className:"sr-only",children:_?" Select all that apply":" Select one"}),d.map(((t,r)=>{var n=!!e.hasOpenChoice&&r===e.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?m.isSelected:k?f===t:w(f)&&f.includes(t);return rc("label",{className:n?"choice-option-open":"",children:[rc("div",{className:"response-choice",children:[rc("input",{type:k?"radio":"checkbox",name:a,checked:s,onChange:()=>C(t,n),id:a,"aria-controls":o}),rc("span",{children:n?t+":":t})]}),n&&rc("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:m.inputValue,onKeyDown:I,onInput:T,onClick(e){m.isSelected||C(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),rc(vc,{text:e.buttonText||"Submit",submitDisabled:R(),appearance:n,onSubmit:A,onPreviewSubmit:A,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Cc=[1,2,3,4,5],Mc=[1,2,3,4,5,6,7],Tc=[0,1,2,3,4,5,6,7,8,9,10],Ic={2:[uc,lc],3:[ac,nc,ic],5:[oc,ac,nc,ic,sc]};function Rc(t){switch(t){case 5:default:return Cc;case 7:return Mc;case 10:return Tc}}var Ac=Ot("[Surveys]");function Ec(t,e,r){var i,n=t.questions[e],a=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?sh.End:a;if(n.branching.type===sh.End)return sh.End;if(n.branching.type===sh.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===sh.ResponseBased){if(n.type===oh.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===sh.End?sh.End:a}}else if(n.type===oh.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=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")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===sh.End?sh.End:a}}return a}return Ac.warn("Falling back to next question index due to unexpected branching type"),a}var Lc=Ot("[SurveyTranslations]");function Oc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=ci(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var a=function(t){return t&&"object"==typeof t&&"language"in t?ci(t.language):null}(r);if(a)return null==e||e.info("Using person property language: "+a),a;var o=ci(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:k(t.get_property)?t.get_property(ze):void 0,locale:navigator.language||navigator.userLanguage},Lc)}(e);if(!r)return Lc.info("No user language detected"),{survey:t,language:null};var i=pi(t,r,Lc);return{survey:i.survey,language:i.matchedKey}}var Pc=-1,Dc=t,Nc=i,Fc="ph:show_survey_widget",qc="PHWidgetSurveyClickListener";function jc(t,e){try{var r=t.getBoundingClientRect(),i=Dc.innerHeight,n=Dc.innerWidth,a=r.left+r.width/2-e/2;a+e>n-20&&(a=n-e-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Rh.zIndex}}catch(t){return ch.warn("Failed to calculate trigger position:",t),null}}class Bc{constructor(t){var e=this;this.li=new Map,this.hi=new Map,this.ci=new Map,this.di=new Set,this.vi=null,this.fi=!1,this.pi=null,this.gi=null,this.mi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(We);if(t)for(var e of t)Yh(e)&&Fh(e,this._posthog)},this.handlePopoverSurvey=function(t,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=e.yi(t),v=d.survey,f=d.language;e.vi=f,e.mi=null,e.bi=r;var p=e.wi(v,r);e.ki(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Si(p,y,m,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){e.xi(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===ih.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=Nc.querySelector(p.appearance.widgetSelector);_&&(w=jc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Rh.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=Oh(p,e._posthog).shadow;e.ci.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ci,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(e.mi=C,0>=S)return e.fi=!0,Rl(rc(Wc,h({},C)),x);var M=()=>{if(!e.Mi(p))return ch.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ci(p);(()=>{e.fi=!0;var i=e.yi(t),n=i.survey,a=i.language;e.vi=a;var o=e.wi(n,r),s=h({},C,{survey:o,surveyLanguage:a});e.mi=s,Rl(rc(Wc,h({},s,{survey:h({},o,{appearance:h({},o.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},T=c?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,R=I(T)?Math.max(0,Date.now()-T):0,A=Math.max(0,1e3*S-R);if(0>=A)return M();var E=Dc.setTimeout((()=>{e.li.delete(p.id),M()}),A);e.li.set(p.id,E)}},this.Ti=t=>{var e=this.yi(t),r=e.survey,i=e.language,n=Oh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.ci.set(a,a.host),o&&Rl(rc(Zc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),a)},this.Ii=t=>{var e=this.hi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(qc),this.hi.delete(t),ch.info("Removed click listener for survey "+t))},this.Ri=t=>{this.Ai(t)||(this.Ei(t),this.Ii(t.id))},this.Ai=t=>{try{var e,r=Nc.querySelector(Xh(t,!0));return!(null==r||null==(e=r.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Li=(t,e)=>{var r=Nc.querySelector(e),i=this.hi.get(t.id);if(r){if(this.Ti(t),i){if(r===i.element)return;ch.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ii(t.id)}if(!r.hasAttribute(qc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===ih.NextToTrigger?jc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Rh.maxWidth)):{};Dc.dispatchEvent(new CustomEvent(Fc,{detail:{surveyId:t.id,position:n}}))};Nt(r,"click",n),r.setAttribute(qc,"true"),this.hi.set(t.id,{element:r,listener:n,survey:t}),ch.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Ri(t)},this.renderPopover=t=>{var e=this.yi(t),r=e.survey,i=e.language,n=Oh(r,this._posthog).shadow;this.ci.set(n,n.host),Rl(rc(Wc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Ci,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.yi(t),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.Oi(a,o,r)),Rl(rc(Wc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ci,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.Mi(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===ah.Popover||t.type===ah.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.li.keys()))i.has(n)||e.cancelSurvey(n);var a=e.Pi(r),o=new Set;a.forEach((t=>{if(t.type===ah.Widget){var r,i,n,a;if((null==(r=t.appearance)?void 0:r.widgetType)===rh.Tab)return void e.Ti(t);(null==(i=t.appearance)?void 0:i.widgetType)===rh.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Li(t,null==(a=t.appearance)?void 0:a.widgetSelector))}M(e.Di)&&t.type===ah.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.hi.forEach((t=>{var r=t.survey;o.has(r.id)||e.Ri(r)}))}),t)},this.xi=t=>{M(this.Di)||ch.error("Survey "+this.Di+" already in focus. Cannot add survey "+t.id+"."),this.Di=t.id},this.Ci=t=>{this.Di!==t.id&&ch.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.ki(t.id),this.Di=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0,this.Ei(t)},this._posthog=t,this.Di=null,this.pi=()=>this.Ni(),Nt(Dc,"languagechange",this.pi),this.gi=t.onFeatureFlags((()=>this.Ni()))}Ni(){if(!M(this.Di)){var t=this._posthog.get_property(We),e=null==t?void 0:t.find((t=>t.id===this.Di));if(e){var r=this.yi(e),i=r.survey,n=r.language;if(n!==this.vi&&(this.vi=n,this.fi)){var a=this.wi(i,this.bi),o=Oh(a,this._posthog).shadow;Rl(rc(Wc,h({},this.mi,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ci,surveyLanguage:n})),o)}}}}get Fi(){var t,e,r;return null!==(t=null==(e=(r=this._posthog).getExtension)?void 0:e.call(r,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}wi(t,e){return null!=e&&e.position||null!=e&&e.selector?h({},t,{appearance:h({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}ki(t){var e=this.li.get(t);e&&(clearTimeout(e),this.li.delete(t))}cancelSurvey(t){this.li.has(t)&&(ch.info("Cancelled pending survey "+t),this.ki(t),this.Di===t&&(this.Di=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0))}setAutomaticDisplayDispose(t){this.qi=t}dispose(){var t;null==(t=this.qi)||t.call(this),this.qi=void 0,this.pi&&(Dc.removeEventListener("languagechange",this.pi),this.pi=null),this.gi&&(this.gi(),this.gi=null),this.li.forEach(((t,e)=>this.ki(e))),this.hi.forEach(((t,e)=>this.Ii(e))),this.ci.forEach(((t,e)=>{Rl(null,e),null==t||t.remove()})),this.ci.clear(),this.Di=null}Pi(t){return t.sort(((t,e)=>{var r,i,n=Yh(t),a=Yh(e);if(n&&!a)return-1;if(!n&&a)return 1;var o=t.schedule===uh,s=e.schedule===uh;return o&&!s?1:!o&&s?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}yi(t){return Oc(t,this._posthog)}Oi(t,e,r){if(this.di.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!S(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);e[d]||(e[d]=[]),e[d].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(Dc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;ch.info("[Survey Prefill] Detected URL prefill parameters");var a=this.ji(t,n,e);return!!a&&(this.Bi(t,a,r,e),this.di.add(t.id),a.isSurveyCompleted)}Bi(t,e,r,i){var n=e.responses,a=e.submissionId,o=e.isSurveyCompleted,s=e.skippedResponses;(Object.keys(s).length>0&&t.enable_partial_responses||o)&&Ph({responses:o?n:s,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,properties:r,surveyLanguage:i})}Si(t,e,r,i){var n={};for(var a of Object.entries(e)){var o=a[1];n[parseInt(a[0])]=w(o)?o.map(String):[String(o)]}ch.info("[Survey] Processing initial responses");var s=this.ji(t,n,i);return!!s&&(this.Bi(t,s,r,i),s.isSurveyCompleted)}ji(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],a=si(t.id);try{switch(t.type){case oh.SingleChoice:if(!t.choices||0===t.choices.length)return void Lt.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Lt.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=t.choices[o];break;case oh.MultipleChoice:if(!t.choices||0===t.choices.length)return void Lt.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===s.length)return void Lt.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((e=>t.choices[e])))];s.length>u.length&&Lt.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case oh.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Lt.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Lt.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Lt.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return ch.warn("[Survey Prefill] No valid responses after conversion"),null;var n=kh(),a=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},a=[],o=t.questions.length+1,s=0;t.questions.length>i&&o>s&&(s++,e.includes(i));){var u=t.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=si(u.id);S(r[l])||(n[l]=r[l])}a.push(i);var h=Ec(t,i,u.id?r[si(u.id)]:null);if(h===sh.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(t,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=o.skippedIndices,h=s>=t.questions.length;return Qh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,questionOrder:Bh(t.questions),visitedIndices:l,surveyLanguage:r}),ch.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:h,skippedResponses:u}}catch(t){return ch.error("[Survey Prefill] Error handling prefill:",t),null}}Hi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=this.Fi,i=!(null==r||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==r?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),i&&n}Ui(t){return!t.conditions||Vh(t,this._posthog)&&Zh(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Th||!Th.querySelector(t.conditions.selector))}(t)}$i(t){var e;return Uh(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.Fi)&&e.hasLoadedFlags?{satisfied:this.Hi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,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(!ph.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.Hi(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.Hi(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.$i(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,xh.ai("lastSeenSurveyDate"))?(t=>!!xh.ai(vh(t))&&!Uh(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!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.zi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}zi(t){var e;if(!gi(t)&&!function(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}Wi(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.Hi(e)}))}Mi(t){return this.checkSurveyEligibility(t).eligible&&this.Ui(t)&&this.zi(t)&&this.Wi(t)}Ei(t){try{var e=Nc.querySelector(Xh(t,!0));null!=e&&e.shadowRoot&&(Rl(null,e.shadowRoot),this.ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){ch.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.xi,removeSurveyFromFocus:this.Ci,surveyInFocus:this.Di,surveyTimeouts:this.li,handleWidget:this.Ti,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Li,sortSurveysByAppearanceDelay:this.Pi,checkFlags:this.Wi.bind(this),isSurveyFeatureFlagEnabled:this.Hi.bind(this),onLanguageChange:this.Ni.bind(this),currentLanguage:this.vi,surveyIsRendered:this.fi}}}function Hc(t,e){if(Nc&&Dc){var r,i=new Bc(t);if(t.config.disable_surveys_automatic_display)return ch.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return ch.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{S(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{S(r)||(clearInterval(r),r=void 0)};n();var o=()=>{Nc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Nt(Nc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),Nc.removeEventListener("visibilitychange",o)})),i}}function Uc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,a=t.isPreviewMode,o=void 0!==a&&a,s=t.posthog;Wl((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===ah.Widget,a=Vh(e,s),o=(null==(t=e.appearance)?void 0:t.widgetType)===rh.Tab&&r;if(!a)return ch.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(ch.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Nt(Dc,"popstate",r),Nt(Dc,"hashchange",r);var a=Dc.history.pushState,u=Dc.history.replaceState;return Dc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];a.apply(this,e),r()},Dc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];u.apply(this,e),r()},()=>{Dc.removeEventListener("popstate",r),Dc.removeEventListener("hashchange",r),Dc.history.pushState=a,Dc.history.replaceState=u}}}),[o,e,i,n,s])}var $c=200;function zc(t){switch(void 0===t&&(t=nh.Right),t){case nh.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case nh.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case nh.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Wc(t){var e,r,i,n,a,o,s,u,l,c,d,v,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,w=t.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=t.isPopup,x=void 0===_||_,C=t.onPreviewSubmit,M=void 0===C?()=>{}:C,T=t.onPreviewBack,I=void 0===T?()=>{}:T,R=t.onPopupSurveyDismissed,A=void 0===R?()=>{}:R,E=t.onCloseConfirmationMessage,L=void 0===E?()=>{}:E,O=t.properties,P=t.isSurveyCompleted,D=t.skipShownEvent,N=t.surveyLanguage,F=Vl(null),q=Number.isInteger(b),j=null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(t,e,r,i,n,a,o,s,u){var l=zl(i||0===r||t.type===ah.ExternalSurvey),c=l[0],d=l[1],v=zl(!1),f=v[0],p=v[1],g=Vl(!1),m=()=>{var e=()=>{a&&n(t),d(!1)};if(!g.current){var r=null==o?void 0:o.current;r?(g.current=!0,r.style.transition="opacity "+$c+"ms ease-out",r.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),$c+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Wl((()=>{if(e){if(!i){var n,a=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(Vh(t,e)){d(!0),Dc.dispatchEvent(new Event("PHSurveyShown")),s||e.capture(lh.SHOWN,h({[hh.SURVEY_NAME]:t.name,[hh.SURVEY_ID]:t.id,[hh.SURVEY_ITERATION]:t.current_iteration,[hh.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[hh.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Nt(Dc,"PHSurveyClosed",y),Nt(Dc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return S(l)&&o(),()=>{S(l)||clearTimeout(l),S(n)||clearTimeout(n),Dc.removeEventListener("PHSurveyClosed",y),Dc.removeEventListener("PHSurveySent",a)}}}else ch.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Uc({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:e}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,j,q,k,x,F,D,N),H=B.isPopupVisible,U=B.hidePopupWithAnimation,z=B.isSurveySent||b===f.questions.length||!0===P,W=zl(!1),V=W[0],Z=W[1],G=Zl((()=>!!Jh(f)),[f]),Q=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),J=q?b===Pc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&Q&&!V&&!G,Y=Zl((()=>{var t=Jh(f),e=(null==t?void 0:t.surveySubmissionId)||kh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){N?Nh(f,g,q,N):Nh(f,g,q),A()},isPopup:x||!1,surveySubmissionId:e,onPreviewSubmit:M,onPreviewBack:I,posthog:g,properties:O,surveyLanguage:N}}),[q,b,x,g,f,A,M,I,O,N]);return H?rc($h.Provider,{value:Y,children:rc("div",{className:"ph-survey",style:h({},tc(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:F,children:z?rc(mc,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||Rh,onClose(){U(),L()}}):J?rc(yc,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||Rh,onStart:()=>Z(!0)}):rc(Vc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Vc(t){var e,r,i=t.survey,n=t.forceDisableHtml,a=t.posthog,o=Zl((()=>{var t=Jh(i);if(!t)return null;var e=I(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&i.questions.length>t.lastQuestionIndex?t:(Kh(i),null)}),[i]),s=zl((()=>(null!=o&&o.responses&&ch.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=Gl($h),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,g=c.onPreviewBack,m=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=zl((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=I(t)&&t>=0&&i.questions.length>t?t:0;return I(d)&&d>=0?d:e})),_=k[0],x=k[1],C=zl((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&i.questions.length>t))})),M=C[0],T=C[1],R=zl((()=>{var t,e=Jh(i);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),A=R[0],E=R[1],L=Zl((()=>Bh(Hh(i,o))),[i.id,o]),O=Zl((()=>{if(!L||new Set(L).size!==L.length)return Hh(i,o);var t=new Map(i.questions.map((t=>[t.id,t]))),e=L.map((e=>t.get(e))).filter((t=>!!t));return e.length===L.length?e:i.questions}),[L,i.questions,i,o]);Wl((()=>{!y||S(d)||0>d||x(d)}),[d,y]);var P=!(null==(e=i.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:M.length>0),D=O.at(_);return D?rc("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&rc(pc,{onClick(){v()}}),rc("div",{className:"survey-box","data-question-index":_,children:Gc({question:D,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||Rh,onSubmit:t=>(t=>{var e=t.res,r=t.displayQuestionIndex,n=t.questionId;if(a)if(n){var o=si(n),s=h({},u,{[o]:e});l(s);var c=O[r],d=null!=c&&c.id?h({},A,{[c.id]:c.question}):A;E(d);var v=Ec(i,r,e),f=v===sh.End,p=[...M,r];if(f||(T(p),x(v),Qh(i,{surveySubmissionId:m,responses:s,lastQuestionIndex:v,questionOrder:Bh(O),visitedIndices:p,surveyLanguage:w,questionSnapshots:d})),i.enable_partial_responses||f){var g=new Set(p.map((t=>{var e;return null==(e=O[t])?void 0:e.id})).filter((t=>!!t)).map((t=>si(t)))),y=Object.fromEntries(Object.entries(s).filter((t=>g.has(t[0]))));Ph({responses:y,survey:i,surveySubmissionId:m,isSurveyCompleted:f,posthog:a,properties:b,surveyLanguage:w,questionSnapshots:d})}}else ch.error("onNextButtonClick called without a questionId.");else ch.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:_,questionId:D.id}),onPreviewSubmit:p,initialValue:D.id?u[si(D.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==M.length){var t=M[M.length-1],e=M.slice(0,-1);T(e),x(t),Qh(i,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Bh(O),visitedIndices:e,surveyLanguage:w,questionSnapshots:A})}}})})]}):null}function Zc(t){var e,r,i,n,a,o,s,u=t.survey,l=t.forceDisableHtml,h=t.posthog,c=t.readOnly,d=t.surveyLanguage,v=zl(!0),f=v[0],p=v[1],g=zl(!1),m=g[0],y=g[1],b=zl({}),w=b[0],k=b[1],_=Vl(void 0),x=()=>{y(!m)};if(Wl((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&k({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(ch.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),x())};return Nt(Dc,Fc,e),()=>{S(_.current)||(clearTimeout(_.current),_.current=void 0),Dc.removeEventListener(Fc,e)}}}else ch.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Uc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var C=()=>{u.schedule!==uh&&p(!1),S(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return rc(ll,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&rc("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===nh.Top?"widget-tab-top":""),onClick:x,disabled:c,style:zc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&rc(Wc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:d})]})}var Gc=t=>{var e=t.question,r=t.onSubmit,i=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){i(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case oh.Open:return sl(wc,h({},n,{question:e,key:e.id}));case oh.Link:return sl(kc,h({},n,{question:e,key:e.id}));case oh.Rating:return sl(_c,h({},n,{question:e,key:e.id}));case oh.SingleChoice:case oh.MultipleChoice:return sl(xc,h({},n,{question:e,key:e.id}));default:return ch.error("Unsupported question type: "+e.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=Hc,s.extendPostHogWithSurveys=Hc;var Qc=1e4,Jc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Yc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Jc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(t.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?a=o-1:n=o}return Jc(e,JSON.stringify(t.slice(0,n)),r)},Kc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Xc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},td=(t,e,r)=>{if(!r.truncated)if(_(t)){if(r.seen.has(t))return void Xc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(td(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Xc(e,t,r)},ed=function(t,e,r,i,n,a){if(void 0===n&&(n=!1),!Kc(t))return!n||Jc(e,"null",r);if(M(t)||(t=>{try{return I(t)||R(t)}catch(t){return!1}})(t))return Jc(e,JSON.stringify(t),r);if("string"==typeof t)return Yc(t,e,r);if(!_(t)&&!w(t))return Jc(e,JSON.stringify(t),r);if(i.has(t))return Yc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(k(o))return ed(o.call(t),e,r,i,n)}catch(t){}try{var s={}.toString.call(t);if("[object String]"===s)return Yc(String(t.valueOf()),e,r);if("[object Number]"===s||"[object Boolean]"===s)return Jc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var u={};try{for(var l in t)({}).hasOwnProperty.call(t,l)&&(u[l]=t[l])}catch(t){}try{u.name=t.name}catch(t){}try{u.message=t.message}catch(t){}try{u.stack=t.stack}catch(t){}return ed(u,e,r,i,n,a)}if(w(t)){if(!Jc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Jc(e,",",r))return!1;var c=void 0;try{c=t[h]}catch(t){c=void 0}if(!ed(c,e,r,i,!0))return!1}return Jc(e,"]",r)}if(!Jc(e,"{",r))return!1;var d=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(a)try{td(f,v,a)}catch(t){}if(Kc(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Jc(e,p,r))return!1;var b=e.length,S=ed(f,e,r,i,!1),x=r.truncated;if(e.length!==b){if(d=!1,!S)return!1}else if(e.length=g,r.remaining=m,r.truncated=S?y:x,!S)return!1}}}catch(t){}return Jc(e,"}",r)},rd=(t,e)=>{for(var r=[],i={remaining:e,truncated:!1},n=_(t[0])?{result:{},keysRemaining:50,sizeRemaining:Qc,truncated:!1,seen:new WeakSet([t[0]])}:void 0,a=0;t.length>a&&(0>=a||Jc(r," ",i))&&ed(t[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},id={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},nd=t=>"canCapture"in t,ad=t=>nd(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0;s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(t){var e=t,r=[],i={host:s.location.host},n=!1,a=function(t){var a=s.console[t];r.push(vu(s.console,t,(r=>{var o=(r=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{var c=e;if(u.length>0&&!n&&c){var d=ad(c);if(d){n=!0,a=!0;var v=rd(u,Qc),f=v.body,p=v.attributes,g=h({},i,v.truncated?{body_truncated:"true"}:{});((t,e,r)=>{if(nd(t))e.captureConsoleLog(r);else{var i=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var r=Number(e[1]),i=Number(e[2]);if(r>=392&&419>=r)return 410===r?i>4?i>10?void 0:"de":"le":418===r?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===r?i>2?void 0:"vi":410>r?"le":"he"}})(t.version),n=i?e[i]:void 0;k(n)&&n.call(e,r)}})(c,d,{level:id[t],body:f,attributes:h({"log.source":"console."+t},g,p)})}}}catch(t){}finally{a&&(n=!1),r.apply(s.console,u)}})(r);return o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(a),o})))};for(var o of Object.keys(id))a(o);return()=>{e=void 0,r.forEach((t=>t()))}},replayConsoleBuffer(t,e){var r=ad(t);if(r)for(var i of e)try{var n=rd(i.args,Qc);null==r.captureBufferedConsoleLog||r.captureBufferedConsoleLog({level:id[i.level],body:n.body,attributes:h({"log.source":"console."+i.level,host:s.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},i.context,i.occurredAtMs)}catch(t){}}},Ot("[Error tracking]");var od=Ot("[ExceptionAutocapture]"),sd=new class{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(t){var e=this;return l((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&w(r.stacktrace.frames)&&(r.stacktrace.frames=yield e.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,i;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),h({},t,{cause:r,stack:i})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return l((function*(){var r=t;for(var i of e.modifiers)r=yield i(r);return r}))()}convertToExceptionList(t,e){var r,i,n,a={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(i=e.handled)||void 0===i||i,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var o=[a];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,h({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:lt(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return h({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>i(t,r),next:t=>i(t,r+1)})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=x(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?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){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return L(t,"DOMException")}isDOMError(t){return L(t,"DOMError")}},new class{match(t){return L(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!P(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return E(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.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!!L(t,"ErrorEvent")&&(null!=t.error||this.Vi(t))}coerce(t,e){var r;if(null!=t.error)return e.apply(t.error);var i=e.apply(t.message);return h({},i,{stack:null!==(r=this.Zi(t))&&void 0!==r?r:i.stack,synthetic:!0})}Vi(t){return x(t.message)&&t.message.length>0}Zi(t){var e,r,i=t,n=null!==(e=i.lineno)&&void 0!==e?e:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(x(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(t){return O(t)}coerce(t,e){var r,i=this.getStack(t),n=void 0===i;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:null==(r=e.syntheticException)?void 0:r.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}},new class{match(t){return P(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+St(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(P(t))return t.constructor.name;var e="name"in t?t.name:void 0;return x(e)&&!C(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var 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;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+St(t)}isSeverityLevel(t){return x(t)&&!C(t)&&_t.indexOf(t)>=0}getStack(t){try{return x(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:x(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(O(r))return r}}getObjectClassName(t){try{var 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 r,i=this.getInfos(t),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(kt);return i&&(e=i[1],r=i[2]),[e,r]}},new class{match(t){return E(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];return function(e,i){void 0===i&&(i=0);for(var n=[],a=e.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=wt.test(s)?s.replace(wt,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,t);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map((t=>{return h({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||ht});var r}))}(n)}}("web:javascript",gt,bt)),ud=(t,e)=>{try{t(e())}catch(t){}},ld=e=>{var r=t;r||od.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var t,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];return ud(e,(()=>sd.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4];if(null!=a)return a;if(x(e)&&x(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}}))),!!k(i)&&null!==(t=i(...n))&&void 0!==t&&t},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onerror)||delete t.__POSTHOG_INSTRUMENTED__,r.onerror=i}},hd=function(e,r){void 0===r&&(r=!1);var i=t;i||od.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(t){var i;return ud(e,(()=>sd.buildFromUnknown(t,{mechanism:{handled:!1}}))),k(n)?null!==(i=n(t))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},cd={wrapOnError:ld,wrapUnhandledRejection:hd,wrapConsoleError(t){var e=console;e||od.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;e>n;n++)i[n]=arguments[n];ud(t,(()=>{var t;t=1==i.length?i[0]:i.join(" ");var e=i.find((t=>t instanceof Error));return sd.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})})),k(r)&&r(...i)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=cd,s.posthogErrorWrappingFunctions=cd;var dd=(t,e)=>{if(k(null==t?void 0:t.capture)){var r=null==e?void 0:e.autocaptureExceptions,i=!M(r)&&"object"==typeof r&&w(r.errors_to_ignore)?r.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){od.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){od.error("Failed to capture exception for a legacy client",t)}};ld((t=>{i.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),hd(n,!0)}};s.extendPostHogWithExceptionAutoCapture=dd,s.extendPostHogWithExceptionAutocapture=dd;var vd="X-POSTHOG-SESSION-ID",fd="X-POSTHOG-WINDOW-ID",pd="X-POSTHOG-DISTINCT-ID",gd=[vd,fd,pd],md=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],yd=(t,e)=>({}.hasOwnProperty.call(t,e)),bd=t=>"object"==typeof t&&!M(t)||k(t),wd=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),kd=e=>{try{var r;return wd(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(r=t.location)?void 0:r.href).toString()}catch(t){return}},_d=(t,e,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(w(t)&&!t.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(vd,s.sessionId),n.set(fd,u),o=!0}var l=(t=>k(t)?t():t)(e);return l&&"$posthog_cookieless"!==l&&(n.set(pd,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var Sd={_patchFetch:(e,r,i)=>vu(t,"fetch",(t=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=kd(n);if(u)if(wd(n)){var l=new Request(n,a);_d(e,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(bd(a)?a.headers:void 0);if(_d(e,r,i,u,c)){var d=((t,e)=>{if(S(t)||M(t))return{headers:e};if(bd(t)){var r=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),i}return new Proxy({headers:e},{get:(t,e)=>yd(t,e)?Reflect.get(t,e):Reflect.get(r,e,r),has:(t,e)=>yd(t,e)||e in r,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(r).forEach((t=>e.add(t))),md.forEach((t=>{t in r&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&md.includes(e)&&e in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,e,r)}};var n=Reflect.getOwnPropertyDescriptor(r,e);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(t){s=o}return t.apply(this,s)})),_patchXHR:(e,r,i)=>vu(t.XMLHttpRequest.prototype,"open",(t=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=kd(a);c&&_d(e,r,i,c,h);var d=t.call(l,n,a,o,s,u);return gd.forEach((t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=Sd,s.postHogTracingHeadersPatchFns=Sd,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var r=this.length-1;r>=0;r--){var i=this[r];if(t.call(e,i,r,this))return i}},writable:!0,enumerable:!1,configurable:!0});let xd=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Cd=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Md=t=>{if("loading"===document.readyState)return"loading";var e=Cd();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"},Td=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Id=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,a=n.id?"#"+n.id:[Td(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+a.length>99)return e||a;if(e=e?a+">"+e:a,n.id)break;t=n.parentNode}}catch(t){}return e},Rd=new WeakMap;function Ad(t,e){var r=Rd.get(e);return r||(r=new WeakMap,Rd.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var Ed=-1,Ld=()=>Ed,Od=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ed=e.timeStamp,t(e))}),!0)},Pd=(t,e,r,i)=>{var n,a;return o=>{e.value>=0&&(o||i)&&((a=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=a,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Dd=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Nd=()=>{var t,e;return null!==(t=null==(e=Cd())?void 0:e.activationStart)&&void 0!==t?t:0},Fd=-1,qd=new Set,jd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Bd=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of qd)e();isFinite(Fd)||(Fd="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Bd,!0))}},Hd=function(t){if(void 0===t&&(t=!1),t&&(Fd=1/0),0>Fd){var e,r=Nd(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;Fd=null!=i?i:jd(),addEventListener("visibilitychange",Bd,!0),addEventListener("prerenderingchange",Bd,!0),Od((()=>{setTimeout((()=>{Fd=jd()}))}))}return{get firstHiddenTime(){return Fd},onHidden(t){qd.add(t)}}},Ud=function(t,e,r,i,n,a,o){void 0===e&&(e=-1),void 0===i&&(i=0);var s=Cd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Ld()?s&&(document.prerendering||Nd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},$d=function(t,e,r){void 0===r&&(r={});try{var i=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(i.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();i.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(t){}},zd=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Wd=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Vd=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Zd{constructor(){this.u=void 0}}var Gd,Qd=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Jd=[1800,3e3],Yd=function(t,e){void 0===e&&(e={});var r=zd(e);Qd((()=>{var i,n=Ad(e,Zd),a=Hd(),o=Ud("FCP"),s=$d(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),a.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Nd(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));s&&(i=Pd(t,o,Jd,e.reportAllChanges),Od((r=>{o=Ud("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ld()),i=Pd(t,o,Jd,e.reportAllChanges),Dd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&$d(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&Wd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Ud("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Pd(t,o,Jd,e.reportAllChanges))(!0)}))}),e)}))},Kd=[.1,.25],Xd=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],tv=function(t,e){void 0===e&&(e={});var r=Ad(e=Object.assign({},e),xd),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=Xd(t.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==e.generateTarget?void 0:e.generateTarget(a))&&void 0!==o?o:Id(a);i.set(n,s)}}},function(t,e){void 0===e&&(e={});var r=Hd();Yd(Vd((()=>{var i,n=Ud("CLS",0),a=Ad(e,xd),o=(r,o,s,u,l)=>{n=Ud("CLS",0,r,o,s,u,l),a.o=0,i=Pd(t,n,Kd,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(t)},u=t=>{s(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?a.l(e):u(e);s()},h=["layout-shift"];zd(e)&&h.push("soft-navigation");var c=$d(h,l);c&&(i=Pd(t,n,Kd,e.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),Od((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ld()),Dd(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var a=Xd(n.sources);a&&(e={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Md(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},ev=function(t,e){void 0===e&&(e={});var r=Ad(e=Object.assign({},e),Zd);zd(e)&&(r.u=new Map),Yd((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Md(Ld())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=Cd(),n=t.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:a,firstByteToFCP:t.value-a,loadState:Md(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(t.navigationId);s&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:s})}return Object.assign(t,{attribution:e})})(e))}),e)},rv=0,iv=1/0,nv=0,av=t=>{for(var e of t)e.interactionId&&(iv=Math.min(iv,e.interactionId),nv=Math.max(nv,e.interactionId),rv=nv?(nv-iv)/7+1:0)},ov=()=>{var t;return Gd?rv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let sv=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return ov()-this.h}D(){this.h=ov(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>r.k){var n;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):(this.p.set((i={id:t.interactionId,entries:[t],k:t.duration}).id,i),this.v.push(i)),this.v.sort(((t,e)=>e.k-t.k)),this.v.length>10){var a=this.v.splice(10);for(var o of a)this.p.delete(o.id)}null==(n=this.M)||n.call(this,i)}}}};var uv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Vd(t),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},lv=[200,500],hv=function(t,e){void 0===e&&(e={});var r=Ad(e=Object.assign({},e),sv),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(uv(c),u=!0)},c=()=>{var t=new Set(r.v.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((r,i)=>i>=e||t.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((t=>t.startTime>a||s.has(t))),u=!1};r.m=t=>{var r,i=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),e.includeProcessedEventEntries&&r.entries.push(t);break}}r||n.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&o.set(t,r),l()},r.M=t=>{if(!s.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Id(i);s.set(t,a)}else{var o,u=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;u&&s.set(t,u)}}};var d=(t,e)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=t){if(n.startTime>e)break;r.push(n)}return r};$d(["long-animation-frame"],(t=>{i=i.concat(t),l()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Hd();Qd((()=>{var i;"interactionCount"in performance||Gd||(Gd=$d(["event"],av,{durationThreshold:0}));var n,a=Ud("INP"),o=Ad(e,sv),s=(r,i,s,u,l)=>{o.D(),a=Ud("INP",-1,r,i,s,u,l),n=Pd(t,a,lv,e.reportAllChanges)},u=()=>{var t=o.S(a.navigationType);t&&t.k!==a.value&&(a.value=t.k,a.entries=t.entries,n())},l=t=>{u(),n(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),uv((()=>{for(var r of t)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),e&&n(!0)}))},d=["event","first-input"];zd(e)&&d.push("soft-navigation");var v=$d(d,c,h({},e,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));n=Pd(t,a,lv,e.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),Od((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Md(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var i=t.entries[0],n=o.get(i),a=Math.max(n.processingStart,i.startTime),u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),c=d(i.startTime,l),v=r.p.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:Md(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,a,o=t.inputDelay,s=t.processingDuration,u=0,l=0,h=0,c=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-g,l+=g,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(t.longestScript={entry:n,subpart:a,intersectingDuration:c}),t.totalScriptDuration=u,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)};let cv=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],dv=50,vv=[];$d(["resource"],(t=>{for(var e of t)vv.push(e),vv.length>dv&&vv.shift()}));var fv=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(dv=e.resourceBufferSize);var r=Ad(e,cv),i=new WeakMap;zd(e)&&(r.u=new Map),r.m=t=>{var r=t.element;if(r){var n,a=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Id(r);i.set(t,a)}else t.id&&i.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=zd(e);Qd((()=>{var n,a=Hd(),o=Ud("LCP"),s=Ad(e,cv),u=(i,s,u,l,h)=>{o=Ud("LCP",-1,i,s,u,l,h),n=Pd(t,o,$,e.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Hd(!0))},l=t=>{s.u&&t.navigationId&&Wd(s.u,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-Nd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=$d(c,h);if(d){n=Pd(t,o,$,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;uv((()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Od((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ld()),n=Pd(t,o,$,e.reportAllChanges),Dd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,a,o,s,u,l,c=t.entries.at(-1),d=c.url&&(vv.findLast((t=>t.name===c.url))||performance.getEntriesByType("resource").findLast((t=>t.name===c.url)));e.target=i.get(c),e.lcpEntry=c,c.url&&(e.url=c.url),d&&(e.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(a=l=Cd())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=t.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(t.navigationId)),l){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=h({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:l})}}return Object.assign(t,{attribution:e})})(e))}),e)},pv=-1,gv=()=>pv,mv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(pv=e.timeStamp,t(e))}),!0)},yv=(t,e,r,i)=>{var n,a;return o=>{e.value>=0&&(o||i)&&((a=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=a,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},bv=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},wv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},kv=()=>{var t,e;return null!==(t=null==(e=wv())?void 0:e.activationStart)&&void 0!==t?t:0},_v=-1,Sv=new Set,xv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Cv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Sv)e();isFinite(_v)||(_v="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Cv,!0))}},Mv=function(t){if(void 0===t&&(t=!1),t&&(_v=1/0),0>_v){var e,r=kv(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;_v=null!=i?i:xv(),addEventListener("visibilitychange",Cv,!0),addEventListener("prerenderingchange",Cv,!0),mv((()=>{setTimeout((()=>{_v=xv()}))}))}return{get firstHiddenTime(){return _v},onHidden(t){Sv.add(t)}}},Tv=function(t,e,r,i,n,a,o){void 0===e&&(e=-1),void 0===i&&(i=0);var s=wv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>gv()?s&&(document.prerendering||kv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Iv=new WeakMap;function Rv(t,e){var r=Iv.get(e);return r||(r=new WeakMap,Iv.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Av{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Ev=function(t,e,r){void 0===r&&(r={});try{var i=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(i.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();i.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(t){}},Lv=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ov=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Pv=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Dv{constructor(){this.l=void 0}}var Nv,Fv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},qv=[1800,3e3],jv=function(t,e){void 0===e&&(e={});var r=Lv(e);Fv((()=>{var i,n=Rv(e,Dv),a=Mv(),o=Tv("FCP"),s=Ev(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),a.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-kv(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));s&&(i=yv(t,o,qv,e.reportAllChanges),mv((r=>{o=Tv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,gv()),i=yv(t,o,qv,e.reportAllChanges),bv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Ev(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&Ov(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Tv("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=yv(t,o,qv,e.reportAllChanges))(!0)}))}),e)}))},Bv=[.1,.25],Hv=function(t,e){void 0===e&&(e={});var r=Mv();jv(Pv((()=>{var i,n=Tv("CLS",0),a=Rv(e,Av),o=(r,o,s,u,l)=>{n=Tv("CLS",0,r,o,s,u,l),a.i=0,i=yv(t,n,Bv,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(t)},u=t=>{s(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?a.h(e):u(e);s()},h=["layout-shift"];Lv(e)&&h.push("soft-navigation");var c=Ev(h,l);c&&(i=yv(t,n,Bv,e.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),mv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,gv()),bv(i)})),setTimeout(i))})))},Uv=0,$v=1/0,zv=0,Wv=t=>{for(var e of t)e.interactionId&&($v=Math.min($v,e.interactionId),zv=Math.max(zv,e.interactionId),Uv=zv?(zv-$v)/7+1:0)},Vv=()=>{var t;return Nv?Uv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class Zv{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Vv()-this.u}M(){this.u=Vv(),this.v.length=0,this.m.clear()}L(t){var e=this._(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>r.P){var n;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):(this.m.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.v.push(i)),this.v.sort(((t,e)=>e.P-t.P)),this.v.length>10){var a=this.v.splice(10);for(var o of a)this.m.delete(o.id)}null==(n=this.T)||n.call(this,i)}}}}var Gv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Pv(t),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Qv=[200,500],Jv=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Mv();Fv((()=>{var i;"interactionCount"in performance||Nv||(Nv=Ev(["event"],Wv,{durationThreshold:0}));var n,a=Tv("INP"),o=Rv(e,Zv),s=(r,i,s,u,l)=>{o.M(),a=Tv("INP",-1,r,i,s,u,l),n=yv(t,a,Qv,e.reportAllChanges)},u=()=>{var t=o.L(a.navigationType);t&&t.P!==a.value&&(a.value=t.P,a.entries=t.entries,n())},l=t=>{u(),n(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),Gv((()=>{for(var r of t)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),e&&n(!0)}))},d=["event","first-input"];Lv(e)&&d.push("soft-navigation");var v=Ev(d,c,h({},e,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));n=yv(t,a,Qv,e.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),mv((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,gv())})))}))}};class Yv{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var Kv=[2500,4e3],Xv=function(t,e){void 0===e&&(e={});var r=!1,i=Lv(e);Fv((()=>{var n,a=Mv(),o=Tv("LCP"),s=Rv(e,Yv),u=(i,s,u,l,h)=>{o=Tv("LCP",-1,i,s,u,l,h),n=yv(t,o,Kv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Mv(!0))},l=t=>{s.l&&t.navigationId&&Ov(s.l,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-kv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Ev(c,h);if(d){n=yv(t,o,Kv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;Gv((()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});mv((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,gv()),n=yv(t,o,Kv,e.reportAllChanges),bv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},tf={onLCP:fv,onCLS:tv,onFCP:ev,onINP:hv,withoutAttribution:{onLCP:Xv,onCLS:Hv,onFCP:jv,onINP:Jv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=tf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=tf,s.postHogWebVitalsCallbacks=tf;var ef={onLCP:Xv,onCLS:Hv,onFCP:jv,onINP:Jv};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=ef,s.__PosthogExtensions__.postHogWebVitalsCallbacks=ef,s.postHogWebVitalsCallbacks=ef,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ef;var rf={onLCP:fv,onCLS:tv,onFCP:ev,onINP:hv,withoutAttribution:{onLCP:Xv,onCLS:Hv,onFCP:jv,onINP:Jv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=rf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=rf,s.postHogWebVitalsCallbacks=rf;var nf={onLCP:Xv,onCLS:Hv,onFCP:jv,onINP:Jv};function af(t,e){return e.length>t?e.slice(0,t)+"...":e}function of(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!zt(e));return e}function sf(e,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!zt(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!Wt(f,"body")&&Zt>c.length;)if(Vt(f.parentNode)){var p=f.parentNode.host;if(d.has(p))break;d.add(p),c.push(p),f=p}else{if(!zt(f.parentNode))break;if(d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var g,m=[],y={},b=!1,k=!1;if(Pt(c,(t=>{var e=re(t);if(Wt(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&ce(r))&&(l?ut(r):r)}v(Qt(t),"ph-no-capture")&&(k=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var a=t.tagName.toLowerCase(),o={tag_name:a};Yt.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?af(1024,de(t)):af(1024,Jt(t)));var s=Qt(t);s.length>0&&(o.classes=s.filter((function(t){return""!==t}))),Pt(t.attributes,(function(r){var a;if((!ie(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&ce(r.value)&&(!x(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Gt(s).join(" ")),o["attr__"+r.name]=af(1024,"href"===r.name&&n?ut(s):s)}}));for(var u=1,l=1,h=t;h=of(h);)u++,h.tagName===t.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(t,o,s,u,l));var i=function(t){if(!re(t))return{};var e={};return Pt(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&ce(i)&&(e[r]=i)}})),e}(t);Pt(i,((t,e)=>{({}).hasOwnProperty.call(y,e)||(y[e]=t)}))})),k)return{props:{},explicitNoCapture:k};if(s||(m[0].$el_text=Wt(e,"a")||Wt(e,"button")?de(e):Jt(e)),b){var _,S;m[0].attr__href=b;var C=null==(_=qt(b))?void 0:_.host,M=null==t||null==(S=t.location)?void 0:S.host;C&&M&&C!==M&&(g=b)}var T,I=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(t[a]=n[a]);return t}({$event_type:a.type,$ce_version:1},{$elements:m},{$elements_chain:(T=m,w(T)?function(t){var e=t.map((t=>{var e,r,i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))i+="."+n.replace(/"/g,"");var a=h({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Dt(a).sort(((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0]))).forEach((t=>{var e=t[1];return o[fe(t[0].toString())]=fe(e.toString())})),(i+=":")+Dt(o).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:pe(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(T)):"")},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},g&&"click"===a.type?{$external_click_url:g}:{},y);return{props:I}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=nf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=nf,s.postHogWebVitalsCallbacks=nf,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>nf,Ot("[AutoCapture]");var uf={};function lf(e,r){var i=uf[e];if(i)return i;var n=r[e];if((t=>k(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return uf[e]=n.bind(r);var a=r.document;if(a&&k(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return v(t,"AppleWebKit")&&!v(t,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(t){Lt.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&k(n)?uf[e]=n.bind(r):n}function hf(t,e){var r=function(t){var e;return S(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}(t);return r?h({node:r,originalEvent:t,timestamp:Date.now()},e):null}function cf(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function df(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var vf="canvas,video,audio,embed,object",ff=1e3;function pf(t,e){return I(t)&&t>=e}function gf(t){return t>=0&&ff>t?t:void 0}function mf(t,e){return e?gf(t-e):void 0}class yf{Gi(t){var e,r,i,n,a,o,s,u,l=this.Qi((null==t?void 0:t.__onCapture)||this.Ji.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==t?void 0:t.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,e){this.Yi=[],this.Ki=0,this.Qi=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.Xi=t=>{var e=hf(t,{type:"click"});M(e)||this.tn(e)||this.en(e),this.rn()},this.nn=()=>{var t=Date.now();this.an=t,t%50==0&&this.Yi.forEach((e=>{S(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.sn=()=>{this.un=Date.now()},this.Ve=()=>{var t=Date.now();this.ln=t,this.hn("visibilityChangedDelayMs",t)},this.cn=()=>{var t=Date.now();this.dn=t,this.hn("focusChangedDelayMs",t)},this.vn=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.fn=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.pn=()=>{this.fn=void 0},this.gn=t=>{var e,r=this.fn;if(this.fn=void 0,!S(r)&&this.mn.max_dead_swipes_per_page_load>this.Ki){var n=t,a=null==(e=n.changedTouches)?void 0:e[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.mn.swipe_threshold_px;if(u>=l*l&&![this.an,this.yn,this.un].some((t=>I(t)&&t>=r.timestamp))){var h;if(this.bn()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(vf))))return;var c=hf(n,{type:"swipe",swipeDirection:cf(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});M(c)||this.tn(c)||this.en(c),this.rn()}}}},this.instance=t,this.mn=this.Gi(e),this._onCapture=this.mn.__onCapture}start(t){this.wn(),this.kn(),this._n(),this.Sn(),this.xn(),this.Cn(t),this.mn.capture_dead_swipes&&this.Mn()}Cn(t){if(!this.Tn){var e=function(t){return lf("MutationObserver",t)}(s);this.Tn=new e((t=>{this.In(t)})),this.Tn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Tn)||t.disconnect(),this.Tn=void 0,s.removeEventListener("click",this.Xi),s.removeEventListener("scroll",this.nn,{capture:!0}),s.removeEventListener("selectionchange",this.sn),s.removeEventListener("touchstart",this.vn,{capture:!0}),s.removeEventListener("touchend",this.gn,{capture:!0}),s.removeEventListener("touchcancel",this.pn,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.Ve),s.removeEventListener("blur",this.cn),s.removeEventListener("focus",this.cn),this.fn=void 0}In(t){this.yn=Date.now()}wn(){Nt(s,"click",this.Xi)}en(t){t.visibilityChangedDelayMs=mf(t.timestamp,this.ln),t.focusChangedDelayMs=mf(t.timestamp,this.dn),this.Yi.push(t)}rn(){this.Yi.length&&S(this.Rn)&&(this.Rn=s.setTimeout((()=>{this.An()}),1e3))}kn(){Nt(s,"scroll",this.nn,{capture:!0})}_n(){Nt(s,"selectionchange",this.sn)}Sn(){Nt(i,"visibilitychange",this.Ve)}xn(){Nt(s,"blur",this.cn),Nt(s,"focus",this.cn)}hn(t,e){this.Yi.forEach((r=>{var i=gf(e-r.timestamp);I(i)&&(S(r[t])||r[t]>i)&&(r[t]=i)}))}Mn(){Nt(s,"touchstart",this.vn,{capture:!0,passive:!0}),Nt(s,"touchend",this.gn,{capture:!0,passive:!0}),Nt(s,"touchcancel",this.pn,{capture:!0,passive:!0})}bn(){var t=S(this.En)||I(this.yn)&&this.yn>this.En;return(S(this.Ln)||t)&&(this.En=Date.now(),this.Ln=!(null==i||!i.querySelector(vf))),!!this.Ln}tn(t){return!t||("swipe"===t.type?this.On(t):this.Pn(t))}On(e){if((r=e.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.Yi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!Wt(e.node,"html")&&zt(e.node)&&function(e,r){var i;if(!t||te(e))return!1;var n=R(r)?Xt:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:Xt;return!function(t,e){if(S(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}(ee(e).targetElementList,n)}(e.node,{css_selector_ignorelist:this.mn.css_selector_ignorelist}))}Pn(e){return!(this.mn.capture_clicks_with_modifier_keys||(r=e.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.On(e)||(i=e.node,!(!t||te(i))&&ee(i).targetElementList.some((t=>Wt(t,"a"))));var r,i}An(){if(this.Yi.length){clearTimeout(this.Rn),this.Rn=void 0;var t=this.Yi;for(var e of(this.Yi=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.yn&&this.yn>=e.timestamp?this.yn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.un&&this.un>=e.timestamp?this.un-e.timestamp:void 0;var i=pf(e.scrollDelayMs,this.mn.scroll_threshold_ms),n=pf(e.selectionChangedDelayMs,this.mn.selection_change_threshold_ms),a=pf(e.mutationDelayMs,this.mn.mutation_threshold_ms),o=pf(e.absoluteDelayMs,1.1*this.mn.mutation_threshold_ms),s=I(e.scrollDelayMs)&&this.mn.scroll_threshold_ms>e.scrollDelayMs,u=I(e.mutationDelayMs)&&this.mn.mutation_threshold_ms>e.mutationDelayMs,l=I(e.selectionChangedDelayMs)&&this.mn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=I(e.visibilityChangedDelayMs),c=I(e.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=df(e);if("$dead_swipe"===d){if(this.Ki>=this.mn.max_dead_swipes_per_page_load)continue;this.Ki++}this._onCapture(e,{[d+"_last_mutation_timestamp"]:this.yn,[d+"_event_timestamp"]:e.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.mn.mutation_threshold_ms>e.absoluteDelayMs&&this.Yi.push(e)}this.rn()}}Ji(t,e){var r=df(t);this.instance.capture(r,h({},e,sf(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.mn.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:t.scrollDelayMs,[r+"_mutation_delay_ms"]:t.mutationDelayMs,[r+"_absolute_delay_ms"]:t.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new yf(t,e)}();
|
|
2
2
|
//# sourceMappingURL=all-external-dependencies.js.map
|