@mrrocket/sdk 0.4.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +137 -8
  3. package/dist/api-client.d.ts +213 -0
  4. package/dist/api-client.js +67 -0
  5. package/dist/api-client.js.map +1 -0
  6. package/dist/api.d.ts +9 -109
  7. package/dist/api.js +7 -62
  8. package/dist/api.js.map +1 -1
  9. package/dist/browser/mrrocket-flows.js +64 -0
  10. package/dist/browser/mrrocket-messenger.js +313 -0
  11. package/dist/browser/mrrocket-push.js +1 -0
  12. package/dist/browser/mrrocket-replay.js +3 -3
  13. package/dist/browser/mrrocket-sw.js +1 -0
  14. package/dist/browser/mrrocket.js +2 -1
  15. package/dist/browser.d.ts +3 -2
  16. package/dist/browser.js +6 -1
  17. package/dist/browser.js.map +1 -1
  18. package/dist/capture.d.ts +1 -13
  19. package/dist/capture.js +1 -22
  20. package/dist/capture.js.map +1 -1
  21. package/dist/client.d.ts +36 -1
  22. package/dist/client.js +161 -6
  23. package/dist/client.js.map +1 -1
  24. package/dist/context.d.ts +10 -0
  25. package/dist/context.js.map +1 -1
  26. package/dist/core.d.ts +64 -3
  27. package/dist/core.js +54 -2
  28. package/dist/core.js.map +1 -1
  29. package/dist/feedback.d.ts +19 -4
  30. package/dist/feedback.js +655 -190
  31. package/dist/feedback.js.map +1 -1
  32. package/dist/flows-ui.d.ts +23 -0
  33. package/dist/flows-ui.js +384 -0
  34. package/dist/flows-ui.js.map +1 -0
  35. package/dist/flows-web.d.ts +19 -0
  36. package/dist/flows-web.js +42 -0
  37. package/dist/flows-web.js.map +1 -0
  38. package/dist/flows.d.ts +222 -0
  39. package/dist/flows.js +409 -0
  40. package/dist/flows.js.map +1 -0
  41. package/dist/index.d.ts +5 -2
  42. package/dist/index.js +13 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/messenger-ui.d.ts +47 -0
  45. package/dist/messenger-ui.js +583 -0
  46. package/dist/messenger-ui.js.map +1 -0
  47. package/dist/messenger.d.ts +37 -0
  48. package/dist/messenger.js +69 -0
  49. package/dist/messenger.js.map +1 -0
  50. package/dist/proxy.d.ts +34 -1
  51. package/dist/proxy.js +14 -1
  52. package/dist/proxy.js.map +1 -1
  53. package/dist/push-web.d.ts +43 -0
  54. package/dist/push-web.js +81 -0
  55. package/dist/push-web.js.map +1 -0
  56. package/dist/rage.d.ts +14 -0
  57. package/dist/rage.js +27 -0
  58. package/dist/rage.js.map +1 -0
  59. package/dist/react-native/index.d.cts +640 -3
  60. package/dist/react-native/index.d.ts +640 -3
  61. package/dist/react-native/index.js +2015 -34
  62. package/dist/react-native/index.js.map +1 -1
  63. package/dist/styles-css.d.ts +6 -0
  64. package/dist/styles-css.js +327 -0
  65. package/dist/styles-css.js.map +1 -0
  66. package/dist/styles.d.ts +1 -2
  67. package/dist/styles.js +3 -134
  68. package/dist/styles.js.map +1 -1
  69. package/dist/ui.d.ts +3 -0
  70. package/dist/ui.js +12 -0
  71. package/dist/ui.js.map +1 -1
  72. package/package.json +20 -4
