mixpanel-browser 2.56.0 → 2.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/LICENSE +1 -15
- package/build.sh +3 -3
- package/dist/mixpanel-core.cjs.js +898 -410
- package/dist/mixpanel-recorder.js +897 -409
- package/dist/mixpanel-recorder.min.js +10 -10
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +898 -410
- package/dist/mixpanel.amd.js +898 -410
- package/dist/mixpanel.cjs.js +898 -410
- package/dist/mixpanel.globals.js +898 -410
- package/dist/mixpanel.min.js +122 -112
- package/dist/mixpanel.module.js +898 -410
- package/dist/mixpanel.umd.js +898 -410
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/externs.js +14 -0
- package/src/gdpr-utils.js +2 -1
- package/src/mixpanel-core.js +3 -2
- package/src/promise-polyfill.js +379 -0
- package/src/recorder/index.js +2 -1
- package/src/recorder/session-recording.js +2 -1
- package/src/request-batcher.js +185 -164
- package/src/request-queue.js +200 -147
- package/src/shared-lock.js +104 -98
- package/src/storage/local-storage.js +53 -0
- package/src/storage/wrapper.js +14 -0
- package/src/utils.js +16 -33
- package/src/window.js +20 -0
- package/dist/mixpanel.min.js.map +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){"use strict";var A;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(A||(A={}));function Mr(e){return e.nodeType===e.ELEMENT_NODE}function we(e){const t=e?.host;return t?.shadowRoot===e}function Me(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ir(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function Cr(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const 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 Ne(e){try{const t=e.rules||e.cssRules;return t?Ir(Array.from(t,It).join("")):null}catch{return null}}function It(e){let t;if(Or(e))try{t=Ne(e.styleSheet)||Cr(e)}catch{}else if(Er(e)&&e.selectorText.includes(":"))return _r(e.cssText);return t||e.cssText}function _r(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Or(e){return"styleSheet"in e}function Er(e){return"selectorText"in e}class Ct{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return 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){const 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){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Rr(){return new Ct}function rt({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let a=i||"";const l=n&&ie(n);return(t[r.toLowerCase()]||l&&t[l])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ie(e){return e.toLowerCase()}const _t="__rrweb_original__";function xr(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=_t in o?o[_t]:o;if(new Uint32Array(a.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(s=>s!==0))return!1}return!0}function nt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ie(t):null}function Ot(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const i=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(i);return(r=o?.[1])!==null&&r!==void 0?r:null}let kr=1;const Tr=new RegExp("[^a-z0-9-_:]"),Ie=-2;function Et(){return kr++}function Dr(e){if(e instanceof HTMLFormElement)return"form";const t=ie(e.tagName);return Tr.test(t)?"div":t}function Nr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let fe,Rt;const Ar=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Lr=/^(?:[a-z+]+:)?\/\//i,Fr=/^www\..*/i,Pr=/^(data:)([^,]*),(.*)/i;function Ae(e,t){return(e||"").replace(Ar,(r,n,i,o,a,l)=>{const s=i||a||l,c=n||o||"";if(!s)return r;if(Lr.test(s)||Fr.test(s))return`url(${c}${s}${c})`;if(Pr.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${Nr(t)+s}${c})`;const u=t.split("/"),h=s.split("/");u.pop();for(const m of h)m!=="."&&(m===".."?u.pop():u.push(m));return`url(${c}${u.join("/")}${c})`})}const Br=/^[^ \t\n\r\u000c]+/,Ur=/^[, \t\n\r\u000c]+/;function Wr(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a;const l=o.exec(t.substring(r));return l?(a=l[0],r+=a.length,a):""}const i=[];for(;n(Ur),!(r>=t.length);){let o=n(Br);if(o.slice(-1)===",")o=he(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=he(e,o);let l=!1;for(;;){const s=t.charAt(r);if(s===""){i.push((o+a).trim());break}else if(l)s===")"&&(l=!1);else if(s===","){r+=1,i.push((o+a).trim());break}else s==="("&&(l=!0);a+=s,r+=1}}}return i.join(", ")}function he(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function zr(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function it(){const e=document.createElement("a");return e.href="",e.href}function xt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?he(e,n):r==="srcset"?Wr(e,n):r==="style"?Ae(n,it()):t==="object"&&r==="data"?he(e,n):n)}function kt(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function Hr(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function Le(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Le(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return r?Le(e.parentNode,t,r):!1}function Tt(e,t,r,n){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Le(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function $r(e,t,r){const n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){const l=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),i=!0,t()});return}const 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 qr(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function jr(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:s={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:p=!1}=t,y=Gr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:A.Document,childNodes:[],compatMode:e.compatMode}:{type:A.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:A.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return Jr(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:s,maskInputFn:u,dataURLOptions:h,inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:p,rootId:y});case e.TEXT_NODE:return Vr(e,{needsMask:a,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:A.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:A.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function Gr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Vr(e,t){var r;const{needsMask:n,maskTextFn:i,rootId:o}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const s=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;if(s&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=Ne(e.parentNode.sheet))}catch(u){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${u}`,e)}l=Ae(l,it())}return c&&(l="SCRIPT_PLACEHOLDER"),!s&&!c&&l&&n&&(l=i?i(l,e.parentElement):l.replace(/[\S]/g,"*")),{type:A.Text,textContent:l||"",isStyle:s,rootId:o}}function Jr(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:s={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:m=!1,rootId:f}=t,g=Hr(e,n,i),p=Dr(e);let y={};const w=e.attributes.length;for(let v=0;v<w;v++){const b=e.attributes[v];kt(p,b.name,b.value)||(y[b.name]=xt(r,p,ie(b.name),b.value))}if(p==="link"&&o){const v=Array.from(r.styleSheets).find(M=>M.href===e.href);let b=null;v&&(b=Ne(v)),b&&(delete y.rel,delete y.href,y._cssText=Ae(b,v.href))}if(p==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const v=Ne(e.sheet);v&&(y._cssText=Ae(v,it()))}if(p==="input"||p==="textarea"||p==="select"){const v=e.value,b=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&v?y.value=rt({element:e,type:nt(e),tagName:p,value:v,maskInputOptions:a,maskInputFn:l}):b&&(y.checked=b)}if(p==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),p==="canvas"&&u){if(e.__context==="2d")xr(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const v=e.toDataURL(s.type,s.quality),b=document.createElement("canvas");b.width=e.width,b.height=e.height;const M=b.toDataURL(s.type,s.quality);v!==M&&(y.rr_dataURL=v)}}if(p==="img"&&c){fe||(fe=r.createElement("canvas"),Rt=fe.getContext("2d"));const v=e,b=v.crossOrigin;v.crossOrigin="anonymous";const M=()=>{v.removeEventListener("load",M);try{fe.width=v.naturalWidth,fe.height=v.naturalHeight,Rt.drawImage(v,0,0),y.rr_dataURL=fe.toDataURL(s.type,s.quality)}catch(B){console.warn(`Cannot inline img src=${v.currentSrc}! Error: ${B}`)}b?y.crossOrigin=b:v.removeAttribute("crossorigin")};v.complete&&v.naturalWidth!==0?M():v.addEventListener("load",M)}if(p==="audio"||p==="video"){const v=y;v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime,v.rr_mediaPlaybackRate=e.playbackRate,v.rr_mediaMuted=e.muted,v.rr_mediaLoop=e.loop,v.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){const{width:v,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${v}px`,rr_height:`${b}px`}}p==="iframe"&&!h(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let S;try{customElements.get(p)&&(S=!0)}catch{}return{type:A.Element,tagName:p,attributes:y,childNodes:[],isSVG:zr(e)||void 0,needBlock:g,rootId:f,isCustom:S}}function R(e){return e==null?"":e.toLowerCase()}function Xr(e,t){if(t.comment&&e.type===A.Comment)return!0;if(e.type===A.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ot(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||R(e.attributes.name)==="application-name"||R(e.attributes.rel)==="icon"||R(e.attributes.rel)==="apple-touch-icon"||R(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||R(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(R(e.attributes.name)==="robots"||R(e.attributes.name)==="googlebot"||R(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(R(e.attributes.name)==="author"||R(e.attributes.name)==="generator"||R(e.attributes.name)==="framework"||R(e.attributes.name)==="publisher"||R(e.attributes.name)==="progid"||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(R(e.attributes.name)==="google-site-verification"||R(e.attributes.name)==="yandex-verification"||R(e.attributes.name)==="csrf-token"||R(e.attributes.name)==="p:domain_verify"||R(e.attributes.name)==="verify-v1"||R(e.attributes.name)==="verification"||R(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function pe(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g={},inlineImages:p=!1,recordCanvas:y=!1,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:v=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:B=()=>!1,newlyAddedElement:P=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:k=!0}=t;!x&&e.childNodes&&(x=Tt(e,a,l,x===void 0));const j=jr(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:m,dataURLOptions:g,inlineImages:p,recordCanvas:y,keepIframeSrcFn:B,newlyAddedElement:P});if(!j)return console.warn(e,"not serialized"),null;let G;n.hasNode(e)?G=n.getId(e):Xr(j,f)||!k&&j.type===A.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?G=Ie:G=Et();const E=Object.assign(j,{id:G});if(n.add(e,E),G===Ie)return null;w&&w(e);let le=!s;if(E.type===A.Element){le=le&&!E.needBlock,delete E.needBlock;const z=e.shadowRoot;z&&Me(z)&&(E.isShadowHost=!0)}if((E.type===A.Document||E.type===A.Element)&&le){f.headWhitespace&&E.type===A.Element&&E.tagName==="head"&&(k=!1);const z={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:x,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:p,recordCanvas:y,preserveWhiteSpace:k,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:B};if(!(E.type===A.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0))for(const ne of Array.from(e.childNodes)){const Z=pe(ne,z);Z&&E.childNodes.push(Z)}if(Mr(e)&&e.shadowRoot)for(const ne of Array.from(e.shadowRoot.childNodes)){const Z=pe(ne,z);Z&&(Me(e.shadowRoot)&&(Z.isShadow=!0),E.childNodes.push(Z))}}return e.parentNode&&we(e.parentNode)&&Me(e.parentNode)&&(E.isShadow=!0),E.type===A.Element&&E.tagName==="iframe"&&$r(e,()=>{const z=e.contentDocument;if(z&&S){const ne=pe(z,{doc:z,mirror:n,blockClass:i,blockSelector:o,needsMask:x,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:p,recordCanvas:y,preserveWhiteSpace:k,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:B});ne&&S(e,ne)}},v),E.type===A.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Ot(E.attributes.href)==="css")&&qr(e,()=>{if(b){const z=pe(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:x,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:p,recordCanvas:y,preserveWhiteSpace:k,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:B});z&&b(e,z)}},M),E}function Kr(e,t){const{mirror:r=new Ct,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:m,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:p,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:M=()=>!1}=t||{};return pe(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:h,maskInputFn:m,slimDOMOptions:f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:f==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:f===!1?{}:f,dataURLOptions:g,inlineImages:s,recordCanvas:c,preserveWhiteSpace:p,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:M,newlyAddedElement:!1})}function U(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const me=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
(function(){"use strict";var P;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(P||(P={}));function Br(e){return e.nodeType===e.ELEMENT_NODE}function Ce(e){const t=e?.host;return t?.shadowRoot===e}function _e(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ur(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function Wr(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const 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 Be(e){try{const t=e.rules||e.cssRules;return t?Ur(Array.from(t,Nt).join("")):null}catch{return null}}function Nt(e){let t;if(qr(e))try{t=Be(e.styleSheet)||Wr(e)}catch{}else if($r(e)&&e.selectorText.includes(":"))return zr(e.cssText);return t||e.cssText}function zr(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function qr(e){return"styleSheet"in e}function $r(e){return"selectorText"in e}class Dt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return 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){const 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){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Hr(){return new Dt}function ut({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let a=i||"";const u=n&&ae(n);return(t[r.toLowerCase()]||u&&t[u])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ae(e){return e.toLowerCase()}const At="__rrweb_original__";function jr(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=At in o?o[At]:o;if(new Uint32Array(a.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(s=>s!==0))return!1}return!0}function lt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ae(t):null}function Lt(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const i=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(i);return(r=o?.[1])!==null&&r!==void 0?r:null}let Gr=1;const Vr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function Pt(){return Gr++}function Jr(e){if(e instanceof HTMLFormElement)return"form";const t=ae(e.tagName);return Vr.test(t)?"div":t}function Xr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let me,Ft;const Kr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Yr=/^(?:[a-z+]+:)?\/\//i,Qr=/^www\..*/i,Zr=/^(data:)([^,]*),(.*)/i;function Ue(e,t){return(e||"").replace(Kr,(r,n,i,o,a,u)=>{const s=i||a||u,d=n||o||"";if(!s)return r;if(Yr.test(s)||Qr.test(s))return`url(${d}${s}${d})`;if(Zr.test(s))return`url(${d}${s}${d})`;if(s[0]==="/")return`url(${d}${Xr(t)+s}${d})`;const c=t.split("/"),f=s.split("/");c.pop();for(const p of f)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${d}${c.join("/")}${d})`})}const en=/^[^ \t\n\r\u000c]+/,tn=/^[, \t\n\r\u000c]+/;function rn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a;const u=o.exec(t.substring(r));return u?(a=u[0],r+=a.length,a):""}const i=[];for(;n(tn),!(r>=t.length);){let o=n(en);if(o.slice(-1)===",")o=ge(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=ge(e,o);let u=!1;for(;;){const s=t.charAt(r);if(s===""){i.push((o+a).trim());break}else if(u)s===")"&&(u=!1);else if(s===","){r+=1,i.push((o+a).trim());break}else s==="("&&(u=!0);a+=s,r+=1}}}return i.join(", ")}function ge(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function nn(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ct(){const e=document.createElement("a");return e.href="",e.href}function Bt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?ge(e,n):r==="srcset"?rn(e,n):r==="style"?Ue(n,ct()):t==="object"&&r==="data"?ge(e,n):n)}function Ut(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function on(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function We(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?We(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return r?We(e.parentNode,t,r):!1}function Wt(e,t,r,n){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(We(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function sn(e,t,r){const n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){const u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}const 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 an(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function un(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:u,maskInputOptions:s={},maskTextFn:d,maskInputFn:c,dataURLOptions:f={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:g,newlyAddedElement:m=!1}=t,v=ln(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:P.Document,childNodes:[],compatMode:e.compatMode}:{type:P.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:P.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return dn(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:s,maskInputFn:c,dataURLOptions:f,inlineImages:p,recordCanvas:h,keepIframeSrcFn:g,newlyAddedElement:m,rootId:v});case e.TEXT_NODE:return cn(e,{needsMask:a,maskTextFn:d,rootId:v});case e.CDATA_SECTION_NODE:return{type:P.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:P.Comment,textContent:e.textContent||"",rootId:v};default:return!1}}function ln(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function cn(e,t){var r;const{needsMask:n,maskTextFn:i,rootId:o}=t,a=e.parentNode&&e.parentNode.tagName;let u=e.textContent;const s=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;if(s&&u){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(u=Be(e.parentNode.sheet))}catch(c){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${c}`,e)}u=Ue(u,ct())}return d&&(u="SCRIPT_PLACEHOLDER"),!s&&!d&&u&&n&&(u=i?i(u,e.parentElement):u.replace(/[\S]/g,"*")),{type:P.Text,textContent:u||"",isStyle:s,rootId:o}}function dn(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:s={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:h}=t,g=on(e,n,i),m=Jr(e);let v={};const w=e.attributes.length;for(let y=0;y<w;y++){const S=e.attributes[y];Ut(m,S.name,S.value)||(v[S.name]=Bt(r,m,ae(S.name),S.value))}if(m==="link"&&o){const y=Array.from(r.styleSheets).find(I=>I.href===e.href);let S=null;y&&(S=Be(y)),S&&(delete v.rel,delete v.href,v._cssText=Ue(S,y.href))}if(m==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const y=Be(e.sheet);y&&(v._cssText=Ue(y,ct()))}if(m==="input"||m==="textarea"||m==="select"){const y=e.value,S=e.checked;v.type!=="radio"&&v.type!=="checkbox"&&v.type!=="submit"&&v.type!=="button"&&y?v.value=ut({element:e,type:lt(e),tagName:m,value:y,maskInputOptions:a,maskInputFn:u}):S&&(v.checked=S)}if(m==="option"&&(e.selected&&!a.select?v.selected=!0:delete v.selected),m==="canvas"&&c){if(e.__context==="2d")jr(e)||(v.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const y=e.toDataURL(s.type,s.quality),S=document.createElement("canvas");S.width=e.width,S.height=e.height;const I=S.toDataURL(s.type,s.quality);y!==I&&(v.rr_dataURL=y)}}if(m==="img"&&d){me||(me=r.createElement("canvas"),Ft=me.getContext("2d"));const y=e,S=y.crossOrigin;y.crossOrigin="anonymous";const I=()=>{y.removeEventListener("load",I);try{me.width=y.naturalWidth,me.height=y.naturalHeight,Ft.drawImage(y,0,0),v.rr_dataURL=me.toDataURL(s.type,s.quality)}catch(U){console.warn(`Cannot inline img src=${y.currentSrc}! Error: ${U}`)}S?v.crossOrigin=S:y.removeAttribute("crossorigin")};y.complete&&y.naturalWidth!==0?I():y.addEventListener("load",I)}if(m==="audio"||m==="video"){const y=v;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop)),g){const{width:y,height:S}=e.getBoundingClientRect();v={class:v.class,rr_width:`${y}px`,rr_height:`${S}px`}}m==="iframe"&&!f(v.src)&&(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(m)&&(b=!0)}catch{}return{type:P.Element,tagName:m,attributes:v,childNodes:[],isSVG:nn(e)||void 0,needBlock:g,rootId:h,isCustom:b}}function R(e){return e==null?"":e.toLowerCase()}function fn(e,t){if(t.comment&&e.type===P.Comment)return!0;if(e.type===P.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Lt(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||R(e.attributes.name)==="application-name"||R(e.attributes.rel)==="icon"||R(e.attributes.rel)==="apple-touch-icon"||R(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||R(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(R(e.attributes.name)==="robots"||R(e.attributes.name)==="googlebot"||R(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(R(e.attributes.name)==="author"||R(e.attributes.name)==="generator"||R(e.attributes.name)==="framework"||R(e.attributes.name)==="publisher"||R(e.attributes.name)==="progid"||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(R(e.attributes.name)==="google-site-verification"||R(e.attributes.name)==="yandex-verification"||R(e.attributes.name)==="csrf-token"||R(e.attributes.name)==="p:domain_verify"||R(e.attributes.name)==="verify-v1"||R(e.attributes.name)==="verification"||R(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ye(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:u,skipChild:s=!1,inlineStylesheet:d=!0,maskInputOptions:c={},maskTextFn:f,maskInputFn:p,slimDOMOptions:h,dataURLOptions:g={},inlineImages:m=!1,recordCanvas:v=!1,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:y=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:U=()=>!1,newlyAddedElement:B=!1}=t;let{needsMask:k}=t,{preserveWhiteSpace:T=!0}=t;!k&&e.childNodes&&(k=Wt(e,a,u,k===void 0));const G=un(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,dataURLOptions:g,inlineImages:m,recordCanvas:v,keepIframeSrcFn:U,newlyAddedElement:B});if(!G)return console.warn(e,"not serialized"),null;let V;n.hasNode(e)?V=n.getId(e):fn(G,h)||!T&&G.type===P.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?V=Oe:V=Pt();const E=Object.assign(G,{id:V});if(n.add(e,E),V===Oe)return null;w&&w(e);let de=!s;if(E.type===P.Element){de=de&&!E.needBlock,delete E.needBlock;const q=e.shadowRoot;q&&_e(q)&&(E.isShadowHost=!0)}if((E.type===P.Document||E.type===P.Element)&&de){h.headWhitespace&&E.type===P.Element&&E.tagName==="head"&&(T=!1);const q={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:u,skipChild:s,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:h,dataURLOptions:g,inlineImages:m,recordCanvas:v,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:U};if(!(E.type===P.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0))for(const se of Array.from(e.childNodes)){const ee=ye(se,q);ee&&E.childNodes.push(ee)}if(Br(e)&&e.shadowRoot)for(const se of Array.from(e.shadowRoot.childNodes)){const ee=ye(se,q);ee&&(_e(e.shadowRoot)&&(ee.isShadow=!0),E.childNodes.push(ee))}}return e.parentNode&&Ce(e.parentNode)&&_e(e.parentNode)&&(E.isShadow=!0),E.type===P.Element&&E.tagName==="iframe"&&sn(e,()=>{const q=e.contentDocument;if(q&&b){const se=ye(q,{doc:q,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:h,dataURLOptions:g,inlineImages:m,recordCanvas:v,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:U});se&&b(e,se)}},y),E.type===P.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Lt(E.attributes.href)==="css")&&an(e,()=>{if(S){const q=ye(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:h,dataURLOptions:g,inlineImages:m,recordCanvas:v,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:U});q&&S(e,q)}},I),E}function hn(e,t){const{mirror:r=new Dt,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:u=!0,inlineImages:s=!1,recordCanvas:d=!1,maskAllInputs:c=!1,maskTextFn:f,maskInputFn:p,slimDOM:h=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:S,keepIframeSrcFn:I=()=>!1}=t||{};return ye(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:h==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:h===!1?{}:h,dataURLOptions:g,inlineImages:s,recordCanvas:d,preserveWhiteSpace:m,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:S,keepIframeSrcFn:I,newlyAddedElement:!1})}function W(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const ve=`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.`;let Dt={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Dt=new Proxy(Dt,{get(e,t,r){return t==="map"&&console.error(me),Reflect.get(e,t,r)}}));function Ce(e,t,r={}){let n=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const l=t-(a-i),s=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=a,e.apply(s,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(s,o)},l))}}function Fe(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Fe(e,t,o||{},!0)}function ge(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}let Pe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Pe=()=>new Date().getTime());function Nt(e){var t,r,n,i,o,a;const l=e.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:l?.documentElement.scrollLeft||((r=(t=l?.body)===null||t===void 0?void 0:t.parentElement)===null||r===void 0?void 0:r.scrollLeft)||((n=l?.body)===null||n===void 0?void 0:n.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:l?.documentElement.scrollTop||((o=(i=l?.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=l?.body)===null||a===void 0?void 0:a.scrollTop)||0}}function At(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Lt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ft(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function W(e,t,r,n){if(!e)return!1;const i=Ft(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(Le(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function Yr(e,t){return t.getId(e)!==-1}function ot(e,t){return t.getId(e)===Ie}function Pt(e,t){if(we(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Pt(e.parentNode,t):!0:!0}function st(e){return!!e.changedTouches}function Qr(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),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function Bt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ut(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e){return!!e?.shadowRoot}class Zr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?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++}}function Wt(e){var t,r;let n=null;return((r=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||r===void 0?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function en(e){let t=e,r;for(;r=Wt(t);)t=r;return t}function tn(e){const t=e.ownerDocument;if(!t)return!1;const r=en(e);return t.contains(r)}function zt(e){const t=e.ownerDocument;return t?t.contains(e)||tn(e):!1}var O=(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))(O||{}),C=(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))(C||{}),$=(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))($||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),ye=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ye||{});function Ht(e){return"__ln"in e}class rn{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ht(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class nn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new rn,i=s=>{let c=s,u=Ie;for(;u===Ie;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},o=s=>{if(!s.parentNode||!zt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=we(s.parentNode)?this.mirror.getId(Wt(s)):this.mirror.getId(s.parentNode),u=i(s);if(c===-1||u===-1)return n.addNode(s);const h=pe(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Bt(m,this.mirror)&&this.iframeManager.addIframe(m),Ut(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),at(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(m,f)=>{this.iframeManager.attachIframe(m,f),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,f)=>{this.stylesheetManager.attachLinkElement(m,f)}});h&&(t.push({parentId:c,nextId:u,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)qt(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(const s of this.addedSet)!Gt(this.droppedSet,s)&&!qt(this.removes,s,this.mirror)||Gt(this.movedSet,s)?o(s):this.droppedSet.add(s);let a=null;for(;n.length;){let s=null;if(a){const c=this.mirror.getId(a.value.parentNode),u=i(a.value);c!==-1&&u!==-1&&(s=a)}if(!s){let c=n.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(u.value.parentNode);if(i(u.value)===-1)continue;if(h!==-1){s=u;break}else{const f=u.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=f.parentNode.host;if(this.mirror.getId(g)!==-1){s=u;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}a=s.previous,n.removeNode(s.value),o(s.value)}const l={texts:this.texts.map(s=>{const c=s.node;return c.parentNode&&c.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c.parentNode),{id:this.mirror.getId(c),value:s.value}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>{const{attributes:c}=s;if(typeof c.style=="string"){const u=JSON.stringify(s.styleDiff),h=JSON.stringify(s._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=s.styleDiff)}return{id:this.mirror.getId(s.node),attributes:c}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},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)),r.attributes.value=Array.from(t.childNodes,n=>n.textContent||"").join("")},this.processMutation=t=>{if(!ot(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!W(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Tt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ft(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){const a=nt(r);i=rt({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(W(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!kt(r.tagName,n)&&(o.attributes[n]=xt(this.doc,ie(r.tagName),ie(n),i),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const s=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);s!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?c===""?o.styleDiff[l]=s:o.styleDiff[l]=[s,c]:o._unchangedStyles[l]=[s,c]}for(const l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!1)}break}case"childList":{if(W(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=we(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);W(t.target,this.blockClass,this.blockSelector,!1)||ot(r,this.mirror)||!Yr(r,this.mirror)||(this.addedSet.has(r)?(lt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Pt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[$t(n,i)]?lt(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:we(t.target)&&Me(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(ot(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[$t(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);W(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),at(t)&&t.shadowRoot.childNodes.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=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function lt(e,t){e.delete(t),t.childNodes.forEach(r=>lt(e,r))}function qt(e,t,r){return e.length===0?!1:jt(e,t,r)}function jt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const i=r.getId(n);return e.some(o=>o.id===i)?!0:jt(e,n,r)}function Gt(e,t){return e.size===0?!1:Vt(e,t)}function Vt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Vt(e,r):!1}let _e;function on(e){_e=e}function sn(){_e=void 0}const _=e=>_e?(...r)=>{try{return e(...r)}catch(n){if(_e&&_e(n)===!0)return;throw n}}:e,oe=[];function Oe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Jt(e,t){var r,n;const i=new nn;oe.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(o=window[a]);const l=new o(_(i.processMutations.bind(i)));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function an({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const s=Ce(_(h=>{const m=Date.now()-l;e(a.map(f=>(f.timeOffset-=m,f)),h),a=[],l=null}),o),c=_(Ce(_(h=>{const m=Oe(h),{clientX:f,clientY:g}=st(h)?h.changedTouches[0]:h;l||(l=Pe()),a.push({x:f,y:g,id:n.getId(m),timeOffset:Pe()-l}),s(typeof DragEvent<"u"&&h instanceof DragEvent?C.Drag:h instanceof MouseEvent?C.MouseMove:C.TouchMove)}),i,{trailing:!1})),u=[U("mousemove",c,r),U("touchmove",c,r),U("drag",c,r)];return _(()=>{u.forEach(h=>h())})}function ln({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let s=null;const c=u=>h=>{const m=Oe(h);if(W(m,n,i,!0))return;let f=null,g=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=ee.Mouse;break;case"touch":f=ee.Touch;break;case"pen":f=ee.Pen;break}f===ee.Touch?$[u]===$.MouseDown?g="TouchStart":$[u]===$.MouseUp&&(g="TouchEnd"):ee.Pen}else st(h)&&(f=ee.Touch);f!==null?(s=f,(g.startsWith("Touch")&&f===ee.Touch||g.startsWith("Mouse")&&f===ee.Mouse)&&(f=null)):$[u]===$.Click&&(f=s,s=null);const p=st(h)?h.changedTouches[0]:h;if(!p)return;const y=r.getId(m),{clientX:w,clientY:S}=p;_(e)(Object.assign({type:$[g],id:y,x:w,y:S},f!==null&&{pointerType:f}))};return Object.keys($).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==!1).forEach(u=>{let h=ie(u);const m=c(u);if(window.PointerEvent)switch($[u]){case $.MouseDown:case $.MouseUp:h=h.replace("mouse","pointer");break;case $.TouchStart:case $.TouchEnd:return}l.push(U(h,m,t))}),_(()=>{l.forEach(u=>u())})}function Xt({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const a=_(Ce(_(l=>{const s=Oe(l);if(!s||W(s,n,i,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const u=Nt(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100));return U("scroll",a,t)}function un({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const i=_(Ce(_(()=>{const o=At(),a=Lt();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a)}),200));return U("resize",i,t)}const cn=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function dn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:s,sampling:c,userTriggeredOnInput:u}){function h(S){let v=Oe(S);const b=S.isTrusted,M=v&&v.tagName;if(v&&M==="OPTION"&&(v=v.parentElement),!v||!M||cn.indexOf(M)<0||W(v,n,i,!0)||v.classList.contains(o)||a&&v.matches(a))return;let B=v.value,P=!1;const x=nt(v)||"";x==="radio"||x==="checkbox"?P=v.checked:(l[M.toLowerCase()]||l[x])&&(B=rt({element:v,maskInputOptions:l,tagName:M,type:x,value:B,maskInputFn:s})),m(v,u?{text:B,isChecked:P,userTriggered:b}:{text:B,isChecked:P});const k=v.name;x==="radio"&&k&&P&&t.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(j=>{if(j!==v){const G=j.value;m(j,u?{text:G,isChecked:!P,userTriggered:!1}:{text:G,isChecked:!P})}})}function m(S,v){const b=Kt.get(S);if(!b||b.text!==v.text||b.isChecked!==v.isChecked){Kt.set(S,v);const M=r.getId(S);_(e)(Object.assign(Object.assign({},v),{id:M}))}}const g=(c.input==="last"?["change"]:["input","change"]).map(S=>U(S,_(h),t)),p=t.defaultView;if(!p)return()=>{g.forEach(S=>S())};const y=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),w=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&g.push(...w.map(S=>Fe(S[0],S[1],{set(){_(h)({target:this,isTrusted:!1})}},!1,p))),_(()=>{g.forEach(S=>S())})}function Be(e){const t=[];function r(n,i){if(Ue("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ue("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ue("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ue("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(a)}return i}return r(e,t)}function te(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function fn({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:_((u,h,m)=>{const[f,g]=m,{id:p,styleId:y}=te(h,t,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&e({id:p,styleId:y,adds:[{rule:f,index:g}]}),u.apply(h,m)})});const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:_((u,h,m)=>{const[f]=m,{id:g,styleId:p}=te(h,t,r.styleMirror);return(g&&g!==-1||p&&p!==-1)&&e({id:g,styleId:p,removes:[{index:f}]}),u.apply(h,m)})});let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:_((u,h,m)=>{const[f]=m,{id:g,styleId:p}=te(h,t,r.styleMirror);return(g&&g!==-1||p&&p!==-1)&&e({id:g,styleId:p,replace:f}),u.apply(h,m)})}));let l;n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:_((u,h,m)=>{const[f]=m,{id:g,styleId:p}=te(h,t,r.styleMirror);return(g&&g!==-1||p&&p!==-1)&&e({id:g,styleId:p,replaceSync:f}),u.apply(h,m)})}));const s={};We("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(We("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),We("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),We("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_((m,f,g)=>{const[p,y]=g,{id:w,styleId:S}=te(f.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||S&&S!==-1)&&e({id:w,styleId:S,adds:[{rule:p,index:[...Be(f),y||0]}]}),m.apply(f,g)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_((m,f,g)=>{const[p]=g,{id:y,styleId:w}=te(f.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||w&&w!==-1)&&e({id:y,styleId:w,removes:[{index:[...Be(f),p]}]}),m.apply(f,g)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(s).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function Yt({mirror:e,stylesheetManager:t},r){var n,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);const l=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,s=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;const h=(u=s.set)===null||u===void 0?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return h}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function hn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:_((l,s,c)=>{var u;const[h,m,f]=c;if(r.has(h))return o.apply(s,[h,m,f]);const{id:g,styleId:p}=te((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||p&&p!==-1)&&e({id:g,styleId:p,set:{property:h,value:m,priority:f},index:Be(s.parentRule)}),l.apply(s,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:_((l,s,c)=>{var u;const[h]=c;if(r.has(h))return a.apply(s,[h]);const{id:m,styleId:f}=te((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,remove:{property:h},index:Be(s.parentRule)}),l.apply(s,c)})}),_(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function pn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const a=_(s=>Ce(_(c=>{const u=Oe(c);if(!u||W(u,t,r,!0))return;const{currentTime:h,volume:m,muted:f,playbackRate:g,loop:p}=u;e({type:s,id:n.getId(u),currentTime:h,volume:m,muted:f,playbackRate:g,loop:p})}),i.media||500)),l=[U("play",a(0),o),U("pause",a(1),o),U("seeked",a(2),o),U("volumechange",a(3),o),U("ratechange",a(4),o)];return _(()=>{l.forEach(s=>s())})}function mn({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(s,c,u){const h=new o(s,c,u);return i.set(h,{family:s,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};const a=ge(t.fonts,"add",function(l){return function(s){return setTimeout(_(()=>{const c=i.get(s);c&&(e(c),i.delete(s))}),0),l.apply(this,[s])}});return n.push(()=>{r.FontFace=o}),n.push(a),_(()=>{n.forEach(l=>l())})}function gn(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let a=!0;const l=_(()=>{const s=t.getSelection();if(!s||a&&s?.isCollapsed)return;a=s.isCollapsed||!1;const c=[],u=s.rangeCount||0;for(let h=0;h<u;h++){const m=s.getRangeAt(h),{startContainer:f,startOffset:g,endContainer:p,endOffset:y}=m;W(f,n,i,!0)||W(p,n,i,!0)||c.push({start:r.getId(f),startOffset:g,end:r.getId(p),endOffset:y})}o({ranges:c})});return l(),U("selectionchange",l)}function yn({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:ge(r.customElements,"define",function(i){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,l])}})}function vn(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:l,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:m,selectionCb:f,customElementCb:g}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),n(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),i(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),o(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),l(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),s(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),h(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),m(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)},e.customElementCb=(...p)=>{t.customElement&&t.customElement(...p),g(...p)}}function Sn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};vn(e,t);let n;e.recordDOM&&(n=Jt(e,e.doc));const i=an(e),o=ln(e),a=Xt(e),l=un(e,{win:r}),s=dn(e),c=pn(e);let u=()=>{},h=()=>{},m=()=>{},f=()=>{};e.recordDOM&&(u=fn(e,{win:r}),h=Yt(e,e.doc),m=hn(e,{win:r}),e.collectFonts&&(f=mn(e)));const g=gn(e),p=yn(e),y=[];for(const w of e.plugins)y.push(w.observer(w.callback,r,w.options));return _(()=>{oe.forEach(w=>w.reset()),n?.disconnect(),i(),o(),a(),l(),s(),c(),u(),h(),m(),f(),g(),p(),y.forEach(w=>w())})}function Ue(e){return typeof window[e]<"u"}function We(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Qt{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let l=o.get(r);return l||(l=this.generateIdFn(),o.set(r,l),a.set(l,r)),l}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,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}}class bn{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Qt(Et),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Qt(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,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case O.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:O.IncrementalSnapshot,data:{source:C.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case O.Meta:case O.Load:case O.DomContentLoaded:return!1;case O.Plugin:return r;case O.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case O.IncrementalSnapshot:switch(r.data.source){case C.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.Drag:case C.TouchMove:case C.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.ViewportResize:return!1;case C.MediaInteraction:case C.MouseInteraction:case C.Scroll:case C.CanvasMutation:case C.Input:return this.replaceIds(r.data,t,["id"]),r;case C.StyleSheetRule:case C.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case C.Font:return r;case C.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case C.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(const o of i)!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!==A.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class wn{constructor(t){this.shadowDoms=new WeakSet,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(!Me(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=Jt(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Xt(Object.assign(Object.assign({},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(t.host)),this.restoreHandlers.push(Yt({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){const n=this;this.restoreHandlers.push(ge(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&zt(this)&&n.addShadowRoot(this.shadowRoot,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`;let zt={map:{},getId(){return console.error(ve),-1},getNode(){return console.error(ve),null},removeNodeFromMap(){console.error(ve)},has(){return console.error(ve),!1},reset(){console.error(ve)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(zt=new Proxy(zt,{get(e,t,r){return t==="map"&&console.error(ve),Reflect.get(e,t,r)}}));function Ee(e,t,r={}){let n=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const u=t-(a-i),s=this;u<=0||u>t?(n&&(clearTimeout(n),n=null),i=a,e.apply(s,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(s,o)},u))}}function ze(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.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||{},!0)}function Se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}let qe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(qe=()=>new Date().getTime());function qt(e){var t,r,n,i,o,a;const u=e.document;return{left:u.scrollingElement?u.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:u?.documentElement.scrollLeft||((r=(t=u?.body)===null||t===void 0?void 0:t.parentElement)===null||r===void 0?void 0:r.scrollLeft)||((n=u?.body)===null||n===void 0?void 0:n.scrollLeft)||0,top:u.scrollingElement?u.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:u?.documentElement.scrollTop||((o=(i=u?.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=u?.body)===null||a===void 0?void 0:a.scrollTop)||0}}function $t(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ht(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jt(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function z(e,t,r,n){if(!e)return!1;const i=jt(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(We(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function pn(e,t){return t.getId(e)!==-1}function dt(e,t){return t.getId(e)===Oe}function Gt(e,t){if(Ce(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Gt(e.parentNode,t):!0:!0}function ft(e){return!!e.changedTouches}function mn(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),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function Vt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Jt(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ht(e){return!!e?.shadowRoot}class gn{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?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++}}function Xt(e){var t,r;let n=null;return((r=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||r===void 0?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function yn(e){let t=e,r;for(;r=Xt(t);)t=r;return t}function vn(e){const t=e.ownerDocument;if(!t)return!1;const r=yn(e);return t.contains(r)}function Kt(e){const t=e.ownerDocument;return t?t.contains(e)||vn(e):!1}var O=(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))(O||{}),C=(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))(C||{}),H=(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))(H||{}),te=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(te||{}),be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(be||{});function Yt(e){return"__ln"in e}class Sn{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Yt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Yt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Qt=(e,t)=>`${e}@${t}`;class bn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new Sn,i=s=>{let d=s,c=Oe;for(;c===Oe;)d=d&&d.nextSibling,c=d&&this.mirror.getId(d);return c},o=s=>{if(!s.parentNode||!Kt(s)||s.parentNode.tagName==="TEXTAREA")return;const d=Ce(s.parentNode)?this.mirror.getId(Xt(s)):this.mirror.getId(s.parentNode),c=i(s);if(d===-1||c===-1)return n.addNode(s);const f=ye(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Vt(p,this.mirror)&&this.iframeManager.addIframe(p),Jt(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),ht(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{this.iframeManager.attachIframe(p,h),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)}});f&&(t.push({parentId:d,nextId:c,node:f}),r.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Zt(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(const s of this.addedSet)!tr(this.droppedSet,s)&&!Zt(this.removes,s,this.mirror)||tr(this.movedSet,s)?o(s):this.droppedSet.add(s);let a=null;for(;n.length;){let s=null;if(a){const d=this.mirror.getId(a.value.parentNode),c=i(a.value);d!==-1&&c!==-1&&(s=a)}if(!s){let d=n.tail;for(;d;){const c=d;if(d=d.previous,c){const f=this.mirror.getId(c.value.parentNode);if(i(c.value)===-1)continue;if(f!==-1){s=c;break}else{const h=c.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=h.parentNode.host;if(this.mirror.getId(g)!==-1){s=c;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}a=s.previous,n.removeNode(s.value),o(s.value)}const u={texts:this.texts.map(s=>{const d=s.node;return d.parentNode&&d.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(d.parentNode),{id:this.mirror.getId(d),value:s.value}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>{const{attributes:d}=s;if(typeof d.style=="string"){const c=JSON.stringify(s.styleDiff),f=JSON.stringify(s._unchangedStyles);c.length<d.style.length&&(c+f).split("var(").length===d.style.split("var(").length&&(d.style=s.styleDiff)}return{id:this.mirror.getId(s.node),attributes:d}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(u))},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)),r.attributes.value=Array.from(t.childNodes,n=>n.textContent||"").join("")},this.processMutation=t=>{if(!dt(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!z(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Wt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,jt(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){const a=lt(r);i=ut({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(z(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ut(r.tagName,n)&&(o.attributes[n]=Bt(this.doc,ae(r.tagName),ae(n),i),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const u of Array.from(r.style)){const s=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);s!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?d===""?o.styleDiff[u]=s:o.styleDiff[u]=[s,d]:o._unchangedStyles[u]=[s,d]}for(const u of Array.from(a.style))r.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}break}case"childList":{if(z(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=Ce(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);z(t.target,this.blockClass,this.blockSelector,!1)||dt(r,this.mirror)||!pn(r,this.mirror)||(this.addedSet.has(r)?(pt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Gt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Qt(n,i)]?pt(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:Ce(t.target)&&_e(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(dt(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Qt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);z(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),ht(t)&&t.shadowRoot.childNodes.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=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function pt(e,t){e.delete(t),t.childNodes.forEach(r=>pt(e,r))}function Zt(e,t,r){return e.length===0?!1:er(e,t,r)}function er(e,t,r){const{parentNode:n}=t;if(!n)return!1;const i=r.getId(n);return e.some(o=>o.id===i)?!0:er(e,n,r)}function tr(e,t){return e.size===0?!1:rr(e,t)}function rr(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:rr(e,r):!1}let Re;function wn(e){Re=e}function In(){Re=void 0}const _=e=>Re?(...r)=>{try{return e(...r)}catch(n){if(Re&&Re(n)===!0)return;throw n}}:e,ue=[];function xe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function nr(e,t){var r,n;const i=new bn;ue.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(o=window[a]);const u=new o(_(i.processMutations.bind(i)));return u.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),u}function Mn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],u;const s=Ee(_(f=>{const p=Date.now()-u;e(a.map(h=>(h.timeOffset-=p,h)),f),a=[],u=null}),o),d=_(Ee(_(f=>{const p=xe(f),{clientX:h,clientY:g}=ft(f)?f.changedTouches[0]:f;u||(u=qe()),a.push({x:h,y:g,id:n.getId(p),timeOffset:qe()-u}),s(typeof DragEvent<"u"&&f instanceof DragEvent?C.Drag:f instanceof MouseEvent?C.MouseMove:C.TouchMove)}),i,{trailing:!1})),c=[W("mousemove",d,r),W("touchmove",d,r),W("drag",d,r)];return _(()=>{c.forEach(f=>f())})}function Cn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let s=null;const d=c=>f=>{const p=xe(f);if(z(p,n,i,!0))return;let h=null,g=c;if("pointerType"in f){switch(f.pointerType){case"mouse":h=te.Mouse;break;case"touch":h=te.Touch;break;case"pen":h=te.Pen;break}h===te.Touch?H[c]===H.MouseDown?g="TouchStart":H[c]===H.MouseUp&&(g="TouchEnd"):te.Pen}else ft(f)&&(h=te.Touch);h!==null?(s=h,(g.startsWith("Touch")&&h===te.Touch||g.startsWith("Mouse")&&h===te.Mouse)&&(h=null)):H[c]===H.Click&&(h=s,s=null);const m=ft(f)?f.changedTouches[0]:f;if(!m)return;const v=r.getId(p),{clientX:w,clientY:b}=m;_(e)(Object.assign({type:H[g],id:v,x:w,y:b},h!==null&&{pointerType:h}))};return Object.keys(H).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let f=ae(c);const p=d(c);if(window.PointerEvent)switch(H[c]){case H.MouseDown:case H.MouseUp:f=f.replace("mouse","pointer");break;case H.TouchStart:case H.TouchEnd:return}u.push(W(f,p,t))}),_(()=>{u.forEach(c=>c())})}function ir({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const a=_(Ee(_(u=>{const s=xe(u);if(!s||z(s,n,i,!0))return;const d=r.getId(s);if(s===t&&t.defaultView){const c=qt(t.defaultView);e({id:d,x:c.left,y:c.top})}else e({id:d,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100));return W("scroll",a,t)}function _n({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const i=_(Ee(_(()=>{const o=$t(),a=Ht();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a)}),200));return W("resize",i,t)}const On=["INPUT","TEXTAREA","SELECT"],or=new WeakMap;function En({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:s,sampling:d,userTriggeredOnInput:c}){function f(b){let y=xe(b);const S=b.isTrusted,I=y&&y.tagName;if(y&&I==="OPTION"&&(y=y.parentElement),!y||!I||On.indexOf(I)<0||z(y,n,i,!0)||y.classList.contains(o)||a&&y.matches(a))return;let U=y.value,B=!1;const k=lt(y)||"";k==="radio"||k==="checkbox"?B=y.checked:(u[I.toLowerCase()]||u[k])&&(U=ut({element:y,maskInputOptions:u,tagName:I,type:k,value:U,maskInputFn:s})),p(y,c?{text:U,isChecked:B,userTriggered:S}:{text:U,isChecked:B});const T=y.name;k==="radio"&&T&&B&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(G=>{if(G!==y){const V=G.value;p(G,c?{text:V,isChecked:!B,userTriggered:!1}:{text:V,isChecked:!B})}})}function p(b,y){const S=or.get(b);if(!S||S.text!==y.text||S.isChecked!==y.isChecked){or.set(b,y);const I=r.getId(b);_(e)(Object.assign(Object.assign({},y),{id:I}))}}const g=(d.input==="last"?["change"]:["input","change"]).map(b=>W(b,_(f),t)),m=t.defaultView;if(!m)return()=>{g.forEach(b=>b())};const v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),w=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&g.push(...w.map(b=>ze(b[0],b[1],{set(){_(f)({target:this,isTrusted:!1})}},!1,m))),_(()=>{g.forEach(b=>b())})}function $e(e){const t=[];function r(n,i){if(He("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(a)}return i}return r(e,t)}function ne(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Rn({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:_((c,f,p)=>{const[h,g]=p,{id:m,styleId:v}=ne(f,t,r.styleMirror);return(m&&m!==-1||v&&v!==-1)&&e({id:m,styleId:v,adds:[{rule:h,index:g}]}),c.apply(f,p)})});const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:_((c,f,p)=>{const[h]=p,{id:g,styleId:m}=ne(f,t,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&e({id:g,styleId:m,removes:[{index:h}]}),c.apply(f,p)})});let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:_((c,f,p)=>{const[h]=p,{id:g,styleId:m}=ne(f,t,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&e({id:g,styleId:m,replace:h}),c.apply(f,p)})}));let u;n.CSSStyleSheet.prototype.replaceSync&&(u=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:_((c,f,p)=>{const[h]=p,{id:g,styleId:m}=ne(f,t,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&e({id:g,styleId:m,replaceSync:h}),c.apply(f,p)})}));const s={};je("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(je("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),je("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),je("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const d={};return Object.entries(s).forEach(([c,f])=>{d[c]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(d[c].insertRule,{apply:_((p,h,g)=>{const[m,v]=g,{id:w,styleId:b}=ne(h.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||b&&b!==-1)&&e({id:w,styleId:b,adds:[{rule:m,index:[...$e(h),v||0]}]}),p.apply(h,g)})}),f.prototype.deleteRule=new Proxy(d[c].deleteRule,{apply:_((p,h,g)=>{const[m]=g,{id:v,styleId:w}=ne(h.parentStyleSheet,t,r.styleMirror);return(v&&v!==-1||w&&w!==-1)&&e({id:v,styleId:w,removes:[{index:[...$e(h),m]}]}),p.apply(h,g)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),u&&(n.CSSStyleSheet.prototype.replaceSync=u),Object.entries(s).forEach(([c,f])=>{f.prototype.insertRule=d[c].insertRule,f.prototype.deleteRule=d[c].deleteRule})})}function sr({mirror:e,stylesheetManager:t},r){var n,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);const u=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,s=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var d;return(d=s.get)===null||d===void 0?void 0:d.call(this)},set(d){var c;const f=(c=s.set)===null||c===void 0?void 0:c.call(this,d);if(a!==null&&a!==-1)try{t.adoptStyleSheets(d,a)}catch{}return f}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function xn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:_((u,s,d)=>{var c;const[f,p,h]=d;if(r.has(f))return o.apply(s,[f,p,h]);const{id:g,styleId:m}=ne((c=s.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||m&&m!==-1)&&e({id:g,styleId:m,set:{property:f,value:p,priority:h},index:$e(s.parentRule)}),u.apply(s,d)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:_((u,s,d)=>{var c;const[f]=d;if(r.has(f))return a.apply(s,[f]);const{id:p,styleId:h}=ne((c=s.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:f},index:$e(s.parentRule)}),u.apply(s,d)})}),_(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function kn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const a=_(s=>Ee(_(d=>{const c=xe(d);if(!c||z(c,t,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g,loop:m}=c;e({type:s,id:n.getId(c),currentTime:f,volume:p,muted:h,playbackRate:g,loop:m})}),i.media||500)),u=[W("play",a(0),o),W("pause",a(1),o),W("seeked",a(2),o),W("volumechange",a(3),o),W("ratechange",a(4),o)];return _(()=>{u.forEach(s=>s())})}function Tn({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(s,d,c){const f=new o(s,d,c);return i.set(f,{family:s,buffer:typeof d!="string",descriptors:c,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),f};const a=Se(t.fonts,"add",function(u){return function(s){return setTimeout(_(()=>{const d=i.get(s);d&&(e(d),i.delete(s))}),0),u.apply(this,[s])}});return n.push(()=>{r.FontFace=o}),n.push(a),_(()=>{n.forEach(u=>u())})}function Nn(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let a=!0;const u=_(()=>{const s=t.getSelection();if(!s||a&&s?.isCollapsed)return;a=s.isCollapsed||!1;const d=[],c=s.rangeCount||0;for(let f=0;f<c;f++){const p=s.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:m,endOffset:v}=p;z(h,n,i,!0)||z(m,n,i,!0)||d.push({start:r.getId(h),startOffset:g,end:r.getId(m),endOffset:v})}o({ranges:d})});return u(),W("selectionchange",u)}function Dn({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Se(r.customElements,"define",function(i){return function(o,a,u){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,u])}})}function An(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:s,styleSheetRuleCb:d,styleDeclarationCb:c,canvasMutationCb:f,fontCb:p,selectionCb:h,customElementCb:g}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),u(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),s(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),d(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),f(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),g(...m)}}function Ln(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};An(e,t);let n;e.recordDOM&&(n=nr(e,e.doc));const i=Mn(e),o=Cn(e),a=ir(e),u=_n(e,{win:r}),s=En(e),d=kn(e);let c=()=>{},f=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=Rn(e,{win:r}),f=sr(e,e.doc),p=xn(e,{win:r}),e.collectFonts&&(h=Tn(e)));const g=Nn(e),m=Dn(e),v=[];for(const w of e.plugins)v.push(w.observer(w.callback,r,w.options));return _(()=>{ue.forEach(w=>w.reset()),n?.disconnect(),i(),o(),a(),u(),s(),d(),c(),f(),p(),h(),g(),m(),v.forEach(w=>w())})}function He(e){return typeof window[e]<"u"}function je(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ar{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let u=o.get(r);return u||(u=this.generateIdFn(),o.set(r,u),a.set(u,r)),u}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,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}}class Pn{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ar(Pt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ar(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,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case O.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:O.IncrementalSnapshot,data:{source:C.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case O.Meta:case O.Load:case O.DomContentLoaded:return!1;case O.Plugin:return r;case O.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case O.IncrementalSnapshot:switch(r.data.source){case C.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.Drag:case C.TouchMove:case C.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.ViewportResize:return!1;case C.MediaInteraction:case C.MouseInteraction:case C.Scroll:case C.CanvasMutation:case C.Input:return this.replaceIds(r.data,t,["id"]),r;case C.StyleSheetRule:case C.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case C.Font:return r;case C.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case C.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(const o of i)!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!==P.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class Fn{constructor(t){this.shadowDoms=new WeakSet,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(!_e(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=nr(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ir(Object.assign(Object.assign({},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(t.host)),this.restoreHandlers.push(sr({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){const n=this;this.restoreHandlers.push(Se(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&Kt(this)&&n.addShadowRoot(this.shadowRoot,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
5
5
|
|
|
6
6
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -13,10 +13,10 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
13
13
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */function
|
|
17
|
-
`);i.pop(),i.shift();for(var o=i[0].search(/\S/),a=/(['"])__worker_loader_strict__(['"])/g,
|
|
16
|
+
***************************************************************************** */function Bn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Un(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(c){try{d(n.next(c))}catch(f){a(f)}}function s(c){try{d(n.throw(c))}catch(f){a(f)}}function d(c){c.done?o(c.value):i(c.value).then(u,s)}d((n=n.apply(e,t||[])).next())})}for(var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ge=0;Ge<we.length;Ge++)Wn[we.charCodeAt(Ge)]=Ge;var zn=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=we[t[r]>>2],i+=we[(t[r]&3)<<4|t[r+1]>>4],i+=we[(t[r+1]&15)<<2|t[r+2]>>6],i+=we[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const ur=new Map;function qn(e,t){let r=ur.get(e);return r||(r=new Map,ur.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const lr=(e,t,r)=>{if(!e||!(dr(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=qn(r,n);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Ve(e,t,r){if(e instanceof Array)return e.map(n=>Ve(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){const n=e.constructor.name,i=zn(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ve(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ve(e.data,t,r),e.width,e.height]};if(dr(e,t)||typeof e=="object"){const n=e.constructor.name,i=lr(e,t,r);return{rr_type:n,index:i}}}}return e}const cr=(e,t,r)=>e.map(n=>Ve(n,t,r)),dr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function $n(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=Se(t.CanvasRenderingContext2D.prototype,a,function(s){return function(...d){return z(this.canvas,r,n,!0)||setTimeout(()=>{const c=cr(d,t,this);e(this.canvas,{type:be["2D"],property:a,args:c})},0),s.apply(this,d)}});i.push(u)}catch{const s=ze(t.CanvasRenderingContext2D.prototype,a,{set(d){e(this.canvas,{type:be["2D"],property:a,args:[d],setter:!0})}});i.push(s)}return()=>{i.forEach(a=>a())}}function Hn(e){return e==="experimental-webgl"?"webgl":e}function fr(e,t,r,n){const i=[];try{const o=Se(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...s){if(!z(this,t,r,!0)){const d=Hn(u);if("__context"in this||(this.__context=d),n&&["webgl","webgl2"].includes(d))if(s[0]&&typeof s[0]=="object"){const c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...s])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function hr(e,t,r,n,i,o,a){const u=[],s=Object.getOwnPropertyNames(e);for(const d of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const c=Se(e,d,function(f){return function(...p){const h=f.apply(this,p);if(lr(h,a,this),"tagName"in this.canvas&&!z(this.canvas,n,i,!0)){const g=cr(p,a,this),m={type:t,property:d,args:g};r(this.canvas,m)}return h}});u.push(c)}catch{const f=ze(e,d,{set(p){r(this.canvas,{type:t,property:d,args:[p],setter:!0})}});u.push(f)}return u}function jn(e,t,r,n,i){const o=[];return o.push(...hr(t.WebGLRenderingContext.prototype,be.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...hr(t.WebGL2RenderingContext.prototype,be.WebGL2,e,r,n,i,t)),()=>{o.forEach(a=>a())}}function Gn(e,t){var r=t===void 0?null:t,n=e.toString(),i=n.split(`
|
|
17
|
+
`);i.pop(),i.shift();for(var o=i[0].search(/\S/),a=/(['"])__worker_loader_strict__(['"])/g,u=0,s=i.length;u<s;++u)i[u]=i[u].substring(o).replace(a,"$1use strict$2")+`
|
|
18
18
|
`;return r&&i.push("//# sourceMappingURL="+r+`
|
|
19
|
-
`),i}function
|
|
19
|
+
`),i}function Vn(e,t){var r=Gn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function Jn(e,t){var r;return function(i){return r=r||Vn(e,t),new Worker(r,i)}}var Xn=Jn(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
|
|
20
20
|
Copyright (c) Microsoft Corporation.
|
|
21
21
|
|
|
22
22
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -29,11 +29,11 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
29
29
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
30
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
31
|
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
-
***************************************************************************** */function e(c,u,h,m){function f(g){return g instanceof h?g:new h(function(p){p(g)})}return new(h||(h=Promise))(function(g,p){function y(v){try{S(m.next(v))}catch(b){p(b)}}function w(v){try{S(m.throw(v))}catch(b){p(b)}}function S(v){v.done?g(v.value):f(v.value).then(y,w)}S((m=m.apply(c,u||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(c){var u=new Uint8Array(c),h,m=u.length,f="";for(h=0;h<m;h+=3)f+=t[u[h]>>2],f+=t[(u[h]&3)<<4|u[h+1]>>4],f+=t[(u[h+1]&15)<<2|u[h+2]>>6],f+=t[u[h+2]&63];return m%3===2?f=f.substring(0,f.length-1)+"=":m%3===1&&(f=f.substring(0,f.length-2)+"=="),f};const o=new Map,a=new Map;function l(c,u,h){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const f=new OffscreenCanvas(c,u);f.getContext("2d");const p=yield(yield f.convertToBlob(h)).arrayBuffer(),y=i(p);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:h,width:m,height:f,dataURLOptions:g}=c.data,p=l(m,f,g),y=new OffscreenCanvas(m,f);y.getContext("2d").drawImage(h,0,0),h.close();const S=yield y.convertToBlob(g),v=S.type,b=yield S.arrayBuffer(),M=i(b);if(!o.has(u)&&(yield p)===M)return o.set(u,M),s.postMessage({id:u});if(o.get(u)===M)return s.postMessage({id:u});s.postMessage({id:u,type:v,base64:M,width:m,height:f}),o.set(u,M)}else return s.postMessage({id:c.data.id})})}})()},null);class An{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=nr(r,n,i,!0),l=new Map,s=new Nn;s.onmessage=g=>{const{id:p}=g.data;if(l.set(p,!1),!("base64"in g.data))return;const{base64:y,type:w,width:S,height:v}=g.data;this.mutationCb({id:p,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,h;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(p=>{W(p,n,i,!0)||g.push(p)}),g},f=g=>{if(u&&g-u<c){h=requestAnimationFrame(f);return}u=g,m().forEach(p=>In(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(p);if(l.get(w)||p.width===0||p.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(p.__context)){const v=p.getContext(p.__context);((y=v?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=yield createImageBitmap(p);s.postMessage({id:w,bitmap:S,width:p.width,height:p.height,dataURLOptions:o.dataURLOptions},[S])})),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=nr(t,r,n,!1),o=En(this.processMutation.bind(this),t,r,n),a=xn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>Mn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class Ln{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Zr,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;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:It(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function L(e){return Object.assign(Object.assign({},e),{timestamp:Pe()})}let N,$e,ut,qe=!1;const V=Rr();function Ee(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:m,slimDOMOptions:f,maskInputFn:g,maskTextFn:p,hooks:y,packFn:w,sampling:S={},dataURLOptions:v={},mousemoveWait:b,recordDOM:M=!0,recordCanvas:B=!1,recordCrossOriginIframes:P=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:j=!1,inlineImages:G=!1,plugins:E,keepIframeSrcFn:le=()=>!1,ignoreCSSAttributes:z=new Set([]),errorHandler:ne}=e;on(ne);const Z=P?window.parent===window:!0;let Ze=!1;if(!Z)try{window.parent.document&&(Ze=!1)}catch{Ze=!0}if(Z&&!t)throw new Error("emit function is required");b!==void 0&&S.mousemove===void 0&&(S.mousemove=b),V.reset();const vt=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},St=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};Qr();let vr,bt=0;const Sr=I=>{for(const K of E||[])K.eventProcessor&&(I=K.eventProcessor(I));return w&&!Ze&&(I=w(I)),I};N=(I,K)=>{var D;if(!((D=oe[0])===null||D===void 0)&&D.isFrozen()&&I.type!==O.FullSnapshot&&!(I.type===O.IncrementalSnapshot&&I.data.source===C.Mutation)&&oe.forEach(H=>H.unfreeze()),Z)t?.(Sr(I),K);else if(Ze){const H={type:"rrweb",event:Sr(I),origin:window.location.origin,isCheckout:K};window.parent.postMessage(H,"*")}if(I.type===O.FullSnapshot)vr=I,bt=0;else if(I.type===O.IncrementalSnapshot){if(I.data.source===C.Mutation&&I.data.isAttachIframe)return;bt++;const H=n&&bt>=n,de=r&&I.timestamp-vr.timestamp>r;(H||de)&&$e(!0)}};const et=I=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Mutation},I)}))},br=I=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Scroll},I)})),wr=I=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},I)})),ii=I=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},I)})),ue=new Ln({mutationCb:et,adoptedStyleSheetCb:ii}),ce=new bn({mirror:V,mutationCb:et,stylesheetManager:ue,recordCrossOriginIframes:P,wrappedEmit:N});for(const I of E||[])I.getMirror&&I.getMirror({nodeMirror:V,crossOriginIframeMirror:ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:ce.crossOriginIframeStyleMirror});const wt=new Fn;ut=new An({recordCanvas:B,mutationCb:wr,win:window,blockClass:i,blockSelector:o,mirror:V,sampling:S.canvas,dataURLOptions:v});const tt=new wn({mutationCb:et,scrollCb:br,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:vt,dataURLOptions:v,maskTextFn:p,maskInputFn:g,recordCanvas:B,inlineImages:G,sampling:S,slimDOMOptions:St,iframeManager:ce,stylesheetManager:ue,canvasManager:ut,keepIframeSrcFn:le,processedNodeManager:wt},mirror:V});$e=(I=!1)=>{if(!M)return;N(L({type:O.Meta,data:{href:window.location.href,width:Lt(),height:At()}}),I),ue.reset(),tt.init(),oe.forEach(D=>D.lock());const K=Kr(document,{mirror:V,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:vt,maskTextFn:p,slimDOM:St,dataURLOptions:v,recordCanvas:B,inlineImages:G,onSerialize:D=>{Bt(D,V)&&ce.addIframe(D),Ut(D,V)&&ue.trackLinkElement(D),at(D)&&tt.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,H)=>{ce.attachIframe(D,H),tt.observeAttachShadow(D)},onStylesheetLoad:(D,H)=>{ue.attachLinkElement(D,H)},keepIframeSrcFn:le});if(!K)return console.warn("Failed to snapshot the document");N(L({type:O.FullSnapshot,data:{node:K,initialOffset:Nt(window)}}),I),oe.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,V.getId(document))};try{const I=[],K=H=>{var de;return _(Sn)({mutationCb:et,mousemoveCb:(T,Mt)=>N(L({type:O.IncrementalSnapshot,data:{source:Mt,positions:T}})),mouseInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},T)})),scrollCb:br,viewportResizeCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},T)})),inputCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Input},T)})),mediaInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},T)})),styleSheetRuleCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},T)})),styleDeclarationCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},T)})),canvasMutationCb:wr,fontCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Font},T)})),selectionCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Selection},T)}))},customElementCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},T)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:vt,inlineStylesheet:u,sampling:S,recordDOM:M,recordCanvas:B,inlineImages:G,userTriggeredOnInput:k,collectFonts:j,doc:H,maskInputFn:g,maskTextFn:p,keepIframeSrcFn:le,blockSelector:o,slimDOMOptions:St,dataURLOptions:v,mirror:V,iframeManager:ce,stylesheetManager:ue,shadowDomManager:tt,processedNodeManager:wt,canvasManager:ut,ignoreCSSAttributes:z,plugins:((de=E?.filter(T=>T.observer))===null||de===void 0?void 0:de.map(T=>({observer:T.observer,options:T.options,callback:Mt=>N(L({type:O.Plugin,data:{plugin:T.name,payload:Mt}}))})))||[]},y)};ce.addLoadListener(H=>{try{I.push(K(H.contentDocument))}catch(de){console.warn(de)}});const D=()=>{$e(),I.push(K(document)),qe=!0};return document.readyState==="interactive"||document.readyState==="complete"?D():(I.push(U("DOMContentLoaded",()=>{N(L({type:O.DomContentLoaded,data:{}})),x==="DOMContentLoaded"&&D()})),I.push(U("load",()=>{N(L({type:O.Load,data:{}})),x==="load"&&D()},window))),()=>{I.forEach(H=>H()),wt.destroy(),qe=!1,sn()}}catch(I){console.warn(I)}}Ee.addCustomEvent=(e,t)=>{if(!qe)throw new Error("please add custom event after start recording");N(L({type:O.Custom,data:{tag:e,payload:t}}))},Ee.freezePage=()=>{oe.forEach(e=>e.freeze())},Ee.takeFullSnapshot=e=>{if(!qe)throw new Error("please take full snapshot after start recording");$e(e)},Ee.mirror=V;var or=(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))(or||{}),Y=(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))(Y||{}),ct={DEBUG:!1,LIB_VERSION:"2.56.0"},F;if(typeof window>"u"){var sr={hostname:""};F={navigator:{userAgent:"",onLine:!0},document:{location:sr,referrer:""},screen:{width:0,height:0},location:sr}}else F=window;var je=24*60*60*1e3,dt=8*1e3,Ge=Array.prototype,Pn=Function.prototype,ar=Object.prototype,se=Ge.slice,Re=ar.toString,Ve=ar.hasOwnProperty,xe=F.console,ke=F.navigator,q=F.document,Je=F.opera,Xe=F.screen,ae=ke.userAgent,ft=Pn.bind,lr=Ge.forEach,ur=Ge.indexOf,cr=Ge.map,Bn=Array.isArray,ht={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(xe)&&xe){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{xe.error.apply(xe,e)}catch{d.each(e,function(r){xe.error(r)})}}}},pt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Te=function(e){return{log:pt(J.log,e),error:pt(J.error,e),critical:pt(J.critical,e)}};d.bind=function(e,t){var r,n;if(ft&&e.bind===ft)return ft.apply(e,se.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=se.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(se.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(se.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(lr&&e.forEach===lr)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===ht)return}else for(var o in e)if(Ve.call(e,o)&&t.call(r,e[o],o,e)===ht)return}},d.extend=function(e){return d.each(se.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=Bn||function(e){return Re.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&Ve.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?se.call(e):d.values(e):[]},d.map=function(e,t,r){if(cr&&e.map===cr)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:ur&&e.indexOf===ur?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return ht}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(Ve.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Re.call(e)=="[object String]"},d.isDate=function(e){return Re.call(e)=="[object Date]"},d.isNumber=function(e){return Re.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",h=0,m=a,f=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=l,f=[],Re.apply(g)==="[object Array]"){for(h=g.length,s=0;s<h;s+=1)f[s]=n(s,g)||"null";return u=f.length===0?"[]":a?`[
|
|
33
|
-
`+a+
|
|
32
|
+
***************************************************************************** */function e(d,c,f,p){function h(g){return g instanceof f?g:new f(function(m){m(g)})}return new(f||(f=Promise))(function(g,m){function v(y){try{b(p.next(y))}catch(S){m(S)}}function w(y){try{b(p.throw(y))}catch(S){m(S)}}function b(y){y.done?g(y.value):h(y.value).then(v,w)}b((p=p.apply(d,c||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(d){var c=new Uint8Array(d),f,p=c.length,h="";for(f=0;f<p;f+=3)h+=t[c[f]>>2],h+=t[(c[f]&3)<<4|c[f+1]>>4],h+=t[(c[f+1]&15)<<2|c[f+2]>>6],h+=t[c[f+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;function u(d,c,f){return e(this,void 0,void 0,function*(){const p=`${d}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(d,c);h.getContext("2d");const m=yield(yield h.convertToBlob(f)).arrayBuffer(),v=i(m);return a.set(p,v),v}else return""})}const s=self;s.onmessage=function(d){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:f,width:p,height:h,dataURLOptions:g}=d.data,m=u(p,h,g),v=new OffscreenCanvas(p,h);v.getContext("2d").drawImage(f,0,0),f.close();const b=yield v.convertToBlob(g),y=b.type,S=yield b.arrayBuffer(),I=i(S);if(!o.has(c)&&(yield m)===I)return o.set(c,I),s.postMessage({id:c});if(o.get(c)===I)return s.postMessage({id:c});s.postMessage({id:c,type:y,base64:I,width:p,height:h}),o.set(c,I)}else return s.postMessage({id:d.data.id})})}})()},null);class Kn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(d)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:u})}initCanvasFPSObserver(t,r,n,i,o){const a=fr(r,n,i,!0),u=new Map,s=new Xn;s.onmessage=g=>{const{id:m}=g.data;if(u.set(m,!1),!("base64"in g.data))return;const{base64:v,type:w,width:b,height:y}=g.data;this.mutationCb({id:m,type:be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:v}],type:w}]},0,0]}]})};const d=1e3/t;let c=0,f;const p=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(m=>{z(m,n,i,!0)||g.push(m)}),g},h=g=>{if(c&&g-c<d){f=requestAnimationFrame(h);return}c=g,p().forEach(m=>Un(this,void 0,void 0,function*(){var v;const w=this.mirror.getId(m);if(u.get(w)||m.width===0||m.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((v=y?.getContextAttributes())===null||v===void 0?void 0:v.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(m);s.postMessage({id:w,bitmap:b,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[b])})),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(f)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=fr(t,r,n,!1),o=$n(this.processMutation.bind(this),t,r,n),a=jn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>Bn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class Yn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new gn,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;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,s)=>({rule:Nt(u),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Qn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function F(e){return Object.assign(Object.assign({},e),{timestamp:qe()})}let A,Je,mt,Xe=!1;const J=Hr();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:s="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:h,maskInputFn:g,maskTextFn:m,hooks:v,packFn:w,sampling:b={},dataURLOptions:y={},mousemoveWait:S,recordDOM:I=!0,recordCanvas:U=!1,recordCrossOriginIframes:B=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:T=!1,collectFonts:G=!1,inlineImages:V=!1,plugins:E,keepIframeSrcFn:de=()=>!1,ignoreCSSAttributes:q=new Set([]),errorHandler:se}=e;wn(se);const ee=B?window.parent===window:!0;let ot=!1;if(!ee)try{window.parent.document&&(ot=!1)}catch{ot=!0}if(ee&&!t)throw new Error("emit function is required");S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),J.reset();const Et=f===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},Rt=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};mn();let Ar,xt=0;const Lr=M=>{for(const Q of E||[])Q.eventProcessor&&(M=Q.eventProcessor(M));return w&&!ot&&(M=w(M)),M};A=(M,Q)=>{var D;if(!((D=ue[0])===null||D===void 0)&&D.isFrozen()&&M.type!==O.FullSnapshot&&!(M.type===O.IncrementalSnapshot&&M.data.source===C.Mutation)&&ue.forEach($=>$.unfreeze()),ee)t?.(Lr(M),Q);else if(ot){const $={type:"rrweb",event:Lr(M),origin:window.location.origin,isCheckout:Q};window.parent.postMessage($,"*")}if(M.type===O.FullSnapshot)Ar=M,xt=0;else if(M.type===O.IncrementalSnapshot){if(M.data.source===C.Mutation&&M.data.isAttachIframe)return;xt++;const $=n&&xt>=n,pe=r&&M.timestamp-Ar.timestamp>r;($||pe)&&Je(!0)}};const st=M=>{A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.Mutation},M)}))},Pr=M=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.Scroll},M)})),Fr=M=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},M)})),Mi=M=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},M)})),fe=new Yn({mutationCb:st,adoptedStyleSheetCb:Mi}),he=new Pn({mirror:J,mutationCb:st,stylesheetManager:fe,recordCrossOriginIframes:B,wrappedEmit:A});for(const M of E||[])M.getMirror&&M.getMirror({nodeMirror:J,crossOriginIframeMirror:he.crossOriginIframeMirror,crossOriginIframeStyleMirror:he.crossOriginIframeStyleMirror});const kt=new Qn;mt=new Kn({recordCanvas:U,mutationCb:Fr,win:window,blockClass:i,blockSelector:o,mirror:J,sampling:b.canvas,dataURLOptions:y});const at=new Fn({mutationCb:st,scrollCb:Pr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Et,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:U,inlineImages:V,sampling:b,slimDOMOptions:Rt,iframeManager:he,stylesheetManager:fe,canvasManager:mt,keepIframeSrcFn:de,processedNodeManager:kt},mirror:J});Je=(M=!1)=>{if(!I)return;A(F({type:O.Meta,data:{href:window.location.href,width:Ht(),height:$t()}}),M),fe.reset(),at.init(),ue.forEach(D=>D.lock());const Q=hn(document,{mirror:J,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Et,maskTextFn:m,slimDOM:Rt,dataURLOptions:y,recordCanvas:U,inlineImages:V,onSerialize:D=>{Vt(D,J)&&he.addIframe(D),Jt(D,J)&&fe.trackLinkElement(D),ht(D)&&at.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,$)=>{he.attachIframe(D,$),at.observeAttachShadow(D)},onStylesheetLoad:(D,$)=>{fe.attachLinkElement(D,$)},keepIframeSrcFn:de});if(!Q)return console.warn("Failed to snapshot the document");A(F({type:O.FullSnapshot,data:{node:Q,initialOffset:qt(window)}}),M),ue.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&fe.adoptStyleSheets(document.adoptedStyleSheets,J.getId(document))};try{const M=[],Q=$=>{var pe;return _(Ln)({mutationCb:st,mousemoveCb:(N,Tt)=>A(F({type:O.IncrementalSnapshot,data:{source:Tt,positions:N}})),mouseInteractionCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},N)})),scrollCb:Pr,viewportResizeCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},N)})),inputCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.Input},N)})),mediaInteractionCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},N)})),styleSheetRuleCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},N)})),styleDeclarationCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},N)})),canvasMutationCb:Fr,fontCb:N=>A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.Font},N)})),selectionCb:N=>{A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.Selection},N)}))},customElementCb:N=>{A(F({type:O.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},N)}))},blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:s,maskTextSelector:d,maskInputOptions:Et,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:U,inlineImages:V,userTriggeredOnInput:T,collectFonts:G,doc:$,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:de,blockSelector:o,slimDOMOptions:Rt,dataURLOptions:y,mirror:J,iframeManager:he,stylesheetManager:fe,shadowDomManager:at,processedNodeManager:kt,canvasManager:mt,ignoreCSSAttributes:q,plugins:((pe=E?.filter(N=>N.observer))===null||pe===void 0?void 0:pe.map(N=>({observer:N.observer,options:N.options,callback:Tt=>A(F({type:O.Plugin,data:{plugin:N.name,payload:Tt}}))})))||[]},v)};he.addLoadListener($=>{try{M.push(Q($.contentDocument))}catch(pe){console.warn(pe)}});const D=()=>{Je(),M.push(Q(document)),Xe=!0};return document.readyState==="interactive"||document.readyState==="complete"?D():(M.push(W("DOMContentLoaded",()=>{A(F({type:O.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&D()})),M.push(W("load",()=>{A(F({type:O.Load,data:{}})),k==="load"&&D()},window))),()=>{M.forEach($=>$()),kt.destroy(),Xe=!1,In()}}catch(M){console.warn(M)}}ke.addCustomEvent=(e,t)=>{if(!Xe)throw new Error("please add custom event after start recording");A(F({type:O.Custom,data:{tag:e,payload:t}}))},ke.freezePage=()=>{ue.forEach(e=>e.freeze())},ke.takeFullSnapshot=e=>{if(!Xe)throw new Error("please take full snapshot after start recording");Je(e)},ke.mirror=J;var pr=(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))(pr||{}),Z=(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))(Z||{}),gt={DEBUG:!1,LIB_VERSION:"2.57.1"},x;if(typeof window>"u"){var mr={hostname:""};x={navigator:{userAgent:"",onLine:!0},document:{location:mr,referrer:""},screen:{width:0,height:0},location:mr}}else x=window;var gr=x.setImmediate,ie,yt,vt,yr=Object.prototype.toString,Zn=typeof gr<"u"?function(t){return gr(t)}:setTimeout;try{Object.defineProperty({},"x",{}),ie=function(t,r,n,i){return Object.defineProperty(t,r,{value:n,writable:!0,configurable:i!==!1})}}catch{ie=function(r,n,i){return r[n]=i,r}}vt=function(){var t,r,n;function i(o,a){this.fn=o,this.self=a,this.next=void 0}return{add:function(a,u){n=new i(a,u),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var a=t;for(t=r=yt=void 0;a;)a.fn.call(a.self),a=a.next}}}();function Ke(e,t){vt.add(e,t),yt||(yt=Zn(vt.drain))}function vr(e){var t,r=typeof e;return e!==null&&(r==="object"||r==="function")&&(t=e.then),typeof t=="function"?t:!1}function St(){for(var e=0;e<this.chain.length;e++)ei(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function ei(e,t,r){var n,i;try{t===!1?r.reject(e.msg):(t===!0?n=e.msg:n=t.call(void 0,e.msg),n===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=vr(n))?i.call(n,r.resolve,r.reject):r.resolve(n))}catch(o){r.reject(o)}}function Sr(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=vr(e))?Ke(function(){var n=new wr(r);try{t.call(e,function(){Sr.apply(n,arguments)},function(){Te.apply(n,arguments)})}catch(i){Te.call(n,i)}}):(r.msg=e,r.state=1,r.chain.length>0&&Ke(St,r))}catch(n){Te.call(new wr(r),n)}}}function Te(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&Ke(St,t))}function br(e,t,r,n){for(var i=0;i<t.length;i++)(function(a){e.resolve(t[a]).then(function(s){r(a,s)},n)})(i)}function wr(e){this.def=e,this.triggered=!1}function ti(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function oe(e){if(typeof e!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var t=new ti(this);this.then=function(n,i){var o={success:typeof n=="function"?n:!0,failure:typeof i=="function"?i:!1};return o.promise=new this.constructor(function(u,s){if(typeof u!="function"||typeof s!="function")throw TypeError("Not a function");o.resolve=u,o.reject=s}),t.chain.push(o),t.state!==0&&Ke(St,t),o.promise},this.catch=function(n){return this.then(void 0,n)};try{e.call(void 0,function(n){Sr.call(t,n)},function(n){Te.call(t,n)})}catch(r){Te.call(t,r)}}var Ir=ie({},"constructor",oe,!1);oe.prototype=Ir,ie(Ir,"__NPO__",0,!1),ie(oe,"resolve",function(t){var r=this;return t&&typeof t=="object"&&t.__NPO__===1?t:new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");i(t)})}),ie(oe,"reject",function(t){return new this(function(n,i){if(typeof n!="function"||typeof i!="function")throw TypeError("Not a function");i(t)})}),ie(oe,"all",function(t){var r=this;return yr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):t.length===0?r.resolve([]):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");var a=t.length,u=Array(a),s=0;br(r,t,function(c,f){u[c]=f,++s===a&&i(u)},o)})}),ie(oe,"race",function(t){var r=this;return yr.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");br(r,t,function(u,s){i(s)},o)})});var L;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?L=Promise:L=oe;var Ye=24*60*60*1e3,bt=8*1e3,Qe=Array.prototype,ri=Function.prototype,Mr=Object.prototype,le=Qe.slice,Ne=Mr.toString,Ze=Mr.hasOwnProperty,De=x.console,Ae=x.navigator,j=x.document,et=x.opera,tt=x.screen,ce=Ae.userAgent,wt=ri.bind,Cr=Qe.forEach,_r=Qe.indexOf,Or=Qe.map,ni=Array.isArray,It={},l={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},X={log:function(){},warn:function(){},error:function(){},critical:function(){if(!l.isUndefined(De)&&De){var e=["Mixpanel error:"].concat(l.toArray(arguments));try{De.error.apply(De,e)}catch{l.each(e,function(r){De.error(r)})}}}},Mt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(X,arguments)}},Le=function(e){return{log:Mt(X.log,e),error:Mt(X.error,e),critical:Mt(X.critical,e)}};l.bind=function(e,t){var r,n;if(wt&&e.bind===wt)return wt.apply(e,le.call(arguments,1));if(!l.isFunction(e))throw new TypeError;return r=le.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(le.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(le.call(arguments)));return Object(a)===a?a:o},n},l.each=function(e,t,r){if(e!=null){if(Cr&&e.forEach===Cr)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===It)return}else for(var o in e)if(Ze.call(e,o)&&t.call(r,e[o],o,e)===It)return}},l.extend=function(e){return l.each(le.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},l.isArray=ni||function(e){return Ne.call(e)==="[object Array]"},l.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},l.isArguments=function(e){return!!(e&&Ze.call(e,"callee"))},l.toArray=function(e){return e?e.toArray?e.toArray():l.isArray(e)||l.isArguments(e)?le.call(e):l.values(e):[]},l.map=function(e,t,r){if(Or&&e.map===Or)return e.map(t,r);var n=[];return l.each(e,function(i){n.push(t.call(r,i))}),n},l.keys=function(e){var t=[];return e===null||l.each(e,function(r,n){t[t.length]=n}),t},l.values=function(e){var t=[];return e===null||l.each(e,function(r){t[t.length]=r}),t},l.include=function(e,t){var r=!1;return e===null?r:_r&&e.indexOf===_r?e.indexOf(t)!=-1:(l.each(e,function(n){if(r||(r=n===t))return It}),r)},l.includes=function(e,t){return e.indexOf(t)!==-1},l.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},l.isObject=function(e){return e===Object(e)&&!l.isArray(e)},l.isEmptyObject=function(e){if(l.isObject(e)){for(var t in e)if(Ze.call(e,t))return!1;return!0}return!1},l.isUndefined=function(e){return e===void 0},l.isString=function(e){return Ne.call(e)=="[object String]"},l.isDate=function(e){return Ne.call(e)=="[object Date]"},l.isNumber=function(e){return Ne.call(e)=="[object Number]"},l.isElement=function(e){return!!(e&&e.nodeType===1)},l.encodeDates=function(e){return l.each(e,function(t,r){l.isDate(t)?e[r]=l.formatDate(t):l.isObject(t)&&(e[r]=l.encodeDates(t))}),e},l.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},l.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},l.strip_empty_properties=function(e){var t={};return l.each(e,function(r,n){l.isString(r)&&r.length>0&&(t[n]=r)}),t},l.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):l.isArray(e)?(r=[],l.each(e,function(n){r.push(l.truncate(n,t))})):l.isObject(e)?(r={},l.each(e,function(n,i){r[i]=l.truncate(n,t)})):r=e,r},l.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(u){var s=a[u];return typeof s=="string"?s:"\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",u=" ",s=0,d="",c="",f=0,p=a,h=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=u,h=[],Ne.apply(g)==="[object Array]"){for(f=g.length,s=0;s<f;s+=1)h[s]=n(s,g)||"null";return c=h.length===0?"[]":a?`[
|
|
33
|
+
`+a+h.join(`,
|
|
34
34
|
`+a)+`
|
|
35
|
-
`+
|
|
36
|
-
`,r:"\r",t:" "},n,i=function(
|
|
35
|
+
`+p+"]":"["+h.join(",")+"]",a=p,c}for(d in g)Ze.call(g,d)&&(c=n(d,g),c&&h.push(r(d)+(a?": ":":")+c));return c=h.length===0?"{}":a?"{"+h.join(",")+p+"}":"{"+h.join(",")+"}",a=p,c}};return n("",{"":t})}}(),l.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
36
|
+
`,r:"\r",t:" "},n,i=function(h){var g=new SyntaxError(h);throw g.at=e,g.text=n,g},o=function(h){return h&&h!==t&&i("Expected '"+h+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},a=function(){var h,g="";for(t==="-"&&(g="-",o("-"));t>="0"&&t<="9";)g+=t,o();if(t===".")for(g+=".";o()&&t>="0"&&t<="9";)g+=t;if(t==="e"||t==="E")for(g+=t,o(),(t==="-"||t==="+")&&(g+=t,o());t>="0"&&t<="9";)g+=t,o();if(h=+g,!isFinite(h))i("Bad number");else return h},u=function(){var h,g,m="",v;if(t==='"')for(;o();){if(t==='"')return o(),m;if(t==="\\")if(o(),t==="u"){for(v=0,g=0;g<4&&(h=parseInt(o(),16),!!isFinite(h));g+=1)v=v*16+h;m+=String.fromCharCode(v)}else if(typeof r[t]=="string")m+=r[t];else break;else m+=t}i("Bad string")},s=function(){for(;t&&t<=" ";)o()},d=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},c,f=function(){var h=[];if(t==="["){if(o("["),s(),t==="]")return o("]"),h;for(;t;){if(h.push(c()),s(),t==="]")return o("]"),h;o(","),s()}}i("Bad array")},p=function(){var h,g={};if(t==="{"){if(o("{"),s(),t==="}")return o("}"),g;for(;t;){if(h=u(),s(),o(":"),Object.hasOwnProperty.call(g,h)&&i('Duplicate key "'+h+'"'),g[h]=c(),s(),t==="}")return o("}"),g;o(","),s()}}i("Bad object")};return c=function(){switch(s(),t){case"{":return p();case"[":return f();case'"':return u();case"-":return a();default:return t>="0"&&t<="9"?a():d()}},function(h){var g;return n=h,e=0,t=" ",g=c(),s(),t&&i("Syntax error"),g}}(),l.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,o,a,u,s,d,c=0,f=0,p="",h=[];if(!e)return e;e=l.utf8Encode(e);do r=e.charCodeAt(c++),n=e.charCodeAt(c++),i=e.charCodeAt(c++),d=r<<16|n<<8|i,o=d>>18&63,a=d>>12&63,u=d>>6&63,s=d&63,h[f++]=t.charAt(o)+t.charAt(a)+t.charAt(u)+t.charAt(s);while(c<e.length);switch(p=h.join(""),e.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"=";break}return p},l.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
|
|
37
37
|
`).replace(/\r/g,`
|
|
38
|
-
`);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),l=null;a<128?n++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(n>r&&(t+=e.substring(r,n)),t+=l,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},d.UUID=function(){var e=function(){var n=1*new Date,i;if(F.performance&&F.performance.now)i=F.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ae,i,o,a=[],l=0;function s(c,u){var h,m=0;for(h=0;h<u.length;h++)m|=a[h]<<h*8;return c^m}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(l=s(l,a),a=[]);return a.length>0&&(l=s(l,a)),l.toString(16)};return function(){var n=(Xe.height*Xe.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var dr=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];d.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<dr.length;t++)if(e.indexOf(dr[t])!==-1)return!0;return!1},d.HTTPBuildQuery=function(e,t){var r,n,i=[];return d.isUndefined(t)&&(t="&"),d.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},d.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{J.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},d.cookie={get:function(e){for(var t=e+"=",r=q.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=d.JSONDecode(d.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=fr(q.location.hostname);l=u?"; domain=."+u:""}if(r){var h=new Date;h.setTime(h.getTime()+r*1e3),s="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),q.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c},set:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=fr(q.location.hostname);l=u?"; domain=."+u:""}if(r){var h=new Date;h.setTime(h.getTime()+r*24*60*60*1e3),s="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var m=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c;return q.cookie=m,m},remove:function(e,t,r){d.cookie.set(e,"",-1,t,!1,!1,r)}};var mt=null,Ke=function(e,t){if(mt!==null&&!t)return mt;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+gt(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return mt=r,r};d.localStorage={is_supported:function(e){var t=Ke(null,e);return t||J.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){J.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){d.localStorage.error(t)}return null},parse:function(e){try{return d.JSONDecode(d.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){d.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){d.localStorage.error(t)}}},d.register_event=function(){var e=function(n,i,o,a,l){if(!n){J.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!l);else{var s="on"+i,c=n[s];n[s]=t(n,o,c)}};function t(n,i,o){var a=function(l){if(l=l||r(window.event),!!l){var s=!0,c,u;return d.isFunction(o)&&(c=o(l)),u=i.call(n,l),(c===!1||u===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var Un=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');d.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!q.getElementsByTagName)return[];var o=i.split(" "),a,l,s,c,u,h,m,f,g,p,y=[q];for(h=0;h<o.length;h++){if(a=o[h].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),s=l[0];var w=l[1],S=q.getElementById(w);if(!S||s&&S.nodeName.toLowerCase()!=s)return[];y=[S];continue}if(a.indexOf(".")>-1){l=a.split("."),s=l[0];var v=l[1];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];for(y=[],p=0,m=0;m<c.length;m++)c[m].className&&d.isString(c[m].className)&&r(c[m],v)&&(y[p++]=c[m]);continue}var b=a.match(Un);if(b){s=b[1];var M=b[2],B=b[3],P=b[4];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=[],p=0;var x;switch(B){case"=":x=function(k){return k.getAttribute(M)==P};break;case"~":x=function(k){return k.getAttribute(M).match(new RegExp("\\b"+P+"\\b"))};break;case"|":x=function(k){return k.getAttribute(M).match(new RegExp("^"+P+"-?"))};break;case"^":x=function(k){return k.getAttribute(M).indexOf(P)===0};break;case"$":x=function(k){return k.getAttribute(M).lastIndexOf(P)==k.getAttribute(M).length-P.length};break;case"*":x=function(k){return k.getAttribute(M).indexOf(P)>-1};break;default:x=function(k){return k.getAttribute(M)}}for(y=[],p=0,m=0;m<c.length;m++)x(c[m])&&(y[p++]=c[m]);continue}for(s=a,c=[],u=0,m=0;m<y.length;m++)for(g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=c}return y}return function(i){return d.isElement(i)?[i]:d.isObject(i)&&!d.isUndefined(i.length)?i:n.call(this,i)}}();var Wn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],zn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];d.info={campaignParams:function(e){var t="",r={};return d.each(Wn,function(n){t=d.getQueryParam(q.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return d.each(zn,function(r){e=d.getQueryParam(q.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return d.extend(d.info.campaignParams(),d.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=d.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=d.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||d.includes(e," OPR/")?d.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":d.includes(e,"IEMobile")||d.includes(e,"WPDesktop")?"Internet Explorer Mobile":d.includes(e,"SamsungBrowser/")?"Samsung Internet":d.includes(e,"Edge")||d.includes(e,"Edg/")?"Microsoft Edge":d.includes(e,"FBIOS")?"Facebook Mobile":d.includes(e,"Chrome")?"Chrome":d.includes(e,"CriOS")?"Chrome iOS":d.includes(e,"UCWEB")||d.includes(e,"UCBrowser")?"UC Browser":d.includes(e,"FxiOS")?"Firefox iOS":d.includes(t,"Apple")?d.includes(e,"Mobile")?"Mobile Safari":"Safari":d.includes(e,"Android")?"Android Mobile":d.includes(e,"Konqueror")?"Konqueror":d.includes(e,"Firefox")?"Firefox":d.includes(e,"MSIE")||d.includes(e,"Trident/")?"Internet Explorer":d.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=d.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ae;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return F.location.href},properties:function(e){return typeof e!="object"&&(e={}),d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,ke.vendor,Je),$referrer:q.referrer,$referring_domain:d.info.referringDomain(q.referrer),$device:d.info.device(ae)}),{$current_url:d.info.currentUrl(),$browser_version:d.info.browserVersion(ae,ke.vendor,Je),$screen_height:Xe.height,$screen_width:Xe.width,mp_lib:"web",$lib_version:ct.LIB_VERSION,$insert_id:gt(),time:d.timestamp()/1e3},d.strip_empty_properties(e))},people_properties:function(){return d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,ke.vendor,Je)}),{$browser_version:d.info.browserVersion(ae,ke.vendor,Je)})},mpPageViewProperties:function(){return d.strip_empty_properties({current_page_title:q.title,current_domain:F.location.hostname,current_url_path:F.location.pathname,current_url_protocol:F.location.protocol,current_url_search:F.location.search})}};var gt=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},Hn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,$n=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,fr=function(e){var t=$n,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=Hn);var i=e.match(t);return i?i[0]:""},qn=function(){var e=F.navigator.onLine;return d.isUndefined(e)||e},Ye=null,Qe=null;typeof JSON<"u"&&(Ye=JSON.stringify,Qe=JSON.parse),Ye=Ye||d.JSONEncode,Qe=Qe||d.JSONDecode,d.toArray=d.toArray,d.isObject=d.isObject,d.JSONEncode=d.JSONEncode,d.JSONDecode=d.JSONDecode,d.isBlockedUA=d.isBlockedUA,d.isEmptyObject=d.isEmptyObject,d.info=d.info,d.info.device=d.info.device,d.info.browser=d.info.browser,d.info.browserVersion=d.info.browserVersion,d.info.properties=d.info.properties;var jn="__mp_opt_in_out_";function Gn(e,t){if(Yn(t))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Kn(e,t)==="0";return r&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Vn(e){return Qn(e,function(t){return this.get_config(t)})}function Jn(e){return e=e||{},e.persistenceType==="localStorage"?d.localStorage:d.cookie}function Xn(e,t){return t=t||{},(t.persistencePrefix||jn)+e}function Kn(e,t){return Jn(t).get(Xn(e,t))}function Yn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||F,r=t.navigator||{},n=!1;return d.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){d.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function Qn(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");n&&(r=Gn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:l}))}catch(c){J.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var Zn=Te("lock"),hr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};hr.prototype.withLock=function(e,t,r){!r&&typeof t!="function"&&(r=t,t=null);var n=r||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,s=this.storage,c=o+":X",u=o+":Y",h=o+":Z",m=function(S){t&&t(S)},f=function(S){if(new Date().getTime()-i>l){Zn.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+n+"]"),s.removeItem(h),s.removeItem(u),y();return}setTimeout(function(){try{S()}catch(v){m(v)}},a*(Math.random()+.1))},g=function(S,v){S()?v():f(function(){g(S,v)})},p=function(){var S=s.getItem(u);if(S&&S!==n)return!1;if(s.setItem(u,n),s.getItem(u)===n)return!0;if(!Ke(s,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},y=function(){s.setItem(c,n),g(p,function(){if(s.getItem(c)===n){w();return}f(function(){if(s.getItem(u)!==n){y();return}g(function(){return!s.getItem(h)},w)})})},w=function(){s.setItem(h,"1");try{e()}finally{s.removeItem(h),s.getItem(u)===n&&s.removeItem(u),s.getItem(c)===n&&s.removeItem(c)}};try{if(Ke(s,!0))y();else throw new Error("localStorage support check failed")}catch(S){m(S)}};var pr=Te("batch"),re=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.storage=t.storage||window.localStorage,this.lock=new hr(e,{storage:this.storage})),this.reportError=t.errorReporter||d.bind(pr.error,pr),this.pid=t.pid||null,this.memQueue=[]};re.prototype.enqueue=function(e,t,r){var n={id:gt(),flushAfter:new Date().getTime()+t*2,payload:e};this.usePersistence?this.lock.withLock(d.bind(function(){var o;try{var a=this.readFromStorage();a.push(n),o=this.saveToStorage(a),o&&this.memQueue.push(n)}catch{this.reportError("Error enqueueing item",e),o=!1}r&&r(o)},this),d.bind(function(o){this.reportError("Error acquiring storage lock",o),r&&r(!1)},this),this.pid):(this.memQueue.push(n),r&&r(!0))},re.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var r=this.readFromStorage();if(r.length){var n={};d.each(t,function(a){n[a.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!n[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var mr=function(e,t){var r=[];return d.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};re.prototype.removeItemsByID=function(e,t){var r={};if(d.each(e,function(i){r[i]=!0}),this.memQueue=mr(this.memQueue,r),!this.usePersistence)t&&t(!0);else{var n=d.bind(function(){var i;try{var o=this.readFromStorage();if(o=mr(o,r),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var a=0;a<o.length;a++){var l=o[a];if(l.id&&r[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",e),i=!1}return i},this);this.lock.withLock(function(){var o=n();t&&t(o)},d.bind(function(o){var a=!1;if(this.reportError("Error acquiring storage lock",o),!Ke(this.storage,!0)&&(a=n(),!a))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}t&&t(a)},this),this.pid)}};var gr=function(e,t){var r=[];return d.each(e,function(n){var i=n.id;if(i in t){var o=t[i];o!==null&&(n.payload=o,r.push(n))}else r.push(n)}),r};re.prototype.updatePayloads=function(e,t){this.memQueue=gr(this.memQueue,e),this.usePersistence?this.lock.withLock(d.bind(function(){var n;try{var i=this.readFromStorage();i=gr(i,e),n=this.saveToStorage(i)}catch{this.reportError("Error updating items",e),n=!1}t&&t(n)},this),d.bind(function(n){this.reportError("Error acquiring storage lock",n),t&&t(!1)},this),this.pid):t&&t(!0)},re.prototype.readFromStorage=function(){var e;try{e=this.storage.getItem(this.storageKey),e&&(e=Qe(e),d.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},re.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Ye(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},re.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var ei=10*60*1e3,De=Te("batch"),Q=function(e,t){this.errorReporter=t.errorReporter,this.queue=new re(e,{errorReporter:d.bind(this.reportError,this),storage:t.storage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};Q.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},Q.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Q.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Q.prototype.clear=function(){this.queue.clear()},Q.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Q.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Q.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(d.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},Q.prototype.flush=function(e){try{if(this.requestInProgress){De.log("Flush: Request already in progress");return}e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize,i=this.queue.fillBatch(n),o=i.length===n,a=[],l={};if(d.each(i,function(u){var h=u.payload;if(this.beforeSendHook&&!u.orphaned&&(h=this.beforeSendHook(h)),h){h.event&&h.properties&&(h.properties=d.extend({},h.properties,{mp_sent_by_lib_version:ct.LIB_VERSION}));var m=!0,f=u.id;f?(this.itemIdsSentSuccessfully[f]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]}),m=!1):this.reportError("[dupe] found item with no ID",{item:u}),m&&a.push(h)}l[u.id]=h},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var s=d.bind(function(u){this.requestInProgress=!1;try{var h=!1;if(e.unloading)this.queue.updatePayloads(l);else if(d.isObject(u)&&u.error==="timeout"&&new Date().getTime()-r>=t)this.reportError("Network timeout; retrying"),this.flush();else if(d.isObject(u)&&(u.httpStatusCode>=500||u.httpStatusCode===429||u.httpStatusCode<=0&&!qn()||u.error==="timeout")){var m=this.flushInterval*2;u.retryAfter&&(m=parseInt(u.retryAfter,10)*1e3||m),m=Math.min(ei,m),this.reportError("Error; retry in "+m+" ms"),this.scheduleFlush(m)}else if(d.isObject(u)&&u.httpStatusCode===413)if(i.length>1){var f=Math.max(1,Math.floor(n/2));this.batchSize=Math.min(this.batchSize,f,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),h=!0;else h=!0;h&&(this.queue.removeItemsByID(d.map(i,function(g){return g.id}),d.bind(function(g){g?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),d.each(i,d.bind(function(g){var p=g.id;p?(this.itemIdsSentSuccessfully[p]=this.itemIdsSentSuccessfully[p]||0,this.itemIdsSentSuccessfully[p]++,this.itemIdsSentSuccessfully[p]>5&&this.reportError("[dupe] item ID sent too many times",{item:g,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]})):this.reportError("[dupe] found item with no ID while removing",{item:g})},this)))}catch(g){this.reportError("Error handling API response",g),this.resetFlush()}},this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),De.log("MIXPANEL REQUEST:",a),this.sendRequest(a,c,s)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},Q.prototype.reportError=function(e,t){if(De.error.apply(De.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){De.error(r)}};var Se=Te("recorder"),yr=F.CompressionStream,ti={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},ri=new Set([Y.MouseMove,Y.MouseInteraction,Y.Scroll,Y.ViewportResize,Y.Input,Y.TouchMove,Y.MediaInteraction,Y.Drag,Y.Selection]);function ni(e){return e.type===or.IncrementalSnapshot&&ri.has(e.data.source)}var X=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout,this._onMaxLengthReached=e.onMaxLengthReached,this._rrwebRecord=e.rrwebRecord,this.replayId=e.replayId,this._stopRecording=null,this.seqNo=0,this.replayStartTime=null,this.batchStartUrl=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=je,this.recordMinMs=0;var t="__mprec_"+this.getConfig("token")+"_"+this.replayId;this.batcher=new Q(t,{errorReporter:d.bind(this.reportError,this),flushOnlyOnInterval:!0,libConfig:ti,sendRequestFunc:d.bind(this.flushEventsWithOptOut,this),usePersistence:!1})};X.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},X.prototype.get_config=function(e){return this.getConfig(e)},X.prototype.startRecording=function(e){if(this._stopRecording!==null){Se.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>je&&(this.recordMaxMs=je,Se.critical("record_max_ms cannot be greater than "+je+"ms. Capping value.")),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>dt&&(this.recordMinMs=dt,Se.critical("record_min_ms cannot be greater than "+dt+"ms. Capping value.")),this.replayStartTime=new Date().getTime(),this.batchStartUrl=d.info.currentUrl(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=d.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(this._onIdleTimeout,this.getConfig("record_idle_timeout_ms"))},this),r=this.getConfig("record_block_selector");if((r===""||r===null)&&(r=void 0),this._stopRecording=this._rrwebRecord({emit:d.bind(function(n){this.batcher.enqueue(n),ni(n)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())},this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector")}),typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}t(),this.maxTimeoutId=setTimeout(d.bind(this._onMaxLengthReached,this),this.recordMaxMs)},X.prototype.stopRecording=function(){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(e){this.reportError("Error with rrweb stopRecording",e)}this._stopRecording=null}this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},X.prototype.isRrwebStopped=function(){return this._stopRecording===null},X.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,d.bind(this._onOptOut,this))},X.prototype._onOptOut=function(e){e===0&&this.stopRecording()},X.prototype._sendRequest=function(e,t,r,n){var i=d.bind(function(o,a){o.status===200&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=d.info.currentUrl()),n({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})},this);F.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){n({error:a})})}).catch(function(o){n({error:o,httpStatusCode:0})})},X.prototype._flushEvents=Vn(function(e,t,r){const n=e.length;if(n>0){var i=this.replayId,o=e[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var a=e[n-1].timestamp-this.replayStartTime,l={$current_url:this.batchStartUrl,$lib_version:ct.LIB_VERSION,batch_start_time:o/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:i,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3,seq:this.seqNo},s=d.JSONEncode(e),c=this._mixpanel.get_property("$device_id");c&&(l.$device_id=c);var u=this._mixpanel.get_property("$user_id");if(u&&(l.$user_id=u),yr){var h=new Blob([s],{type:"application/json"}).stream(),m=h.pipeThrough(new yr("gzip"));new Response(m).blob().then(d.bind(function(f){l.format="gzip",this._sendRequest(i,l,f,r)},this))}else l.format="body",this._sendRequest(i,l,s,r)}}),X.prototype.reportError=function(e,t){Se.error.apply(Se.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(r){Se.error(r)}};var yt=Te("recorder"),be=function(e){this._mixpanel=e,this.activeRecording=null};be.prototype.startRecording=function(e){if(this.activeRecording&&!this.activeRecording.isRrwebStopped()){yt.log("Recording already in progress, skipping startRecording.");return}var t=d.bind(function(){yt.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),r=d.bind(function(){yt.log("Max recording length reached, stopping recording."),this.resetRecording()},this);this.activeRecording=new X({mixpanelInstance:this._mixpanel,onIdleTimeout:t,onMaxLengthReached:r,replayId:d.UUID(),rrwebRecord:Ee}),this.activeRecording.startRecording(e)},be.prototype.stopRecording=function(){this.activeRecording&&(this.activeRecording.stopRecording(),this.activeRecording=null)},be.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},be.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(be.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),F.__mp_recorder=be})();
|
|
38
|
+
`);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),u=null;a<128?n++:a>127&&a<2048?u=String.fromCharCode(a>>6|192,a&63|128):u=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),u!==null&&(n>r&&(t+=e.substring(r,n)),t+=u,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},l.UUID=function(){var e=function(){var n=1*new Date,i;if(x.performance&&x.performance.now)i=x.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ce,i,o,a=[],u=0;function s(d,c){var f,p=0;for(f=0;f<c.length;f++)p|=a[f]<<f*8;return d^p}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(u=s(u,a),a=[]);return a.length>0&&(u=s(u,a)),u.toString(16)};return function(){var n=(tt.height*tt.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var Er=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];l.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Er.length;t++)if(e.indexOf(Er[t])!==-1)return!0;return!1},l.HTTPBuildQuery=function(e,t){var r,n,i=[];return l.isUndefined(t)&&(t="&"),l.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},l.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{X.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},l.cookie={get:function(e){for(var t=e+"=",r=j.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=l.JSONDecode(l.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var u="",s="",d="";if(a)u="; domain="+a;else if(n){var c=Rr(j.location.hostname);u=c?"; domain=."+c:""}if(r){var f=new Date;f.setTime(f.getTime()+r*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure"),j.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+u+d},set:function(e,t,r,n,i,o,a){var u="",s="",d="";if(a)u="; domain="+a;else if(n){var c=Rr(j.location.hostname);u=c?"; domain=."+c:""}if(r){var f=new Date;f.setTime(f.getTime()+r*24*60*60*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure");var p=e+"="+encodeURIComponent(t)+s+"; path=/"+u+d;return j.cookie=p,p},remove:function(e,t,r){l.cookie.set(e,"",-1,t,!1,!1,r)}};var Ct=null,rt=function(e,t){if(Ct!==null&&!t)return Ct;var r=!0;try{e=e||x.localStorage;var n="__mplss_"+_t(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return Ct=r,r};l.localStorage={is_supported:function(e){var t=rt(null,e);return t||X.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){X.error("localStorage error: "+e)},get:function(e){try{return x.localStorage.getItem(e)}catch(t){l.localStorage.error(t)}return null},parse:function(e){try{return l.JSONDecode(l.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{x.localStorage.setItem(e,t)}catch(r){l.localStorage.error(r)}},remove:function(e){try{x.localStorage.removeItem(e)}catch(t){l.localStorage.error(t)}}},l.register_event=function(){var e=function(n,i,o,a,u){if(!n){X.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!u);else{var s="on"+i,d=n[s];n[s]=t(n,o,d)}};function t(n,i,o){var a=function(u){if(u=u||r(x.event),!!u){var s=!0,d,c;return l.isFunction(o)&&(d=o(u)),c=i.call(n,u),(d===!1||c===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var ii=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');l.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!j.getElementsByTagName)return[];var o=i.split(" "),a,u,s,d,c,f,p,h,g,m,v=[j];for(f=0;f<o.length;f++){if(a=o[f].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){u=a.split("#"),s=u[0];var w=u[1],b=j.getElementById(w);if(!b||s&&b.nodeName.toLowerCase()!=s)return[];v=[b];continue}if(a.indexOf(".")>-1){u=a.split("."),s=u[0];var y=u[1];for(s||(s="*"),d=[],c=0,p=0;p<v.length;p++)for(s=="*"?g=e(v[p]):g=v[p].getElementsByTagName(s),h=0;h<g.length;h++)d[c++]=g[h];for(v=[],m=0,p=0;p<d.length;p++)d[p].className&&l.isString(d[p].className)&&r(d[p],y)&&(v[m++]=d[p]);continue}var S=a.match(ii);if(S){s=S[1];var I=S[2],U=S[3],B=S[4];for(s||(s="*"),d=[],c=0,p=0;p<v.length;p++)for(s=="*"?g=e(v[p]):g=v[p].getElementsByTagName(s),h=0;h<g.length;h++)d[c++]=g[h];v=[],m=0;var k;switch(U){case"=":k=function(T){return T.getAttribute(I)==B};break;case"~":k=function(T){return T.getAttribute(I).match(new RegExp("\\b"+B+"\\b"))};break;case"|":k=function(T){return T.getAttribute(I).match(new RegExp("^"+B+"-?"))};break;case"^":k=function(T){return T.getAttribute(I).indexOf(B)===0};break;case"$":k=function(T){return T.getAttribute(I).lastIndexOf(B)==T.getAttribute(I).length-B.length};break;case"*":k=function(T){return T.getAttribute(I).indexOf(B)>-1};break;default:k=function(T){return T.getAttribute(I)}}for(v=[],m=0,p=0;p<d.length;p++)k(d[p])&&(v[m++]=d[p]);continue}for(s=a,d=[],c=0,p=0;p<v.length;p++)for(g=v[p].getElementsByTagName(s),h=0;h<g.length;h++)d[c++]=g[h];v=d}return v}return function(i){return l.isElement(i)?[i]:l.isObject(i)&&!l.isUndefined(i.length)?i:n.call(this,i)}}();var oi=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],si=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];l.info={campaignParams:function(e){var t="",r={};return l.each(oi,function(n){t=l.getQueryParam(j.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return l.each(si,function(r){e=l.getQueryParam(j.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return l.extend(l.info.campaignParams(),l.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=l.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=l.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||l.includes(e," OPR/")?l.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":l.includes(e,"IEMobile")||l.includes(e,"WPDesktop")?"Internet Explorer Mobile":l.includes(e,"SamsungBrowser/")?"Samsung Internet":l.includes(e,"Edge")||l.includes(e,"Edg/")?"Microsoft Edge":l.includes(e,"FBIOS")?"Facebook Mobile":l.includes(e,"Chrome")?"Chrome":l.includes(e,"CriOS")?"Chrome iOS":l.includes(e,"UCWEB")||l.includes(e,"UCBrowser")?"UC Browser":l.includes(e,"FxiOS")?"Firefox iOS":l.includes(t,"Apple")?l.includes(e,"Mobile")?"Mobile Safari":"Safari":l.includes(e,"Android")?"Android Mobile":l.includes(e,"Konqueror")?"Konqueror":l.includes(e,"Firefox")?"Firefox":l.includes(e,"MSIE")||l.includes(e,"Trident/")?"Internet Explorer":l.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=l.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ce;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return x.location.href},properties:function(e){return typeof e!="object"&&(e={}),l.extend(l.strip_empty_properties({$os:l.info.os(),$browser:l.info.browser(ce,Ae.vendor,et),$referrer:j.referrer,$referring_domain:l.info.referringDomain(j.referrer),$device:l.info.device(ce)}),{$current_url:l.info.currentUrl(),$browser_version:l.info.browserVersion(ce,Ae.vendor,et),$screen_height:tt.height,$screen_width:tt.width,mp_lib:"web",$lib_version:gt.LIB_VERSION,$insert_id:_t(),time:l.timestamp()/1e3},l.strip_empty_properties(e))},people_properties:function(){return l.extend(l.strip_empty_properties({$os:l.info.os(),$browser:l.info.browser(ce,Ae.vendor,et)}),{$browser_version:l.info.browserVersion(ce,Ae.vendor,et)})},mpPageViewProperties:function(){return l.strip_empty_properties({current_page_title:j.title,current_domain:x.location.hostname,current_url_path:x.location.pathname,current_url_protocol:x.location.protocol,current_url_search:x.location.search})}};var _t=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},ai=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,ui=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Rr=function(e){var t=ui,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=ai);var i=e.match(t);return i?i[0]:""},li=function(){var e=x.navigator.onLine;return l.isUndefined(e)||e},nt=null,it=null;typeof JSON<"u"&&(nt=JSON.stringify,it=JSON.parse),nt=nt||l.JSONEncode,it=it||l.JSONDecode,l.toArray=l.toArray,l.isObject=l.isObject,l.JSONEncode=l.JSONEncode,l.JSONDecode=l.JSONDecode,l.isBlockedUA=l.isBlockedUA,l.isEmptyObject=l.isEmptyObject,l.info=l.info,l.info.device=l.info.device,l.info.browser=l.info.browser,l.info.browserVersion=l.info.browserVersion,l.info.properties=l.info.properties,l.NPO=oe;var ci="__mp_opt_in_out_";function di(e,t){if(gi(t))return X.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=mi(e,t)==="0";return r&&X.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function fi(e){return yi(e,function(t){return this.get_config(t)})}function hi(e){return e=e||{},e.persistenceType==="localStorage"?l.localStorage:l.cookie}function pi(e,t){return t=t||{},(t.persistencePrefix||ci)+e}function mi(e,t){return hi(t).get(pi(e,t))}function gi(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||x,r=t.navigator||{},n=!1;return l.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){l.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function yi(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),u=t.call(this,"window");n&&(r=di(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:u}))}catch(d){X.error("Unexpected error when checking tracking opt-out status: "+d)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var vi=Le("lock"),xr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||L};xr.prototype.withLock=function(e,t){var r=this.promiseImpl;return new r(l.bind(function(n,i){var o=t||new Date().getTime()+"|"+Math.random(),a=new Date().getTime(),u=this.storageKey,s=this.pollIntervalMS,d=this.timeoutMS,c=this.storage,f=u+":X",p=u+":Y",h=u+":Z",g=function(y){if(new Date().getTime()-a>d){vi.error("Timeout waiting for mutex on "+u+"; clearing lock. ["+o+"]"),c.removeItem(h),c.removeItem(p),w();return}setTimeout(function(){try{y()}catch(S){i(S)}},s*(Math.random()+.1))},m=function(y,S){y()?S():g(function(){m(y,S)})},v=function(){var y=c.getItem(p);return y&&y!==o?!1:(c.setItem(p,o),c.getItem(p)===o?!0:(rt(c,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},w=function(){c.setItem(f,o),m(v,function(){if(c.getItem(f)===o){b();return}g(function(){if(c.getItem(p)!==o){w();return}m(function(){return!c.getItem(h)},b)})})},b=function(){c.setItem(h,"1");var y=function(){c.removeItem(h),c.getItem(p)===o&&c.removeItem(p),c.getItem(f)===o&&c.removeItem(f)};e().then(function(S){y(),n(S)}).catch(function(S){y(),i(S)})};try{if(rt(c,!0))w();else throw new Error("localStorage support check failed")}catch(y){i(y)}},this))};var Pe=function(e){this.storage=e||localStorage};Pe.prototype.init=function(){return L.resolve()},Pe.prototype.setItem=function(e,t){return new L(l.bind(function(r,n){try{this.storage.setItem(e,t)}catch(i){n(i)}r()},this))},Pe.prototype.getItem=function(e){return new L(l.bind(function(t,r){var n;try{n=this.storage.getItem(e)}catch(i){r(i)}t(n)},this))},Pe.prototype.removeItem=function(e){return new L(l.bind(function(t,r){try{this.storage.removeItem(e)}catch(n){r(n)}t()},this))};var kr=Le("batch"),re=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Pe,this.lock=new xr(e,{storage:t.sharedLockStorage||window.localStorage}),this.queueStorage.init()),this.reportError=t.errorReporter||l.bind(kr.error,kr),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1};re.prototype.ensureInit=function(){return this.initialized?L.resolve():this.queueStorage.init().then(l.bind(function(){this.initialized=!0},this)).catch(l.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},re.prototype.enqueue=function(e,t){var r={id:_t(),flushAfter:new Date().getTime()+t*2,payload:e};if(this.usePersistence){var n=l.bind(function(){return this.ensureInit().then(l.bind(function(){return this.readFromStorage()},this)).then(l.bind(function(i){return i.push(r),this.saveToStorage(i)},this)).then(l.bind(function(i){return i&&this.memQueue.push(r),i},this)).catch(l.bind(function(i){return this.reportError("Error enqueueing item",i,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(l.bind(function(i){return this.reportError("Error acquiring storage lock",i),!1},this))}else return this.memQueue.push(r),L.resolve(!0)},re.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(l.bind(function(){return this.readFromStorage()},this)).then(l.bind(function(r){if(r.length){var n={};l.each(t,function(a){n[a.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!n[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):L.resolve(t)};var Tr=function(e,t){var r=[];return l.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};re.prototype.removeItemsByID=function(e){var t={};if(l.each(e,function(n){t[n]=!0}),this.memQueue=Tr(this.memQueue,t),this.usePersistence){var r=l.bind(function(){return this.ensureInit().then(l.bind(function(){return this.readFromStorage()},this)).then(l.bind(function(n){return n=Tr(n,t),this.saveToStorage(n)},this)).then(l.bind(function(){return this.readFromStorage()},this)).then(l.bind(function(n){for(var i=0;i<n.length;i++){var o=n[i];if(o.id&&t[o.id])throw new Error("Item not removed from storage")}return!0},this)).catch(l.bind(function(n){return this.reportError("Error removing items",n,e),!1},this))},this);return this.lock.withLock(r,this.pid).catch(l.bind(function(n){return this.reportError("Error acquiring storage lock",n),rt(this.queueStorage.storage,!0)?!1:r().then(l.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(l.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return L.resolve(!0)};var Nr=function(e,t){var r=[];return l.each(e,function(n){var i=n.id;if(i in t){var o=t[i];o!==null&&(n.payload=o,r.push(n))}else r.push(n)}),r};re.prototype.updatePayloads=function(e){return this.memQueue=Nr(this.memQueue,e),this.usePersistence?this.lock.withLock(l.bind(function(){return this.ensureInit().then(l.bind(function(){return this.readFromStorage()},this)).then(l.bind(function(r){return r=Nr(r,e),this.saveToStorage(r)},this)).catch(l.bind(function(r){return this.reportError("Error updating items",e,r),!1},this))},this),this.pid).catch(l.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this)):L.resolve(!0)},re.prototype.readFromStorage=function(){return this.ensureInit().then(l.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(l.bind(function(e){return e&&(e=it(e),l.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(l.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},re.prototype.saveToStorage=function(e){try{var t=nt(e)}catch(r){return this.reportError("Error serializing queue",r),L.resolve(!1)}return this.ensureInit().then(l.bind(function(){return this.queueStorage.setItem(this.storageKey,t)},this)).then(function(){return!0}).catch(l.bind(function(r){return this.reportError("Error saving queue",r),!1},this))},re.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(l.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):L.resolve()};var Si=10*60*1e3,Fe=Le("batch"),K=function(e,t){this.errorReporter=t.errorReporter,this.queue=new re(e,{errorReporter:l.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};K.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},K.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},K.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},K.prototype.clear=function(){return this.queue.clear()},K.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},K.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},K.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(l.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},K.prototype.sendRequestPromise=function(e,t){return new L(l.bind(function(r){this.sendRequest(e,t,r)},this))},K.prototype.flush=function(e){if(this.requestInProgress)return Fe.log("Flush: Request already in progress"),L.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(l.bind(function(i){var o=i.length===n,a=[],u={};if(l.each(i,function(f){var p=f.payload;if(this.beforeSendHook&&!f.orphaned&&(p=this.beforeSendHook(p)),p){p.event&&p.properties&&(p.properties=l.extend({},p.properties,{mp_sent_by_lib_version:gt.LIB_VERSION}));var h=!0,g=f.id;g?(this.itemIdsSentSuccessfully[g]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:f,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[g]}),h=!1):this.reportError("[dupe] found item with no ID",{item:f}),h&&a.push(p)}u[f.id]=p},this),a.length<1)return this.requestInProgress=!1,this.resetFlush(),L.resolve();var s=l.bind(function(){return this.queue.removeItemsByID(l.map(i,function(f){return f.id})).then(l.bind(function(f){return l.each(i,l.bind(function(p){var h=p.id;h?(this.itemIdsSentSuccessfully[h]=this.itemIdsSentSuccessfully[h]||0,this.itemIdsSentSuccessfully[h]++,this.itemIdsSentSuccessfully[h]>5&&this.reportError("[dupe] item ID sent too many times",{item:p,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]})):this.reportError("[dupe] found item with no ID while removing",{item:p})},this)),f?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),L.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),L.resolve())},this))},this),d=l.bind(function(f){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(u);if(l.isObject(f)&&f.error==="timeout"&&new Date().getTime()-r>=t)return this.reportError("Network timeout; retrying"),this.flush();if(l.isObject(f)&&(f.httpStatusCode>=500||f.httpStatusCode===429||f.httpStatusCode<=0&&!li()||f.error==="timeout")){var p=this.flushInterval*2;return f.retryAfter&&(p=parseInt(f.retryAfter,10)*1e3||p),p=Math.min(Si,p),this.reportError("Error; retry in "+p+" ms"),this.scheduleFlush(p),L.resolve()}else if(l.isObject(f)&&f.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),L.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),s();else return s()}catch(g){this.reportError("Error handling API response",g),this.resetFlush()}},this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(c.transport="sendBeacon"),Fe.log("MIXPANEL REQUEST:",a),this.sendRequestPromise(a,c).then(d)},this)).catch(l.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},K.prototype.reportError=function(e,t){if(Fe.error.apply(Fe.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){Fe.error(r)}};var Ie=Le("recorder"),Dr=x.CompressionStream,bi={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},wi=new Set([Z.MouseMove,Z.MouseInteraction,Z.Scroll,Z.ViewportResize,Z.Input,Z.TouchMove,Z.MediaInteraction,Z.Drag,Z.Selection]);function Ii(e){return e.type===pr.IncrementalSnapshot&&wi.has(e.data.source)}var Y=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout,this._onMaxLengthReached=e.onMaxLengthReached,this._rrwebRecord=e.rrwebRecord,this.replayId=e.replayId,this._stopRecording=null,this.seqNo=0,this.replayStartTime=null,this.batchStartUrl=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=Ye,this.recordMinMs=0;var t="__mprec_"+this.getConfig("token")+"_"+this.replayId;this.batcher=new K(t,{errorReporter:l.bind(this.reportError,this),flushOnlyOnInterval:!0,libConfig:bi,sendRequestFunc:l.bind(this.flushEventsWithOptOut,this),usePersistence:!1})};Y.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Y.prototype.get_config=function(e){return this.getConfig(e)},Y.prototype.startRecording=function(e){if(this._stopRecording!==null){Ie.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>Ye&&(this.recordMaxMs=Ye,Ie.critical("record_max_ms cannot be greater than "+Ye+"ms. Capping value.")),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>bt&&(this.recordMinMs=bt,Ie.critical("record_min_ms cannot be greater than "+bt+"ms. Capping value.")),this.replayStartTime=new Date().getTime(),this.batchStartUrl=l.info.currentUrl(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=l.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(this._onIdleTimeout,this.getConfig("record_idle_timeout_ms"))},this),r=this.getConfig("record_block_selector");if((r===""||r===null)&&(r=void 0),this._stopRecording=this._rrwebRecord({emit:l.bind(function(n){this.batcher.enqueue(n),Ii(n)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())},this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector")}),typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}t(),this.maxTimeoutId=setTimeout(l.bind(this._onMaxLengthReached,this),this.recordMaxMs)},Y.prototype.stopRecording=function(){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(e){this.reportError("Error with rrweb stopRecording",e)}this._stopRecording=null}this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Y.prototype.isRrwebStopped=function(){return this._stopRecording===null},Y.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,l.bind(this._onOptOut,this))},Y.prototype._onOptOut=function(e){e===0&&this.stopRecording()},Y.prototype._sendRequest=function(e,t,r,n){var i=l.bind(function(o,a){o.status===200&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=l.info.currentUrl()),n({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})},this);x.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){n({error:a})})}).catch(function(o){n({error:o,httpStatusCode:0})})},Y.prototype._flushEvents=fi(function(e,t,r){const n=e.length;if(n>0){var i=this.replayId,o=e[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var a=e[n-1].timestamp-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:gt.LIB_VERSION,batch_start_time:o/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:i,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3,seq:this.seqNo},s=l.JSONEncode(e),d=this._mixpanel.get_property("$device_id");d&&(u.$device_id=d);var c=this._mixpanel.get_property("$user_id");if(c&&(u.$user_id=c),Dr){var f=new Blob([s],{type:"application/json"}).stream(),p=f.pipeThrough(new Dr("gzip"));new Response(p).blob().then(l.bind(function(h){u.format="gzip",this._sendRequest(i,u,h,r)},this))}else u.format="body",this._sendRequest(i,u,s,r)}}),Y.prototype.reportError=function(e,t){Ie.error.apply(Ie.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(r){Ie.error(r)}};var Ot=Le("recorder"),Me=function(e){this._mixpanel=e,this.activeRecording=null};Me.prototype.startRecording=function(e){if(this.activeRecording&&!this.activeRecording.isRrwebStopped()){Ot.log("Recording already in progress, skipping startRecording.");return}var t=l.bind(function(){Ot.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),r=l.bind(function(){Ot.log("Max recording length reached, stopping recording."),this.resetRecording()},this);this.activeRecording=new Y({mixpanelInstance:this._mixpanel,onIdleTimeout:t,onMaxLengthReached:r,replayId:l.UUID(),rrwebRecord:ke}),this.activeRecording.startRecording(e)},Me.prototype.stopRecording=function(){this.activeRecording&&(this.activeRecording.stopRecording(),this.activeRecording=null)},Me.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Me.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Me.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),x.__mp_recorder=Me})();
|
|
39
39
|
//# sourceMappingURL=mixpanel-recorder.min.js.map
|