@@ -1,6 +1,6 @@
1
- (function(){'use strict';var St=Object.defineProperty;var Cr=(e,t,r)=>t in e?St(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Mr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ir=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:true});};var ge=(e,t,r)=>Cr(e,typeof t!="symbol"?t+"":t,r);var br={};Ir(br,{record:()=>Ie});function ht(e){if(xe[e])return xe[e];let t=globalThis[e],r=t.prototype,n=e in Nt?Nt[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in Lt?Lt[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Lr())return xe[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),jt[e]=()=>c.remove()):c.remove(),xe[e]=p}catch(c){return r}}function J(e,t,r){var n,s;let o=(n=Je[e])==null?void 0:n[r];if(o)return o.call(t);let a=ht(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Je[e]||(Je[e]={}))[r]=c,c.call(t)):t[r]}function Vt(e,t,r){let n=`${e}.${String(r)}`;if(Qe[n])return Qe[n].bind(t);let o=ht(e)[r];return typeof o!="function"?t[r]:(Qe[n]=o,o.bind(t))}function _r(e){return J("Node",e,"ownerDocument")}function Dr(e){return J("Node",e,"childNodes")}function Ar(e){return J("Node",e,"parentNode")}function Fr(e){return J("Node",e,"parentElement")}function Pr(e){return J("Node",e,"textContent")}function Ur(e){return J("Node",e,"firstChild")}function Wr(e){return J("Node",e,"lastChild")}function Br(e){return J("Node",e,"nextSibling")}function Hr(e){return J("Node",e,"previousSibling")}function zr(e,t){return Vt("Node",e,"contains")(t)}function $r(e){return Vt("Node",e,"getRootNode")()}function jr(e){return !e||!("host"in e)?null:J("ShadowRoot",e,"host")}function Vr(e){return e.styleSheets}function Gr(e){return !e||!("shadowRoot"in e)?null:J("Element",e,"shadowRoot")}function qr(e,t){return J("Element",e,"querySelector")(t)}function Kr(e,t){return J("Element",e,"querySelectorAll")(t)}function Gt(){var e;return [ht("MutationObserver").constructor,(e=jt.MutationObserver)!=null?e:(()=>{})]}function ae(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function qt(e){return e.nodeType===e.ELEMENT_NODE}function be(e){let t=e&&"host"in e&&"mode"in e&&S.host(e)||null;return !!(t&&"shadowRoot"in t&&S.shadowRoot(t)===e)}function Se(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Xr(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Yr(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Kt(s,r)).join("");return Xr(n)}catch(t){return null}}function Kt(e,t){if(Qr(e)){let r;try{r=tt(e.styleSheet)||Yr(e);}catch(n){r=e.cssText;}return e.styleSheet.href?Pe(r,e.styleSheet.href):r}else {let r=e.cssText;return Zr(e)&&e.selectorText.includes(":")&&(r=Jr(r)),t?Pe(r,t):r}}function Jr(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Qr(e){return "styleSheet"in e}function Zr(e){return "selectorText"in e}function en(){return new De}function Ae({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&ne(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ne(e){return e.toLowerCase()}function tn(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=_t in o?o[_t]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Fe(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ne(t):null}function Xt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function rn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Pe(e,t){return (e||"").replace(nn,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(sn.test(i)||on.test(i))return `url(${p}${i}${p})`;if(an.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${rn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),h=t.split("#")[0].split("/"),f=u.split("/");h.pop();for(let m of f)m!=="."&&(m===".."?h.pop():h.push(m));return `url(${p}${h.join("/")}${d}${p})`})}function Oe(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ln(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Oe(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Oe(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let h=p.substring(0,d),f=a.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&n[i-1].textContent!=="")m=a.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=a.split(h),f.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(h));if(f.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Oe(l).length;m=a.indexOf(h,b);}m===-1&&(m=f[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Oe(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function cn(e,t){return ln(e,t).join("/* rr_split */")}function Yt(){return un++}function pn(e){if(e instanceof HTMLFormElement)return "form";let t=ne(e.tagName);return dn.test(t)?"div":t}function mn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(fn),!(r>=t.length);){let o=n(hn);if(o.slice(-1)===",")o=pe(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=pe(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function pe(e,t){return !t||t.trim()===""?t:ft(e,t)}function gn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function ft(e,t){let r=At.get(e);if(r||(r=e.createElement("a"),At.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Jt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?pe(e,n):r==="srcset"?mn(e,n):r==="style"?Pe(n,ft(e)):t==="object"&&r==="data"?pe(e,n):n)}function Qt(e,t,r){return ["video","audio"].includes(e)&&ne(t)==="autoplay"}function yn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function We(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?We(S.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?We(S.parentNode(e),t,r):false}function Zt(e,t,r,n){let s;if(qt(e)){if(s=e,!S.childNodes(s).length)return false}else {if(S.parentElement(e)===null)return false;s=S.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(We(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function bn(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function Sn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function wn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,C=vn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Mn(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l,rootId:C});case e.TEXT_NODE:return Cn(e,{doc:r,needsMask:a,maskTextFn:p,rootId:C,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:B.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return {type:B.Comment,textContent:S.textContent(e)||"",rootId:C};default:return false}}function vn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Cn(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=S.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=S.textContent(e),p&&i&&(i=Pe(i,ft(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,S.parentElement(e)):i.replace(/[\S]/g,"*")),{type:B.Text,textContent:i||"",rootId:s}}function Mn(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=false,rootId:f}=t,m=yn(e,n,s),l=pn(e),b={},C=e.attributes.length;for(let g=0;g<C;g++){let I=e.attributes[g];Qt(l,I.name,I.value)||(b[I.name]=Jt(r,l,ne(I.name),I.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(L=>L.href===e.href),I=null;g&&(I=tt(g)),I&&(delete b.rel,delete b.href,b._cssText=I);}if(l==="style"&&e.sheet){let g=tt(e.sheet);g&&(e.childNodes.length>1&&(g=cn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,I=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Ae({element:e,type:Fe(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):I&&(b.checked=I);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")tn(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),I=r.createElement("canvas");I.width=e.width,I.height=e.height;let L=I.toDataURL(i.type,i.quality);g!==L&&(b.rr_dataURL=g);}}if(l==="img"&&p){ce||(ce=r.createElement("canvas"),Dt=ce.getContext("2d"));let g=e,I=g.currentSrc||g.getAttribute("src")||"<unknown-src>",L=g.crossOrigin,D=()=>{g.removeEventListener("load",D);try{ce.width=g.naturalWidth,ce.height=g.naturalHeight,Dt.drawImage(g,0,0),b.rr_dataURL=ce.toDataURL(i.type,i.quality);}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?D():g.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${I}! Error: ${H}`);}g.crossOrigin==="anonymous"&&(L?b.crossOrigin=L:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?D():g.addEventListener("load",D);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:I}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${I}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let w;try{customElements.get(l)&&(w=!0);}catch(g){}return {type:B.Element,tagName:l,attributes:b,childNodes:[],isSVG:gn(e)||void 0,needBlock:m,rootId:f,isCustom:w}}function _(e){return e==null?"":e.toLowerCase()}function er(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function In(e,t){if(t.comment&&e.type===B.Comment)return true;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Xt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(_(e.attributes.name).match(/^msapplication-tile(image|color)$/)||_(e.attributes.name)==="application-name"||_(e.attributes.rel)==="icon"||_(e.attributes.rel)==="apple-touch-icon"||_(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&_(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(_(e.attributes.property).match(/^(og|twitter|fb):/)||_(e.attributes.name).match(/^(og|twitter):/)||_(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(_(e.attributes.name)==="robots"||_(e.attributes.name)==="googlebot"||_(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(_(e.attributes.name)==="author"||_(e.attributes.name)==="generator"||_(e.attributes.name)==="framework"||_(e.attributes.name)==="publisher"||_(e.attributes.name)==="progid"||_(e.attributes.property).match(/^article:/)||_(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(_(e.attributes.name)==="google-site-verification"||_(e.attributes.name)==="yandex-verification"||_(e.attributes.name)==="csrf-token"||_(e.attributes.name)==="p:domain_verify"||_(e.attributes.name)==="verify-v1"||_(e.attributes.name)==="verification"||_(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function he(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:L=5e3,keepIframeSrcFn:D=()=>false,newlyAddedElement:H=false,cssCaptured:X=false}=t,{needsMask:z}=t,{preserveWhiteSpace:q=true}=t;z||(z=Zt(e,a,c,z===void 0));let $=wn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:z,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:D,newlyAddedElement:H,cssCaptured:X});if(!$)return console.warn(e,"not serialized"),null;let j;n.hasNode(e)?j=n.getId(e):In($,f)||!q&&$.type===B.Text&&!$.textContent.replace(/^\s+|\s+$/gm,"").length?j=Ue:j=Yt();let E=Object.assign($,{id:j});if(n.add(e,E),j===Ue)return null;C&&C(e);let te=!i;if(E.type===B.Element){te=te&&!E.needBlock,delete E.needBlock;let v=S.shadowRoot(e);v&&Se(v)&&(E.isShadowHost=true);}if((E.type===B.Document||E.type===B.Element)&&te){f.headWhitespace&&E.type===B.Element&&E.tagName==="head"&&(q=false);let v={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:z,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:D,cssCaptured:false};if(!(E.type===B.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===B.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(v.cssCaptured=true);for(let A of Array.from(S.childNodes(e))){let F=he(A,v);F&&E.childNodes.push(F);}}let O=null;if(qt(e)&&(O=S.shadowRoot(e)))for(let A of Array.from(S.childNodes(O))){let F=he(A,v);F&&(Se(O)&&(F.isShadow=true),E.childNodes.push(F));}}let M=S.parentNode(e);return M&&be(M)&&Se(M)&&(E.isShadow=true),E.type===B.Element&&E.tagName==="iframe"&&bn(e,()=>{let v=e.contentDocument;if(v&&w){let O=he(v,{doc:v,mirror:n,blockClass:s,blockSelector:o,needsMask:z,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:D});O&&w(e,O);}},g),E.type===B.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Xt(E.attributes.href)==="css")&&Sn(e,()=>{if(I){let v=he(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:z,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:D});v&&I(e,v);}},L),E}function Rn(e,t){let{mirror:r=new De,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:h,slimDOM:f=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L=()=>false}=t,D=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,H=er(f);return he(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:D,maskTextFn:d,maskInputFn:h,slimDOMOptions:H,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L,newlyAddedElement:false})}function V(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Ce(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function $e(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>$e(e,t,o||{},true)}function tr(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=S.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((n=S.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function rr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function sr(e){return e?e.nodeType===e.ELEMENT_NODE?e:S.parentElement(e):null}function G(e,t,r,n){if(!e)return false;let s=sr(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(We(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function En(e,t){return t.getId(e)!==-1}function Ze(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===Ue}function or(e,t){if(be(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=S.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?or(n,t):true}function nt(e){return !!e.changedTouches}function kn(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function ir(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ar(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function st(e){return e?e instanceof rt&&"shadowRoot"in e?!!e.shadowRoot:!!S.shadowRoot(e):false}function lr(e){var t;let r=null;return "getRootNode"in e&&((t=S.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&S.host(S.getRootNode(e))&&(r=S.host(S.getRootNode(e))),r}function xn(e){let t=e,r;for(;r=lr(t);)t=r;return t}function On(e){let t=S.ownerDocument(e);if(!t)return false;let r=xn(e);return S.contains(t,r)}function cr(e){let t=S.ownerDocument(e);return t?S.contains(t,e)||On(e):false}function at(e,t){e.delete(t),S.childNodes(t).forEach(r=>at(e,r));}function Tn(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),S.childNodes(n).forEach(s=>r.push(s)));}}function Ut(e,t){return e.size===0?false:ur(e,t)}function ur(e,t){if(e.has(t))return true;let r=S.parentNode(t);return r?ur(e,r):false}function Nn(e){we=e;}function Ln(){we=void 0;}function Me(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function dr(e,t){let r=new it;ie.push(r),r.init(e);let[n,s]=Gt(),o=new n(k(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function _n({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=Ce(k(d=>{let h=Date.now()-c;e(a.map(f=>(f.timeOffset-=h,f)),d),a=[],c=null;}),o),p=k(Ce(k(d=>{let h=Me(d),{clientX:f,clientY:m}=nt(d)?d.changedTouches[0]:d;c||(c=ve()),a.push({x:f,y:m,id:n.getId(h),timeOffset:ve()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?R.Drag:d instanceof MouseEvent?R.MouseMove:R.TouchMove);}),s,{trailing:!1})),u=[V("mousemove",p,r),V("touchmove",p,r),V("drag",p,r)];return k(()=>{u.forEach(d=>d());})}function Dn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let h=Me(d);if(G(h,n,s,true))return;let f=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":f=ee.Mouse;break;case "touch":f=ee.Touch;break;case "pen":f=ee.Pen;break}f===ee.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):ee.Pen;}else nt(d)&&(f=ee.Touch);f!==null?(i=f,(m.startsWith("Touch")&&f===ee.Touch||m.startsWith("Mouse")&&f===ee.Mouse)&&(f=null)):K[u]===K.Click&&(f=i,i=null);let l=nt(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(h),{clientX:C,clientY:w}=l;k(e)({type:K[m],id:b,x:C,y:w,...f!==null&&{pointerType:f}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=ne(u),h=p(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:d=d.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}c.push(V(d,h,t));}),k(()=>{c.forEach(u=>u());})}function pr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=k(Ce(k(c=>{let i=Me(c);if(!i||G(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=tr(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return V("scroll",a,t)}function An({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=k(Ce(k(()=>{let o=rr(),a=nr();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return V("resize",s,t)}function Pn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(w){let g=Me(w),I=w.isTrusted,L=g&&g.tagName;if(g&&L==="OPTION"&&(g=S.parentElement(g)),!g||!L||Fn.indexOf(L)<0||G(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let D=g.value,H=false,X=Fe(g)||"";X==="radio"||X==="checkbox"?H=g.checked:(c[L.toLowerCase()]||c[X])&&(D=Ae({element:g,maskInputOptions:c,tagName:L,type:X,value:D,maskInputFn:i})),h(g,u?{text:D,isChecked:H,userTriggered:I}:{text:D,isChecked:H});let z=g.name;X==="radio"&&z&&H&&t.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(q=>{if(q!==g){let $=q.value;h(q,u?{text:$,isChecked:!H,userTriggered:false}:{text:$,isChecked:!H});}});}function h(w,g){let I=Wt.get(w);if(!I||I.text!==g.text||I.isChecked!==g.isChecked){Wt.set(w,g);let L=r.getId(w);k(e)({...g,id:L});}}let m=(p.input==="last"?["change"]:["input","change"]).map(w=>V(w,k(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(w=>w());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),C=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...C.map(w=>$e(w[0],w[1],{set(){k(d)({target:this,isTrusted:false});}},false,l))),k(()=>{m.forEach(w=>w());})}function Be(e){let t=[];function r(n,s){if(Te("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Te("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Te("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Te("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function re(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Un({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:k((u,d,h)=>{let[f,m]=h,{id:l,styleId:b}=re(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:f,index:m}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,h=this.cssRules.length){let f=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:k((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:f}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:k((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:f}),u.apply(d,h)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:k((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:f}),u.apply(d,h)})}));let i={};Ne("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Ne("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Ne("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Ne("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:k((h,f,m)=>{let[l,b]=m,{id:C,styleId:w}=re(f.parentStyleSheet,t,r.styleMirror);return (C&&C!==-1||w&&w!==-1)&&e({id:C,styleId:w,adds:[{rule:l,index:[...Be(f),b||0]}]}),h.apply(f,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:k((h,f,m)=>{let[l]=m,{id:b,styleId:C}=re(f.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||C&&C!==-1)&&e({id:b,styleId:C,removes:[{index:[...Be(f),l]}]}),h.apply(f,m)})});}),k(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function hr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(S.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(h){}return d}}),k(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function Wn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:k((c,i,p)=>{var u;let[d,h,f]=p;if(r.has(d))return o.apply(i,[d,h,f]);let{id:m,styleId:l}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:h,priority:f},index:Be(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:k((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:h,styleId:f}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:Be(i.parentRule)}),c.apply(i,p)})}),k(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function Bn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=k(i=>Ce(k(p=>{let u=Me(p);if(!u||G(u,t,r,!0))return;let{currentTime:d,volume:h,muted:f,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:h,muted:f,playbackRate:m,loop:l});}),s.media||500)),c=[V("play",a(ue.Play),o),V("pause",a(ue.Pause),o),V("seeked",a(ue.Seeked),o),V("volumechange",a(ue.VolumeChange),o),V("ratechange",a(ue.RateChange),o)];return k(()=>{c.forEach(i=>i());})}function Hn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ae(t.fonts,"add",function(c){return function(i){return setTimeout(k(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),k(()=>{n.forEach(c=>c());})}function zn(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=k(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let h=i.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:l,endOffset:b}=h;G(f,n,s,!0)||G(l,n,s,!0)||p.push({start:r.getId(f),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),V("selectionchange",c)}function $n({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ae(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function jn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),h(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),f(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function Vn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};jn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=dr(e,e.doc));let o=_n(e),a=Dn(e),c=pr(e),i=An(e,{win:r}),p=Pn(e),u=Bn(e),d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=Un(e,{win:r}),h=hr(e,e.doc),f=Wn(e,{win:r}),e.collectFonts&&(m=Hn(e)));let l=zn(e),b=$n(e),C=[];for(let w of e.plugins)C.push(w.observer(w.callback,r,w.options));return k(()=>{ie.forEach(w=>w.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),h(),f(),m(),l(),b(),C.forEach(w=>w());})}function Te(e){return typeof window[e]!="undefined"}function Ne(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function Kn(e,t){let r=Bt.get(e);return r||(r=new Map,Bt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=qn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(gr(e,t)||typeof e=="object"){let n=e.constructor.name,s=fr(e,t,r);return {rr_type:n,index:s}}}}return e}function Xn(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ae(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return G(this.canvas,r,n,!0)||setTimeout(()=>{let u=mr(p,t,this);e(this.canvas,{type:me["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=$e(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:me["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function Yn(e){return e==="experimental-webgl"?"webgl":e}function Ht(e,t,r,n){let s=[];try{let o=ae(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!G(this,t,r,!0)){let p=Yn(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function zt(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ae(e,i,function(u){return function(...d){let h=u.apply(this,d);if(fr(h,o,this),"tagName"in this.canvas&&!G(this.canvas,n,s,!0)){let f=mr(d,o,this),m={type:t,property:i,args:f};r(this.canvas,m);}return h}});a.push(p);}catch(p){let u=$e(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function Jn(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...zt(t.WebGLRenderingContext.prototype,me.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...zt(t.WebGL2RenderingContext.prototype,me.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function Qn(e){let t;try{if(t=$t&&(self.URL||self.webkitURL).createObjectURL($t),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(yr),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function Ie(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:l,hooks:b,packFn:C,sampling:w={},dataURLOptions:g={},mousemoveWait:I,recordDOM:L=true,recordCanvas:D=false,recordCrossOriginIframes:H=false,recordAfter:X=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:z=false,collectFonts:q=false,inlineImages:$=false,plugins:j,keepIframeSrcFn:E=()=>false,ignoreCSSAttributes:te=new Set([]),errorHandler:M}=e;Nn(M);let v=H?window.parent===window:true,O=false;if(!v)try{window.parent.document&&(O=!1);}catch(T){O=true;}if(v&&!t)throw new Error("emit function is required");if(!v&&!O)return ()=>{};I!==void 0&&w.mousemove===void 0&&(w.mousemove=I),Z.reset();let A=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:h!==void 0?h:{password:true},F=er(f);kn();let le,Ve=0,gt=T=>{for(let Q of j||[])Q.eventProcessor&&(T=Q.eventProcessor(T));return C&&!O&&(T=C(T)),T};W=(T,Q)=>{var P;let U=T;if(U.timestamp=ve(),(P=ie[0])!=null&&P.isFrozen()&&U.type!==x.FullSnapshot&&!(U.type===x.IncrementalSnapshot&&U.data.source===R.Mutation)&&ie.forEach(Y=>Y.unfreeze()),v)t==null||t(gt(U),Q);else if(O){let Y={type:"rrweb",event:gt(U),origin:window.location.origin,isCheckout:Q};window.parent.postMessage(Y,"*");}if(U.type===x.FullSnapshot)le=U,Ve=0;else if(U.type===x.IncrementalSnapshot){if(U.data.source===R.Mutation&&U.data.isAttachIframe)return;Ve++;let Y=n&&Ve>=n,N=r&&U.timestamp-le.timestamp>r;(Y||N)&&_e(true);}};let Re=T=>{W({type:x.IncrementalSnapshot,data:{source:R.Mutation,...T}});},yt=T=>W({type:x.IncrementalSnapshot,data:{source:R.Scroll,...T}}),bt=T=>W({type:x.IncrementalSnapshot,data:{source:R.CanvasMutation,...T}}),vr=T=>W({type:x.IncrementalSnapshot,data:{source:R.AdoptedStyleSheet,...T}}),se=new dt({mutationCb:Re,adoptedStyleSheetCb:vr}),oe=new lt({mirror:Z,mutationCb:Re,stylesheetManager:se,recordCrossOriginIframes:H,wrappedEmit:W});for(let T of j||[])T.getMirror&&T.getMirror({nodeMirror:Z,crossOriginIframeMirror:oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:oe.crossOriginIframeStyleMirror});let Ge=new pt;et=new ut({recordCanvas:D,mutationCb:bt,win:window,blockClass:s,blockSelector:o,mirror:Z,sampling:w.canvas,dataURLOptions:g});let Ee=new ct({mutationCb:Re,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:A,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:D,inlineImages:$,sampling:w,slimDOMOptions:F,iframeManager:oe,stylesheetManager:se,canvasManager:et,keepIframeSrcFn:E,processedNodeManager:Ge},mirror:Z});_e=(T=false)=>{if(!L)return;W({type:x.Meta,data:{href:window.location.href,width:nr(),height:rr()}},T),se.reset(),Ee.init(),ie.forEach(P=>P.lock());let Q=Rn(document,{mirror:Z,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:A,maskTextFn:l,maskInputFn:m,slimDOM:F,dataURLOptions:g,recordCanvas:D,inlineImages:$,onSerialize:P=>{ir(P,Z)&&oe.addIframe(P),ar(P,Z)&&se.trackLinkElement(P),st(P)&&Ee.addShadowRoot(S.shadowRoot(P),document);},onIframeLoad:(P,U)=>{oe.attachIframe(P,U),Ee.observeAttachShadow(P);},onStylesheetLoad:(P,U)=>{se.attachLinkElement(P,U);},keepIframeSrcFn:E});if(!Q)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:Q,initialOffset:tr(window)}},T),ie.forEach(P=>P.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document));};try{let T=[],Q=U=>{var Y;return k(Vn)({mutationCb:Re,mousemoveCb:(N,qe)=>W({type:x.IncrementalSnapshot,data:{source:qe,positions:N}}),mouseInteractionCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.MouseInteraction,...N}}),scrollCb:yt,viewportResizeCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.ViewportResize,...N}}),inputCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.Input,...N}}),mediaInteractionCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.MediaInteraction,...N}}),styleSheetRuleCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.StyleSheetRule,...N}}),styleDeclarationCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.StyleDeclaration,...N}}),canvasMutationCb:bt,fontCb:N=>W({type:x.IncrementalSnapshot,data:{source:R.Font,...N}}),selectionCb:N=>{W({type:x.IncrementalSnapshot,data:{source:R.Selection,...N}});},customElementCb:N=>{W({type:x.IncrementalSnapshot,data:{source:R.CustomElement,...N}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:A,inlineStylesheet:u,sampling:w,recordDOM:L,recordCanvas:D,inlineImages:$,userTriggeredOnInput:z,collectFonts:q,doc:U,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:E,blockSelector:o,slimDOMOptions:F,dataURLOptions:g,mirror:Z,iframeManager:oe,stylesheetManager:se,shadowDomManager:Ee,processedNodeManager:Ge,canvasManager:et,ignoreCSSAttributes:te,plugins:((Y=j==null?void 0:j.filter(N=>N.observer))==null?void 0:Y.map(N=>({observer:N.observer,options:N.options,callback:qe=>W({type:x.Plugin,data:{plugin:N.name,payload:qe}})})))||[]},b)};oe.addLoadListener(U=>{try{T.push(Q(U.contentDocument));}catch(Y){console.warn(Y);}});let P=()=>{_e(),T.push(Q(document)),ze=!0;};return ["interactive","complete"].includes(document.readyState)?P():(T.push(V("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),X==="DOMContentLoaded"&&P();})),T.push(V("load",()=>{W({type:x.Load,data:{}}),X==="load"&&P();},window))),()=>{T.forEach(U=>{try{U();}catch(Y){String(Y).toLowerCase().includes("cross-origin")||console.warn(Y);}}),Ge.destroy(),ze=!1,Ln();}}catch(T){console.warn(T);}}var Tr,Nr,y,Tt,x,R,K,ee,me,ue,B,Nt,Lt,xe,jt,Lr,Je,Qe,ve,S,De,_t,nn,sn,on,an,un,dn,Ue,ce,Dt,hn,fn,At,rt,de,Ft,ot,Pt,it,we,k,ie,Fn,Wt,He,lt,ct,fe,Gn,ye,qn,Bt,fr,mr,gr,yr,$t,ut,dt,pt,W,_e,et,ze,Z,Sr=Mr(()=>{Tr=Object.defineProperty,Nr=(e,t,r)=>t in e?Tr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>Nr(e,typeof t!="symbol"?t+"":t,r),x=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(x||{}),R=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(R||{}),K=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(K||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(me||{}),ue=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ue||{}),B=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(B||{}),Nt={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xe={},jt={},Lr=()=>!!globalThis.Zone;Je={};Qe={};ve=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ve=()=>new Date().getTime());S={ownerDocument:_r,childNodes:Dr,parentNode:Ar,parentElement:Fr,textContent:Pr,firstChild:Ur,lastChild:Wr,nextSibling:Br,previousSibling:Hr,contains:zr,getRootNode:$r,host:jr,styleSheets:Vr,shadowRoot:Gr,querySelector:qr,querySelectorAll:Kr,nowTimestamp:ve,mutationObserverCtor:Gt,patch:ae};De=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};_t="__rrweb_original__";nn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sn=/^(?:[a-z+]+:)?\/\//i,on=/^www\..*/i,an=/^(data:)([^,]*),(.*)/i;un=1,dn=new RegExp("[^a-z0-9-_:]"),Ue=-2;hn=/^[^ \t\n\r\u000c]+/,fn=/^[, \t\n\r\u000c]+/;At=new WeakMap;rt=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){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"}};de=`Please stop import mirror directly. Instead of that,\r
1
+ (function(){'use strict';var St=Object.defineProperty;var vr=(e,t,r)=>t in e?St(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Mr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ir=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:true});};var Ee=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);var br={};Ir(br,{record:()=>Me});function ht(e){if(ke[e])return ke[e];let t=globalThis[e],r=t.prototype,n=e in Nt?Nt[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in Lt?Lt[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Lr())return ke[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),jt[e]=()=>c.remove()):c.remove(),ke[e]=p}catch(c){return r}}function J(e,t,r){var n,s;let o=(n=Je[e])==null?void 0:n[r];if(o)return o.call(t);let a=ht(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Je[e]||(Je[e]={}))[r]=c,c.call(t)):t[r]}function Vt(e,t,r){let n=`${e}.${String(r)}`;if(Qe[n])return Qe[n].bind(t);let o=ht(e)[r];return typeof o!="function"?t[r]:(Qe[n]=o,o.bind(t))}function Dr(e){return J("Node",e,"ownerDocument")}function _r(e){return J("Node",e,"childNodes")}function Ar(e){return J("Node",e,"parentNode")}function Fr(e){return J("Node",e,"parentElement")}function Pr(e){return J("Node",e,"textContent")}function Ur(e){return J("Node",e,"firstChild")}function Wr(e){return J("Node",e,"lastChild")}function Br(e){return J("Node",e,"nextSibling")}function Hr(e){return J("Node",e,"previousSibling")}function $r(e,t){return Vt("Node",e,"contains")(t)}function zr(e){return Vt("Node",e,"getRootNode")()}function jr(e){return !e||!("host"in e)?null:J("ShadowRoot",e,"host")}function Vr(e){return e.styleSheets}function Gr(e){return !e||!("shadowRoot"in e)?null:J("Element",e,"shadowRoot")}function qr(e,t){return J("Element",e,"querySelector")(t)}function Kr(e,t){return J("Element",e,"querySelectorAll")(t)}function Gt(){var e;return [ht("MutationObserver").constructor,(e=jt.MutationObserver)!=null?e:(()=>{})]}function ae(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function qt(e){return e.nodeType===e.ELEMENT_NODE}function ye(e){let t=e&&"host"in e&&"mode"in e&&S.host(e)||null;return !!(t&&"shadowRoot"in t&&S.shadowRoot(t)===e)}function be(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Xr(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Yr(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Kt(s,r)).join("");return Xr(n)}catch(t){return null}}function Kt(e,t){if(Qr(e)){let r;try{r=tt(e.styleSheet)||Yr(e);}catch(n){r=e.cssText;}return e.styleSheet.href?Pe(r,e.styleSheet.href):r}else {let r=e.cssText;return Zr(e)&&e.selectorText.includes(":")&&(r=Jr(r)),t?Pe(r,t):r}}function Jr(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Qr(e){return "styleSheet"in e}function Zr(e){return "selectorText"in e}function en(){return new _e}function Ae({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&ne(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ne(e){return e.toLowerCase()}function tn(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=Dt in o?o[Dt]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Fe(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ne(t):null}function Xt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function rn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Pe(e,t){return (e||"").replace(nn,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(sn.test(i)||on.test(i))return `url(${p}${i}${p})`;if(an.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${rn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),h=t.split("#")[0].split("/"),f=u.split("/");h.pop();for(let m of f)m!=="."&&(m===".."?h.pop():h.push(m));return `url(${p}${h.join("/")}${d}${p})`})}function Oe(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ln(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Oe(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Oe(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let h=p.substring(0,d),f=a.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&n[i-1].textContent!=="")m=a.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=a.split(h),f.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(h));if(f.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Oe(l).length;m=a.indexOf(h,b);}m===-1&&(m=f[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Oe(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function cn(e,t){return ln(e,t).join("/* rr_split */")}function Yt(){return un++}function pn(e){if(e instanceof HTMLFormElement)return "form";let t=ne(e.tagName);return dn.test(t)?"div":t}function mn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(fn),!(r>=t.length);){let o=n(hn);if(o.slice(-1)===",")o=pe(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=pe(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function pe(e,t){return !t||t.trim()===""?t:ft(e,t)}function gn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function ft(e,t){let r=At.get(e);if(r||(r=e.createElement("a"),At.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Jt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?pe(e,n):r==="srcset"?mn(e,n):r==="style"?Pe(n,ft(e)):t==="object"&&r==="data"?pe(e,n):n)}function Qt(e,t,r){return ["video","audio"].includes(e)&&ne(t)==="autoplay"}function yn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function We(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?We(S.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?We(S.parentNode(e),t,r):false}function Zt(e,t,r,n){let s;if(qt(e)){if(s=e,!S.childNodes(s).length)return false}else {if(S.parentElement(e)===null)return false;s=S.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(We(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function bn(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function Sn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function wn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,v=Cn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Mn(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l,rootId:v});case e.TEXT_NODE:return vn(e,{doc:r,needsMask:a,maskTextFn:p,rootId:v,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:B.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return {type:B.Comment,textContent:S.textContent(e)||"",rootId:v};default:return false}}function Cn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function vn(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=S.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=S.textContent(e),p&&i&&(i=Pe(i,ft(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,S.parentElement(e)):i.replace(/[\S]/g,"*")),{type:B.Text,textContent:i||"",rootId:s}}function Mn(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=false,rootId:f}=t,m=yn(e,n,s),l=pn(e),b={},v=e.attributes.length;for(let g=0;g<v;g++){let I=e.attributes[g];Qt(l,I.name,I.value)||(b[I.name]=Jt(r,l,ne(I.name),I.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(L=>L.href===e.href),I=null;g&&(I=tt(g)),I&&(delete b.rel,delete b.href,b._cssText=I);}if(l==="style"&&e.sheet){let g=tt(e.sheet);g&&(e.childNodes.length>1&&(g=cn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,I=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Ae({element:e,type:Fe(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):I&&(b.checked=I);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")tn(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),I=r.createElement("canvas");I.width=e.width,I.height=e.height;let L=I.toDataURL(i.type,i.quality);g!==L&&(b.rr_dataURL=g);}}if(l==="img"&&p){ce||(ce=r.createElement("canvas"),_t=ce.getContext("2d"));let g=e,I=g.currentSrc||g.getAttribute("src")||"<unknown-src>",L=g.crossOrigin,_=()=>{g.removeEventListener("load",_);try{ce.width=g.naturalWidth,ce.height=g.naturalHeight,_t.drawImage(g,0,0),b.rr_dataURL=ce.toDataURL(i.type,i.quality);}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?_():g.addEventListener("load",_);return}else console.warn(`Cannot inline img src=${I}! Error: ${H}`);}g.crossOrigin==="anonymous"&&(L?b.crossOrigin=L:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?_():g.addEventListener("load",_);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:I}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${I}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let w;try{customElements.get(l)&&(w=!0);}catch(g){}return {type:B.Element,tagName:l,attributes:b,childNodes:[],isSVG:gn(e)||void 0,needBlock:m,rootId:f,isCustom:w}}function D(e){return e==null?"":e.toLowerCase()}function er(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function In(e,t){if(t.comment&&e.type===B.Comment)return true;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Xt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(D(e.attributes.name).match(/^msapplication-tile(image|color)$/)||D(e.attributes.name)==="application-name"||D(e.attributes.rel)==="icon"||D(e.attributes.rel)==="apple-touch-icon"||D(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&D(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(D(e.attributes.property).match(/^(og|twitter|fb):/)||D(e.attributes.name).match(/^(og|twitter):/)||D(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(D(e.attributes.name)==="robots"||D(e.attributes.name)==="googlebot"||D(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(D(e.attributes.name)==="author"||D(e.attributes.name)==="generator"||D(e.attributes.name)==="framework"||D(e.attributes.name)==="publisher"||D(e.attributes.name)==="progid"||D(e.attributes.property).match(/^article:/)||D(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(D(e.attributes.name)==="google-site-verification"||D(e.attributes.name)==="yandex-verification"||D(e.attributes.name)==="csrf-token"||D(e.attributes.name)==="p:domain_verify"||D(e.attributes.name)==="verify-v1"||D(e.attributes.name)==="verification"||D(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function he(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:L=5e3,keepIframeSrcFn:_=()=>false,newlyAddedElement:H=false,cssCaptured:X=false}=t,{needsMask:$}=t,{preserveWhiteSpace:q=true}=t;$||($=Zt(e,a,c,$===void 0));let z=wn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:H,cssCaptured:X});if(!z)return console.warn(e,"not serialized"),null;let j;n.hasNode(e)?j=n.getId(e):In(z,f)||!q&&z.type===B.Text&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?j=Ue:j=Yt();let E=Object.assign(z,{id:j});if(n.add(e,E),j===Ue)return null;v&&v(e);let te=!i;if(E.type===B.Element){te=te&&!E.needBlock,delete E.needBlock;let C=S.shadowRoot(e);C&&be(C)&&(E.isShadowHost=true);}if((E.type===B.Document||E.type===B.Element)&&te){f.headWhitespace&&E.type===B.Element&&E.tagName==="head"&&(q=false);let C={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_,cssCaptured:false};if(!(E.type===B.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===B.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(C.cssCaptured=true);for(let A of Array.from(S.childNodes(e))){let F=he(A,C);F&&E.childNodes.push(F);}}let O=null;if(qt(e)&&(O=S.shadowRoot(e)))for(let A of Array.from(S.childNodes(O))){let F=he(A,C);F&&(be(O)&&(F.isShadow=true),E.childNodes.push(F));}}let M=S.parentNode(e);return M&&ye(M)&&be(M)&&(E.isShadow=true),E.type===B.Element&&E.tagName==="iframe"&&bn(e,()=>{let C=e.contentDocument;if(C&&w){let O=he(C,{doc:C,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_});O&&w(e,O);}},g),E.type===B.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Xt(E.attributes.href)==="css")&&Sn(e,()=>{if(I){let C=he(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_});C&&I(e,C);}},L),E}function Rn(e,t){let{mirror:r=new _e,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:h,slimDOM:f=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L=()=>false}=t,_=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,H=er(f);return he(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:_,maskTextFn:d,maskInputFn:h,slimDOMOptions:H,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L,newlyAddedElement:false})}function V(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Ce(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function ze(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>ze(e,t,o||{},true)}function tr(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=S.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((n=S.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function rr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function sr(e){return e?e.nodeType===e.ELEMENT_NODE?e:S.parentElement(e):null}function G(e,t,r,n){if(!e)return false;let s=sr(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(We(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function En(e,t){return t.getId(e)!==-1}function Ze(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===Ue}function or(e,t){if(ye(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=S.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?or(n,t):true}function nt(e){return !!e.changedTouches}function xn(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function ir(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ar(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function st(e){return e?e instanceof rt&&"shadowRoot"in e?!!e.shadowRoot:!!S.shadowRoot(e):false}function lr(e){var t;let r=null;return "getRootNode"in e&&((t=S.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&S.host(S.getRootNode(e))&&(r=S.host(S.getRootNode(e))),r}function kn(e){let t=e,r;for(;r=lr(t);)t=r;return t}function On(e){let t=S.ownerDocument(e);if(!t)return false;let r=kn(e);return S.contains(t,r)}function cr(e){let t=S.ownerDocument(e);return t?S.contains(t,e)||On(e):false}function at(e,t){e.delete(t),S.childNodes(t).forEach(r=>at(e,r));}function Tn(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),S.childNodes(n).forEach(s=>r.push(s)));}}function Ut(e,t){return e.size===0?false:ur(e,t)}function ur(e,t){if(e.has(t))return true;let r=S.parentNode(t);return r?ur(e,r):false}function Nn(e){Se=e;}function Ln(){Se=void 0;}function ve(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function dr(e,t){let r=new it;ie.push(r),r.init(e);let[n,s]=Gt(),o=new n(x(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function Dn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=Ce(x(d=>{let h=Date.now()-c;e(a.map(f=>(f.timeOffset-=h,f)),d),a=[],c=null;}),o),p=x(Ce(x(d=>{let h=ve(d),{clientX:f,clientY:m}=nt(d)?d.changedTouches[0]:d;c||(c=we()),a.push({x:f,y:m,id:n.getId(h),timeOffset:we()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?R.Drag:d instanceof MouseEvent?R.MouseMove:R.TouchMove);}),s,{trailing:!1})),u=[V("mousemove",p,r),V("touchmove",p,r),V("drag",p,r)];return x(()=>{u.forEach(d=>d());})}function _n({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let h=ve(d);if(G(h,n,s,true))return;let f=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":f=ee.Mouse;break;case "touch":f=ee.Touch;break;case "pen":f=ee.Pen;break}f===ee.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):ee.Pen;}else nt(d)&&(f=ee.Touch);f!==null?(i=f,(m.startsWith("Touch")&&f===ee.Touch||m.startsWith("Mouse")&&f===ee.Mouse)&&(f=null)):K[u]===K.Click&&(f=i,i=null);let l=nt(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(h),{clientX:v,clientY:w}=l;x(e)({type:K[m],id:b,x:v,y:w,...f!==null&&{pointerType:f}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=ne(u),h=p(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:d=d.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}c.push(V(d,h,t));}),x(()=>{c.forEach(u=>u());})}function pr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=x(Ce(x(c=>{let i=ve(c);if(!i||G(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=tr(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return V("scroll",a,t)}function An({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=x(Ce(x(()=>{let o=rr(),a=nr();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return V("resize",s,t)}function Pn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(w){let g=ve(w),I=w.isTrusted,L=g&&g.tagName;if(g&&L==="OPTION"&&(g=S.parentElement(g)),!g||!L||Fn.indexOf(L)<0||G(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let _=g.value,H=false,X=Fe(g)||"";X==="radio"||X==="checkbox"?H=g.checked:(c[L.toLowerCase()]||c[X])&&(_=Ae({element:g,maskInputOptions:c,tagName:L,type:X,value:_,maskInputFn:i})),h(g,u?{text:_,isChecked:H,userTriggered:I}:{text:_,isChecked:H});let $=g.name;X==="radio"&&$&&H&&t.querySelectorAll(`input[type="radio"][name="${$}"]`).forEach(q=>{if(q!==g){let z=q.value;h(q,u?{text:z,isChecked:!H,userTriggered:false}:{text:z,isChecked:!H});}});}function h(w,g){let I=Wt.get(w);if(!I||I.text!==g.text||I.isChecked!==g.isChecked){Wt.set(w,g);let L=r.getId(w);x(e)({...g,id:L});}}let m=(p.input==="last"?["change"]:["input","change"]).map(w=>V(w,x(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(w=>w());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),v=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...v.map(w=>ze(w[0],w[1],{set(){x(d)({target:this,isTrusted:false});}},false,l))),x(()=>{m.forEach(w=>w());})}function Be(e){let t=[];function r(n,s){if(Te("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Te("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Te("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Te("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function re(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Un({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:x((u,d,h)=>{let[f,m]=h,{id:l,styleId:b}=re(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:f,index:m}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,h=this.cssRules.length){let f=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:f}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:f}),u.apply(d,h)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:f}),u.apply(d,h)})}));let i={};Ne("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Ne("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Ne("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Ne("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:x((h,f,m)=>{let[l,b]=m,{id:v,styleId:w}=re(f.parentStyleSheet,t,r.styleMirror);return (v&&v!==-1||w&&w!==-1)&&e({id:v,styleId:w,adds:[{rule:l,index:[...Be(f),b||0]}]}),h.apply(f,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:x((h,f,m)=>{let[l]=m,{id:b,styleId:v}=re(f.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||v&&v!==-1)&&e({id:b,styleId:v,removes:[{index:[...Be(f),l]}]}),h.apply(f,m)})});}),x(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function hr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(S.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(h){}return d}}),x(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function Wn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:x((c,i,p)=>{var u;let[d,h,f]=p;if(r.has(d))return o.apply(i,[d,h,f]);let{id:m,styleId:l}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:h,priority:f},index:Be(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:x((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:h,styleId:f}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:Be(i.parentRule)}),c.apply(i,p)})}),x(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function Bn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=x(i=>Ce(x(p=>{let u=ve(p);if(!u||G(u,t,r,!0))return;let{currentTime:d,volume:h,muted:f,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:h,muted:f,playbackRate:m,loop:l});}),s.media||500)),c=[V("play",a(ue.Play),o),V("pause",a(ue.Pause),o),V("seeked",a(ue.Seeked),o),V("volumechange",a(ue.VolumeChange),o),V("ratechange",a(ue.RateChange),o)];return x(()=>{c.forEach(i=>i());})}function Hn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ae(t.fonts,"add",function(c){return function(i){return setTimeout(x(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),x(()=>{n.forEach(c=>c());})}function $n(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=x(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let h=i.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:l,endOffset:b}=h;G(f,n,s,!0)||G(l,n,s,!0)||p.push({start:r.getId(f),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),V("selectionchange",c)}function zn({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ae(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function jn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),h(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),f(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function Vn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};jn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=dr(e,e.doc));let o=Dn(e),a=_n(e),c=pr(e),i=An(e,{win:r}),p=Pn(e),u=Bn(e),d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=Un(e,{win:r}),h=hr(e,e.doc),f=Wn(e,{win:r}),e.collectFonts&&(m=Hn(e)));let l=$n(e),b=zn(e),v=[];for(let w of e.plugins)v.push(w.observer(w.callback,r,w.options));return x(()=>{ie.forEach(w=>w.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),h(),f(),m(),l(),b(),v.forEach(w=>w());})}function Te(e){return typeof window[e]!="undefined"}function Ne(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function Kn(e,t){let r=Bt.get(e);return r||(r=new Map,Bt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=qn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(gr(e,t)||typeof e=="object"){let n=e.constructor.name,s=fr(e,t,r);return {rr_type:n,index:s}}}}return e}function Xn(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ae(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return G(this.canvas,r,n,!0)||setTimeout(()=>{let u=mr(p,t,this);e(this.canvas,{type:me["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=ze(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:me["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function Yn(e){return e==="experimental-webgl"?"webgl":e}function Ht(e,t,r,n){let s=[];try{let o=ae(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!G(this,t,r,!0)){let p=Yn(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function $t(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ae(e,i,function(u){return function(...d){let h=u.apply(this,d);if(fr(h,o,this),"tagName"in this.canvas&&!G(this.canvas,n,s,!0)){let f=mr(d,o,this),m={type:t,property:i,args:f};r(this.canvas,m);}return h}});a.push(p);}catch(p){let u=ze(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function Jn(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...$t(t.WebGLRenderingContext.prototype,me.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...$t(t.WebGL2RenderingContext.prototype,me.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function Qn(e){let t;try{if(t=zt&&(self.URL||self.webkitURL).createObjectURL(zt),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(yr),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function Me(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:l,hooks:b,packFn:v,sampling:w={},dataURLOptions:g={},mousemoveWait:I,recordDOM:L=true,recordCanvas:_=false,recordCrossOriginIframes:H=false,recordAfter:X=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=false,collectFonts:q=false,inlineImages:z=false,plugins:j,keepIframeSrcFn:E=()=>false,ignoreCSSAttributes:te=new Set([]),errorHandler:M}=e;Nn(M);let C=H?window.parent===window:true,O=false;if(!C)try{window.parent.document&&(O=!1);}catch(T){O=true;}if(C&&!t)throw new Error("emit function is required");if(!C&&!O)return ()=>{};I!==void 0&&w.mousemove===void 0&&(w.mousemove=I),Z.reset();let A=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:h!==void 0?h:{password:true},F=er(f);xn();let le,Ve=0,gt=T=>{for(let Q of j||[])Q.eventProcessor&&(T=Q.eventProcessor(T));return v&&!O&&(T=v(T)),T};W=(T,Q)=>{var P;let U=T;if(U.timestamp=we(),(P=ie[0])!=null&&P.isFrozen()&&U.type!==k.FullSnapshot&&!(U.type===k.IncrementalSnapshot&&U.data.source===R.Mutation)&&ie.forEach(Y=>Y.unfreeze()),C)t==null||t(gt(U),Q);else if(O){let Y={type:"rrweb",event:gt(U),origin:window.location.origin,isCheckout:Q};window.parent.postMessage(Y,"*");}if(U.type===k.FullSnapshot)le=U,Ve=0;else if(U.type===k.IncrementalSnapshot){if(U.data.source===R.Mutation&&U.data.isAttachIframe)return;Ve++;let Y=n&&Ve>=n,N=r&&U.timestamp-le.timestamp>r;(Y||N)&&De(true);}};let Ie=T=>{W({type:k.IncrementalSnapshot,data:{source:R.Mutation,...T}});},yt=T=>W({type:k.IncrementalSnapshot,data:{source:R.Scroll,...T}}),bt=T=>W({type:k.IncrementalSnapshot,data:{source:R.CanvasMutation,...T}}),Cr=T=>W({type:k.IncrementalSnapshot,data:{source:R.AdoptedStyleSheet,...T}}),se=new dt({mutationCb:Ie,adoptedStyleSheetCb:Cr}),oe=new lt({mirror:Z,mutationCb:Ie,stylesheetManager:se,recordCrossOriginIframes:H,wrappedEmit:W});for(let T of j||[])T.getMirror&&T.getMirror({nodeMirror:Z,crossOriginIframeMirror:oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:oe.crossOriginIframeStyleMirror});let Ge=new pt;et=new ut({recordCanvas:_,mutationCb:bt,win:window,blockClass:s,blockSelector:o,mirror:Z,sampling:w.canvas,dataURLOptions:g});let Re=new ct({mutationCb:Ie,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:A,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:_,inlineImages:z,sampling:w,slimDOMOptions:F,iframeManager:oe,stylesheetManager:se,canvasManager:et,keepIframeSrcFn:E,processedNodeManager:Ge},mirror:Z});De=(T=false)=>{if(!L)return;W({type:k.Meta,data:{href:window.location.href,width:nr(),height:rr()}},T),se.reset(),Re.init(),ie.forEach(P=>P.lock());let Q=Rn(document,{mirror:Z,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:A,maskTextFn:l,maskInputFn:m,slimDOM:F,dataURLOptions:g,recordCanvas:_,inlineImages:z,onSerialize:P=>{ir(P,Z)&&oe.addIframe(P),ar(P,Z)&&se.trackLinkElement(P),st(P)&&Re.addShadowRoot(S.shadowRoot(P),document);},onIframeLoad:(P,U)=>{oe.attachIframe(P,U),Re.observeAttachShadow(P);},onStylesheetLoad:(P,U)=>{se.attachLinkElement(P,U);},keepIframeSrcFn:E});if(!Q)return console.warn("Failed to snapshot the document");W({type:k.FullSnapshot,data:{node:Q,initialOffset:tr(window)}},T),ie.forEach(P=>P.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document));};try{let T=[],Q=U=>{var Y;return x(Vn)({mutationCb:Ie,mousemoveCb:(N,qe)=>W({type:k.IncrementalSnapshot,data:{source:qe,positions:N}}),mouseInteractionCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.MouseInteraction,...N}}),scrollCb:yt,viewportResizeCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.ViewportResize,...N}}),inputCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.Input,...N}}),mediaInteractionCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.MediaInteraction,...N}}),styleSheetRuleCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.StyleSheetRule,...N}}),styleDeclarationCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.StyleDeclaration,...N}}),canvasMutationCb:bt,fontCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.Font,...N}}),selectionCb:N=>{W({type:k.IncrementalSnapshot,data:{source:R.Selection,...N}});},customElementCb:N=>{W({type:k.IncrementalSnapshot,data:{source:R.CustomElement,...N}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:A,inlineStylesheet:u,sampling:w,recordDOM:L,recordCanvas:_,inlineImages:z,userTriggeredOnInput:$,collectFonts:q,doc:U,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:E,blockSelector:o,slimDOMOptions:F,dataURLOptions:g,mirror:Z,iframeManager:oe,stylesheetManager:se,shadowDomManager:Re,processedNodeManager:Ge,canvasManager:et,ignoreCSSAttributes:te,plugins:((Y=j==null?void 0:j.filter(N=>N.observer))==null?void 0:Y.map(N=>({observer:N.observer,options:N.options,callback:qe=>W({type:k.Plugin,data:{plugin:N.name,payload:qe}})})))||[]},b)};oe.addLoadListener(U=>{try{T.push(Q(U.contentDocument));}catch(Y){console.warn(Y);}});let P=()=>{De(),T.push(Q(document)),$e=!0;};return ["interactive","complete"].includes(document.readyState)?P():(T.push(V("DOMContentLoaded",()=>{W({type:k.DomContentLoaded,data:{}}),X==="DOMContentLoaded"&&P();})),T.push(V("load",()=>{W({type:k.Load,data:{}}),X==="load"&&P();},window))),()=>{T.forEach(U=>{try{U();}catch(Y){String(Y).toLowerCase().includes("cross-origin")||console.warn(Y);}}),Ge.destroy(),$e=!1,Ln();}}catch(T){console.warn(T);}}var Tr,Nr,y,Tt,k,R,K,ee,me,ue,B,Nt,Lt,ke,jt,Lr,Je,Qe,we,S,_e,Dt,nn,sn,on,an,un,dn,Ue,ce,_t,hn,fn,At,rt,de,Ft,ot,Pt,it,Se,x,ie,Fn,Wt,He,lt,ct,fe,Gn,ge,qn,Bt,fr,mr,gr,yr,zt,ut,dt,pt,W,De,et,$e,Z,Sr=Mr(()=>{Tr=Object.defineProperty,Nr=(e,t,r)=>t in e?Tr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>Nr(e,typeof t!="symbol"?t+"":t,r),k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(k||{}),R=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(R||{}),K=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(K||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(me||{}),ue=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ue||{}),B=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(B||{}),Nt={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ke={},jt={},Lr=()=>!!globalThis.Zone;Je={};Qe={};we=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>new Date().getTime());S={ownerDocument:Dr,childNodes:_r,parentNode:Ar,parentElement:Fr,textContent:Pr,firstChild:Ur,lastChild:Wr,nextSibling:Br,previousSibling:Hr,contains:$r,getRootNode:zr,host:jr,styleSheets:Vr,shadowRoot:Gr,querySelector:qr,querySelectorAll:Kr,nowTimestamp:we,mutationObserverCtor:Gt,patch:ae};_e=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};Dt="__rrweb_original__";nn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sn=/^(?:[a-z+]+:)?\/\//i,on=/^www\..*/i,an=/^(data:)([^,]*),(.*)/i;un=1,dn=new RegExp("[^a-z0-9-_:]"),Ue=-2;hn=/^[^ \t\n\r\u000c]+/,fn=/^[, \t\n\r\u000c]+/;At=new WeakMap;rt=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){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"}};de=`Please stop import mirror directly. Instead of that,\r
2
2
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
3
- or you can use record.mirror to access the mirror instance during recording.`,Ft={map:{},getId(){return console.error(de),-1},getNode(){return console.error(de),null},removeNodeFromMap(){console.error(de);},has(){return console.error(de),false},reset(){console.error(de);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ft=new Proxy(Ft,{get(e,t,r){return t==="map"&&console.error(de),Reflect.get(e,t,r)}}));ot=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map);}getId(t){var r;return (r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Pt=(e,t)=>`${e}@${t}`,it=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let h of this.movedSet){let f=S.parentNode(h);this.removesSubTreeCache.has(f)&&!this.movedSet.has(f)||this.addedSet.add(h);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(S.previousSibling(n)))a=n,n=S.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=S.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(cr(s)?(c=Ut(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&Ut(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(S.lastChild(s)))n=S.lastChild(s),a=null;else for(;;){if(a=S.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=be(s)?this.mirror.getId(lr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=S.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let h=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(h=true);}let f=a?this.mirror.getId(a):null;for(;f===Ue;)a=a&&S.nextSibling(a),f=a&&this.mirror.getId(a);if(f===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=he(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:l=>{ir(l,this.mirror)&&this.iframeManager.addIframe(l),ar(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),st(n)&&this.shadowDomManager.addShadowRoot(S.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:h});m&&(t.push({parentId:o,nextId:f,node:m}),r.add(m.id));}let d={texts:this.texts.map(h=>{let f=h.node,m=S.parentNode(f);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(f),value:h.value}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),attributes:this.attributes.map(h=>{let{attributes:f}=h;if(typeof f.style=="string"){let m=JSON.stringify(h.styleDiff),l=JSON.stringify(h._unchangedStyles);m.length<f.style.length&&(m+l).split("var(").length===f.style.split("var(").length&&(f.style=h.styleDiff);}return {id:this.mirror.getId(h.node),attributes:f}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(S.childNodes(t),s=>S.textContent(s)||"").join("");r.attributes.value=Ae({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Fe(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!Ze(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=S.textContent(t.target);!G(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:Zt(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,sr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=ne(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Fe(r);o=Ae({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(G(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Qt(n,s))if(a.attributes[s]=Jt(this.doc,n,ne(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(G(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=be(t.target)?this.mirror.getId(S.host(t.target)):this.mirror.getId(t.target);G(t.target,this.blockClass,this.blockSelector,false)||Ze(r,this.mirror,this.slimDOMOptions)||!En(r,this.mirror)||(this.addedSet.has(r)?(at(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||or(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Pt(n,s)]?at(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:be(t.target)&&Se(t.target)?true:void 0}),Tn(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ze(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Pt(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);G(t,this.blockClass,this.blockSelector,false)||(S.childNodes(t).forEach(n=>this.genAdds(n)),st(t)&&S.childNodes(S.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};k=e=>we?(...r)=>{try{return e(...r)}catch(n){if(we&&we(n)===true)return;throw n}}:e,ie=[];Fn=["INPUT","TEXTAREA","SELECT"],Wt=new WeakMap;He=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},lt=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new He(Yt)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new He(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(t){this.iframes.set(t,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.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){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:x.IncrementalSnapshot,data:{source:R.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case x.Meta:case x.Load:case x.DomContentLoaded:return false;case x.Plugin:return r;case x.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case x.IncrementalSnapshot:switch(r.data.source){case R.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.Drag:case R.TouchMove:case R.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.ViewportResize:return false;case R.MediaInteraction:case R.MouseInteraction:case R.Scroll:case R.CanvasMutation:case R.Input:return this.replaceIds(r.data,t,["id"]),r;case R.StyleSheetRule:case R.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case R.Font:return r;case R.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case R.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==B.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},ct=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(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,r){if(!Se(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=dr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pr({...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(S.host(t))),this.restoreHandlers.push(hr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t));},0);}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument);}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(ae(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=S.shadowRoot(this);return c&&cr(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(ye=0;ye<fe.length;ye++)Gn[fe.charCodeAt(ye)]=ye;qn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=fe[t[r]>>2],s+=fe[(t[r]&3)<<4|t[r+1]>>4],s+=fe[(t[r+1]&15)<<2|t[r+2]>>6],s+=fe[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Bt=new Map;fr=(e,t,r)=>{if(!e||!(gr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Kn(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};mr=(e,t,r)=>e.map(n=>Le(n,t,r)),gr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);yr=`(function() {
3
+ or you can use record.mirror to access the mirror instance during recording.`,Ft={map:{},getId(){return console.error(de),-1},getNode(){return console.error(de),null},removeNodeFromMap(){console.error(de);},has(){return console.error(de),false},reset(){console.error(de);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ft=new Proxy(Ft,{get(e,t,r){return t==="map"&&console.error(de),Reflect.get(e,t,r)}}));ot=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map);}getId(t){var r;return (r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Pt=(e,t)=>`${e}@${t}`,it=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let h of this.movedSet){let f=S.parentNode(h);this.removesSubTreeCache.has(f)&&!this.movedSet.has(f)||this.addedSet.add(h);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(S.previousSibling(n)))a=n,n=S.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=S.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(cr(s)?(c=Ut(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&Ut(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(S.lastChild(s)))n=S.lastChild(s),a=null;else for(;;){if(a=S.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=ye(s)?this.mirror.getId(lr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=S.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let h=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(h=true);}let f=a?this.mirror.getId(a):null;for(;f===Ue;)a=a&&S.nextSibling(a),f=a&&this.mirror.getId(a);if(f===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=he(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:l=>{ir(l,this.mirror)&&this.iframeManager.addIframe(l),ar(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),st(n)&&this.shadowDomManager.addShadowRoot(S.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:h});m&&(t.push({parentId:o,nextId:f,node:m}),r.add(m.id));}let d={texts:this.texts.map(h=>{let f=h.node,m=S.parentNode(f);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(f),value:h.value}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),attributes:this.attributes.map(h=>{let{attributes:f}=h;if(typeof f.style=="string"){let m=JSON.stringify(h.styleDiff),l=JSON.stringify(h._unchangedStyles);m.length<f.style.length&&(m+l).split("var(").length===f.style.split("var(").length&&(f.style=h.styleDiff);}return {id:this.mirror.getId(h.node),attributes:f}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(S.childNodes(t),s=>S.textContent(s)||"").join("");r.attributes.value=Ae({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Fe(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!Ze(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=S.textContent(t.target);!G(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:Zt(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,sr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=ne(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Fe(r);o=Ae({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(G(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Qt(n,s))if(a.attributes[s]=Jt(this.doc,n,ne(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(G(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=ye(t.target)?this.mirror.getId(S.host(t.target)):this.mirror.getId(t.target);G(t.target,this.blockClass,this.blockSelector,false)||Ze(r,this.mirror,this.slimDOMOptions)||!En(r,this.mirror)||(this.addedSet.has(r)?(at(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||or(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Pt(n,s)]?at(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:ye(t.target)&&be(t.target)?true:void 0}),Tn(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ze(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Pt(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);G(t,this.blockClass,this.blockSelector,false)||(S.childNodes(t).forEach(n=>this.genAdds(n)),st(t)&&S.childNodes(S.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};x=e=>Se?(...r)=>{try{return e(...r)}catch(n){if(Se&&Se(n)===true)return;throw n}}:e,ie=[];Fn=["INPUT","TEXTAREA","SELECT"],Wt=new WeakMap;He=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},lt=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new He(Yt)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new He(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(t){this.iframes.set(t,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.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){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:R.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case k.Meta:case k.Load:case k.DomContentLoaded:return false;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case R.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.Drag:case R.TouchMove:case R.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.ViewportResize:return false;case R.MediaInteraction:case R.MouseInteraction:case R.Scroll:case R.CanvasMutation:case R.Input:return this.replaceIds(r.data,t,["id"]),r;case R.StyleSheetRule:case R.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case R.Font:return r;case R.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case R.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==B.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},ct=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(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,r){if(!be(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=dr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pr({...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(S.host(t))),this.restoreHandlers.push(hr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t));},0);}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument);}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(ae(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=S.shadowRoot(this);return c&&cr(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(ge=0;ge<fe.length;ge++)Gn[fe.charCodeAt(ge)]=ge;qn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=fe[t[r]>>2],s+=fe[(t[r]&3)<<4|t[r+1]>>4],s+=fe[(t[r+1]&15)<<2|t[r+2]>>6],s+=fe[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Bt=new Map;fr=(e,t,r)=>{if(!e||!(gr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Kn(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};mr=(e,t,r)=>e.map(n=>Le(n,t,r)),gr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);yr=`(function() {
4
4
  "use strict";
5
5
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
6
  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
@@ -75,4 +75,4 @@ or you can use record.mirror to access the mirror instance during recording.`,Ft
75
75
  };
76
76
  })();
77
77
  //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
78
- `,$t=typeof self!="undefined"&&self.Blob&&new Blob([yr],{type:"text/javascript;charset=utf-8"});ut=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=Ht(r,n,s,true),c=new Map,i=new Qn;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:C,width:w,height:g}=m.data;this.mutationCb({id:l,type:me["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:C}]},0,0]}]});};let p=1e3/t,u=0,d,h=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{G(l,n,s,true)||m.push(l);}),m},f=m=>{if(u&&m-u<p){d=requestAnimationFrame(f);return}u=m,h().forEach(async l=>{var b;let C=this.mirror.getId(l);if(c.get(C)||l.width===0||l.height===0)return;if(c.set(C,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let w=await createImageBitmap(l);i.postMessage({id:C,bitmap:w,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[w]);}),d=requestAnimationFrame(f);};d=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=Ht(t,r,n,false),o=Xn(this.processMutation.bind(this),t,r,n),a=Jn(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},dt=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new ot),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Kt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},pt=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},ze=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Tt=e.contentWindow)==null?void 0:Tt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}Z=en();Ie.addCustomEvent=(e,t)=>{if(!ze)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:e,payload:t}});};Ie.freezePage=()=>{ie.forEach(e=>e.freeze());};Ie.takeFullSnapshot=e=>{if(!ze)throw new Error("please take full snapshot after start recording");_e(e);};Ie.mirror=Z;});var wt="[data-ck-mask]",vt="[data-ck-block]";var Ct=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ke=1800*1e3,Xe=60*1e3,Mt=30*1e3,Rr=5*1e3,Ye=64*1024,Er=4*1024*1024,It=1024*1024,kr=[vt,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),xr=wt,Rt=(e,t)=>Ct(`replay:${e}`)<Math.min(1,Math.max(0,t)),Et=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Or=e=>"*".repeat(Math.min(12,e.length)),kt=e=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Or,maskTextSelector:xr,blockSelector:kr,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),ke=class{constructor(t=Xe,r=Er){ge(this,"windowMs",t);ge(this,"maxBytes",r);ge(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},xt=(e,t)=>e>=Ye||e>0&&t>=Rr,Ot=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var mt=(e,t)=>String(e!=null?e:"").slice(0,t),je=()=>window.location.pathname.slice(0,300)||"/",Zn=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},wr=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(Sr(),br)),r=`${e.host}/api/sdk/replay`,n=Rt(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=null,i=0,p=false,u=Date.now(),d=new ke,h=[],f=0,m=Date.now(),l=[{t:Date.now(),kind:"pageview",path:je()}],b=Promise.resolve(),C=M=>{p||(!M&&n==="upload"&&g(false),p=true,j==null||j(),window.clearInterval(E),window.clearInterval(te),window.removeEventListener("error",X),window.removeEventListener("unhandledrejection",z),window.removeEventListener("pagehide",q),document.removeEventListener("visibilitychange",$),console.error===H&&(console.error=D),h=[],d.clear(),l=[]);},w=async(M,v,O)=>{let A;if(!O&&typeof CompressionStream!="undefined"?A=JSON.stringify({...M,enc:"gzip",data:Ot(await Zn(v))}):A=JSON.stringify({...M,enc:"json",data:v}),A.length>It){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),C(true);return}if(!(O&&"sendBeacon"in navigator&&navigator.sendBeacon(r,A)))try{let F=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:A,keepalive:O||A.length<6e4});(F.status===403||F.status===409||F.status===413)&&C(!0);}catch(F){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function g(M){if(!h.length)return;let v=h;h=[],f=0,m=Date.now(),c!=null||(c=v[0].timestamp);let O=l;l=[];let A={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,start:c,seq:i++,consent:{replay:true},trigger:s,final:M,meta:{first:v[0].timestamp,last:v[v.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:O}},F=`[${v.map(le=>le.json).join(",")}]`;M?w(A,F,true):b=b.then(()=>w(A,F,false));}let I=M=>{p||n==="upload"||(n="upload",s=M,window.clearInterval(te),h=d.drain(),f=h.reduce((v,O)=>v+O.json.length,0),g(false));},L=M=>{var A;if(p)return;if(Date.now()-(c!=null?c:u)>Ke){C(false);return}let v=JSON.stringify(M),O={type:M.type,timestamp:M.timestamp,json:v};if(n==="buffer"){d.push(O,v.length);let F=(A=d.first)!=null?A:M.timestamp-Xe;l=l.filter(le=>le.t>=F);return}h.push(O),f+=v.length,f>=Ye&&g(false);},D=console.error,H=(...M)=>{try{t.addCustomEvent("$console",{level:"error",text:mt(M.map(v=>v instanceof Error?v.message:typeof v=="string"?v:"[object]").join(" "),300)});}catch(v){}D.apply(console,M);},X=M=>{let v=mt(M.message||"Script error",200);l.push({t:Date.now(),kind:"error",path:je(),label:v});try{t.addCustomEvent("$error",{message:v});}catch(O){}I("error");},z=M=>{let v=M.reason,O=mt(typeof(v==null?void 0:v.message)=="string"?v.message:"Unhandled promise rejection",200);l.push({t:Date.now(),kind:"error",path:je(),label:O});try{t.addCustomEvent("$error",{message:O});}catch(A){}I("error");},q=()=>n==="upload"&&g(true),$=()=>document.visibilityState==="hidden"&&n==="upload"&&g(false),j=t(kt(L));if(!j)return null;console.error=H,window.addEventListener("error",X),window.addEventListener("unhandledrejection",z),window.addEventListener("pagehide",q),document.addEventListener("visibilitychange",$);let E=window.setInterval(()=>{Date.now()-(c!=null?c:u)>Ke?C(false):n==="upload"&&xt(f,Date.now()-m)&&g(false);},1e3),te=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),Mt):0;return {event:M=>{let v=Et(M);v&&I(v);},click:(M,v)=>{if(p)return;let O=Date.now(),A=je(),F=M.label||M.selector.split(" > ").pop()||"";l.push({t:O,kind:"click",path:A,label:F,x:M.x,y:M.y,vw:M.vw,dead:!M.interactive}),v&&(l.push({t:O,kind:"rage",path:A,label:F,x:M.x,y:M.y,vw:M.vw}),I("rage"));},page:M=>!p&&l.push({t:Date.now(),kind:"pageview",path:M.slice(0,300)||"/"}),identify:M=>{o=M,a=true;},stop:(M=false)=>C(M)}};window.__mrrocketReplay={startReplay:wr};})();
78
+ `,zt=typeof self!="undefined"&&self.Blob&&new Blob([yr],{type:"text/javascript;charset=utf-8"});ut=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=Ht(r,n,s,true),c=new Map,i=new Qn;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:v,width:w,height:g}=m.data;this.mutationCb({id:l,type:me["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:v}]},0,0]}]});};let p=1e3/t,u=0,d,h=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{G(l,n,s,true)||m.push(l);}),m},f=m=>{if(u&&m-u<p){d=requestAnimationFrame(f);return}u=m,h().forEach(async l=>{var b;let v=this.mirror.getId(l);if(c.get(v)||l.width===0||l.height===0)return;if(c.set(v,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let w=await createImageBitmap(l);i.postMessage({id:v,bitmap:w,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[w]);}),d=requestAnimationFrame(f);};d=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=Ht(t,r,n,false),o=Xn(this.processMutation.bind(this),t,r,n),a=Jn(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},dt=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new ot),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Kt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},pt=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},$e=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Tt=e.contentWindow)==null?void 0:Tt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}Z=en();Me.addCustomEvent=(e,t)=>{if(!$e)throw new Error("please add custom event after start recording");W({type:k.Custom,data:{tag:e,payload:t}});};Me.freezePage=()=>{ie.forEach(e=>e.freeze());};Me.takeFullSnapshot=e=>{if(!$e)throw new Error("please take full snapshot after start recording");De(e);};Me.mirror=Z;});var wt="[data-ck-mask]",Ct="[data-ck-block]";var vt=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ke=1800*1e3,Xe=60*1e3,Mt=30*1e3,Rr=5*1e3,Ye=64*1024,Er=4*1024*1024,It=1024*1024,xr=[Ct,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),kr=wt,Rt=(e,t)=>vt(`replay:${e}`)<Math.min(1,Math.max(0,t)),Et=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Or=e=>"*".repeat(Math.min(12,e.length)),xt=e=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Or,maskTextSelector:kr,blockSelector:xr,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),xe=class{constructor(t=Xe,r=Er){Ee(this,"windowMs",t);Ee(this,"maxBytes",r);Ee(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},kt=(e,t)=>e>=Ye||e>0&&t>=Rr,Ot=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var mt=(e,t)=>String(e!=null?e:"").slice(0,t),je=()=>window.location.pathname.slice(0,300)||"/",Zn=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},wr=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(Sr(),br)),r=`${e.host}/api/sdk/replay`,n=Rt(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=null,i=0,p=false,u=Date.now(),d=new xe,h=[],f=0,m=Date.now(),l=[{t:Date.now(),kind:"pageview",path:je()}],b=Promise.resolve(),v=M=>{p||(!M&&n==="upload"&&g(false),p=true,j==null||j(),window.clearInterval(E),window.clearInterval(te),window.removeEventListener("error",X),window.removeEventListener("unhandledrejection",$),window.removeEventListener("pagehide",q),document.removeEventListener("visibilitychange",z),console.error===H&&(console.error=_),h=[],d.clear(),l=[]);},w=async(M,C,O)=>{let A;if(!O&&typeof CompressionStream!="undefined"?A=JSON.stringify({...M,enc:"gzip",data:Ot(await Zn(C))}):A=JSON.stringify({...M,enc:"json",data:C}),A.length>It){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),v(true);return}if(!(O&&"sendBeacon"in navigator&&navigator.sendBeacon(r,A)))try{let F=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:A,keepalive:O||A.length<6e4});(F.status===403||F.status===409||F.status===413)&&v(!0);}catch(F){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function g(M){if(!h.length)return;let C=h;h=[],f=0,m=Date.now(),c!=null||(c=C[0].timestamp);let O=l;l=[];let A={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,start:c,seq:i++,consent:{replay:true},trigger:s,final:M,meta:{first:C[0].timestamp,last:C[C.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:O}},F=`[${C.map(le=>le.json).join(",")}]`;M?w(A,F,true):b=b.then(()=>w(A,F,false));}let I=M=>{p||n==="upload"||(n="upload",s=M,window.clearInterval(te),h=d.drain(),f=h.reduce((C,O)=>C+O.json.length,0),g(false));},L=M=>{var A;if(p)return;if(Date.now()-(c!=null?c:u)>Ke){v(false);return}let C=JSON.stringify(M),O={type:M.type,timestamp:M.timestamp,json:C};if(n==="buffer"){d.push(O,C.length);let F=(A=d.first)!=null?A:M.timestamp-Xe;l=l.filter(le=>le.t>=F);return}h.push(O),f+=C.length,f>=Ye&&g(false);},_=console.error,H=(...M)=>{try{t.addCustomEvent("$console",{level:"error",text:mt(M.map(C=>C instanceof Error?C.message:typeof C=="string"?C:"[object]").join(" "),300)});}catch(C){}_.apply(console,M);},X=M=>{let C=mt(M.message||"Script error",200);l.push({t:Date.now(),kind:"error",path:je(),label:C});try{t.addCustomEvent("$error",{message:C});}catch(O){}I("error");},$=M=>{let C=M.reason,O=mt(typeof(C==null?void 0:C.message)=="string"?C.message:"Unhandled promise rejection",200);l.push({t:Date.now(),kind:"error",path:je(),label:O});try{t.addCustomEvent("$error",{message:O});}catch(A){}I("error");},q=()=>n==="upload"&&g(true),z=()=>document.visibilityState==="hidden"&&n==="upload"&&g(false),j=t(xt(L));if(!j)return null;console.error=H,window.addEventListener("error",X),window.addEventListener("unhandledrejection",$),window.addEventListener("pagehide",q),document.addEventListener("visibilitychange",z);let E=window.setInterval(()=>{Date.now()-(c!=null?c:u)>Ke?v(false):n==="upload"&&kt(f,Date.now()-m)&&g(false);},1e3),te=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),Mt):0;return {event:M=>{let C=Et(M);C&&I(C);},click:(M,C)=>{if(p)return;let O=Date.now(),A=je(),F=M.label||M.selector.split(" > ").pop()||"";l.push({t:O,kind:"click",path:A,label:F,x:M.x,y:M.y,vw:M.vw,dead:!M.interactive}),C&&(l.push({t:O,kind:"rage",path:A,label:F,x:M.x,y:M.y,vw:M.vw}),I("rage"));},page:M=>!p&&l.push({t:Date.now(),kind:"pageview",path:M.slice(0,300)||"/"}),identify:M=>{o=M,a=true;},stop:(M=false)=>v(M)}};window.__mrrocketReplay={startReplay:wr};})();
@@ -0,0 +1 @@
1
+ (function(){'use strict';var n=self,w=new URLSearchParams(n.location.search);n.addEventListener("install",()=>{n.skipWaiting();});n.addEventListener("activate",i=>i.waitUntil(n.clients.claim()));n.addEventListener("push",i=>{var o;let t={};try{t=i.data?i.data.json():{};}catch(s){t={title:(o=i.data)==null?void 0:o.text()};}t.title&&i.waitUntil(n.registration.showNotification(t.title,{body:t.body,icon:t.icon,data:t,tag:t.id}));});n.addEventListener("notificationclick",i=>{var a,r,c,l,d;let t=(r=(a=i.notification)==null?void 0:a.data)!=null?r:{};(c=i.notification)==null||c.close();let o=t.k||w.get("key"),s=(d=(l=t.h)!=null?l:w.get("host"))!=null?d:"",g=o&&t.id?fetch(`${s}/api/sdk/events`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:o,events:[{event:"$push",props:{action:"opened",message:t.id},ts:Date.now(),url:t.url}]})}).catch(()=>null):null,h=t.url?n.clients.matchAll({type:"window",includeUncontrolled:true}).then(p=>{let u=new URL(t.url,n.location.origin).href,e=p.find(f=>f.url===u);return e!=null&&e.focus?e.focus():n.clients.openWindow(u)}):null;i.waitUntil(Promise.all([g,h]));});})();
@@ -1 +1,2 @@
1
- (function(){'use strict';var _t=Object.defineProperty;var It=(e,t,n)=>t in e?_t(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var D=(e,t,n)=>It(e,typeof t!="symbol"?t+"":t,n);var Qe=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t+=1:o<2048?t+=2:o>=55296&&o<=56319&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(t+=4,n++):t+=3;}return t},St=(e,t,n)=>{let o=`{"key":${JSON.stringify(e)},"sdk":${JSON.stringify(n)},"events":[`,i=Qe(o)+2,a=[],l=[],f=[],g=i,m=()=>{l.length&&a.push({body:`${o}${l.join(",")}]}`,events:f}),l=[],f=[],g=i;};for(let E of t){let I=JSON.stringify(E),p=Qe(I)+1;i+p>6e4||((l.length===100||g+p>6e4)&&m(),l.push(I),f.push(E),g+=p);}return m(),a},Ze=(e,t,n)=>St(e,t,n).map(o=>o.body);var Mt='a[href],button,input,select,textarea,label,summary,[role="button"],[role="link"],[role="tab"],[role="menuitem"],[role="checkbox"],[role="switch"],[onclick],[data-ck-goal]',At="[data-ck-mask]",$t="[data-ck-block]",et=/\d{4,}|^[a-z]{1,3}-[a-z0-9]{5,}$|^_|__|css-|^sc-|^jsx-/i,Ot=e=>{let t=e.tagName.toLowerCase();if(e.id&&!et.test(e.id)&&e.id.length<=40)return `${t}#${e.id}`;let n=typeof e.className=="string"?e.className.split(/\s+/).filter(a=>a&&!et.test(a)&&a.length<=30&&!a.includes(":")):[],o=n.length?`${t}.${n.slice(0,2).join(".")}`:t,i=e.parentElement?[...e.parentElement.children].filter(a=>a.tagName===e.tagName):[];return i.length>1?`${o}:nth-of-type(${i.indexOf(e)+1})`:o},Lt=e=>{let t=[],n=e;for(;n&&t.length<3&&n.tagName&&n.tagName!=="BODY"&&n.tagName!=="HTML";){let o=Ot(n);if(t.unshift(o),o.includes("#"))break;n=n.parentElement;}return t.join(" > ").slice(0,160)},ee=e=>(e!=null?e:"").replace(/\s+/g," ").trim().slice(0,40),Tt=e=>{var n,o,i,a,l;if(e.closest(`${At},${$t}`))return "";let t=e.tagName.toLowerCase();if(t==="input"){let f=((n=e.getAttribute("type"))!=null?n:"text").toLowerCase();return ee(f==="submit"||f==="button"?(o=e.getAttribute("aria-label"))!=null?o:e.value:e.getAttribute("aria-label"))}return ee(t==="select"||t==="textarea"?e.getAttribute("aria-label"):(l=(a=(i=e.getAttribute("aria-label"))!=null?i:e.getAttribute("title"))!=null?a:e.innerText)!=null?l:e.textContent)},tt=e=>{var a,l;let t=e.target instanceof Element?e.target:null;if(!t)return null;let n=t.closest(Mt),o=n!=null?n:t,i=document.documentElement;return {x:Math.round(e.clientX),y:Math.round(e.clientY+window.scrollY),vw:window.innerWidth,vh:window.innerHeight,docH:Math.max(i.scrollHeight,(l=(a=document.body)==null?void 0:a.scrollHeight)!=null?l:0),selector:Lt(o),label:n?Tt(n):"",interactive:!!n}},te=class{constructor(t=1e3,n=30,o=3){D(this,"windowMs",t);D(this,"radius",n);D(this,"count",o);D(this,"clicks",[]);D(this,"fired",false);}push(t,n,o){let i=this.clicks.filter(a=>o-a.t<=this.windowMs&&Math.hypot(a.x-t,a.y-n)<=this.radius);return i.length!==this.clicks.length&&(this.fired=false),this.clicks=[...i,{x:t,y:n,t:o}],this.clicks.length>=this.count&&!this.fired?(this.fired=true,true):false}},nt=()=>{var n,o;let e=document.documentElement,t=Math.max(e.scrollHeight,(o=(n=document.body)==null?void 0:n.scrollHeight)!=null?o:0);return t?Math.min(100,Math.round((window.scrollY+window.innerHeight)/t*100)):0};var ne="0.4.0",Pt=(e,t)=>{let n=t.trim().toLowerCase();for(let[o,i]of Object.entries(e))if(o.toLowerCase()===n)return i},Nt=(e,t)=>{let n=e.trim().toLowerCase(),o=t.trim().toLowerCase();return o.startsWith("@")?n.endsWith(o):n===o},Dt=(e,t)=>{if(e.op==="in cohort")return false;let n=Pt(t,e.property),o=n==null?"":String(n);if(e.op==="\u2265"){let a=Number(o),l=Number(e.values[0]);return o!==""&&Number.isFinite(a)&&Number.isFinite(l)&&a>=l}let i=o!==""&&e.values.some(a=>Nt(o,a));return e.op==="is"||e.op==="in"?i:!i},Ut=(e,t,n={})=>{var f;if(!e.on)return false;let o={id:t,...n},i=e.sets.length?e.sets.find(g=>g.conditions.every(m=>Dt(m,o))):{rollout:100};if(!i||rt(`${e.key}:rollout:${t}`)*100>=i.rollout)return false;if(!((f=e.variants)!=null&&f.length))return true;let a=rt(`${e.key}:variant:${t}`)*100,l=0;for(let g of e.variants)if(l+=g.split,a<l)return g.key;return e.variants[e.variants.length-1].key},Re=(e,t,n,o={})=>{var a;let i=(a=t==null?void 0:t.flags)==null?void 0:a.find(l=>l.key===e);return i?Ut(i,n,o):false},Ht=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],ot="ck_preview",st="ck_embed",L="ck_id",U="ck_sid";var Ft=e=>{var n;let t={};for(let o of Ht){let i=(n=e(o))==null?void 0:n.trim();i&&(t[o]=i.slice(0,150));}return t},it=e=>{let t=new URLSearchParams(e);return Ft(n=>t.get(n))};var Kt=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return (t>>>0)/4294967296},rt=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,(t>>>0)/4294967296},jt=(e,t)=>{var a,l,f,g;let n=(l=(a=e.variants[0])==null?void 0:a.id)!=null?l:"control";if(e.winner)return e.winner;if(e.status!=="running")return n;let o=Kt(`${e.key}:${t}`),i=0;for(let m of e.variants)if(i+=m.weight,o<i)return m.id;return (g=(f=e.variants[e.variants.length-1])==null?void 0:f.id)!=null?g:n},at=e=>{let t=Array.isArray(e)?e[0]:e;if(!t)return {};let n={};for(let o of t.split(",")){let[i,a]=o.split(":");i&&a&&(n[i.trim()]=a.trim());}return n};var re=(e,t,n,o)=>{if(o[e])return o[e];let i=t==null?void 0:t.experiments.find(a=>a.key===e);return i?jt(i,n):"control"},ct=(e,t,n)=>{var i,a,l,f,g;let o={};for(let m of (i=e==null?void 0:e.experiments)!=null?i:[]){let E=re(m.key,e,t,n);E!==((l=(a=m.variants[0])==null?void 0:a.id)!=null?l:"control")&&Object.assign(o,(g=(f=m.variants.find(I=>I.id===E))==null?void 0:f.changes)!=null?g:{});}return o};var Ee=()=>typeof crypto!="undefined"&&"randomUUID"in crypto?crypto.randomUUID():`ck_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;var V=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e,Vt=e=>{var t;if(e instanceof Error)return {type:e.name||"Error",message:V(e.message||String(e),1e3),stack:e.stack?V(e.stack,8192):void 0};if(typeof e=="string")return {type:"Error",message:V(e,1e3)};try{return {type:"Error",message:V((t=JSON.stringify(e))!=null?t:String(e),1e3)}}catch(n){return {type:"Error",message:String(e)}}},lt=e=>{let t=[],n=[],o=new Set,i=0,a=`${e.host}/api/sdk/errors`,l=(p=false)=>{for(;t.length;){let h=JSON.stringify({key:e.apiKey,errors:t.splice(0,4)});p&&typeof navigator!="undefined"&&"sendBeacon"in navigator&&navigator.sendBeacon(a,h)||fetch(a,{method:"POST",headers:{"content-type":"application/json"},body:h,keepalive:true}).then(C=>{!C.ok&&C.status!==429&&e.warn(`Error reports were rejected with ${C.status}. Check the public key and NEXT_PUBLIC_MRROCKET_HOST.`);}).catch(()=>{});}},f=(p,h="manual")=>{let S=e.context();if(!S.send||i>=20)return;let C=Vt(p);if(/\/api\/sdk\/errors/.test(C.message))return;let H=`${C.type}:${C.message}`;o.has(H)||(o.add(H),i++,t.push({...C,mechanism:h,handled:h==="manual",url:window.location.href,ts:Date.now(),crumbs:n.slice(),...e.release?{release:e.release}:{},...S.distinctId?{distinctId:S.distinctId}:{},...S.sessionId?{sessionId:S.sessionId}:{}}));},g=p=>{var h;!p.error&&(!p.message||p.message==="Script error.")||f((h=p.error)!=null?h:new Error(p.message),"onerror");},m=p=>{var h;return f((h=p.reason)!=null?h:new Error("Unhandled promise rejection"),"onunhandledrejection")},E=()=>l(true);window.addEventListener("error",g),window.addEventListener("unhandledrejection",m),window.addEventListener("pagehide",E);let I=window.setInterval(()=>l(),2e3);return {capture:f,crumb:(p,h)=>{n.push({ts:Date.now(),type:p,message:V(h,120)}),n.length>20&&n.shift();},stop:()=>{window.removeEventListener("error",g),window.removeEventListener("unhandledrejection",m),window.removeEventListener("pagehide",E),window.clearInterval(I),l(true);}}};var ie="mrr_ref",ae="mrr_ref",Bt="mrr_ref",Yt="mrr_click";var B=/^[A-Za-z0-9_-]{1,64}$/;var qt=(e,t="ref")=>{let n=new URLSearchParams(e);return Wt(o=>n.get(o),t)},Wt=(e,t="ref")=>{let n=e(Bt);if(n&&B.test(n)){let i=e(Yt);return {code:n,clickId:i&&B.test(i)?i:null,direct:false}}let o=e(t);return o&&B.test(o)?{code:o,clickId:null,direct:true}:null},dt=e=>{var t;return `${e.code}.${(t=e.clickId)!=null?t:""}.${e.at}`},oe=(e,t=60,n=Date.now())=>{if(!e)return null;let[o,i,a]=e.split("."),l=Number(a);return !o||!B.test(o)||!Number.isFinite(l)||i&&!B.test(i)||n-l>t*864e5||l>n+864e5?null:{code:o,clickId:i||null,at:l}};var R=null,ce=()=>typeof document!="undefined",ut=e=>{var n;if(!ce())return;let t=(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.slice(e.length+1);try{return t?decodeURIComponent(t):void 0}catch(o){return t}},le=()=>{try{return typeof localStorage=="undefined"?null:localStorage}catch(e){return null}},Ce=()=>{var e,t;return R||(ce()?(t=oe(ut(ie),3650))!=null?t:oe((e=le())==null?void 0:e.getItem(ae),3650):null)};var se=(e,t)=>{var i;if(!ce())return;let n=Math.max(1,Math.round(t))*86400,o=typeof location!="undefined"&&location.protocol==="https:"?"; secure":"";document.cookie=`${ie}=${encodeURIComponent(dt(e))}; path=/; max-age=${n}; samesite=lax${o}`;try{(i=le())==null||i.setItem(ae,dt(e));}catch(a){}},de=()=>{var e;if(ce()){document.cookie=`${ie}=; path=/; max-age=0; samesite=lax`;try{(e=le())==null||e.removeItem(ae);}catch(t){}}},ft=()=>{R=null;},pt=async e=>{var o,i,a;let t=qt(e.search,e.param),n=(o=e.now)!=null?o:Date.now();if(!t)return !R&&e.store&&(R=(a=oe(ut(ie),e.days,n))!=null?a:oe((i=le())==null?void 0:i.getItem(ae),e.days,n),R||de()),R;if(R={code:t.code,clickId:t.clickId,at:n},e.store&&se(R,e.days),e.beacon)try{let l=await e.beacon({code:t.code,clickId:t.clickId});l&&R&&R.code===t.code&&!R.clickId&&(R={...R,clickId:l},e.store&&se(R,e.days));}catch(l){}return R},gt=e=>e==="$identify"||!e.startsWith("$");var be=3600*24*365,kt=e=>{var n;if(typeof document=="undefined")return;let t=(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.slice(e.length+1);if(t)try{return decodeURIComponent(t)}catch(o){return t}},ue=(e,t,n)=>{let o=window.location.protocol==="https:"?"; secure":"";document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${n}; samesite=lax${o}`;},Y=e=>{document.cookie=`${e}=; path=/; max-age=0; samesite=lax`;},w={utm:{}},ht=()=>{var e;return (e=w.id)!=null?e:w.id=Ee()},ve=(e,t)=>{if(e!=="cookies")return ht();let n=kt(L);if(n)return w.id=n;let o=ht();return ue(L,o,be),o},_e=e=>{var i;let t=Date.now(),n=w.session,o=(i=e?kt(U):void 0)!=null?i:n&&t-n.last<18e5?n.id:Ee();return w.session={id:o,last:t},e&&ue(U,o,18e5/1e3),o},Ie=()=>{var n;let e=window.location.href;if(w.url===e)return;w.referrer=(n=w.url)!=null?n:document.referrer||void 0,w.url=e;let t=it(window.location.search);Object.keys(t).length&&(w.utm=t);},yt=()=>{let e=navigator,t=window;return e.doNotTrack==="1"||t.doNotTrack==="1"||e.globalPrivacyControl===true};var T=window,Jt=()=>{var e,t;return (t=(e=document.currentScript)!=null?e:document.querySelector('script[data-key][src*="sdk"]'))!=null?t:document.querySelector("script[data-key][src*='mrrocket']")},wt=new Set,_=e=>{wt.has(e)||(wt.add(e),console.warn(`[MRRocket] ${e}`));},Gt=()=>{var qe,We,Xe,Je,Ge;let e=Jt(),t=r=>{var s;return (s=e==null?void 0:e.getAttribute(`data-${r}`))!=null?s:void 0},n=(r,s)=>{let c=t(r);return c===void 0?s:!["false","0","off","no"].includes(c.trim().toLowerCase())},o=(qe=e==null?void 0:e.src)!=null?qe:"",i="";try{i=o?new URL(o,window.location.href).origin:"";}catch(r){i="";}let a=((We=t("key"))!=null?We:"").trim(),l=((Xe=t("api-host"))!=null?Xe:i).trim().replace(/\/+$/,""),f=t("consent"),g=n("respect-dnt",false),m=n("heatmaps",true),E=n("errors",true),I=t("release"),p=t("attribution"),h=p==="always"||p==="off"?p:"consent",S=t("referral-param")||"ref",C=(Je=t("replay-src"))!=null?Je:o?o.replace(/(\.min)?\.js(\?[^#]*)?(#.*)?$/,`-replay$1.js?v=${ne}`):"",H=new URLSearchParams(window.location.search),q=at(H.get(ot)),W=H.get(st)==="1",Rt=yt(),Se=f==="cookies"||f==="off"?f:"cookieless",Me=n("replay",false),fe="",$,X,k=null,pe=false,Ae=false,$e=null,Oe=null,Le=window.location.pathname,P=[],ge=new Set,Te=[],b=()=>g&&Rt?"off":Se,M=()=>!W&&b()!=="off",O=()=>$!=null?$:fe,J=()=>b()==="cookies"?O():$;a||_('No public key. Add data-key="mrr_pub_\u2026" to the script tag; nothing is tracked until then.');let Pe=(r=false)=>{if(!P.length)return;if(!a){P.length=0;return}let s=`${l}/api/sdk/events`;for(let c of Ze(a,P.splice(0),{v:ne,errors:E,platform:"web"}))r&&"sendBeacon"in navigator&&navigator.sendBeacon(s,c)||fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:c,keepalive:true}).then(u=>{u.ok||_(`Events were rejected with ${u.status}. Check data-key (MRRocket \u203A Settings \u203A Products).`);}).catch(()=>_(`Could not reach ${l||"this origin"} to send events. Check data-api-host.`));},x=null,v=null,F=(r,s,c=Date.now(),d)=>{if(!M())return;let u=gt(r)?Ce():null;P.push({event:r,props:u?{...s,$referral:{code:u.code,clickId:u.clickId}}:s,distinctId:J(),sessionId:_e(b()==="cookies"),ts:c,url:d!=null?d:window.location.href,referrer:w.referrer,...w.utm,screen:{w:window.screen.width,h:window.screen.height}});},G=(r,s)=>{typeof r!="string"||!r||(F(r,s),M()&&(x==null||x.event(r)));},Ne=(r,s)=>{if(!M())return;let c=`${window.location.pathname}|${r}`;ge.has(c)||(ge.add(c),G("$exposure",{experiment:r,variant:s}));},K=()=>{if(!k)return;let r=document.querySelectorAll("[data-ck-text]");if(!r.length)return;let s=ct(k,O(),q),c=new Set;r.forEach(d=>{var Z,ze;let u=d.dataset.ckText;if(!u)return;c.add(u),d.dataset.ckDefault===void 0&&(d.dataset.ckDefault=(Z=d.textContent)!=null?Z:"");let y=(ze=s[u])!=null?ze:d.dataset.ckDefault;d.textContent!==y&&(d.textContent=y);});for(let d of k.experiments)d.variants.some(u=>{var y;return Object.keys((y=u.changes)!=null?y:{}).some(Z=>c.has(Z))})&&Ne(d.key,re(d.key,k,O(),q));},De=()=>{var r,s;return (s=(r=k==null?void 0:k.referral)==null?void 0:r.cookieDays)!=null?s:60},Ue=()=>h==="always"?b()!=="off":h==="consent"&&b()==="cookies",He=null,me=false,he=()=>{if(!pe||W)return;if(h==="off"||b()==="off"){ft(),(h==="off"||me)&&de();return}let r=window.location.href;He!==r&&(He=r,pt({search:window.location.search,param:S,store:Ue(),days:De(),beacon:a?({code:s,clickId:c})=>fetch(`${l}/api/sdk/affiliate/click`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:a,code:s,clickId:c,url:r,referrer:document.referrer||void 0}),keepalive:true}).then(d=>d.ok?d.json():null).then(d=>{var u;return (u=d==null?void 0:d.clickId)!=null?u:null}):void 0}));},Et=()=>{let r=Ue(),s=Ce();r&&s?se(s,De()):!r&&me&&de(),me=r;},z=null,Ct=()=>z!=null?z:z=new Promise((r,s)=>{if(T.__mrrocketReplay)return r(T.__mrrocketReplay);if(!C)return s(new Error("no recorder address"));let c=document.createElement("script");c.async=true,c.src=C,c.onload=()=>T.__mrrocketReplay?r(T.__mrrocketReplay):s(new Error("recorder missing")),c.onerror=()=>s(new Error("recorder did not load")),document.head.appendChild(c);}).catch(r=>{throw z=null,r}),Fe=0,Ke=false,je=()=>{var d,u;let r=M()&&Me&&!!(k!=null&&k.replay)&&!!a;if(r===Ke)return;Ke=r;let s=++Fe;if(!r){x==null||x.stop(true),x=null;return}let c=(u=(d=k==null?void 0:k.replay)==null?void 0:d.sampleRate)!=null?u:.1;Ct().then(y=>y.startReplay({host:l,apiKey:a,sessionId:_e(b()==="cookies"),distinctId:J(),identified:!!$,sampleRate:c,warn:_})).then(y=>{s!==Fe?y==null||y.stop(true):x=y;}).catch(()=>_("Session recording could not start (the recorder did not load)."));},ke=()=>{!Ae||!M()||Oe===window.location.pathname||(Oe=window.location.pathname,G("$pageview",{path:window.location.pathname}));},A=null,Ve=()=>{let r=A;m&&r&&r.max>0&&F("$scroll",{depth:r.max,docH:r.docH,vw:window.innerWidth,vh:window.innerHeight},Date.now(),r.url),A=null;},j=()=>{var u,y;if(!m||!M()||W)return;let r=document.documentElement,s=Math.max(r.scrollHeight,(y=(u=document.body)==null?void 0:u.scrollHeight)!=null?y:0),c=nt(),d=window.location.href;(A==null?void 0:A.url)!==d?A={url:d,max:c,docH:s}:c>A.max&&(A={url:d,max:c,docH:s});},Be=()=>{let r=window.location.pathname;r!==Le&&(Le=r,Ve(),Ie(),x==null||x.page(r),v==null||v.crumb("navigation",r),ke(),he(),window.setTimeout(()=>{j(),K();},0));},Ye=()=>{let r=b(),s=$e;$e=r,s==="cookies"&&r!=="cookies"&&(Y(L),Y(U)),r==="off"&&(P.length=0,w.session=void 0),fe=ve(r),Et(),he(),je(),ke(),j();},Q={track:G,identify:(r,s)=>{if(typeof r!="string"||!r)return;let c=J();$=r,F("$identify",{...s,id:r,...c&&c!==r?{previousId:c}:{}}),x==null||x.identify(r),b()==="cookies"&&ue(L,r,be),X={...s,id:r},K();},reset:()=>{$=void 0,X=void 0,ge.clear(),b()==="cookies"&&(Y(L),Y(U)),w.id=void 0,w.session=void 0,fe=ve(b()),K();},captureError:r=>v==null?void 0:v.capture(r,"manual"),setConsent:r=>{let{analytics:s,replay:c}=typeof r=="string"?{analytics:r,replay:void 0}:r!=null?r:{};if(s!==void 0&&s!=="cookieless"&&s!=="cookies"&&s!=="off"){_(`setConsent: "${String(s)}" is not a consent mode. Use "cookieless", "cookies" or "off".`);return}s==="off"&&(P.length=0),s&&(Se=s),typeof c=="boolean"&&(Me=c),Ye();},getFlag:r=>Re(r,k,O(),{...X})!==false,getFlagVariant:r=>{let s=Re(r,k,O(),{...X});return typeof s=="string"?s:null},getVariant:r=>{let s=re(r,k,O(),q);return (k||q[r])&&Ne(r,s),s},ready:r=>{typeof r=="function"&&(pe?window.setTimeout(()=>r(Q),0):Te.push(r));},getDistinctId:O,version:ne};Ie(),Ye();let N=T.mrrocket,bt=(Ge=N==null?void 0:N.q)!=null?Ge:[],ye=N&&typeof N=="object"?N:{};Object.assign(ye,Q,{__loaded:true}),delete ye.q,T.mrrocket=ye;for(let[r,s]of bt){let c=Q[r];if(typeof c=="function")try{c(...Array.from(s!=null?s:[]));}catch(d){console.error(d);}}Ae=true,ke(),E&&a&&!W&&(v=lt({host:l,apiKey:a,release:I,context:()=>{var r;return {send:M(),distinctId:J(),sessionId:(r=w.session)==null?void 0:r.id}},warn:_}),v.crumb("navigation",window.location.pathname));for(let r of ["pushState","replaceState"]){let s=history[r];history[r]=function(...c){let d=s.apply(this,c);return Be(),d};}window.addEventListener("popstate",Be);let vt=new te;document.addEventListener("click",r=>{var y;let s=r.target instanceof Element?r.target.closest("[data-ck-goal]"):null;if(s!=null&&s.dataset.ckGoal&&G(s.dataset.ckGoal,{text:(y=s.textContent)==null?void 0:y.trim().slice(0,80)}),!M())return;let c=tt(r);if(!c)return;let d=vt.push(c.x,c.y,Date.now());if((c.label||c.selector)&&(v==null||v.crumb("click",c.label||c.selector)),x==null||x.click(c,d),!m)return;let u={x:c.x,y:c.y,vw:c.vw,vh:c.vh,docH:c.docH,selector:c.selector,label:c.label,dead:!c.interactive};F("$click",u),d&&F("$rageclick",u);});let we=0;window.addEventListener("scroll",()=>{we||(we=window.requestAnimationFrame(()=>{we=0,j();}));},{passive:true}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>j()):j(),window.setInterval(()=>Pe(),2e3),window.addEventListener("pagehide",()=>{Ve(),Pe(true);});let xe=()=>{pe=true,he(),je(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",K):K();for(let r of Te.splice(0))try{r(Q);}catch(s){console.error(s);}};a?fetch(`${l}/api/sdk/config?key=${encodeURIComponent(a)}`).then(r=>(r.ok||_(`Config request to ${l||"this origin"} answered ${r.status}. Check data-key and data-api-host.`),r.ok?r.json():null)).then(r=>{r&&Array.isArray(r.experiments)&&(k=r),xe();}).catch(()=>{_(`Could not reach ${l||"this origin"}. Check data-api-host. The page keeps its own texts and flags stay off.`),xe();}):xe();},xt;typeof window!="undefined"&&typeof document!="undefined"&&!((xt=T.mrrocket)!=null&&xt.__loaded)&&Gt();})();
1
+ (function(){'use strict';var Yt=Object.defineProperty;var Xt=(e,t,r)=>t in e?Yt(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var oe=(e,t,r)=>Xt(e,typeof t!="symbol"?t+"":t,r);var pt=e=>{let t=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t+=1:s<2048?t+=2:s>=55296&&s<=56319&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(t+=4,r++):t+=3;}return t},Gt=(e,t,r)=>{let s=`{"key":${JSON.stringify(e)},"sdk":${JSON.stringify(r)},"events":[`,a=pt(s)+2,c=[],f=[],C=[],v=a,g=()=>{f.length&&c.push({body:`${s}${f.join(",")}]}`,events:C}),f=[],C=[],v=a;};for(let R of t){let b=JSON.stringify(R),k=pt(b)+1;a+k>6e4||((f.length===100||v+k>6e4)&&g(),f.push(b),C.push(R),v+=k);}return g(),c},gt=(e,t,r)=>Gt(e,t,r).map(s=>s.body);var le=class{constructor(t=1e3,r=30,s=3){oe(this,"windowMs",t);oe(this,"radius",r);oe(this,"count",s);oe(this,"clicks",[]);oe(this,"fired",false);}push(t,r,s){let a=this.clicks.filter(c=>s-c.t<=this.windowMs&&Math.hypot(c.x-t,c.y-r)<=this.radius);return a.length!==this.clicks.length&&(this.fired=false),this.clicks=[...a,{x:t,y:r,t:s}],this.clicks.length>=this.count&&!this.fired?(this.fired=true,true):false}};var Jt='a[href],button,input,select,textarea,label,summary,[role="button"],[role="link"],[role="tab"],[role="menuitem"],[role="checkbox"],[role="switch"],[onclick],[data-ck-goal]',zt="[data-ck-mask]",Qt="[data-ck-block]",mt=/\d{4,}|^[a-z]{1,3}-[a-z0-9]{5,}$|^_|__|css-|^sc-|^jsx-/i,Zt=e=>{let t=e.tagName.toLowerCase();if(e.id&&!mt.test(e.id)&&e.id.length<=40)return `${t}#${e.id}`;let r=typeof e.className=="string"?e.className.split(/\s+/).filter(c=>c&&!mt.test(c)&&c.length<=30&&!c.includes(":")):[],s=r.length?`${t}.${r.slice(0,2).join(".")}`:t,a=e.parentElement?[...e.parentElement.children].filter(c=>c.tagName===e.tagName):[];return a.length>1?`${s}:nth-of-type(${a.indexOf(e)+1})`:s},en=e=>{let t=[],r=e;for(;r&&t.length<3&&r.tagName&&r.tagName!=="BODY"&&r.tagName!=="HTML";){let s=Zt(r);if(t.unshift(s),s.includes("#"))break;r=r.parentElement;}return t.join(" > ").slice(0,160)},xe=e=>(e!=null?e:"").replace(/\s+/g," ").trim().slice(0,40),tn=e=>{var r,s,a,c,f;if(e.closest(`${zt},${Qt}`))return "";let t=e.tagName.toLowerCase();if(t==="input"){let C=((r=e.getAttribute("type"))!=null?r:"text").toLowerCase();return xe(C==="submit"||C==="button"?(s=e.getAttribute("aria-label"))!=null?s:e.value:e.getAttribute("aria-label"))}return xe(t==="select"||t==="textarea"?e.getAttribute("aria-label"):(f=(c=(a=e.getAttribute("aria-label"))!=null?a:e.getAttribute("title"))!=null?c:e.innerText)!=null?f:e.textContent)},ht=e=>{var c,f;let t=e.target instanceof Element?e.target:null;if(!t)return null;let r=t.closest(Jt),s=r!=null?r:t,a=document.documentElement;return {x:Math.round(e.clientX),y:Math.round(e.clientY+window.scrollY),vw:window.innerWidth,vh:window.innerHeight,docH:Math.max(a.scrollHeight,(f=(c=document.body)==null?void 0:c.scrollHeight)!=null?f:0),selector:en(s),label:r?tn(r):"",interactive:!!r}},wt=()=>{var r,s;let e=document.documentElement,t=Math.max(e.scrollHeight,(s=(r=document.body)==null?void 0:r.scrollHeight)!=null?s:0);return t?Math.min(100,Math.round((window.scrollY+window.innerHeight)/t*100)):0};var ve="0.9.0",nn=(e,t)=>{let r=t.trim().toLowerCase();for(let[s,a]of Object.entries(e))if(s.toLowerCase()===r)return a},rn=(e,t)=>{let r=e.trim().toLowerCase(),s=t.trim().toLowerCase();return s.startsWith("@")?r.endsWith(s):r===s},on=(e,t)=>{if(e.op==="in cohort")return false;let r=nn(t,e.property),s=r==null?"":String(r);if(e.op==="\u2265"){let c=Number(s),f=Number(e.values[0]);return s!==""&&Number.isFinite(c)&&Number.isFinite(f)&&c>=f}let a=s!==""&&e.values.some(c=>rn(s,c));return e.op==="is"||e.op==="in"?a:!a},sn=(e,t,r={})=>{var C;if(!e.on)return false;let s={id:t,...r},a=e.sets.length?e.sets.find(v=>v.conditions.every(g=>on(g,s))):{rollout:100};if(!a||kt(`${e.key}:rollout:${t}`)*100>=a.rollout)return false;if(!((C=e.variants)!=null&&C.length))return true;let c=kt(`${e.key}:variant:${t}`)*100,f=0;for(let v of e.variants)if(f+=v.split,c<f)return v.key;return e.variants[e.variants.length-1].key},Ke=(e,t,r,s={})=>{var c;let a=(c=t==null?void 0:t.flags)==null?void 0:c.find(f=>f.key===e);return a?sn(a,r,s):false},an=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],yt="ck_preview",bt="ck_embed",Q="ck_id",se="ck_sid";var cn=e=>{var r;let t={};for(let s of an){let a=(r=e(s))==null?void 0:r.trim();a&&(t[s]=a.slice(0,150));}return t},Ct=e=>{let t=new URLSearchParams(e);return cn(r=>t.get(r))};var ln=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296},kt=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,(t>>>0)/4294967296},dn=(e,t)=>{var c,f,C,v;let r=(f=(c=e.variants[0])==null?void 0:c.id)!=null?f:"control";if(e.winner)return e.winner;if(e.status!=="running")return r;let s=ln(`${e.key}:${t}`),a=0;for(let g of e.variants)if(a+=g.weight,s<a)return g.id;return (v=(C=e.variants[e.variants.length-1])==null?void 0:C.id)!=null?v:r},xt=e=>{let t=Array.isArray(e)?e[0]:e;if(!t)return {};let r={};for(let s of t.split(",")){let[a,c]=s.split(":");a&&c&&(r[a.trim()]=c.trim());}return r};var ue=(e,t,r,s)=>{if(s[e])return s[e];let a=t==null?void 0:t.experiments.find(c=>c.key===e);return a?dn(a,r):"control"},Rt=(e,t,r)=>{var a,c,f,C,v,g;let s={...(a=e==null?void 0:e.texts)!=null?a:{}};for(let R of (c=e==null?void 0:e.experiments)!=null?c:[]){let b=ue(R.key,e,t,r);b!==((C=(f=R.variants[0])==null?void 0:f.id)!=null?C:"control")&&Object.assign(s,(g=(v=R.variants.find(k=>k.id===b))==null?void 0:v.changes)!=null?g:{});}return s},de="ck_x",Re=e=>e.replace(/\/+$/,"")||"/",vt=(e,t,r,s={})=>{var C,v;if(!e)return null;let a;try{a=new URL(t);}catch(g){return null}if(a.searchParams.has(de))return null;let c=Re(a.pathname),f=(g,R)=>{let b;try{b=new URL(g,a);}catch(k){return}if(!(!/^https?:$/.test(b.protocol)||b.origin===a.origin&&Re(b.pathname)===c))return a.searchParams.forEach((k,x)=>{b.searchParams.has(x)||b.searchParams.set(x,k);}),R&&b.searchParams.set(de,R),b.hash||(b.hash=a.hash),b.href};for(let g of (C=e.redirects)!=null?C:[]){let R=g.from&&Re(g.from)===c?f(g.to):void 0;if(R)return {to:R}}for(let g of e.experiments){if(!g.path||Re(g.path)!==c)continue;let R=g.status==="running"&&!g.winner;if(R&&r===null&&!s[g.key])return null;let b=ue(g.key,e,r!=null?r:"",s),k=(v=g.variants.find(P=>P.id===b))==null?void 0:v.url,x=k?f(k,R?`${g.key}:${b}`:void 0):void 0;return R?{to:x,experiment:g.key,variant:b}:x?{to:x}:null}return null},Et=(e,t)=>{let[r,s]=(t!=null?t:"").split(":"),a=e==null?void 0:e.experiments.find(c=>c.key===r);return a&&a.variants.some(c=>c.id===s)?{experiment:r,variant:s}:null};var We=()=>typeof crypto!="undefined"&&"randomUUID"in crypto?crypto.randomUUID():`ck_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;var fe=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e,un=e=>{var t;if(e instanceof Error)return {type:e.name||"Error",message:fe(e.message||String(e),1e3),stack:e.stack?fe(e.stack,8192):void 0};if(typeof e=="string")return {type:"Error",message:fe(e,1e3)};try{return {type:"Error",message:fe((t=JSON.stringify(e))!=null?t:String(e),1e3)}}catch(r){return {type:"Error",message:String(e)}}},_t=e=>{let t=[],r=[],s=new Set,a=0,c=`${e.host}/api/sdk/errors`,f=(k=false)=>{for(;t.length;){let x=JSON.stringify({key:e.apiKey,errors:t.splice(0,4)});k&&typeof navigator!="undefined"&&"sendBeacon"in navigator&&navigator.sendBeacon(c,x)||fetch(c,{method:"POST",headers:{"content-type":"application/json"},body:x,keepalive:true}).then(I=>{!I.ok&&I.status!==429&&e.warn(`Error reports were rejected with ${I.status}. Check the public key and NEXT_PUBLIC_MRROCKET_HOST.`);}).catch(()=>{});}},C=(k,x="manual")=>{let P=e.context();if(!P.send||a>=20)return;let I=un(k);if(/\/api\/sdk\/errors/.test(I.message))return;let A=`${I.type}:${I.message}`;s.has(A)||(s.add(A),a++,t.push({...I,mechanism:x,handled:x==="manual",url:window.location.href,ts:Date.now(),crumbs:r.slice(),...e.release?{release:e.release}:{},...P.distinctId?{distinctId:P.distinctId}:{},...P.sessionId?{sessionId:P.sessionId}:{}}));},v=k=>{var x;!k.error&&(!k.message||k.message==="Script error.")||C((x=k.error)!=null?x:new Error(k.message),"onerror");},g=k=>{var x;return C((x=k.reason)!=null?x:new Error("Unhandled promise rejection"),"onunhandledrejection")},R=()=>f(true);window.addEventListener("error",v),window.addEventListener("unhandledrejection",g),window.addEventListener("pagehide",R);let b=window.setInterval(()=>f(),2e3);return {capture:C,crumb:(k,x)=>{r.push({ts:Date.now(),type:k,message:fe(x,120)}),r.length>20&&r.shift();},stop:()=>{window.removeEventListener("error",v),window.removeEventListener("unhandledrejection",g),window.removeEventListener("pagehide",R),window.clearInterval(b),f(true);}}};var pe="$cancel_flow",Z="$onboarding",Be="$inapp",fn={version:0,question:"",reasons:[],offers:{},confirm:{title:"Cancel your subscription?",body:"You keep access until the end of the billing period.",button:"Cancel subscription"},offersFor:"business"},pn="Something went wrong. Please try again.",gn="mrrocket:onboarding",St=e=>e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),It=new Set(["signed_up","signup","sign_up","registered","account_created","user_signed_up"]),Ft=(e,t)=>{let r=St(e),s=St(t);return !r||!s?false:r===s||It.has(r)&&It.has(s)},mn=e=>/^(first (launch|visit|open|session|login|sign ?in|app open)|app (opened|launched)|on load|every visit|always)?$/i.test(e.trim()),hn=()=>`cf_${Math.random().toString(36).slice(2,10)}${Date.now().toString(36)}`;var wn=e=>{let t=(e!=null?e:"").trim();return /^https?:\/\//i.test(t)||/^\/(?!\/)/.test(t)?t:void 0},Ot=e=>{let t=null,r=null,s=null,a=[],c=false,f=null,C,v=null,g=new Map,R=new Set,b=new Set,k=new Set,x=e.auto!==false,P=()=>{var n;return (n=t==null?void 0:t.onboarding)!=null?n:[]},I=n=>n?P().find(i=>i.id===n):void 0,A=n=>{let i=g.get(n);return i||g.set(n,i={done:new Set,dismissed:false}),i},W=n=>{let i=g.get(n.id);return !!i&&(i.dismissed||n.steps.every(u=>i.done.has(u.id)))},he=n=>`${gn}:${n!=null?n:"visitor"}`,K=()=>{var u;let n=(u=e.storage)==null?void 0:u.call(e);if(!n)return;let i={};for(let[m,y]of g)i[m]={done:[...y.done],...y.dismissed?{dismissed:true}:{}};try{n.set(he(e.personId()),JSON.stringify(i));}catch(m){}},B=n=>{var i;for(let[u,m]of Object.entries(n!=null?n:{})){let y=A(u);for(let S of (i=m.done)!=null?i:[])y.done.add(S);m.dismissed&&(y.dismissed=true);}},D=()=>{let n=I(s);if(!n)return null;let i=A(n.id),u=n.steps.findIndex(y=>!i.done.has(y.id));if(u<0||i.dismissed)return null;let m=n.steps[u];if(m.kind==="checklist"){let y=u;for(;y>0&&n.steps[y-1].kind==="checklist";)y--;let S=u;for(;S+1<n.steps.length&&n.steps[S+1].kind==="checklist";)S++;return {type:"checklist",flow:n,items:n.steps.slice(y,S+1).map(w=>({step:w,done:i.done.has(w.id)}))}}return {type:"step",flow:n,step:m,index:u,total:n.steps.length,last:u===n.steps.length-1}},z=()=>{if(r){let u=r.reason?r.flow.offers[r.reason]:void 0;return {type:"cancel",screen:r.screen,flow:r.flow,reason:r.reason,offer:r.screen==="offer"?u:void 0,price:r.options.price,busy:r.busy,error:r.error,step:r.plain||r.screen==="survey"?1:r.screen==="offer"?2:3,steps:r.plain?1:3}}let n=D();if(n)return n;s&&(s=null);let i=a.find(u=>!R.has(u.id));return i?{type:"message",message:i}:null},F=()=>{let n=z();if((n==null?void 0:n.type)==="step"&&!b.has(`s:${n.step.id}`))b.add(`s:${n.step.id}`),e.track(Z,{flow:n.flow.id,step:n.step.id,kind:n.step.kind,action:"shown"});else if((n==null?void 0:n.type)==="checklist")for(let i of n.items)!i.done&&!b.has(`s:${i.step.id}`)&&(b.add(`s:${i.step.id}`),e.track(Z,{flow:n.flow.id,step:i.step.id,kind:"checklist",action:"shown"}));else (n==null?void 0:n.type)==="message"&&!b.has(`m:${n.message.id}`)&&(b.add(`m:${n.message.id}`),e.track(Be,{message:n.message.id,journey:n.message.journey,action:"shown"}));for(let i of [...k])try{i();}catch(u){}},ee=n=>s===n.id?true:s&&I(s)&&!W(I(s))?false:(s=n.id,e.track(Z,{flow:n.id,action:"started"}),F(),true),we=()=>{var i;if(!x||s||!c||!e.personId()&&!((i=e.storage)!=null&&i.call(e)))return;let n=P().find(u=>mn(u.trigger)&&u.steps.length&&!W(u));n&&ee(n);},ie=()=>{let n=e.personId();v!==null&&v!==n&&(g.clear(),R.clear(),s=null,C=void 0),v=n;let i=(async()=>{var y,S;let u=(y=e.storage)==null?void 0:y.call(e);if(u)try{let w=await u.get(he(n));w&&B(JSON.parse(w));}catch(w){}let m=P().length>0||!!(t!=null&&t.messages);if(n&&m&&C!==n){C=n;let w=await e.fetchInApp(n).catch(()=>null);w&&e.personId()===n&&(B(w.onboarding),a=((S=w.messages)!=null?S:[]).filter(M=>M&&M.id&&M.title));}n||(a=[]),c=true,we(),F();})();return f=i.finally(()=>{f===i&&(f=null);}),f},T=(n,i,u)=>{var y;let m=n.reason?n.flow.offers[n.reason]:void 0;return {outcome:i,run:n.run,...n.reason?{reason:n.reason,reasonLabel:(y=n.flow.reasons.find(S=>S.id===n.reason))==null?void 0:y.label}:{},...i==="saved"&&m?{offer:m}:{},...u!=null&&u.trim()?{comment:u.trim().slice(0,500)}:{}}},q=(n,i)=>{var u;e.track(pe,{action:"finished",run:n.run,version:n.flow.version,outcome:i.outcome,customer:(u=n.options.customer)!=null?u:"consumer",...i.reason?{reason:i.reason}:{},...i.offer?{offer:i.offer.kind}:{},...i.comment?{comment:i.comment}:{}}),r===n&&(r=null),n.resolve(i),F();},_=(n,i,u)=>{if(n.busy)return;let m=T(n,i,u),y=i==="saved"?n.options.onSave:n.options.onCancel;n.busy=true,n.error=void 0,F(),Promise.resolve().then(()=>y==null?void 0:y(m)).then(()=>q(n,m),()=>{n.busy=false,n.error=pn,F();});};return {setConfig:n=>{t=n,s&&!I(s)&&(s=null),F();},refresh:ie,onEvent:n=>{var y;if(!n||n.startsWith("$"))return;let i=I(s),u=false;if(i){let S=A(i.id);for(let w of i.steps)w.kind==="checklist"&&w.event&&!S.done.has(w.id)&&Ft(w.event,n)&&(S.done.add(w.id),u=true,e.track(Z,{flow:i.id,step:w.id,kind:w.kind,action:"completed"}));}if(u&&(K(),F()),!x||!e.personId()&&!((y=e.storage)!=null&&y.call(e)))return;let m=P().find(S=>S.steps.length&&Ft(S.trigger,n)&&!W(S));m&&ee(m);},openCancelFlow:(n={})=>{var w,M;if(r)return r.promise;let i=(w=t==null?void 0:t.cancelFlow)!=null?w:fn,u=n.customer!=="business"||i.reasons.length<2,m=()=>{},y=new Promise(H=>m=H),S={flow:i,options:n,plain:u,screen:u?"confirm":"survey",run:hn(),busy:false,resolve:m,promise:y};return r=S,e.track(pe,{action:"shown",run:S.run,version:i.version,customer:(M=n.customer)!=null?M:"consumer",plain:u}),F(),y},startOnboarding:n=>{let i=n?I(n):P().find(m=>m.steps.length&&!W(m));if(!i||!i.steps.length)return false;let u=A(i.id);return u.dismissed=false,ee(i)},view:z,subscribe:n=>(k.add(n),()=>k.delete(n)),cancel:{pick:n=>{!r||r.busy||!r.flow.reasons.some(i=>i.id===n)||(r.reason=n,r.error=void 0,F());},next:()=>{let n=r;!n||n.screen!=="survey"||!n.reason||(e.track(pe,{action:"answered",run:n.run,version:n.flow.version,reason:n.reason}),n.screen=n.flow.offers[n.reason]?"offer":"confirm",F());},accept:n=>{let i=r;if(!i||i.screen!=="offer"||!i.reason)return;let u=i.flow.offers[i.reason];i.busy||e.track(pe,{action:"offer",run:i.run,version:i.flow.version,reason:i.reason,offer:u==null?void 0:u.kind,outcome:"accepted"}),_(i,"saved",n);},decline:()=>{var i;let n=r;!n||n.screen!=="offer"||n.busy||(e.track(pe,{action:"offer",run:n.run,version:n.flow.version,reason:n.reason,offer:n.reason?(i=n.flow.offers[n.reason])==null?void 0:i.kind:void 0,outcome:"declined"}),n.screen="confirm",n.error=void 0,F());},confirm:n=>{let i=r;!i||i.screen!=="confirm"||_(i,"cancelled",n);},close:()=>{var u,m;let n=r;if(!n||n.busy)return;let i=T(n,"kept");(m=(u=n.options).onClose)==null||m.call(u,i),q(n,i);}},onboarding:{next:()=>{let n=D();(n==null?void 0:n.type)==="step"&&(A(n.flow.id).done.add(n.step.id),e.track(Z,{flow:n.flow.id,step:n.step.id,kind:n.step.kind,action:"completed"}),K(),F());},check:n=>{let i=D();if((i==null?void 0:i.type)!=="checklist")return;let u=i.items.find(m=>m.step.id===n);!u||u.done||(A(i.flow.id).done.add(n),e.track(Z,{flow:i.flow.id,step:n,kind:"checklist",action:"completed"}),K(),F());},dismiss:()=>{let n=D();!n||n.type!=="step"&&n.type!=="checklist"||(A(n.flow.id).dismissed=true,e.track(Z,{flow:n.flow.id,...n.type==="step"?{step:n.step.id}:{},action:"dismissed"}),s=null,K(),F());}},message:{click:()=>{var u;let n=z();if((n==null?void 0:n.type)!=="message")return;R.add(n.message.id),e.track(Be,{message:n.message.id,journey:n.message.journey,action:"clicked"});let i=wn(n.message.url);F(),i&&((u=e.openUrl)==null||u.call(e,i));},dismiss:()=>{let n=z();(n==null?void 0:n.type)==="message"&&(R.add(n.message.id),e.track(Be,{message:n.message.id,journey:n.message.journey,action:"dismissed"}),F());}}}};var kn={get:e=>{try{return window.localStorage.getItem(e)}catch(t){return null}},set:(e,t)=>{try{window.localStorage.setItem(e,t);}catch(r){}}},Mt=()=>{try{for(let e=window.localStorage.length-1;e>=0;e--){let t=window.localStorage.key(e);t!=null&&t.startsWith("mrrocket:onboarding")&&window.localStorage.removeItem(t);}}catch(e){}},$t=e=>({track:e.track,personId:e.personId,auto:e.auto,storage:()=>e.canStore()?kn:null,openUrl:t=>window.location.assign(t),fetchInApp:async t=>{if(!e.apiKey)return null;let r=await fetch(`${e.host}/api/sdk/inapp?key=${encodeURIComponent(e.apiKey)}&distinctId=${encodeURIComponent(t)}`);return r.ok?await r.json():null}});var Se="mrr_ref",Ie="mrr_ref",yn="mrr_ref",bn="mrr_click";var ge=/^[A-Za-z0-9_-]{1,64}$/;var Cn=(e,t="ref")=>{let r=new URLSearchParams(e);return xn(s=>r.get(s),t)},xn=(e,t="ref")=>{let r=e(yn);if(r&&ge.test(r)){let a=e(bn);return {code:r,clickId:a&&ge.test(a)?a:null,direct:false}}let s=e(t);return s&&ge.test(s)?{code:s,clickId:null,direct:true}:null},Pt=e=>{var t;return `${e.code}.${(t=e.clickId)!=null?t:""}.${e.at}`},Ee=(e,t=60,r=Date.now())=>{if(!e)return null;let[s,a,c]=e.split("."),f=Number(c);return !s||!ge.test(s)||!Number.isFinite(f)||a&&!ge.test(a)||r-f>t*864e5||f>r+864e5?null:{code:s,clickId:a||null,at:f}};var L=null,Fe=()=>typeof document!="undefined",At=e=>{var r;if(!Fe())return;let t=(r=document.cookie.split("; ").find(s=>s.startsWith(`${e}=`)))==null?void 0:r.slice(e.length+1);try{return t?decodeURIComponent(t):void 0}catch(s){return t}},Oe=()=>{try{return typeof localStorage=="undefined"?null:localStorage}catch(e){return null}},qe=()=>{var e,t;return L||(Fe()?(t=Ee(At(Se),3650))!=null?t:Ee((e=Oe())==null?void 0:e.getItem(Ie),3650):null)};var _e=(e,t)=>{var a;if(!Fe())return;let r=Math.max(1,Math.round(t))*86400,s=typeof location!="undefined"&&location.protocol==="https:"?"; secure":"";document.cookie=`${Se}=${encodeURIComponent(Pt(e))}; path=/; max-age=${r}; samesite=lax${s}`;try{(a=Oe())==null||a.setItem(Ie,Pt(e));}catch(c){}},Me=()=>{var e;if(Fe()){document.cookie=`${Se}=; path=/; max-age=0; samesite=lax`;try{(e=Oe())==null||e.removeItem(Ie);}catch(t){}}},Lt=()=>{L=null;},Tt=async e=>{var s,a,c;let t=Cn(e.search,e.param),r=(s=e.now)!=null?s:Date.now();if(!t)return !L&&e.store&&(L=(c=Ee(At(Se),e.days,r))!=null?c:Ee((a=Oe())==null?void 0:a.getItem(Ie),e.days,r),L||Me()),L;if(L={code:t.code,clickId:t.clickId,at:r},e.store&&_e(L,e.days),e.beacon)try{let f=await e.beacon({code:t.code,clickId:t.clickId});f&&L&&L.code===t.code&&!L.clickId&&(L={...L,clickId:f},e.store&&_e(L,e.days));}catch(f){}return L},Nt=e=>e==="$identify"||!e.startsWith("$");var Ye=3600*24*365,Ht=e=>{var r;if(typeof document=="undefined")return;let t=(r=document.cookie.split("; ").find(s=>s.startsWith(`${e}=`)))==null?void 0:r.slice(e.length+1);if(t)try{return decodeURIComponent(t)}catch(s){return t}},$e=(e,t,r)=>{let s=window.location.protocol==="https:"?"; secure":"";document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${r}; samesite=lax${s}`;},me=e=>{document.cookie=`${e}=; path=/; max-age=0; samesite=lax`;},O={utm:{}},Dt=()=>{var e;return (e=O.id)!=null?e:O.id=We()},Xe=(e,t)=>{if(e!=="cookies")return Dt();let r=Ht(Q);if(r)return O.id=r;let s=Dt();return $e(Q,s,Ye),s},Ge=e=>{var a;let t=Date.now(),r=O.session,s=(a=e?Ht(se):void 0)!=null?a:r&&t-r.last<18e5?r.id:We();return O.session={id:s,last:t},e&&$e(se,s,18e5/1e3),s},Je=()=>{var r;let e=window.location.href;if(O.url===e)return;O.referrer=(r=O.url)!=null?r:document.referrer||void 0,O.url=e;let t=Ct(window.location.search);Object.keys(t).length&&(O.utm=t);},jt=()=>{let e=navigator,t=window;return e.doNotTrack==="1"||t.doNotTrack==="1"||e.globalPrivacyControl===true};var Pe=window,vn=()=>{var e,t;return (t=(e=document.currentScript)!=null?e:document.querySelector('script[data-key][src*="sdk"]'))!=null?t:document.querySelector("script[data-key][src*='mrrocket']")},Vt=new Set,V=e=>{Vt.has(e)||(Vt.add(e),console.warn(`[MRRocket] ${e}`));},En=()=>{var ct,lt,dt,ut;let e=vn(),t=o=>{var l;return (l=e==null?void 0:e.getAttribute(`data-${o}`))!=null?l:void 0},r=(o,l)=>{let d=t(o);return d===void 0?l:!["false","0","off","no"].includes(d.trim().toLowerCase())},s=(ct=e==null?void 0:e.src)!=null?ct:"",a="";try{a=s?new URL(s,window.location.href).origin:"";}catch(o){a="";}let c=((lt=t("key"))!=null?lt:"").trim(),f=((dt=t("api-host"))!=null?dt:a).trim().replace(/\/+$/,""),C=t("consent"),v=r("respect-dnt",false),g=r("heatmaps",true),R=r("errors",true),b=t("release"),k=t("attribution"),x=k==="always"||k==="off"?k:"consent",P=t("referral-param")||"ref",I={},A=(o,l)=>{var d;return (d=I[o])!=null?d:I[o]=new Promise((p,h)=>{var ft;let E=()=>Pe[l];if(E())return p(E());let U=(ft=t(`${o}-src`))!=null?ft:s?s.replace(/(\.min)?\.js(\?[^#]*)?(#.*)?$/,`-${o}$1.js?v=${ve}`):"";if(!U)return h(new Error(o));let J=document.createElement("script");J.async=true,J.src=U,J.onload=()=>E()?p(E()):h(new Error(o)),J.onerror=()=>h(new Error(o)),document.head.appendChild(J);}).catch(p=>{throw I[o]=void 0,p})},W=t("theme"),he={theme:W==="light"||W==="dark"?W:"auto",accent:t("accent")},K=new URLSearchParams(window.location.search),B=xt(K.get(yt)),D=K.get(bt)==="1",z=K.get(de);if(z!==null){K.delete(de);let o=K.toString();history.replaceState(history.state,"",`${window.location.pathname}${o?`?${o}`:""}${window.location.hash}`);}let F=jt(),ee=C==="cookies"||C==="off"?C:"cookieless",we=r("replay",false),ie="",T,q,_=null,Y=false,Ae=false,n=null,i=null,u=window.location.pathname,m=[],y=new Set,S=[],w=()=>v&&F?"off":ee,M=()=>!D&&w()!=="off",H=()=>T!=null?T:ie,ke=()=>w()==="cookies"?H():T;c||V('No public key. Add data-key="mrr_pub_\u2026" to the script tag; nothing is tracked until then.');let Le=(o=false)=>{if(!m.length)return;if(!c){m.length=0;return}let l=`${f}/api/sdk/events`;for(let d of gt(c,m.splice(0),{v:ve,errors:R,platform:"web"}))o&&"sendBeacon"in navigator&&navigator.sendBeacon(l,d)||fetch(l,{method:"POST",headers:{"content-type":"application/json"},body:d,keepalive:true}).then(h=>{h.ok||V(`Events were rejected with ${h.status}. Check data-key (MRRocket \u203A Settings \u203A Products).`);}).catch(()=>V(`Could not reach ${f||"this origin"} to send events. Check data-api-host.`));},$=null,j=null,te=(o,l,d=Date.now(),p)=>{if(!M())return;let h=Nt(o)?qe():null;m.push({event:o,props:h?{...l,$referral:{code:h.code,clickId:h.clickId}}:l,distinctId:ke(),sessionId:Ge(w()==="cookies"),ts:d,url:p!=null?p:window.location.href,referrer:O.referrer,...O.utm,screen:{w:window.screen.width,h:window.screen.height}});},ye=(o,l)=>{typeof o!="string"||!o||(te(o,l),M()&&($==null||$.event(o)),N.onEvent(o));},N=Ot($t({host:f,apiKey:c,track:te,personId:()=>M()?T:void 0,canStore:()=>w()==="cookies",auto:r("onboarding",true)})),Te=false;N.subscribe(()=>{Te||!N.view()||D||(Te=true,A("flows","__mrrocketFlows").then(o=>o.mountFlows(N,he)).catch(()=>{Te=false,V("The cancel flow and onboarding dialogs did not load. Check that sdk-flows.js is served next to sdk.js.");}));});let be=(o,l)=>{if(!M())return;let d=`${window.location.pathname}|${o}`;y.has(d)||(y.add(d),ye("$exposure",{experiment:o,variant:l}));},ze=()=>{let o=vt(_,window.location.href,H(),B);return o!=null&&o.to?(Le(true),window.location.replace(o.to),true):(o!=null&&o.experiment&&be(o.experiment,o.variant),false)},ae=()=>{if(!_)return;let o=document.querySelectorAll("[data-ck-text]");if(!o.length)return;let l=Rt(_,H(),B),d=new Set;o.forEach(p=>{var U,J;let h=p.dataset.ckText;if(!h)return;d.add(h),p.dataset.ckDefault===void 0&&(p.dataset.ckDefault=(U=p.textContent)!=null?U:"");let E=(J=l[h])!=null?J:p.dataset.ckDefault;p.textContent!==E&&(p.textContent=E);});for(let p of _.experiments)p.variants.some(h=>{var E;return Object.keys((E=h.changes)!=null?E:{}).some(U=>d.has(U))})&&be(p.key,ue(p.key,_,H(),B));},Qe=()=>{var o,l;return (l=(o=_==null?void 0:_.referral)==null?void 0:o.cookieDays)!=null?l:60},Ze=()=>x==="always"?w()!=="off":x==="consent"&&w()==="cookies",et=null,Ne=false,Ue=()=>{if(!Y||D)return;if(x==="off"||w()==="off"){Lt(),(x==="off"||Ne)&&Me();return}let o=window.location.href;et!==o&&(et=o,Tt({search:window.location.search,param:P,store:Ze(),days:Qe(),beacon:c?({code:l,clickId:d})=>fetch(`${f}/api/sdk/affiliate/click`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:c,code:l,clickId:d,url:o,referrer:document.referrer||void 0}),keepalive:true}).then(p=>p.ok?p.json():null).then(p=>{var h;return (h=p==null?void 0:p.clickId)!=null?h:null}):void 0}));},Wt=()=>{let o=Ze(),l=qe();o&&l?_e(l,Qe()):!o&&Ne&&Me(),Ne=o;},tt=0,nt=false,rt=()=>{var p,h;let o=M()&&we&&!!(_!=null&&_.replay)&&!!c;if(o===nt)return;nt=o;let l=++tt;if(!o){$==null||$.stop(true),$=null;return}let d=(h=(p=_==null?void 0:_.replay)==null?void 0:p.sampleRate)!=null?h:.1;A("replay","__mrrocketReplay").then(E=>E.startReplay({host:f,apiKey:c,sessionId:Ge(w()==="cookies"),distinctId:ke(),identified:!!T,sampleRate:d,warn:V})).then(E=>{l!==tt?E==null||E.stop(true):$=E;}).catch(()=>V("Session recording could not start (the recorder did not load)."));},ot=r("messenger",false),X=null,ne=o=>{D||c&&(X!=null||(X=A("messenger","__mrrocketMessenger").then(l=>{var E;let d=U=>t(`messenger-${U}`)===void 0?void 0:r(`messenger-${U}`,true),p=t("messenger-position"),h=(E=t("messenger-theme"))!=null?E:W;return l.mountMessenger({host:f,apiKey:c,distinctId:H,user:()=>q,launcher:ot,position:p==="bottom-left"||p==="bottom-right"?p:void 0,title:t("messenger-title"),greeting:t("messenger-greeting"),label:t("messenger-label"),askEmail:d("ask-email"),help:d("help"),sound:d("sound"),preview:d("preview"),theme:h==="light"||h==="dark"||h==="auto"?h:void 0,accent:t("accent")})})),X.then(o).catch(()=>{X=null,V("sdk-messenger.js did not load.");}));},De=()=>{!Ae||!M()||i===window.location.pathname||(i=window.location.pathname,ye("$pageview",{path:window.location.pathname}));},G=null,st=()=>{let o=G;g&&o&&o.max>0&&te("$scroll",{depth:o.max,docH:o.docH,vw:window.innerWidth,vh:window.innerHeight},Date.now(),o.url),G=null;},ce=()=>{var h,E;if(!g||!M()||D)return;let o=document.documentElement,l=Math.max(o.scrollHeight,(E=(h=document.body)==null?void 0:h.scrollHeight)!=null?E:0),d=wt(),p=window.location.href;(G==null?void 0:G.url)!==p?G={url:p,max:d,docH:l}:d>G.max&&(G={url:p,max:d,docH:l});},it=()=>{let o=window.location.pathname;o!==u&&(u=o,!(Y&&ze())&&(st(),Je(),$==null||$.page(o),j==null||j.crumb("navigation",o),De(),Ue(),window.setTimeout(()=>{ce(),ae();},0)));},at=()=>{let o=w(),l=n;n=o,l==="cookies"&&o!=="cookies"&&(me(Q),me(se)),o==="off"&&(m.length=0,O.session=void 0),l==="cookies"&&o!=="cookies"&&Mt(),ie=Xe(o),Wt(),Ue(),rt(),De(),ce();},Ce={track:ye,identify:(o,l)=>{if(typeof o!="string"||!o)return;let d=ke();T=o,te("$identify",{...l,id:o,...d&&d!==o?{previousId:d}:{}}),$==null||$.identify(o),w()==="cookies"&&$e(Q,o,Ye),q={...l,id:o},ae(),Y&&N.refresh();},reset:()=>{T=void 0,q=void 0,y.clear(),w()==="cookies"&&(me(Q),me(se)),O.id=void 0,O.session=void 0,ie=Xe(w()),ae(),Y&&N.refresh();},captureError:o=>j==null?void 0:j.capture(o,"manual"),setConsent:o=>{let{analytics:l,replay:d}=typeof o=="string"?{analytics:o,replay:void 0}:o!=null?o:{};if(l!==void 0&&l!=="cookieless"&&l!=="cookies"&&l!=="off"){V(`setConsent: "${String(l)}" is not a consent mode. Use "cookieless", "cookies" or "off".`);return}l==="off"&&(m.length=0),l&&(ee=l),typeof d=="boolean"&&(we=d),at(),Y&&N.refresh();},getFlag:o=>Ke(o,_,H(),{...q})!==false,getFlagVariant:o=>{let l=Ke(o,_,H(),{...q});return typeof l=="string"?l:null},getVariant:o=>{let l=ue(o,_,H(),B);return (_||B[o])&&be(o,l),l},ready:o=>{typeof o=="function"&&(Y?window.setTimeout(()=>o(Ce),0):S.push(o));},getDistinctId:H,cancelFlow:{open:o=>N.openCancelFlow(o)},onboarding:{start:o=>N.startOnboarding(o)},openCancelFlow:o=>N.openCancelFlow(o),startOnboarding:o=>N.startOnboarding(o),push:{subscribe:o=>{let l=M()?T:void 0;if(!l)return Promise.resolve({status:"not-signed-in"});let d=window.Notification,p=Promise.resolve(d&&d.permission==="default"&&(o==null?void 0:o.ask)!==false?d.requestPermission():d==null?void 0:d.permission);return A("push","__mrrocketPush").then(h=>h.subscribeWebPush({host:f,apiKey:c,distinctId:l,permission:p},o))},unsubscribe:()=>A("push","__mrrocketPush").then(o=>o.unsubscribeWebPush({host:f,apiKey:c,distinctId:T}))},messenger:{open:o=>ne(l=>l.open(o)),close:()=>{X==null?void 0:X.then(o=>o.close()).catch(()=>{});},toggle:()=>ne(o=>o.toggle())},openMessenger:()=>ne(o=>o.open()),version:ve};Je(),at();let re=Pe.mrrocket,Bt=(ut=re==null?void 0:re.q)!=null?ut:[],He=re&&typeof re=="object"?re:{};Object.assign(He,Ce,{__loaded:true}),delete He.q,Pe.mrrocket=He;for(let[o,l]of Bt){let d=Ce[o];if(typeof d=="function")try{d(...Array.from(l!=null?l:[]));}catch(p){console.error(p);}}Ae=true,De(),R&&c&&!D&&(j=_t({host:f,apiKey:c,release:b,context:()=>{var o;return {send:M(),distinctId:ke(),sessionId:(o=O.session)==null?void 0:o.id}},warn:V}),j.crumb("navigation",window.location.pathname));for(let o of ["pushState","replaceState"]){let l=history[o];history[o]=function(...d){let p=l.apply(this,d);return it(),p};}window.addEventListener("popstate",it);let qt=new le;document.addEventListener("click",o=>{var E;o.target instanceof Element&&o.target.closest("[data-ck-messenger]")&&(o.preventDefault(),ne(U=>U.open()));let l=o.target instanceof Element?o.target.closest("[data-ck-goal]"):null;if(l!=null&&l.dataset.ckGoal&&ye(l.dataset.ckGoal,{text:(E=l.textContent)==null?void 0:E.trim().slice(0,80)}),!M())return;let d=ht(o);if(!d)return;let p=qt.push(d.x,d.y,Date.now());if((d.label||d.selector)&&(j==null||j.crumb("click",d.label||d.selector)),$==null||$.click(d,p),!g)return;let h={x:d.x,y:d.y,vw:d.vw,vh:d.vh,docH:d.docH,selector:d.selector,label:d.label,dead:!d.interactive};te("$click",h),p&&te("$rageclick",h);});let je=0;window.addEventListener("scroll",()=>{je||(je=window.requestAnimationFrame(()=>{je=0,ce();}));},{passive:true}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ce()):ce(),window.setInterval(()=>Le(),2e3),window.addEventListener("pagehide",()=>{st(),Le(true);});let Ve=()=>{if(Y=true,ze())return;let o=Et(_,z);o&&be(o.experiment,o.variant),document.documentElement.classList.remove("ck-hide"),Ue(),rt(),N.setConfig(_),N.refresh(),ot&&(document.body?ne():document.addEventListener("DOMContentLoaded",()=>ne())),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ae):ae();for(let l of S.splice(0))try{l(Ce);}catch(d){console.error(d);}};c?fetch(`${f}/api/sdk/config?key=${encodeURIComponent(c)}`).then(o=>(o.ok||V(`Config request to ${f||"this origin"} answered ${o.status}. Check data-key and data-api-host.`),o.ok?o.json():null)).then(o=>{o&&Array.isArray(o.experiments)&&(_=o),Ve();}).catch(()=>{V(`Could not reach ${f||"this origin"}. Check data-api-host. The page keeps its own texts and flags stay off.`),Ve();}):Ve();},Kt;typeof window!="undefined"&&typeof document!="undefined"&&!((Kt=Pe.mrrocket)!=null&&Kt.__loaded)&&En();
2
+ })();
package/dist/browser.d.ts CHANGED
@@ -3,9 +3,10 @@
3
3
  * that the build keeps one client chunk: server components import these as client references, while the plain
4
4
  * helpers (`core`, `server`, `proxy`) stay free of the directive.
5
5
  */
6
- export { CockpitProvider, Experiment, Text, useCockpit, useFlag, useFlagVariant, useVariant, type CockpitProviderProps } from "./client.js";
6
+ export { CockpitProvider, Experiment, Text, useCancelFlow, useCockpit, useFlag, useFlagVariant, usePush, useVariant, type CockpitProviderProps } from "./client.js";
7
7
  export { FeedbackBoard, FeedbackWidget, useFeedback, type FeedbackBoardProps, type FeedbackWidgetProps } from "./feedback.js";
8
+ export { Messenger, useMessenger, type MessengerProps } from "./messenger.js";
8
9
  export { Survey } from "./survey.js";
9
10
  export type { CockpitUser } from "./context.js";
10
- export { type ChangelogEntry, type FeedbackBoardInfo, type FeedbackComment, type FeedbackList, type FeedbackPost, type FeedbackRoadmap, type PostStatus, type SurveyAnswer, type SurveyDefinition, type SurveyQuestion, type SurveyQuestionKind, createApi, } from "./api.js";
11
+ export { type ChangelogEntry, type ChatMessage, type ChatThread, type FeedbackBoardInfo, type FeedbackComment, type FeedbackList, type FeedbackPost, type FeedbackRoadmap, type PostStatus, type SurveyAnswer, type SurveyDefinition, type SurveyQuestion, type SurveyQuestionKind, createApi, } from "./api.js";
11
12
  export { CSS as WIDGET_CSS, useStyles } from "./styles.js";