@statsig/js-client 3.8.2 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var rrwebRecord=function(){"use strict";var L;(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"})(L||(L={}));function zt(e){return e.nodeType===e.ELEMENT_NODE}function de(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function ue(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Bt(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 Ht(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 ge(e){try{const t=e.rules||e.cssRules;return t?Bt(Array.from(t,Ge).join("")):null}catch{return null}}function Ge(e){let t;if(Gt(e))try{t=ge(e.styleSheet)||Ht(e)}catch{}else if(qt(e)&&e.selectorText.includes(":"))return Vt(e.cssText);return t||e.cssText}function Vt(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Gt(e){return"styleSheet"in e}function qt(e){return"selectorText"in e}class qe{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 o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Xt(){return new qe}function De({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:a}){let l=o||"";const i=n&&K(n);return(t[r.toLowerCase()]||i&&t[i])&&(a?l=a(l,e):l="*".repeat(l.length)),l}function K(e){return e.toLowerCase()}const Xe="__rrweb_original__";function Yt(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){const a=t.getImageData,l=Xe in a?a[Xe]:a;if(new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(i=>i!==0))return!1}return!0}function Ae(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?K(t):null}function Ye(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,a=n.pathname.match(o);return(r=a?.[1])!==null&&r!==void 0?r:null}let Jt=1;const Kt=new RegExp("[^a-z0-9-_:]"),pe=-2;function Je(){return Jt++}function Qt(e){if(e instanceof HTMLFormElement)return"form";const t=K(e.tagName);return Kt.test(t)?"div":t}function Zt(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let re,Ke;const er=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,tr=/^(?:[a-z+]+:)?\/\//i,rr=/^www\..*/i,nr=/^(data:)([^,]*),(.*)/i;function Se(e,t){return(e||"").replace(er,(r,n,o,a,l,i)=>{const s=o||l||i,c=n||a||"";if(!s)return r;if(tr.test(s)||rr.test(s))return`url(${c}${s}${c})`;if(nr.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${Zt(t)+s}${c})`;const d=t.split("/"),p=s.split("/");d.pop();for(const h of p)h!=="."&&(h===".."?d.pop():d.push(h));return`url(${c}${d.join("/")}${c})`})}const or=/^[^ \t\n\r\u000c]+/,sr=/^[, \t\n\r\u000c]+/;function ar(e,t){if(t.trim()==="")return t;let r=0;function n(a){let l;const i=a.exec(t.substring(r));return i?(l=i[0],r+=l.length,l):""}const o=[];for(;n(sr),!(r>=t.length);){let a=n(or);if(a.slice(-1)===",")a=be(e,a.substring(0,a.length-1)),o.push(a);else{let l="";a=be(e,a);let i=!1;for(;;){const s=t.charAt(r);if(s===""){o.push((a+l).trim());break}else if(i)s===")"&&(i=!1);else if(s===","){r+=1,o.push((a+l).trim());break}else s==="("&&(i=!0);l+=s,r+=1}}}return o.join(", ")}function be(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function ir(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Fe(){const e=document.createElement("a");return e.href="",e.href}function Qe(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")?be(e,n):r==="srcset"?ar(e,n):r==="style"?Se(n,Fe()):t==="object"&&r==="data"?be(e,n):n)}function Ze(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function lr(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ve(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}return r?ve(e.parentNode,t,r):!1}function et(e,t,r,n){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(ve(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function cr(e,t,r){const n=e.contentWindow;if(!n)return;let o=!1,a;try{a=n.document.readyState}catch{return}if(a!=="complete"){const i=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()});return}const l="about:blank";if(n.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function dr(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;const a=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),n=!0,t()})}function ur(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:l,inlineStylesheet:i,maskInputOptions:s={},maskTextFn:c,maskInputFn:d,dataURLOptions:p={},inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u=!1}=t,y=pr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:L.Document,childNodes:[],compatMode:e.compatMode}:{type:L.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:L.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return mr(e,{doc:r,blockClass:o,blockSelector:a,inlineStylesheet:i,maskInputOptions:s,maskInputFn:d,dataURLOptions:p,inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u,rootId:y});case e.TEXT_NODE:return hr(e,{needsMask:l,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:L.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:L.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function pr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function hr(e,t){var r;const{needsMask:n,maskTextFn:o,rootId:a}=t,l=e.parentNode&&e.parentNode.tagName;let i=e.textContent;const s=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;if(s&&i){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(i=ge(e.parentNode.sheet))}catch(d){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${d}`,e)}i=Se(i,Fe())}return c&&(i="SCRIPT_PLACEHOLDER"),!s&&!c&&i&&n&&(i=o?o(i,e.parentElement):i.replace(/[\S]/g,"*")),{type:L.Text,textContent:i||"",isStyle:s,rootId:a}}function mr(e,t){const{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l={},maskInputFn:i,dataURLOptions:s={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m}=t,f=lr(e,n,o),u=Qt(e);let y={};const S=e.attributes.length;for(let g=0;g<S;g++){const v=e.attributes[g];Ze(u,v.name,v.value)||(y[v.name]=Qe(r,u,K(v.name),v.value))}if(u==="link"&&a){const g=Array.from(r.styleSheets).find(R=>R.href===e.href);let v=null;g&&(v=ge(g)),v&&(delete y.rel,delete y.href,y._cssText=Se(v,g.href))}if(u==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const g=ge(e.sheet);g&&(y._cssText=Se(g,Fe()))}if(u==="input"||u==="textarea"||u==="select"){const g=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=De({element:e,type:Ae(e),tagName:u,value:g,maskInputOptions:l,maskInputFn:i}):v&&(y.checked=v)}if(u==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),u==="canvas"&&d){if(e.__context==="2d")Yt(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const g=e.toDataURL(s.type,s.quality),v=document.createElement("canvas");v.width=e.width,v.height=e.height;const R=v.toDataURL(s.type,s.quality);g!==R&&(y.rr_dataURL=g)}}if(u==="img"&&c){re||(re=r.createElement("canvas"),Ke=re.getContext("2d"));const g=e,v=g.crossOrigin;g.crossOrigin="anonymous";const R=()=>{g.removeEventListener("load",R);try{re.width=g.naturalWidth,re.height=g.naturalHeight,Ke.drawImage(g,0,0),y.rr_dataURL=re.toDataURL(s.type,s.quality)}catch(D){console.warn(`Cannot inline img src=${g.currentSrc}! Error: ${D}`)}v?y.crossOrigin=v:g.removeAttribute("crossorigin")};g.complete&&g.naturalWidth!==0?R():g.addEventListener("load",R)}if((u==="audio"||u==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){const{width:g,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${v}px`}}u==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(u)&&(b=!0)}catch{}return{type:L.Element,tagName:u,attributes:y,childNodes:[],isSVG:ir(e)||void 0,needBlock:f,rootId:m,isCustom:b}}function O(e){return e==null?"":e.toLowerCase()}function fr(e,t){return!!(t.comment&&e.type===L.Comment||e.type===L.Element&&(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"&&Ye(e.attributes.href)==="js")||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(O(e.attributes.name).match(/^msapplication-tile(image|color)$/)||O(e.attributes.name)==="application-name"||O(e.attributes.rel)==="icon"||O(e.attributes.rel)==="apple-touch-icon"||O(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&O(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(O(e.attributes.property).match(/^(og|twitter|fb):/)||O(e.attributes.name).match(/^(og|twitter):/)||O(e.attributes.name)==="pinterest")||t.headMetaRobots&&(O(e.attributes.name)==="robots"||O(e.attributes.name)==="googlebot"||O(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(O(e.attributes.name)==="author"||O(e.attributes.name)==="generator"||O(e.attributes.name)==="framework"||O(e.attributes.name)==="publisher"||O(e.attributes.name)==="progid"||O(e.attributes.property).match(/^article:/)||O(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(O(e.attributes.name)==="google-site-verification"||O(e.attributes.name)==="yandex-verification"||O(e.attributes.name)==="csrf-token"||O(e.attributes.name)==="p:domain_verify"||O(e.attributes.name)==="verify-v1"||O(e.attributes.name)==="verification"||O(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:i,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f={},inlineImages:u=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:V=!1}=t;let{needsMask:U}=t,{preserveWhiteSpace:z=!0}=t;!U&&e.childNodes&&(U=et(e,l,i,U===void 0));const B=ur(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:U,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,dataURLOptions:f,inlineImages:u,recordCanvas:y,keepIframeSrcFn:D,newlyAddedElement:V});if(!B)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):fr(B,m)||!z&&B.type===L.Text&&!B.isStyle&&!B.textContent.replace(/^\s+|\s+$/gm,"").length?X=pe:X=Je();const k=Object.assign(B,{id:X});if(n.add(e,k),X===pe)return null;S&&S(e);let Z=!s;if(k.type===L.Element){Z=Z&&!k.needBlock,delete k.needBlock;const W=e.shadowRoot;W&&ue(W)&&(k.isShadowHost=!0)}if((k.type===L.Document||k.type===L.Element)&&Z){m.headWhitespace&&k.type===L.Element&&k.tagName==="head"&&(z=!1);const W={doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:U,maskTextClass:l,maskTextSelector:i,skipChild:s,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:z,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D};if(!(k.type===L.Element&&k.tagName==="textarea"&&k.attributes.value!==void 0))for(const J of Array.from(e.childNodes)){const G=ne(J,W);G&&k.childNodes.push(G)}if(zt(e)&&e.shadowRoot)for(const J of Array.from(e.shadowRoot.childNodes)){const G=ne(J,W);G&&(ue(e.shadowRoot)&&(G.isShadow=!0),k.childNodes.push(G))}}return e.parentNode&&de(e.parentNode)&&ue(e.parentNode)&&(k.isShadow=!0),k.type===L.Element&&k.tagName==="iframe"&&cr(e,()=>{const W=e.contentDocument;if(W&&b){const J=ne(W,{doc:W,mirror:n,blockClass:o,blockSelector:a,needsMask:U,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:z,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});J&&b(e,J)}},g),k.type===L.Element&&k.tagName==="link"&&typeof k.attributes.rel=="string"&&(k.attributes.rel==="stylesheet"||k.attributes.rel==="preload"&&typeof k.attributes.href=="string"&&Ye(k.attributes.href)==="css")&&dr(e,()=>{if(v){const W=ne(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:U,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:z,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});W&&v(e,W)}},R),k}function yr(e,t){const{mirror:r=new qe,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:i=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:p,maskInputFn:h,slimDOM:m=!1,dataURLOptions:f,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R=()=>!1}=t||{};return ne(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d===!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}:d===!1?{password:!0}:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m===!1?{}:m,dataURLOptions:f,inlineImages:s,recordCanvas:c,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R,newlyAddedElement:!1})}function A(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const oe=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
var rrwebRecord=function(){"use strict";var N;(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"})(N||(N={}));function Bt(e){return e.nodeType===e.ELEMENT_NODE}function ce(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function de(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Vt(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Ht(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 ye(e){try{const t=e.rules||e.cssRules;return t?Vt(Array.from(t,He).join("")):null}catch{return null}}function He(e){let t;if(qt(e))try{t=ye(e.styleSheet)||Ht(e)}catch{}else if(Xt(e)&&e.selectorText.includes(":"))return Gt(e.cssText);return t||e.cssText}function Gt(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function qt(e){return"styleSheet"in e}function Xt(e){return"selectorText"in e}class Ge{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 o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Yt(){return new Ge}function De({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:a}){let l=o||"";const i=n&&K(n);return(t[r.toLowerCase()]||i&&t[i])&&(a?l=a(l,e):l="*".repeat(l.length)),l}function K(e){return e.toLowerCase()}const qe="__rrweb_original__";function Jt(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){const a=t.getImageData,l=qe in a?a[qe]:a;if(new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(i=>i!==0))return!1}return!0}function Ae(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?K(t):null}function Xe(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,a=n.pathname.match(o);return(r=a?.[1])!==null&&r!==void 0?r:null}let Kt=1;const Qt=new RegExp("[^a-z0-9-_:]"),ue=-2;function Ye(){return Kt++}function Zt(e){if(e instanceof HTMLFormElement)return"form";const t=K(e.tagName);return Qt.test(t)?"div":t}function er(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let re,Je;const tr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,rr=/^(?:[a-z+]+:)?\/\//i,nr=/^www\..*/i,or=/^(data:)([^,]*),(.*)/i;function ge(e,t){return(e||"").replace(tr,(r,n,o,a,l,i)=>{const s=o||l||i,c=n||a||"";if(!s)return r;if(rr.test(s)||nr.test(s))return`url(${c}${s}${c})`;if(or.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${er(t)+s}${c})`;const d=t.split("/"),p=s.split("/");d.pop();for(const h of p)h!=="."&&(h===".."?d.pop():d.push(h));return`url(${c}${d.join("/")}${c})`})}const sr=/^[^ \t\n\r\u000c]+/,ar=/^[, \t\n\r\u000c]+/;function ir(e,t){if(t.trim()==="")return t;let r=0;function n(a){let l;const i=a.exec(t.substring(r));return i?(l=i[0],r+=l.length,l):""}const o=[];for(;n(ar),!(r>=t.length);){let a=n(sr);if(a.slice(-1)===",")a=Se(e,a.substring(0,a.length-1)),o.push(a);else{let l="";a=Se(e,a);let i=!1;for(;;){const s=t.charAt(r);if(s===""){o.push((a+l).trim());break}else if(i)s===")"&&(i=!1);else if(s===","){r+=1,o.push((a+l).trim());break}else s==="("&&(i=!0);l+=s,r+=1}}}return o.join(", ")}const Ke=new WeakMap;function Se(e,t){return!t||t.trim()===""?t:be(e,t)}function lr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function be(e,t){let r=Ke.get(e);if(r||(r=e.createElement("a"),Ke.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Qe(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")?Se(e,n):r==="srcset"?ir(e,n):r==="style"?ge(n,be(e)):t==="object"&&r==="data"?Se(e,n):n)}function Ze(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function cr(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ve(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}return r?ve(e.parentNode,t,r):!1}function et(e,t,r,n){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(ve(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function dr(e,t,r){const n=e.contentWindow;if(!n)return;let o=!1,a;try{a=n.document.readyState}catch{return}if(a!=="complete"){const i=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()});return}const l="about:blank";if(n.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ur(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;const a=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),n=!0,t()})}function pr(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:l,inlineStylesheet:i,maskInputOptions:s={},maskTextFn:c,maskInputFn:d,dataURLOptions:p={},inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u=!1}=t,y=hr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:N.Document,childNodes:[],compatMode:e.compatMode}:{type:N.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return fr(e,{doc:r,blockClass:o,blockSelector:a,inlineStylesheet:i,maskInputOptions:s,maskInputFn:d,dataURLOptions:p,inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u,rootId:y});case e.TEXT_NODE:return mr(e,{doc:r,needsMask:l,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:N.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function hr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function mr(e,t){var r;const{needsMask:n,maskTextFn:o,rootId:a}=t,l=e.parentNode&&e.parentNode.tagName;let i=e.textContent;const s=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;if(s&&i){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(i=ye(e.parentNode.sheet))}catch(d){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${d}`,e)}i=ge(i,be(t.doc))}return c&&(i="SCRIPT_PLACEHOLDER"),!s&&!c&&i&&n&&(i=o?o(i,e.parentElement):i.replace(/[\S]/g,"*")),{type:N.Text,textContent:i||"",isStyle:s,rootId:a}}function fr(e,t){const{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l={},maskInputFn:i,dataURLOptions:s={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m}=t,f=cr(e,n,o),u=Zt(e);let y={};const S=e.attributes.length;for(let g=0;g<S;g++){const v=e.attributes[g];Ze(u,v.name,v.value)||(y[v.name]=Qe(r,u,K(v.name),v.value))}if(u==="link"&&a){const g=Array.from(r.styleSheets).find(R=>R.href===e.href);let v=null;g&&(v=ye(g)),v&&(delete y.rel,delete y.href,y._cssText=ge(v,g.href))}if(u==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const g=ye(e.sheet);g&&(y._cssText=ge(g,be(r)))}if(u==="input"||u==="textarea"||u==="select"){const g=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=De({element:e,type:Ae(e),tagName:u,value:g,maskInputOptions:l,maskInputFn:i}):v&&(y.checked=v)}if(u==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),u==="canvas"&&d){if(e.__context==="2d")Jt(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const g=e.toDataURL(s.type,s.quality),v=document.createElement("canvas");v.width=e.width,v.height=e.height;const R=v.toDataURL(s.type,s.quality);g!==R&&(y.rr_dataURL=g)}}if(u==="img"&&c){re||(re=r.createElement("canvas"),Je=re.getContext("2d"));const g=e,v=g.crossOrigin;g.crossOrigin="anonymous";const R=()=>{g.removeEventListener("load",R);try{re.width=g.naturalWidth,re.height=g.naturalHeight,Je.drawImage(g,0,0),y.rr_dataURL=re.toDataURL(s.type,s.quality)}catch(D){console.warn(`Cannot inline img src=${g.currentSrc}! Error: ${D}`)}v?y.crossOrigin=v:g.removeAttribute("crossorigin")};g.complete&&g.naturalWidth!==0?R():g.addEventListener("load",R)}if(u==="audio"||u==="video"){const g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){const{width:g,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${v}px`}}u==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(u)&&(b=!0)}catch{}return{type:N.Element,tagName:u,attributes:y,childNodes:[],isSVG:lr(e)||void 0,needBlock:f,rootId:m,isCustom:b}}function T(e){return e==null?"":e.toLowerCase()}function yr(e,t){return!!(t.comment&&e.type===N.Comment||e.type===N.Element&&(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"&&Xe(e.attributes.href)==="js")||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(T(e.attributes.name).match(/^msapplication-tile(image|color)$/)||T(e.attributes.name)==="application-name"||T(e.attributes.rel)==="icon"||T(e.attributes.rel)==="apple-touch-icon"||T(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&T(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(T(e.attributes.property).match(/^(og|twitter|fb):/)||T(e.attributes.name).match(/^(og|twitter):/)||T(e.attributes.name)==="pinterest")||t.headMetaRobots&&(T(e.attributes.name)==="robots"||T(e.attributes.name)==="googlebot"||T(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(T(e.attributes.name)==="author"||T(e.attributes.name)==="generator"||T(e.attributes.name)==="framework"||T(e.attributes.name)==="publisher"||T(e.attributes.name)==="progid"||T(e.attributes.property).match(/^article:/)||T(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(T(e.attributes.name)==="google-site-verification"||T(e.attributes.name)==="yandex-verification"||T(e.attributes.name)==="csrf-token"||T(e.attributes.name)==="p:domain_verify"||T(e.attributes.name)==="verify-v1"||T(e.attributes.name)==="verification"||T(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:i,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f={},inlineImages:u=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:V=!1}=t;let{needsMask:W}=t,{preserveWhiteSpace:j=!0}=t;!W&&e.childNodes&&(W=et(e,l,i,W===void 0));const z=pr(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,dataURLOptions:f,inlineImages:u,recordCanvas:y,keepIframeSrcFn:D,newlyAddedElement:V});if(!z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):yr(z,m)||!j&&z.type===N.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?X=ue:X=Ye();const C=Object.assign(z,{id:X});if(n.add(e,C),X===ue)return null;S&&S(e);let Z=!s;if(C.type===N.Element){Z=Z&&!C.needBlock,delete C.needBlock;const P=e.shadowRoot;P&&de(P)&&(C.isShadowHost=!0)}if((C.type===N.Document||C.type===N.Element)&&Z){m.headWhitespace&&C.type===N.Element&&C.tagName==="head"&&(j=!1);const P={doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:s,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D};if(!(C.type===N.Element&&C.tagName==="textarea"&&C.attributes.value!==void 0))for(const J of Array.from(e.childNodes)){const H=ne(J,P);H&&C.childNodes.push(H)}if(Bt(e)&&e.shadowRoot)for(const J of Array.from(e.shadowRoot.childNodes)){const H=ne(J,P);H&&(de(e.shadowRoot)&&(H.isShadow=!0),C.childNodes.push(H))}}return e.parentNode&&ce(e.parentNode)&&de(e.parentNode)&&(C.isShadow=!0),C.type===N.Element&&C.tagName==="iframe"&&dr(e,()=>{const P=e.contentDocument;if(P&&b){const J=ne(P,{doc:P,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});J&&b(e,J)}},g),C.type===N.Element&&C.tagName==="link"&&typeof C.attributes.rel=="string"&&(C.attributes.rel==="stylesheet"||C.attributes.rel==="preload"&&typeof C.attributes.href=="string"&&Xe(C.attributes.href)==="css")&&ur(e,()=>{if(v){const P=ne(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});P&&v(e,P)}},R),C}function gr(e,t){const{mirror:r=new Ge,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:i=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:p,maskInputFn:h,slimDOM:m=!1,dataURLOptions:f,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R=()=>!1}=t||{};return ne(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d===!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}:d===!1?{password:!0}:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m===!1?{}:m,dataURLOptions:f,inlineImages:s,recordCanvas:c,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R,newlyAddedElement:!1})}function A(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const oe=`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 tt={map:{},getId(){return console.error(oe),-1},getNode(){return console.error(oe),null},removeNodeFromMap(){console.error(oe)},has(){return console.error(oe),!1},reset(){console.error(oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tt=new Proxy(tt,{get(e,t,r){return t==="map"&&console.error(oe),Reflect.get(e,t,r)}}));function he(e,t,r={}){let n=null,o=0;return function(...a){const l=Date.now();!o&&r.leading===!1&&(o=l);const i=t-(l-o),s=this;i<=0||i>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(s,a)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(s,a)},i))}}function Ie(e,t,r,n,o=window){const a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),a&&a.set&&a.set.call(this,l)}}),()=>Ie(e,t,a||{},!0)}function se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}let Me=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Me=()=>new Date().getTime());function rt(e){var t,r,n,o,a,l;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i?.documentElement.scrollLeft||((r=(t=i?.body)==null?void 0:t.parentElement)==null?void 0:r.scrollLeft)||((n=i?.body)==null?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||((a=(o=i?.body)==null?void 0:o.parentElement)==null?void 0:a.scrollTop)||((l=i?.body)==null?void 0:l.scrollTop)||0}}function nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function st(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function F(e,t,r,n){if(!e)return!1;const o=st(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(ve(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function gr(e,t){return t.getId(e)!==-1}function _e(e,t){return t.getId(e)===pe}function at(e,t){if(de(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?at(e.parentNode,t):!0:!0}function Pe(e){return Boolean(e.changedTouches)}function Sr(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 it(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function lt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $e(e){return Boolean(e?.shadowRoot)}class br{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ct(e){var t,r;let n=null;return((r=(t=e.getRootNode)==null?void 0:t.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function vr(e){let t=e,r;for(;r=ct(t);)t=r;return t}function Ir(e){const t=e.ownerDocument;if(!t)return!1;const r=vr(e);return t.contains(r)}function dt(e){const t=e.ownerDocument;return t?t.contains(e)||Ir(e):!1}var C=(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))(C||{}),M=(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))(M||{}),P=(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))(P||{}),q=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(q||{}),ae=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ae||{}),ie=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ie||{}),Mr=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(Mr||{});function ut(e){return"__ln"in e}class wr{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&&ut(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&&ut(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 pt=(e,t)=>`${e}@${t}`;class Cr{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 wr,o=s=>{let c=s,d=pe;for(;d===pe;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},a=s=>{if(!s.parentNode||!dt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=de(s.parentNode)?this.mirror.getId(ct(s)):this.mirror.getId(s.parentNode),d=o(s);if(c===-1||d===-1)return n.addNode(s);const p=ne(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:h=>{it(h,this.mirror)&&this.iframeManager.addIframe(h),lt(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),$e(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)}});p&&(t.push({parentId:c,nextId:d,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)ht(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||a(s);for(const s of this.addedSet)!ft(this.droppedSet,s)&&!ht(this.removes,s,this.mirror)||ft(this.movedSet,s)?a(s):this.droppedSet.add(s);let l=null;for(;n.length;){let s=null;if(l){const c=this.mirror.getId(l.value.parentNode),d=o(l.value);c!==-1&&d!==-1&&(s=l)}if(!s){let c=n.tail;for(;c;){const d=c;if(c=c.previous,d){const p=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(p!==-1){s=d;break}else{const h=d.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=h.parentNode.host;if(this.mirror.getId(m)!==-1){s=d;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}l=s.previous,n.removeNode(s.value),a(s.value)}const i={texts:this.texts.map(s=>{const c=s.node;return 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 d=JSON.stringify(s.styleDiff),p=JSON.stringify(s._unchangedStyles);d.length<c.style.length&&(d+p).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};!i.texts.length&&!i.attributes.length&&!i.removes.length&&!i.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(i))},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(!_e(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!F(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:et(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,st(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,o=t.target.getAttribute(n);if(n==="value"){const l=Ae(r);o=De({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(F(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)n="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ze(r.tagName,n)&&(a.attributes[n]=Qe(this.doc,K(r.tagName),K(n),o),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const l=this.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(const i of Array.from(r.style)){const s=r.style.getPropertyValue(i),c=r.style.getPropertyPriority(i);s!==l.style.getPropertyValue(i)||c!==l.style.getPropertyPriority(i)?c===""?a.styleDiff[i]=s:a.styleDiff[i]=[s,c]:a._unchangedStyles[i]=[s,c]}for(const i of Array.from(l.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=!1)}break}case"childList":{if(F(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),o=de(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);F(t.target,this.blockClass,this.blockSelector,!1)||_e(r,this.mirror)||!gr(r,this.mirror)||(this.addedSet.has(r)?(We(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||at(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[pt(n,o)]?We(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:de(t.target)&&ue(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(_e(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[pt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);F(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),$e(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 We(e,t){e.delete(t),t.childNodes.forEach(r=>We(e,r))}function ht(e,t,r){return e.length===0?!1:mt(e,t,r)}function mt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(a=>a.id===o)?!0:mt(e,n,r)}function ft(e,t){return e.size===0?!1:yt(e,t)}function yt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:yt(e,r):!1}let me;function kr(e){me=e}function Or(){me=void 0}const w=e=>me?(...t)=>{try{return e(...t)}catch(r){if(me&&me(r)===!0)return;throw r}}:e;var Tr=Object.defineProperty,Er=Object.defineProperties,Rr=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bt=(e,t)=>{for(var r in t||(t={}))xr.call(t,r)&&St(e,r,t[r]);if(gt)for(var r of gt(t))Lr.call(t,r)&&St(e,r,t[r]);return e},Nr=(e,t)=>Er(e,Rr(t));const Q=[];function fe(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 vt(e,t){var r,n;const o=new Cr;Q.push(o),o.init(e);let a=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(a=window[l]);const i=new a(w(o.processMutations.bind(o)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Dr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,a=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],i;const s=he(w(p=>{const h=Date.now()-i;e(l.map(m=>(m.timeOffset-=h,m)),p),l=[],i=null}),a),c=w(he(w(p=>{const h=fe(p),{clientX:m,clientY:f}=Pe(p)?p.changedTouches[0]:p;i||(i=Me()),l.push({x:m,y:f,id:n.getId(h),timeOffset:Me()-i}),s(typeof DragEvent<"u"&&p instanceof DragEvent?M.Drag:p instanceof MouseEvent?M.MouseMove:M.TouchMove)}),o,{trailing:!1})),d=[A("mousemove",c,r),A("touchmove",c,r),A("drag",c,r)];return w(()=>{d.forEach(p=>p())})}function Ar({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const l=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,i=[];let s=null;const c=d=>p=>{const h=fe(p);if(F(h,n,o,!0))return;let m=null,f=d;if("pointerType"in p){switch(p.pointerType){case"mouse":m=q.Mouse;break;case"touch":m=q.Touch;break;case"pen":m=q.Pen;break}m===q.Touch?P[d]===P.MouseDown?f="TouchStart":P[d]===P.MouseUp&&(f="TouchEnd"):q.Pen}else Pe(p)&&(m=q.Touch);m!==null?(s=m,(f.startsWith("Touch")&&m===q.Touch||f.startsWith("Mouse")&&m===q.Mouse)&&(m=null)):P[d]===P.Click&&(m=s,s=null);const u=Pe(p)?p.changedTouches[0]:p;if(!u)return;const y=r.getId(h),{clientX:S,clientY:b}=u;w(e)(bt({type:P[f],id:y,x:S,y:b},m!==null&&{pointerType:m}))};return Object.keys(P).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&l[d]!==!1).forEach(d=>{let p=K(d);const h=c(d);if(window.PointerEvent)switch(P[d]){case P.MouseDown:case P.MouseUp:p=p.replace("mouse","pointer");break;case P.TouchStart:case P.TouchEnd:return}i.push(A(p,h,t))}),w(()=>{i.forEach(d=>d())})}function It({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){const l=w(he(w(i=>{const s=fe(i);if(!s||F(s,n,o,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const d=rt(t.defaultView);e({id:c,x:d.left,y:d.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),a.scroll||100));return A("scroll",l,t)}function Fr({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const o=w(he(w(()=>{const a=nt(),l=ot();(r!==a||n!==l)&&(e({width:Number(l),height:Number(a)}),r=a,n=l)}),200));return A("resize",o,t)}const _r=["INPUT","TEXTAREA","SELECT"],Mt=new WeakMap;function Pr({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:i,maskInputFn:s,sampling:c,userTriggeredOnInput:d}){function p(S){let b=fe(S);const g=S.isTrusted,v=b&&b.tagName;if(b&&v==="OPTION"&&(b=b.parentElement),!b||!v||_r.indexOf(v)<0||F(b,n,o,!0)||b.classList.contains(a)||l&&b.matches(l))return;let R=b.value,D=!1;const V=Ae(b)||"";V==="radio"||V==="checkbox"?D=b.checked:(i[v.toLowerCase()]||i[V])&&(R=De({element:b,maskInputOptions:i,tagName:v,type:V,value:R,maskInputFn:s})),h(b,d?{text:R,isChecked:D,userTriggered:g}:{text:R,isChecked:D});const U=b.name;V==="radio"&&U&&D&&t.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(z=>{if(z!==b){const B=z.value;h(z,d?{text:B,isChecked:!D,userTriggered:!1}:{text:B,isChecked:!D})}})}function h(S,b){const g=Mt.get(S);if(!g||g.text!==b.text||g.isChecked!==b.isChecked){Mt.set(S,b);const v=r.getId(S);w(e)(Nr(bt({},b),{id:v}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(S=>A(S,w(p),t)),f=t.defaultView;if(!f)return()=>{m.forEach(S=>S())};const u=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),y=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return u&&u.set&&m.push(...y.map(S=>Ie(S[0],S[1],{set(){w(p)({target:this,isTrusted:!1})}},!1,f))),w(()=>{m.forEach(S=>S())})}function we(e){const t=[];function r(n,o){if(Ce("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ce("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ce("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ce("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(a)}return o}return r(e,t)}function Y(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function $r({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:w((d,p,h)=>{const[m,f]=h,{id:u,styleId:y}=Y(p,t,r.styleMirror);return(u&&u!==-1||y&&y!==-1)&&e({id:u,styleId:y,adds:[{rule:m,index:f}]}),d.apply(p,h)})});const a=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:w((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,removes:[{index:m}]}),d.apply(p,h)})});let l;n.CSSStyleSheet.prototype.replace&&(l=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:w((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replace:m}),d.apply(p,h)})}));let i;n.CSSStyleSheet.prototype.replaceSync&&(i=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:w((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replaceSync:m}),d.apply(p,h)})}));const s={};ke("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(ke("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),ke("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),ke("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([d,p])=>{c[d]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[d].insertRule,{apply:w((h,m,f)=>{const[u,y]=f,{id:S,styleId:b}=Y(m.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:u,index:[...we(m),y||0]}]}),h.apply(m,f)})}),p.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:w((h,m,f)=>{const[u]=f,{id:y,styleId:S}=Y(m.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...we(m),u]}]}),h.apply(m,f)})})}),w(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=a,l&&(n.CSSStyleSheet.prototype.replace=l),i&&(n.CSSStyleSheet.prototype.replaceSync=i),Object.entries(s).forEach(([d,p])=>{p.prototype.insertRule=c[d].insertRule,p.prototype.deleteRule=c[d].deleteRule})})}function wt({mirror:e,stylesheetManager:t},r){var n,o,a;let l=null;r.nodeName==="#document"?l=e.getId(r):l=e.getId(r.host);const i=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(a=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:a.ShadowRoot,s=i!=null&&i.prototype?Object.getOwnPropertyDescriptor(i?.prototype,"adoptedStyleSheets"):void 0;return l===null||l===-1||!i||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)==null?void 0:c.call(this)},set(c){var d;const p=(d=s.set)==null?void 0:d.call(this,c);if(l!==null&&l!==-1)try{t.adoptStyleSheets(c,l)}catch{}return p}}),w(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Wr({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:w((i,s,c)=>{var d;const[p,h,m]=c;if(r.has(p))return a.apply(s,[p,h,m]);const{id:f,styleId:u}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,set:{property:p,value:h,priority:m},index:we(s.parentRule)}),i.apply(s,c)})});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:w((i,s,c)=>{var d;const[p]=c;if(r.has(p))return l.apply(s,[p]);const{id:h,styleId:m}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,remove:{property:p},index:we(s.parentRule)}),i.apply(s,c)})}),w(()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l})}function Ur({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:a}){const l=w(s=>he(w(c=>{const d=fe(c);if(!d||F(d,t,r,!0))return;const{currentTime:p,volume:h,muted:m,playbackRate:f}=d;e({type:s,id:n.getId(d),currentTime:p,volume:h,muted:m,playbackRate:f})}),o.media||500)),i=[A("play",l(ie.Play),a),A("pause",l(ie.Pause),a),A("seeked",l(ie.Seeked),a),A("volumechange",l(ie.VolumeChange),a),A("ratechange",l(ie.RateChange),a)];return w(()=>{i.forEach(s=>s())})}function jr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(i,s,c){const d=new a(i,s,c);return o.set(d,{family:i,buffer:typeof s!="string",descriptors:c,fontSource:typeof s=="string"?s:JSON.stringify(Array.from(new Uint8Array(s)))}),d};const l=se(t.fonts,"add",function(i){return function(s){return setTimeout(w(()=>{const c=o.get(s);c&&(e(c),o.delete(s))}),0),i.apply(this,[s])}});return n.push(()=>{r.FontFace=a}),n.push(l),w(()=>{n.forEach(i=>i())})}function zr(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:a}=e;let l=!0;const i=w(()=>{const s=t.getSelection();if(!s||l&&s?.isCollapsed)return;l=s.isCollapsed||!1;const c=[],d=s.rangeCount||0;for(let p=0;p<d;p++){const h=s.getRangeAt(p),{startContainer:m,startOffset:f,endContainer:u,endOffset:y}=h;F(m,n,o,!0)||F(u,n,o,!0)||c.push({start:r.getId(m),startOffset:f,end:r.getId(u),endOffset:y})}a({ranges:c})});return i(),A("selectionchange",i)}function Br({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:se(r.customElements,"define",function(n){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,a,l])}})}function Hr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:a,viewportResizeCb:l,inputCb:i,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:p,fontCb:h,selectionCb:m,customElementCb:f}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),a(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),i(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),s(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),d(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),p(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),h(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),m(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),f(...u)}}function Vr(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Hr(e,t);let n;e.recordDOM&&(n=vt(e,e.doc));const o=Dr(e),a=Ar(e),l=It(e),i=Fr(e,{win:r}),s=Pr(e),c=Ur(e);let d=()=>{},p=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=$r(e,{win:r}),p=wt(e,e.doc),h=Wr(e,{win:r}),e.collectFonts&&(m=jr(e)));const f=zr(e),u=Br(e),y=[];for(const S of e.plugins)y.push(S.observer(S.callback,r,S.options));return w(()=>{Q.forEach(S=>S.reset()),n?.disconnect(),o(),a(),l(),i(),s(),c(),d(),p(),h(),m(),f(),u(),y.forEach(S=>S())})}function Ce(e){return typeof window[e]<"u"}function ke(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ct{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,o){const a=n||this.getIdToRemoteIdMap(t),l=o||this.getRemoteIdToIdMap(t);let i=a.get(r);return i||(i=this.generateIdFn(),a.set(r,i),l.set(i,r)),i}getIds(t,r){const n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(a=>this.getId(t,a,n,o))}getRemoteId(t,r,n){const o=n||this.getRemoteIdToIdMap(t);return typeof r!="number"?r:o.get(r)||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,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 Gr{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ct(Je),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ct(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.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 n=this.crossOriginIframeMap.get(t.source);if(!n)return;const o=this.transformCrossOriginEvent(n,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case C.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:C.IncrementalSnapshot,data:{source:M.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case C.Meta:case C.Load:case C.DomContentLoaded:return!1;case C.Plugin:return r;case C.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case C.IncrementalSnapshot:switch(r.data.source){case M.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);const a=this.crossOriginIframeRootIdMap.get(t);a&&this.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case M.Drag:case M.TouchMove:case M.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case M.ViewportResize:return!1;case M.MediaInteraction:case M.MouseInteraction:case M.Scroll:case M.CanvasMutation:case M.Input:return this.replaceIds(r.data,t,["id"]),r;case M.StyleSheetRule:case M.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case M.Font:return r;case M.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case M.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(const a of o)!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(n,r[a]):r[a]=t.getId(n,r[a]));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!==L.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}var qr=Object.defineProperty,Xr=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertySymbols,Jr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,Ot=(e,t,r)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tt=(e,t)=>{for(var r in t||(t={}))Jr.call(t,r)&&Ot(e,r,t[r]);if(kt)for(var r of kt(t))Kr.call(t,r)&&Ot(e,r,t[r]);return e},Et=(e,t)=>Xr(e,Yr(t));class Qr{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(!ue(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=vt(Et(Tt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(It(Et(Tt({},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(wt({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(o){return function(a){const l=o.call(this,a);return this.shadowRoot&&dt(this)&&n.addShadowRoot(this.shadowRoot,r),l}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zr=typeof Uint8Array>"u"?[]:new Uint8Array(256),Oe=0;Oe<le.length;Oe++)Zr[le.charCodeAt(Oe)]=Oe;var en=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=le[t[r]>>2],o+=le[(t[r]&3)<<4|t[r+1]>>4],o+=le[(t[r+1]&15)<<2|t[r+2]>>6],o+=le[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const Rt=new Map;function tn(e,t){let r=Rt.get(e);return r||(r=new Map,Rt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const xt=(e,t,r)=>{if(!e||!(Nt(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=tn(r,n);let a=o.indexOf(e);return a===-1&&(a=o.length,o.push(e)),a};function Te(e,t,r){if(e instanceof Array)return e.map(n=>Te(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,o=en(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Te(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Te(e.data,t,r),e.width,e.height]};if(Nt(e,t)||typeof e=="object"){const n=e.constructor.name,o=xt(e,t,r);return{rr_type:n,index:o}}}}return e}const Lt=(e,t,r)=>e.map(n=>Te(n,t,r)),Nt=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function rn(e,t,r,n){const o=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of a)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const i=se(t.CanvasRenderingContext2D.prototype,l,function(s){return function(...c){return F(this.canvas,r,n,!0)||setTimeout(()=>{const d=Lt(c,t,this);e(this.canvas,{type:ae["2D"],property:l,args:d})},0),s.apply(this,c)}});o.push(i)}catch{const s=Ie(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:ae["2D"],property:l,args:[c],setter:!0})}});o.push(s)}return()=>{o.forEach(l=>l())}}function nn(e){return e==="experimental-webgl"?"webgl":e}function Dt(e,t,r,n){const o=[];try{const a=se(e.HTMLCanvasElement.prototype,"getContext",function(l){return function(i,...s){if(!F(this,t,r,!0)){const c=nn(i);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(s[0]&&typeof s[0]=="object"){const d=s[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return l.apply(this,[i,...s])}});o.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(a=>a())}}function At(e,t,r,n,o,a,l){const i=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const d=se(e,c,function(p){return function(...h){const m=p.apply(this,h);if(xt(m,l,this),"tagName"in this.canvas&&!F(this.canvas,n,o,!0)){const f=Lt(h,l,this),u={type:t,property:c,args:f};r(this.canvas,u)}return m}});i.push(d)}catch{const p=Ie(e,c,{set(h){r(this.canvas,{type:t,property:c,args:[h],setter:!0})}});i.push(p)}return i}function on(e,t,r,n,o){const a=[];return a.push(...At(t.WebGLRenderingContext.prototype,ae.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&a.push(...At(t.WebGL2RenderingContext.prototype,ae.WebGL2,e,r,n,o,t)),()=>{a.forEach(l=>l())}}function sn(e,t){var r=t===void 0?null:t,n=e.toString(),o=n.split(`
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`;let tt={map:{},getId(){return console.error(oe),-1},getNode(){return console.error(oe),null},removeNodeFromMap(){console.error(oe)},has(){return console.error(oe),!1},reset(){console.error(oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tt=new Proxy(tt,{get(e,t,r){return t==="map"&&console.error(oe),Reflect.get(e,t,r)}}));function pe(e,t,r={}){let n=null,o=0;return function(...a){const l=Date.now();!o&&r.leading===!1&&(o=l);const i=t-(l-o),s=this;i<=0||i>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(s,a)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(s,a)},i))}}function Ie(e,t,r,n,o=window){const a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),a&&a.set&&a.set.call(this,l)}}),()=>Ie(e,t,a||{},!0)}function se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}let Me=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Me=()=>new Date().getTime());function rt(e){var t,r,n,o,a,l;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i?.documentElement.scrollLeft||((r=(t=i?.body)==null?void 0:t.parentElement)==null?void 0:r.scrollLeft)||((n=i?.body)==null?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||((a=(o=i?.body)==null?void 0:o.parentElement)==null?void 0:a.scrollTop)||((l=i?.body)==null?void 0:l.scrollTop)||0}}function nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function st(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function F(e,t,r,n){if(!e)return!1;const o=st(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(ve(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Sr(e,t){return t.getId(e)!==-1}function Fe(e,t){return t.getId(e)===ue}function at(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?at(e.parentNode,t):!0:!0}function _e(e){return Boolean(e.changedTouches)}function br(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 it(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function lt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Pe(e){return Boolean(e?.shadowRoot)}class vr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ct(e){var t,r;let n=null;return((r=(t=e.getRootNode)==null?void 0:t.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function Ir(e){let t=e,r;for(;r=ct(t);)t=r;return t}function Mr(e){const t=e.ownerDocument;if(!t)return!1;const r=Ir(e);return t.contains(r)}function dt(e){const t=e.ownerDocument;return t?t.contains(e)||Mr(e):!1}var w=(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))(w||{}),I=(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))(I||{}),_=(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))(_||{}),q=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(q||{}),ae=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ae||{}),ie=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ie||{}),wr=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(wr||{});function ut(e){return"__ln"in e}class Cr{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&&ut(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&&ut(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 pt=(e,t)=>`${e}@${t}`;class kr{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 Cr,o=s=>{let c=s,d=ue;for(;d===ue;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},a=s=>{if(!s.parentNode||!dt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=ce(s.parentNode)?this.mirror.getId(ct(s)):this.mirror.getId(s.parentNode),d=o(s);if(c===-1||d===-1)return n.addNode(s);const p=ne(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:h=>{it(h,this.mirror)&&this.iframeManager.addIframe(h),lt(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),Pe(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)}});p&&(t.push({parentId:c,nextId:d,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)ht(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||a(s);for(const s of this.addedSet)!ft(this.droppedSet,s)&&!ht(this.removes,s,this.mirror)||ft(this.movedSet,s)?a(s):this.droppedSet.add(s);let l=null;for(;n.length;){let s=null;if(l){const c=this.mirror.getId(l.value.parentNode),d=o(l.value);c!==-1&&d!==-1&&(s=l)}if(!s){let c=n.tail;for(;c;){const d=c;if(c=c.previous,d){const p=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(p!==-1){s=d;break}else{const h=d.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=h.parentNode.host;if(this.mirror.getId(m)!==-1){s=d;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}l=s.previous,n.removeNode(s.value),a(s.value)}const i={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 d=JSON.stringify(s.styleDiff),p=JSON.stringify(s._unchangedStyles);d.length<c.style.length&&(d+p).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};!i.texts.length&&!i.attributes.length&&!i.removes.length&&!i.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(i))},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(!Fe(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!F(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:et(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,st(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,o=t.target.getAttribute(n);if(n==="value"){const l=Ae(r);o=De({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(F(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)n="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ze(r.tagName,n)&&(a.attributes[n]=Qe(this.doc,K(r.tagName),K(n),o),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const l=this.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(const i of Array.from(r.style)){const s=r.style.getPropertyValue(i),c=r.style.getPropertyPriority(i);s!==l.style.getPropertyValue(i)||c!==l.style.getPropertyPriority(i)?c===""?a.styleDiff[i]=s:a.styleDiff[i]=[s,c]:a._unchangedStyles[i]=[s,c]}for(const i of Array.from(l.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=!1)}break}case"childList":{if(F(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),o=ce(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);F(t.target,this.blockClass,this.blockSelector,!1)||Fe(r,this.mirror)||!Sr(r,this.mirror)||(this.addedSet.has(r)?($e(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||at(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[pt(n,o)]?$e(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ce(t.target)&&de(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(Fe(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[pt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);F(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),Pe(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 $e(e,t){e.delete(t),t.childNodes.forEach(r=>$e(e,r))}function ht(e,t,r){return e.length===0?!1:mt(e,t,r)}function mt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(a=>a.id===o)?!0:mt(e,n,r)}function ft(e,t){return e.size===0?!1:yt(e,t)}function yt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:yt(e,r):!1}let he;function Or(e){he=e}function Tr(){he=void 0}const M=e=>he?(...t)=>{try{return e(...t)}catch(r){if(he&&he(r)===!0)return;throw r}}:e;var Er=Object.defineProperty,Rr=Object.defineProperties,xr=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bt=(e,t)=>{for(var r in t||(t={}))Lr.call(t,r)&&St(e,r,t[r]);if(gt)for(var r of gt(t))Nr.call(t,r)&&St(e,r,t[r]);return e},Dr=(e,t)=>Rr(e,xr(t));const Q=[];function me(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 vt(e,t){var r,n;const o=new kr;Q.push(o),o.init(e);let a=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(a=window[l]);const i=new a(M(o.processMutations.bind(o)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ar({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,a=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],i;const s=pe(M(p=>{const h=Date.now()-i;e(l.map(m=>(m.timeOffset-=h,m)),p),l=[],i=null}),a),c=M(pe(M(p=>{const h=me(p),{clientX:m,clientY:f}=_e(p)?p.changedTouches[0]:p;i||(i=Me()),l.push({x:m,y:f,id:n.getId(h),timeOffset:Me()-i}),s(typeof DragEvent<"u"&&p instanceof DragEvent?I.Drag:p instanceof MouseEvent?I.MouseMove:I.TouchMove)}),o,{trailing:!1})),d=[A("mousemove",c,r),A("touchmove",c,r),A("drag",c,r)];return M(()=>{d.forEach(p=>p())})}function Fr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const l=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,i=[];let s=null;const c=d=>p=>{const h=me(p);if(F(h,n,o,!0))return;let m=null,f=d;if("pointerType"in p){switch(p.pointerType){case"mouse":m=q.Mouse;break;case"touch":m=q.Touch;break;case"pen":m=q.Pen;break}m===q.Touch?_[d]===_.MouseDown?f="TouchStart":_[d]===_.MouseUp&&(f="TouchEnd"):q.Pen}else _e(p)&&(m=q.Touch);m!==null?(s=m,(f.startsWith("Touch")&&m===q.Touch||f.startsWith("Mouse")&&m===q.Mouse)&&(m=null)):_[d]===_.Click&&(m=s,s=null);const u=_e(p)?p.changedTouches[0]:p;if(!u)return;const y=r.getId(h),{clientX:S,clientY:b}=u;M(e)(bt({type:_[f],id:y,x:S,y:b},m!==null&&{pointerType:m}))};return Object.keys(_).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&l[d]!==!1).forEach(d=>{let p=K(d);const h=c(d);if(window.PointerEvent)switch(_[d]){case _.MouseDown:case _.MouseUp:p=p.replace("mouse","pointer");break;case _.TouchStart:case _.TouchEnd:return}i.push(A(p,h,t))}),M(()=>{i.forEach(d=>d())})}function It({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){const l=M(pe(M(i=>{const s=me(i);if(!s||F(s,n,o,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const d=rt(t.defaultView);e({id:c,x:d.left,y:d.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),a.scroll||100));return A("scroll",l,t)}function _r({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const o=M(pe(M(()=>{const a=nt(),l=ot();(r!==a||n!==l)&&(e({width:Number(l),height:Number(a)}),r=a,n=l)}),200));return A("resize",o,t)}const Pr=["INPUT","TEXTAREA","SELECT"],Mt=new WeakMap;function $r({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:i,maskInputFn:s,sampling:c,userTriggeredOnInput:d}){function p(S){let b=me(S);const g=S.isTrusted,v=b&&b.tagName;if(b&&v==="OPTION"&&(b=b.parentElement),!b||!v||Pr.indexOf(v)<0||F(b,n,o,!0)||b.classList.contains(a)||l&&b.matches(l))return;let R=b.value,D=!1;const V=Ae(b)||"";V==="radio"||V==="checkbox"?D=b.checked:(i[v.toLowerCase()]||i[V])&&(R=De({element:b,maskInputOptions:i,tagName:v,type:V,value:R,maskInputFn:s})),h(b,d?{text:R,isChecked:D,userTriggered:g}:{text:R,isChecked:D});const W=b.name;V==="radio"&&W&&D&&t.querySelectorAll(`input[type="radio"][name="${W}"]`).forEach(j=>{if(j!==b){const z=j.value;h(j,d?{text:z,isChecked:!D,userTriggered:!1}:{text:z,isChecked:!D})}})}function h(S,b){const g=Mt.get(S);if(!g||g.text!==b.text||g.isChecked!==b.isChecked){Mt.set(S,b);const v=r.getId(S);M(e)(Dr(bt({},b),{id:v}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(S=>A(S,M(p),t)),f=t.defaultView;if(!f)return()=>{m.forEach(S=>S())};const u=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),y=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return u&&u.set&&m.push(...y.map(S=>Ie(S[0],S[1],{set(){M(p)({target:this,isTrusted:!1})}},!1,f))),M(()=>{m.forEach(S=>S())})}function we(e){const t=[];function r(n,o){if(Ce("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ce("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ce("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ce("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(a)}return o}return r(e,t)}function Y(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Wr({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:M((d,p,h)=>{const[m,f]=h,{id:u,styleId:y}=Y(p,t,r.styleMirror);return(u&&u!==-1||y&&y!==-1)&&e({id:u,styleId:y,adds:[{rule:m,index:f}]}),d.apply(p,h)})});const a=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,removes:[{index:m}]}),d.apply(p,h)})});let l;n.CSSStyleSheet.prototype.replace&&(l=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replace:m}),d.apply(p,h)})}));let i;n.CSSStyleSheet.prototype.replaceSync&&(i=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replaceSync:m}),d.apply(p,h)})}));const s={};ke("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(ke("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),ke("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),ke("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([d,p])=>{c[d]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[d].insertRule,{apply:M((h,m,f)=>{const[u,y]=f,{id:S,styleId:b}=Y(m.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:u,index:[...we(m),y||0]}]}),h.apply(m,f)})}),p.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:M((h,m,f)=>{const[u]=f,{id:y,styleId:S}=Y(m.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...we(m),u]}]}),h.apply(m,f)})})}),M(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=a,l&&(n.CSSStyleSheet.prototype.replace=l),i&&(n.CSSStyleSheet.prototype.replaceSync=i),Object.entries(s).forEach(([d,p])=>{p.prototype.insertRule=c[d].insertRule,p.prototype.deleteRule=c[d].deleteRule})})}function wt({mirror:e,stylesheetManager:t},r){var n,o,a;let l=null;r.nodeName==="#document"?l=e.getId(r):l=e.getId(r.host);const i=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(a=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:a.ShadowRoot,s=i!=null&&i.prototype?Object.getOwnPropertyDescriptor(i?.prototype,"adoptedStyleSheets"):void 0;return l===null||l===-1||!i||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)==null?void 0:c.call(this)},set(c){var d;const p=(d=s.set)==null?void 0:d.call(this,c);if(l!==null&&l!==-1)try{t.adoptStyleSheets(c,l)}catch{}return p}}),M(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Ur({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:M((i,s,c)=>{var d;const[p,h,m]=c;if(r.has(p))return a.apply(s,[p,h,m]);const{id:f,styleId:u}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,set:{property:p,value:h,priority:m},index:we(s.parentRule)}),i.apply(s,c)})});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:M((i,s,c)=>{var d;const[p]=c;if(r.has(p))return l.apply(s,[p]);const{id:h,styleId:m}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,remove:{property:p},index:we(s.parentRule)}),i.apply(s,c)})}),M(()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l})}function jr({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:a}){const l=M(s=>pe(M(c=>{const d=me(c);if(!d||F(d,t,r,!0))return;const{currentTime:p,volume:h,muted:m,playbackRate:f,loop:u}=d;e({type:s,id:n.getId(d),currentTime:p,volume:h,muted:m,playbackRate:f,loop:u})}),o.media||500)),i=[A("play",l(ie.Play),a),A("pause",l(ie.Pause),a),A("seeked",l(ie.Seeked),a),A("volumechange",l(ie.VolumeChange),a),A("ratechange",l(ie.RateChange),a)];return M(()=>{i.forEach(s=>s())})}function zr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(i,s,c){const d=new a(i,s,c);return o.set(d,{family:i,buffer:typeof s!="string",descriptors:c,fontSource:typeof s=="string"?s:JSON.stringify(Array.from(new Uint8Array(s)))}),d};const l=se(t.fonts,"add",function(i){return function(s){return setTimeout(M(()=>{const c=o.get(s);c&&(e(c),o.delete(s))}),0),i.apply(this,[s])}});return n.push(()=>{r.FontFace=a}),n.push(l),M(()=>{n.forEach(i=>i())})}function Br(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:a}=e;let l=!0;const i=M(()=>{const s=t.getSelection();if(!s||l&&s?.isCollapsed)return;l=s.isCollapsed||!1;const c=[],d=s.rangeCount||0;for(let p=0;p<d;p++){const h=s.getRangeAt(p),{startContainer:m,startOffset:f,endContainer:u,endOffset:y}=h;F(m,n,o,!0)||F(u,n,o,!0)||c.push({start:r.getId(m),startOffset:f,end:r.getId(u),endOffset:y})}a({ranges:c})});return i(),A("selectionchange",i)}function Vr({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:se(r.customElements,"define",function(n){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,a,l])}})}function Hr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:a,viewportResizeCb:l,inputCb:i,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:p,fontCb:h,selectionCb:m,customElementCb:f}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),a(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),i(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),s(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),d(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),p(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),h(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),m(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),f(...u)}}function Gr(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Hr(e,t);let n;e.recordDOM&&(n=vt(e,e.doc));const o=Ar(e),a=Fr(e),l=It(e),i=_r(e,{win:r}),s=$r(e),c=jr(e);let d=()=>{},p=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=Wr(e,{win:r}),p=wt(e,e.doc),h=Ur(e,{win:r}),e.collectFonts&&(m=zr(e)));const f=Br(e),u=Vr(e),y=[];for(const S of e.plugins)y.push(S.observer(S.callback,r,S.options));return M(()=>{Q.forEach(S=>S.reset()),n?.disconnect(),o(),a(),l(),i(),s(),c(),d(),p(),h(),m(),f(),u(),y.forEach(S=>S())})}function Ce(e){return typeof window[e]<"u"}function ke(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ct{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,o){const a=n||this.getIdToRemoteIdMap(t),l=o||this.getRemoteIdToIdMap(t);let i=a.get(r);return i||(i=this.generateIdFn(),a.set(r,i),l.set(i,r)),i}getIds(t,r){const n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(a=>this.getId(t,a,n,o))}getRemoteId(t,r,n){const o=n||this.getRemoteIdToIdMap(t);return typeof r!="number"?r:o.get(r)||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,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 qr{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ct(Ye),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ct(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.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 n=this.crossOriginIframeMap.get(t.source);if(!n)return;const o=this.transformCrossOriginEvent(n,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case w.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:w.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case w.Meta:case w.Load:case w.DomContentLoaded:return!1;case w.Plugin:return r;case w.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case w.IncrementalSnapshot:switch(r.data.source){case I.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);const a=this.crossOriginIframeRootIdMap.get(t);a&&this.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case I.Drag:case I.TouchMove:case I.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(r.data,t,["id"]),r;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case I.Font:return r;case I.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case I.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(const a of o)!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(n,r[a]):r[a]=t.getId(n,r[a]));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!==N.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}var Xr=Object.defineProperty,Yr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,Ot=(e,t,r)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tt=(e,t)=>{for(var r in t||(t={}))Kr.call(t,r)&&Ot(e,r,t[r]);if(kt)for(var r of kt(t))Qr.call(t,r)&&Ot(e,r,t[r]);return e},Et=(e,t)=>Yr(e,Jr(t));class Zr{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(!de(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=vt(Et(Tt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(It(Et(Tt({},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(wt({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(o){return function(a){const l=o.call(this,a);return this.shadowRoot&&dt(this)&&n.addShadowRoot(this.shadowRoot,r),l}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en=typeof Uint8Array>"u"?[]:new Uint8Array(256),Oe=0;Oe<le.length;Oe++)en[le.charCodeAt(Oe)]=Oe;var tn=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=le[t[r]>>2],o+=le[(t[r]&3)<<4|t[r+1]>>4],o+=le[(t[r+1]&15)<<2|t[r+2]>>6],o+=le[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const Rt=new Map;function rn(e,t){let r=Rt.get(e);return r||(r=new Map,Rt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const xt=(e,t,r)=>{if(!e||!(Nt(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=rn(r,n);let a=o.indexOf(e);return a===-1&&(a=o.length,o.push(e)),a};function Te(e,t,r){if(e instanceof Array)return e.map(n=>Te(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,o=tn(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Te(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Te(e.data,t,r),e.width,e.height]};if(Nt(e,t)||typeof e=="object"){const n=e.constructor.name,o=xt(e,t,r);return{rr_type:n,index:o}}}}return e}const Lt=(e,t,r)=>e.map(n=>Te(n,t,r)),Nt=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function nn(e,t,r,n){const o=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of a)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const i=se(t.CanvasRenderingContext2D.prototype,l,function(s){return function(...c){return F(this.canvas,r,n,!0)||setTimeout(()=>{const d=Lt(c,t,this);e(this.canvas,{type:ae["2D"],property:l,args:d})},0),s.apply(this,c)}});o.push(i)}catch{const s=Ie(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:ae["2D"],property:l,args:[c],setter:!0})}});o.push(s)}return()=>{o.forEach(l=>l())}}function on(e){return e==="experimental-webgl"?"webgl":e}function Dt(e,t,r,n){const o=[];try{const a=se(e.HTMLCanvasElement.prototype,"getContext",function(l){return function(i,...s){if(!F(this,t,r,!0)){const c=on(i);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(s[0]&&typeof s[0]=="object"){const d=s[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return l.apply(this,[i,...s])}});o.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(a=>a())}}function At(e,t,r,n,o,a,l){const i=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const d=se(e,c,function(p){return function(...h){const m=p.apply(this,h);if(xt(m,l,this),"tagName"in this.canvas&&!F(this.canvas,n,o,!0)){const f=Lt(h,l,this),u={type:t,property:c,args:f};r(this.canvas,u)}return m}});i.push(d)}catch{const p=Ie(e,c,{set(h){r(this.canvas,{type:t,property:c,args:[h],setter:!0})}});i.push(p)}return i}function sn(e,t,r,n,o){const a=[];return a.push(...At(t.WebGLRenderingContext.prototype,ae.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&a.push(...At(t.WebGL2RenderingContext.prototype,ae.WebGL2,e,r,n,o,t)),()=>{a.forEach(l=>l())}}function an(e,t){var r=t===void 0?null:t,n=e.toString(),o=n.split(`
|
|
4
4
|
`);o.pop(),o.shift();for(var a=o[0].search(/\S/),l=/(['"])__worker_loader_strict__(['"])/g,i=0,s=o.length;i<s;++i)o[i]=o[i].substring(a).replace(l,"$1use strict$2")+`
|
|
5
5
|
`;return r&&o.push("//# sourceMappingURL="+r+`
|
|
6
|
-
`),o}function an(e,t){var r=sn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function ln(e,t){var r;return function(o){return r=r||an(e,t),new Worker(r,o)}}var cn=ln(function(){(function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;var n=function(s){var c=new Uint8Array(s),d,p=c.length,h="";for(d=0;d<p;d+=3)h+=e[c[d]>>2],h+=e[(c[d]&3)<<4|c[d+1]>>4],h+=e[(c[d+1]&15)<<2|c[d+2]>>6],h+=e[c[d+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;async function l(s,c,d){const p=`${s}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(s,c);h.getContext("2d");const m=await(await h.convertToBlob(d)).arrayBuffer(),f=n(m);return a.set(p,f),f}else return""}const i=self;i.onmessage=async function(s){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:d,width:p,height:h,dataURLOptions:m}=s.data,f=l(p,h,m),u=new OffscreenCanvas(p,h);u.getContext("2d").drawImage(d,0,0),d.close();const y=await u.convertToBlob(m),S=y.type,b=await y.arrayBuffer(),g=n(b);if(!o.has(c)&&await f===g)return o.set(c,g),i.postMessage({id:c});if(o.get(c)===g)return i.postMessage({id:c});i.postMessage({id:c,type:S,base64:g,width:p,height:h}),o.set(c,g)}else return i.postMessage({id:s.data.id})}})()},null),Ft=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,pn=(e,t)=>{var r={};for(var n in e)dn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ft)for(var n of Ft(e))t.indexOf(n)<0&&un.call(e,n)&&(r[n]=e[n]);return r},hn=(e,t,r)=>new Promise((n,o)=>{var a=s=>{try{i(r.next(s))}catch(c){o(c)}},l=s=>{try{i(r.throw(s))}catch(c){o(c)}},i=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,l);i((r=r.apply(e,t)).next())});class mn{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:o,blockSelector:a,recordCanvas:l,dataURLOptions:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&r==="all"&&this.initCanvasMutationObserver(n,o,a),l&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,a,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,a){const l=Dt(r,n,o,!0),i=new Map,s=new cn;s.onmessage=f=>{const{id:u}=f.data;if(i.set(u,!1),!("base64"in f.data))return;const{base64:y,type:S,width:b,height:g}=f.data;this.mutationCb({id:u,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,b,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};const c=1e3/t;let d=0,p;const h=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(u=>{F(u,n,o,!0)||f.push(u)}),f},m=f=>{if(d&&f-d<c){p=requestAnimationFrame(m);return}d=f,h().forEach(u=>hn(this,null,function*(){var y;const S=this.mirror.getId(u);if(i.get(S))return;if(i.set(S,!0),["webgl","webgl2"].includes(u.__context)){const g=u.getContext(u.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(u);s.postMessage({id:S,bitmap:b,width:u.width,height:u.height,dataURLOptions:a.dataURLOptions},[b])})),p=requestAnimationFrame(m)};p=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Dt(t,r,n,!1),a=rn(this.processMutation.bind(this),t,r,n),l=on(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),a(),l()}}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 o=n.map(l=>pn(l,["type"])),{type:a}=n[0];this.mutationCb({id:r,type:a,commands:o}),this.pendingCanvasMutations.delete(t)}}class fn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new br,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:[]},o=[];for(const a of t){let l;this.styleMirror.has(a)?l=this.styleMirror.getId(a):(l=this.styleMirror.add(a),o.push({styleId:l,rules:Array.from(a.rules||CSSRule,(i,s)=>({rule:Ge(i),index:s}))})),n.styleIds.push(l)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class yn{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(o=>o!==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}}var gn=Object.defineProperty,Sn=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,In=Object.prototype.propertyIsEnumerable,Pt=(e,t,r)=>t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))vn.call(t,r)&&Pt(e,r,t[r]);if(_t)for(var r of _t(t))In.call(t,r)&&Pt(e,r,t[r]);return e},Mn=(e,t)=>Sn(e,bn(t));function N(e){return Mn($({},e),{timestamp:Me()})}let E,Ee,Ue,Re=!1;const j=Xt();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:i=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:m,maskInputFn:f,maskTextFn:u,hooks:y,packFn:S,sampling:b={},dataURLOptions:g={},mousemoveWait:v,recordDOM:R=!0,recordCanvas:D=!1,recordCrossOriginIframes:V=!1,recordAfter:U=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:B=!1,inlineImages:X=!1,plugins:k,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:W=new Set([]),errorHandler:J}=e;kr(J);const G=V?window.parent===window:!0;let xe=!1;if(!G)try{window.parent.document&&(xe=!1)}catch{xe=!0}if(G&&!t)throw new Error("emit function is required");v!==void 0&&b.mousemove===void 0&&(b.mousemove=v),j.reset();const je=p===!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}:h!==void 0?h:{password:!0},ze=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Sr();let $t,Be=0;const Wt=I=>{for(const H of k||[])H.eventProcessor&&(I=H.eventProcessor(I));return S&&!xe&&(I=S(I)),I};E=(I,H)=>{var x;if(((x=Q[0])==null?void 0:x.isFrozen())&&I.type!==C.FullSnapshot&&!(I.type===C.IncrementalSnapshot&&I.data.source===M.Mutation)&&Q.forEach(_=>_.unfreeze()),G)t?.(Wt(I),H);else if(xe){const _={type:"rrweb",event:Wt(I),origin:window.location.origin,isCheckout:H};window.parent.postMessage(_,"*")}if(I.type===C.FullSnapshot)$t=I,Be=0;else if(I.type===C.IncrementalSnapshot){if(I.data.source===M.Mutation&&I.data.isAttachIframe)return;Be++;const _=n&&Be>=n,ce=r&&I.timestamp-$t.timestamp>r;(_||ce)&&Ee(!0)}};const Le=I=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Mutation},I)}))},Ut=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Scroll},I)})),jt=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.CanvasMutation},I)})),wn=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.AdoptedStyleSheet},I)})),ee=new fn({mutationCb:Le,adoptedStyleSheetCb:wn}),te=new Gr({mirror:j,mutationCb:Le,stylesheetManager:ee,recordCrossOriginIframes:V,wrappedEmit:E});for(const I of k||[])I.getMirror&&I.getMirror({nodeMirror:j,crossOriginIframeMirror:te.crossOriginIframeMirror,crossOriginIframeStyleMirror:te.crossOriginIframeStyleMirror});const He=new yn;Ue=new mn({recordCanvas:D,mutationCb:jt,win:window,blockClass:o,blockSelector:a,mirror:j,sampling:b.canvas,dataURLOptions:g});const Ne=new Qr({mutationCb:Le,scrollCb:Ut,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:je,dataURLOptions:g,maskTextFn:u,maskInputFn:f,recordCanvas:D,inlineImages:X,sampling:b,slimDOMOptions:ze,iframeManager:te,stylesheetManager:ee,canvasManager:Ue,keepIframeSrcFn:Z,processedNodeManager:He},mirror:j});Ee=(I=!1)=>{if(!R)return;E(N({type:C.Meta,data:{href:window.location.href,width:ot(),height:nt()}}),I),ee.reset(),Ne.init(),Q.forEach(x=>x.lock());const H=yr(document,{mirror:j,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:je,maskTextFn:u,slimDOM:ze,dataURLOptions:g,recordCanvas:D,inlineImages:X,onSerialize:x=>{it(x,j)&&te.addIframe(x),lt(x,j)&&ee.trackLinkElement(x),$e(x)&&Ne.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,_)=>{te.attachIframe(x,_),Ne.observeAttachShadow(x)},onStylesheetLoad:(x,_)=>{ee.attachLinkElement(x,_)},keepIframeSrcFn:Z});if(!H)return console.warn("Failed to snapshot the document");E(N({type:C.FullSnapshot,data:{node:H,initialOffset:rt(window)}}),I),Q.forEach(x=>x.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,j.getId(document))};try{const I=[],H=_=>{var ce;return w(Vr)({mutationCb:Le,mousemoveCb:(T,Ve)=>E(N({type:C.IncrementalSnapshot,data:{source:Ve,positions:T}})),mouseInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MouseInteraction},T)})),scrollCb:Ut,viewportResizeCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.ViewportResize},T)})),inputCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Input},T)})),mediaInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MediaInteraction},T)})),styleSheetRuleCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleSheetRule},T)})),styleDeclarationCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleDeclaration},T)})),canvasMutationCb:jt,fontCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Font},T)})),selectionCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Selection},T)}))},customElementCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.CustomElement},T)}))},blockClass:o,ignoreClass:l,ignoreSelector:i,maskTextClass:s,maskTextSelector:c,maskInputOptions:je,inlineStylesheet:d,sampling:b,recordDOM:R,recordCanvas:D,inlineImages:X,userTriggeredOnInput:z,collectFonts:B,doc:_,maskInputFn:f,maskTextFn:u,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:ze,dataURLOptions:g,mirror:j,iframeManager:te,stylesheetManager:ee,shadowDomManager:Ne,processedNodeManager:He,canvasManager:Ue,ignoreCSSAttributes:W,plugins:((ce=k?.filter(T=>T.observer))==null?void 0:ce.map(T=>({observer:T.observer,options:T.options,callback:Ve=>E(N({type:C.Plugin,data:{plugin:T.name,payload:Ve}}))})))||[]},y)};te.addLoadListener(_=>{try{I.push(H(_.contentDocument))}catch(ce){console.warn(ce)}});const x=()=>{Ee(),I.push(H(document)),Re=!0};return document.readyState==="interactive"||document.readyState==="complete"?x():(I.push(A("DOMContentLoaded",()=>{E(N({type:C.DomContentLoaded,data:{}})),U==="DOMContentLoaded"&&x()})),I.push(A("load",()=>{E(N({type:C.Load,data:{}})),U==="load"&&x()},window))),()=>{I.forEach(_=>_()),He.destroy(),Re=!1,Or()}}catch(I){console.warn(I)}}return ye.addCustomEvent=(e,t)=>{if(!Re)throw new Error("please add custom event after start recording");E(N({type:C.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{Q.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Re)throw new Error("please take full snapshot after start recording");Ee(e)},ye.mirror=j,ye}();
|
|
6
|
+
`),o}function ln(e,t){var r=an(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function cn(e,t){var r;return function(o){return r=r||ln(e,t),new Worker(r,o)}}var dn=cn(function(){(function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;var n=function(s){var c=new Uint8Array(s),d,p=c.length,h="";for(d=0;d<p;d+=3)h+=e[c[d]>>2],h+=e[(c[d]&3)<<4|c[d+1]>>4],h+=e[(c[d+1]&15)<<2|c[d+2]>>6],h+=e[c[d+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;async function l(s,c,d){const p=`${s}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(s,c);h.getContext("2d");const m=await(await h.convertToBlob(d)).arrayBuffer(),f=n(m);return a.set(p,f),f}else return""}const i=self;i.onmessage=async function(s){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:d,width:p,height:h,dataURLOptions:m}=s.data,f=l(p,h,m),u=new OffscreenCanvas(p,h);u.getContext("2d").drawImage(d,0,0),d.close();const y=await u.convertToBlob(m),S=y.type,b=await y.arrayBuffer(),g=n(b);if(!o.has(c)&&await f===g)return o.set(c,g),i.postMessage({id:c});if(o.get(c)===g)return i.postMessage({id:c});i.postMessage({id:c,type:S,base64:g,width:p,height:h}),o.set(c,g)}else return i.postMessage({id:s.data.id})}})()},null),Ft=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,hn=(e,t)=>{var r={};for(var n in e)un.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ft)for(var n of Ft(e))t.indexOf(n)<0&&pn.call(e,n)&&(r[n]=e[n]);return r},mn=(e,t,r)=>new Promise((n,o)=>{var a=s=>{try{i(r.next(s))}catch(c){o(c)}},l=s=>{try{i(r.throw(s))}catch(c){o(c)}},i=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,l);i((r=r.apply(e,t)).next())});class fn{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:o,blockSelector:a,recordCanvas:l,dataURLOptions:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&r==="all"&&this.initCanvasMutationObserver(n,o,a),l&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,a,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,a){const l=Dt(r,n,o,!0),i=new Map,s=new dn;s.onmessage=f=>{const{id:u}=f.data;if(i.set(u,!1),!("base64"in f.data))return;const{base64:y,type:S,width:b,height:g}=f.data;this.mutationCb({id:u,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,b,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};const c=1e3/t;let d=0,p;const h=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(u=>{F(u,n,o,!0)||f.push(u)}),f},m=f=>{if(d&&f-d<c){p=requestAnimationFrame(m);return}d=f,h().forEach(u=>mn(this,null,function*(){var y;const S=this.mirror.getId(u);if(i.get(S)||u.width===0||u.height===0)return;if(i.set(S,!0),["webgl","webgl2"].includes(u.__context)){const g=u.getContext(u.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(u);s.postMessage({id:S,bitmap:b,width:u.width,height:u.height,dataURLOptions:a.dataURLOptions},[b])})),p=requestAnimationFrame(m)};p=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Dt(t,r,n,!1),a=nn(this.processMutation.bind(this),t,r,n),l=sn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),a(),l()}}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 o=n.map(l=>hn(l,["type"])),{type:a}=n[0];this.mutationCb({id:r,type:a,commands:o}),this.pendingCanvasMutations.delete(t)}}class yn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new vr,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:[]},o=[];for(const a of t){let l;this.styleMirror.has(a)?l=this.styleMirror.getId(a):(l=this.styleMirror.add(a),o.push({styleId:l,rules:Array.from(a.rules||CSSRule,(i,s)=>({rule:He(i),index:s}))})),n.styleIds.push(l)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class gn{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(o=>o!==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}}var Sn=Object.defineProperty,_t=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,Pt=(e,t,r)=>t in e?Sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))bn.call(t,r)&&Pt(e,r,t[r]);if(_t)for(var r of _t(t))vn.call(t,r)&&Pt(e,r,t[r]);return e},$t;let E,Ee,We,Re=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(($t=e.contentWindow)==null?void 0:$t.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const U=Yt();function fe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:i=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:m,maskInputFn:f,maskTextFn:u,hooks:y,packFn:S,sampling:b={},dataURLOptions:g={},mousemoveWait:v,recordDOM:R=!0,recordCanvas:D=!1,recordCrossOriginIframes:V=!1,recordAfter:W=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:j=!1,collectFonts:z=!1,inlineImages:X=!1,plugins:C,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:J}=e;Or(J);const H=V?window.parent===window:!0;let xe=!1;if(!H)try{window.parent.document&&(xe=!1)}catch{xe=!0}if(H&&!t)throw new Error("emit function is required");v!==void 0&&b.mousemove===void 0&&(b.mousemove=v),U.reset();const Ue=p===!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}:h!==void 0?h:{password:!0},je=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};br();let Wt,ze=0;const Ut=k=>{for(const B of C||[])B.eventProcessor&&(k=B.eventProcessor(k));return S&&!xe&&(k=S(k)),k};E=(k,B)=>{var x;const L=k;if(L.timestamp=Me(),((x=Q[0])==null?void 0:x.isFrozen())&&L.type!==w.FullSnapshot&&!(L.type===w.IncrementalSnapshot&&L.data.source===I.Mutation)&&Q.forEach(G=>G.unfreeze()),H)t?.(Ut(L),B);else if(xe){const G={type:"rrweb",event:Ut(L),origin:window.location.origin,isCheckout:B};window.parent.postMessage(G,"*")}if(L.type===w.FullSnapshot)Wt=L,ze=0;else if(L.type===w.IncrementalSnapshot){if(L.data.source===I.Mutation&&L.data.isAttachIframe)return;ze++;const G=n&&ze>=n,O=r&&L.timestamp-Wt.timestamp>r;(G||O)&&Ee(!0)}};const Le=k=>{E({type:w.IncrementalSnapshot,data:$({source:I.Mutation},k)})},jt=k=>E({type:w.IncrementalSnapshot,data:$({source:I.Scroll},k)}),zt=k=>E({type:w.IncrementalSnapshot,data:$({source:I.CanvasMutation},k)}),In=k=>E({type:w.IncrementalSnapshot,data:$({source:I.AdoptedStyleSheet},k)}),ee=new yn({mutationCb:Le,adoptedStyleSheetCb:In}),te=new qr({mirror:U,mutationCb:Le,stylesheetManager:ee,recordCrossOriginIframes:V,wrappedEmit:E});for(const k of C||[])k.getMirror&&k.getMirror({nodeMirror:U,crossOriginIframeMirror:te.crossOriginIframeMirror,crossOriginIframeStyleMirror:te.crossOriginIframeStyleMirror});const Be=new gn;We=new fn({recordCanvas:D,mutationCb:zt,win:window,blockClass:o,blockSelector:a,mirror:U,sampling:b.canvas,dataURLOptions:g});const Ne=new Zr({mutationCb:Le,scrollCb:jt,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:Ue,dataURLOptions:g,maskTextFn:u,maskInputFn:f,recordCanvas:D,inlineImages:X,sampling:b,slimDOMOptions:je,iframeManager:te,stylesheetManager:ee,canvasManager:We,keepIframeSrcFn:Z,processedNodeManager:Be},mirror:U});Ee=(k=!1)=>{if(!R)return;E({type:w.Meta,data:{href:window.location.href,width:ot(),height:nt()}},k),ee.reset(),Ne.init(),Q.forEach(x=>x.lock());const B=gr(document,{mirror:U,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:Ue,maskTextFn:u,slimDOM:je,dataURLOptions:g,recordCanvas:D,inlineImages:X,onSerialize:x=>{it(x,U)&&te.addIframe(x),lt(x,U)&&ee.trackLinkElement(x),Pe(x)&&Ne.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,L)=>{te.attachIframe(x,L),Ne.observeAttachShadow(x)},onStylesheetLoad:(x,L)=>{ee.attachLinkElement(x,L)},keepIframeSrcFn:Z});if(!B)return console.warn("Failed to snapshot the document");E({type:w.FullSnapshot,data:{node:B,initialOffset:rt(window)}},k),Q.forEach(x=>x.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,U.getId(document))};try{const k=[],B=L=>{var G;return M(Gr)({mutationCb:Le,mousemoveCb:(O,Ve)=>E({type:w.IncrementalSnapshot,data:{source:Ve,positions:O}}),mouseInteractionCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.MouseInteraction},O)}),scrollCb:jt,viewportResizeCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.ViewportResize},O)}),inputCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.Input},O)}),mediaInteractionCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.MediaInteraction},O)}),styleSheetRuleCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.StyleSheetRule},O)}),styleDeclarationCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.StyleDeclaration},O)}),canvasMutationCb:zt,fontCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.Font},O)}),selectionCb:O=>{E({type:w.IncrementalSnapshot,data:$({source:I.Selection},O)})},customElementCb:O=>{E({type:w.IncrementalSnapshot,data:$({source:I.CustomElement},O)})},blockClass:o,ignoreClass:l,ignoreSelector:i,maskTextClass:s,maskTextSelector:c,maskInputOptions:Ue,inlineStylesheet:d,sampling:b,recordDOM:R,recordCanvas:D,inlineImages:X,userTriggeredOnInput:j,collectFonts:z,doc:L,maskInputFn:f,maskTextFn:u,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:je,dataURLOptions:g,mirror:U,iframeManager:te,stylesheetManager:ee,shadowDomManager:Ne,processedNodeManager:Be,canvasManager:We,ignoreCSSAttributes:P,plugins:((G=C?.filter(O=>O.observer))==null?void 0:G.map(O=>({observer:O.observer,options:O.options,callback:Ve=>E({type:w.Plugin,data:{plugin:O.name,payload:Ve}})})))||[]},y)};te.addLoadListener(L=>{try{k.push(B(L.contentDocument))}catch(G){console.warn(G)}});const x=()=>{Ee(),k.push(B(document)),Re=!0};return document.readyState==="interactive"||document.readyState==="complete"?x():(k.push(A("DOMContentLoaded",()=>{E({type:w.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&x()})),k.push(A("load",()=>{E({type:w.Load,data:{}}),W==="load"&&x()},window))),()=>{k.forEach(L=>L()),Be.destroy(),Re=!1,Tr()}}catch(k){console.warn(k)}}return fe.addCustomEvent=(e,t)=>{if(!Re)throw new Error("please add custom event after start recording");E({type:w.Custom,data:{tag:e,payload:t}})},fe.freezePage=()=>{Q.forEach(e=>e.freeze())},fe.takeFullSnapshot=e=>{if(!Re)throw new Error("please take full snapshot after start recording");Ee(e)},fe.mirror=U,fe}();
|
|
7
7
|
|
|
8
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,u=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var i={3331:t=>{t.exports=u},1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.l=void 0;const s=e(7512);i.l=()=>__STATSIG__||u,i.i=t=>(0,i.l)()[t];i.t=t=>{var e=(0,i.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&s.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var r="__STATSIG__",l="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=l[r])?n:e[r])?n:o[r])?n:{instance:i.t};l[r]=u,e[r]=u,o[r]=u},2137:(t,e,i)=>{$Q(e),e.o=e.u=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.u=n,e.o=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const u=i(7512),a=i(9122),r=i(8578),l=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new n}attach(t,e){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,r.T)(t,this.m),e=this.k(t),i=this.S.get(e,t);return i||((i=this.I(e))?(this.S.add(e,i),this.S.get(e,t)):null)}setData(t,e){var e=e&&(0,r.T)(e,this.m),i=this.k(e);this.S.add(i,h("Bootstrap",t,null,e))}D(e,i,n){return s(this,void 0,void 0,function*(){l.Storage.isReady()||(yield l.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.M(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.T)(i,this.m),e=this.k(t),t=yield this.D(null,t,n);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(r,l,o){return s(this,void 0,void 0,function*(){let t=null;r&&this.N(r,l)&&(t=r.data);var e=yield this.R(t,l,o);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.P)(e,"has_updates","Response"),n=this.C(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,l);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,l)}e=this.k(l);return this.S.add(e,s),this.U(e,s),s})}C(){return null!=this.O?this.O:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=l.Storage.getItem)?void 0:e.call(l.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){l.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,l.G)(this.j))?e:{},t=(e[t]=Date.now(),o(e,10));t&&(delete e[t],l.Storage.removeItem(t)),(0,l.L)(this.j,e)}};class n{constructor(){this.K={}}get(t,e){var t=this.K[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=o(this.K,9);i&&delete this.K[i],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function o(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt<i.receivedAt?e:t:n<i?e:t})}},8962:(t,r)=>{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function l(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={q:t=>n.get(t),B:t=>{l(t,s({},i,"overall"))},V:(t,e,i)=>{l(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},J:(t,e)=>{l(t,s(e,i,"initialize","network_request"))},$:(t,e)=>{l(t,s(e,"end","initialize","network_request"))},W:t=>{l(t,s({},i,"initialize","process"))},H:(t,e)=>{l(t,s(e,"end","initialize","process"))},Y:t=>{n.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,i,n){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.X(n)}},tt(t,e,i,n){var s=r.Diagnostics.q(i);null==s||s.length<=0||(r.Diagnostics.Y(i),i=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:s.slice(),statsigOptions:n}),e.enqueue(i))}}},8809:function(t,e){var i=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const s=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r="https://cloudflare-dns.com/dns-query",l=["i","e","d"],o=200;e.et=function(e){return i(this,void 0,void 0,function*(){var i=yield e(r,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:s});if(i.ok){var t,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((t,e)=>e<o&&"="===String.fromCharCode(t)&&l.includes(String.fromCharCode(n[e-1])));if(-1===i)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=i-1;t<n.length;t++)e+=String.fromCharCode(n[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,o,e){var i=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const n=e(7512),u=e(5902),a=e(8e3),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,i){this.O=t,this.m=e,this.nt=i,this.it=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.rt(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}rt(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.st(e,t)):i}catch(t){return this.st(e,t),null}}st(r,l){try{n.Log.warn("Caught error in "+r,{error:l});i(this,void 0,void 0,function*(){var t,e,i=l||Error(c),n=i instanceof Error,s=n?i.name:"No Name";this.it.has(s)||(this.it.add(s),null!=(t=null==(t=this.m)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.nt)&&t.call(this,{name:"error",error:l,tag:r}):(t=u.SDKType.lt(this.O),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.m)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:i}),null!=(n=this.nt)&&n.call(this,{name:"error",error:l,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),l=i(7512),o=i(7410),u=i(6830),a=i(1637),c=i(4534),h=i(1881),d=i(2397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static ot(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,i,n){this.O=t,this.nt=e,this.ht=i,this.m=n,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.bt=!0===(null==n?void 0:n.disableLogging),this.yt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.Ot=new h.UrlConfiguration(o.Endpoint.jt,null==e?void 0:e.logEventUrl,null==e?void 0:e.api,null==e?void 0:e.logEventFallbackUrls)}setLoggingDisabled(t){this.bt=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&_.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.vt={}}start(){(0,u.kt)()||(v[this.O]=this,(0,d.It)(t=>{"background"===t?_.ot(this.O):"foreground"===t&&_.ut(this.O)}),this.ct(f.Startup),this.Dt())}stop(){return n(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete v[this.O],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>_.ot(this.O),200)}St(t){if((0,u.kt)())return!1;if((0,a.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.u)(this.O,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),e=this.vt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=i}return!0}At(t){var e,i;return n(this,void 0,void 0,function*(){if(this.bt)return this.Nt(t),!1;try{return((0,d.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(i=null==(e=this.m)?void 0:e.networkConfig)?void 0:i.networkOverrideFunc)?yield this.Pt(t):yield this.Ct(t)).success?(this.nt({name:"logs_flushed",events:t}),!0):(l.Log.warn("Failed to flush events."),this.Nt(t),!1)}catch(t){return l.Log.warn("Failed to flush events."),!1}})}Ct(e){var i;return n(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(i=null==t?void 0:t.code)?i:-1;return{success:200<=t&&t<300}})}Pt(t){return n(this,void 0,void 0,function*(){return{success:yield this.ht.beacon(this.Ut(t))}})}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(t.length)}}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,c.L)(e,t)}catch(t){l.Log.warn("Unable to save failed logs to storage")}}ct(e){const i=this.o();n(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.G)(i);t&&(e===f.Startup&&c.Storage.removeItem(i),yield this.At(t))&&e===f.GainedFocus&&c.Storage.removeItem(i)}).catch(()=>{l.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,r.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));l.Log.debug("Enqueued Event:",i),this.dt.push(i)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=v[this.O];t&&t.Et===e?_.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=_},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.Lt=r.Kt=r.h=void 0;const l=e(6634);r.h=e=>{let i=0;for(let t=0;t<e.length;t++){var n=e.charCodeAt(t);i=(i<<5)-i+n,i&=i}return String(i>>>0)},r.Kt=(t,e)=>(0,r.h)(JSON.stringify((0,r.Lt)(t,e)));r.Lt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,l.zt)(e)?s[t]=e:s[t]=(0,r.Lt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,i){var y=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const l=i(1845),m=i(8962),S=i(7512),O=i(7410),n=i(308),o=i(5902),u=i(6830),a=i(4143),c=i(9122),j=i(2636),h=i(8e3),w=i(2397),T=500,I=3e4,k=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.Vt=1e4,this.Jt={},this.m={},this.$t=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new n.NetworkFallbackResolver(this.m)}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(n){return y(this,void 0,void 0,function*(){var t,e,i;return!!D(n)&&(e=this.Ht("POST",n),t=yield this.Yt(e,n.data),e=yield this.Xt(e),(i=navigator).sendBeacon.bind(i)(e,t))})}post(e){return y(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return t.body=yield this.Yt(t,e.data),e.isStatsigEncodable&&(t.body=this.Qt(t,t.body)),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(g){var b,p;return y(this,void 0,void 0,function*(){if(!D(g))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,attempt:s}=g,s=null!=s?s:1;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==r&&void 0!==r&&r.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=yield this.Xt(g);let o=null;var u,a=(0,w.Rt)();try{var c,h,d,v={method:e,body:i,headers:$P({},g.headers),signal:null===r||void 0===r?void 0:r.signal,priority:g.priority,keepalive:a},f=(u=s,(_=g).urlConfig.endpoint===O.Endpoint.qt&&m.Diagnostics.J(_.sdkKey,{attempt:u}),null!=(b=this.Jt.networkOverrideFunc)?b:fetch);if(o=yield f(l,v),clearTimeout(t),o.ok)return d=yield o.text(),E(g,o,s,d),this.Wt.tryBumpExpiryTime(g.sdkKey,g.urlConfig),{body:d,code:o.status};throw c=yield o.text().catch(()=>"No Text"),(h=new Error(`NetworkError: ${l} `+c)).name="NetworkError",h}catch(t){var i=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t),a=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(r),_=(E(g,o,s,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(g.sdkKey,g.urlConfig,i,a));return(_&&(g.fallbackUrl=this.Wt.getActiveFallbackUrl(g.sdkKey,g.urlConfig)),!n||n<s||!k.has(null!=(p=null===o||void 0===o?void 0:o.status)?p:500))?(null!=(p=this.nt)&&p.call(this,{name:"error",error:t,tag:j.ErrorTag.NetworkError,requestArgs:g}),S.Log.error(`A networking error occured during ${e} request to ${l}.`,i,t),null):(yield function(e){return y(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(T*(e*e),I)))})}(s),this.Zt($P($P({},g),{retries:n,attempt:s+1})))}})}Xt(n){var s;return y(this,void 0,void 0,function*(){var t=null!=(s=n.fallbackUrl)?s:n.urlConfig.getUrl();const e=$P({[O.NetworkParam.SdkKey]:n.sdkKey,[O.NetworkParam.SdkType]:o.SDKType.lt(n.sdkKey),[O.NetworkParam.SdkVersion]:h.SDK_VERSION,[O.NetworkParam.Time]:String(Date.now()),[O.NetworkParam.SessionID]:a.SessionID.get(n.sdkKey)},n.params);var i=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return t+(i?"?"+i:"")})}Yt(s,r){return y(this,void 0,void 0,function*(){var{sdkKey:t,fallbackUrl:e}=s,i=c.StableID.get(t),n=a.SessionID.get(t),t=o.SDKType.lt(t);return JSON.stringify($P($P({},r),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:t,fallbackUrl:e})}))})}Qt(e,i){var t,n,s=(0,u.te)();if(this.m.disableStatsigEncoding||null!=(0,l.i)("no-encode")||null==s||!s.btoa)return i;try{var r=null!=(t=s.btoa(i).split("").reverse().join(""))?t:i;return e.params=$P($P({},null!=(n=e.params)?n:{}),{[O.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return S.Log.warn("Request encoding failed for "+e.urlConfig.getUrl()),i}}Ht(t,e){var i=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig);return $P($P({},e),{method:t,fallbackUrl:i})}};const D=t=>!!t.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1);function E(t,e,i,n,s){t.urlConfig.endpoint===O.Endpoint.qt&&m.Diagnostics.$(t.sdkKey,m.Diagnostics.Z(e,i,n,s))}},308:function(t,e,i){var u=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const o=i(8809),n=i(1406),r=i(7512),l=i(4534);function a(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,n.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}function d(t){try{return new URL(t).pathname}catch(t){return null}}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var i=null==(i=this.ne)?void 0:i[e.endpoint];i&&(i.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:i})))}getActiveFallbackUrl(t,e){var i;let n=this.ne;null==n&&(n=null!=(s=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return r.Log.error("Failed to parse FallbackInfo"),null}}(t))?s:{},this.ne=n);var s=n[e.endpoint];return!s||Date.now()>(null!=(i=s.expiryTime)?i:0)?(delete n[e.endpoint],this.ne=n,h(t,this.ne),null):s.url||null}getFallbackFromProvided(t){var e=d(t);return e?t.replace(e,""):null}tryFetchUpdatedFallbackInfo(i,n,s,r){var l,o;return u(this,void 0,void 0,function*(){try{var t,e;return a(s,r)?(t=null==n.customUrl&&null==n.fallbackUrls?yield this.se(n):n.fallbackUrls,!!(e=this.le(null==(l=this.ne)?void 0:l[n.endpoint],t))&&(this.oe(i,n.endpoint,e),!0)):!1}catch(t){return null!=(o=this.$t)&&o.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,i){var i={url:i,expiryTime:Date.now()+6048e5,previous:[]},n=null==(n=this.ne)?void 0:n[e],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this.ne)?void 0:n[e])?void 0:n.url);null!=n&&i.previous.push(n),this.ne=$P($P({},this.ne),{[e]:i}),h(t,this.ne)}se(r){var l;return u(this,void 0,void 0,function*(){var t=this.ie[r.endpoint];if(t&&Date.now()<t)return null;this.ie[r.endpoint]=Date.now()+144e5;var e=[],t=yield(0,o.et)(null!=(l=this.re)?l:fetch),i=d(r.defaultUrl);for(const s of t)if(s.startsWith(r.endpointDnsKey+"=")){var n=s.split("=");if(1<n.length){let t=n[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+i)}}return e})}le(t,e){var i;if(null==e)return null;var n=new Set(null!=(i=null==t?void 0:t.previous)?i:[]),s=null==t?void 0:t.url;let r=null;for(const o of e){var l=o.endsWith("/")?o.slice(0,-1):o;if(!n.has(o)&&l!==s){r=l;break}}return r}},e.ee=a},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={lt:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},ue(t,e){i[t]=e},ae(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.Gt=n.ce=n.he=n.kt=n.de=n.te=void 0;n.te=()=>"undefined"!=typeof window?window:null,n.de=()=>{var t=(0,n.te)();return null!=(t=null==t?void 0:t.document)?t:null},n.kt=()=>{var t;return null===(0,n.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.he=(t,e)=>{var i=(0,n.te)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.ce=(t,e)=>{var i=(0,n.de)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.Gt=()=>{var t;try{return null==(t=(0,n.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(2137),r=i(7512),l=i(4534),o=i(8023),u=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=d(t);return(0,l.G)(t)}(t);var i=Date.now();e=e||{sessionID:(0,o.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>u}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,o.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,l.L)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,u),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(4534),l=i(8023),o={};function u(t){return"statsig.stable_id."+(0,n.o)(t)}function a(t,e){e=u(e);try{(0,r.L)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==o[e]){let t=function(t){t=u(t);return(0,r.G)(t)}(e);null==t&&a(t=(0,l.getUUID)(),e),o[e]=t}return o[e]},setOverride:(t,e)=>{a(o[e]=t,e)}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const l=i(1845),o=i(5542),u=i(7770),a=i(7512),c=i(6830),h=i(4143),d=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage._e(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.ge(n.storageProvider),this.O=t,this.m=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.pe=new u.EventLogger(t,r,i,n),this.$t=new o.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),i.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.be(),s=t,r=this,(0,c.kt)()||(i=(0,l.l)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.firstInstance||(i.firstInstance=r),i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,d.Storage._e(t.disableStorage))}flush(){return this.pe.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.fe[i.name]&&this.fe[i.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Se=e.xt=void 0;const s="statsig::config_exposure",r="statsig::gate_exposure",u="statsig::layer_exposure",a=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:l(i,n),secondaryExposures:s,time:Date.now()});e.xt=({eventName:t})=>t===r||t===s||t===u,e.Se=(t,e)=>{var i,n={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(n.configVersion=e.__evaluation.version),a(r,t,e.details,n,null!=(t=null==(i=e.__evaluation)?void 0:i.secondary_exposures)?t:[])},e.je=(t,e)=>{var i,n={config:e.name,ruleID:e.ruleID};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(n.configVersion=e.__evaluation.version),null!=(null==(i=e.__evaluation)?void 0:i.passed)&&(n.rulePassed=String(e.__evaluation.passed)),a(s,t,e.details,n,null!=(t=null==(i=e.__evaluation)?void 0:i.secondary_exposures)?t:[])};e.Oe=(t,e,i)=>{var n=e.__evaluation,s=!0===(null==(s=null==n?void 0:n.explicit_parameters)?void 0:s.includes(i));let r="",l=null!=(o=null==n?void 0:n.undelegated_secondary_exposures)?o:[];s&&(r=null!=(o=n.allocated_experiment_name)?o:"",l=n.secondary_exposures);var o={config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:r,isExplicitParameter:String(s)};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(o.configVersion=e.__evaluation.version),a(u,t,e.details,o,l)};const l=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.8.2";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const l=i(7512),o=i(6634),s="default";function r(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},r(t,e,i,n)),{get:u(t,null==i?void 0:i.value)})}function u(n,s,r){return(t,e)=>{var i=null!=(i=null==s?void 0:s[t])?i:null;return null==i?null!=e?e:null:null==e||(0,o.Me)(i,e)?(null!=r&&r(t),i):(l.Log.warn(`Parameter type mismatch. '${n}.${t}' was found to be type '${typeof i}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,i){return r(t,e,i,!0===(null==i?void 0:i.value))},e.De=n,e.Ie=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return $P($P({},r(t,e,i,void 0)),{get:u(t,null==i?void 0:i.value,n),groupName:null!=(e=null==i?void 0:i.group_name)?e:null,__value:null!=(t=null==i?void 0:i.value)?t:{}})},e.Te=function(t,e,i,n){return $P($P($P({},t),e),{get:u(t.name,i,n)})},e.we=u},1812:(t,e)=>{$Q(e)},8578:(t,e,i)=>{$Q(e),e.v=e.T=void 0;const n=i(1406),s=i(7512);e.T=function(t,e,i){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?n.statsigEnvironment=e.environment:null!=i&&(n.statsigEnvironment={tier:i}),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Kt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.L=i.G=i.Storage=void 0;var n=e(7512),e=e(6830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let l=null;try{const a=(0,e.te)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>a.localStorage.getItem(t),setItem:(t,e)=>a.localStorage.setItem(t,e),removeItem:t=>a.localStorage.removeItem(t),getAllKeys:()=>Object.keys(a.localStorage)})}catch(t){n.Log.warn("Failed to setup localStorageProvider.")}let o=null!==l&&void 0!==l?l:r,u=o;i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>{var e=()=>u.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.ge(r),null;throw t}},setItem:(t,e)=>u.setItem(t,e),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),ge:t=>{o=t,u=t},_e:t=>{u=t?r:o}},i.G=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.L=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.P=void 0;const s=i(7512);e.P=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,i)=>{$Q(e),e.UrlConfiguration=void 0;const s=i(7410),r={[s.Endpoint.qt]:"i",[s.Endpoint.jt]:"e",[s.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=r[t],e&&(this.customUrl=e),!e&&i&&(this.customUrl=i.endsWith("/")?""+i+t:i+"/"+t),n&&(this.fallbackUrls=n);e=s.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}}},2397:(t,e,i)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;i=i(6830);const n="foreground",s="background",r=[];let l=n,o=!1;e.xe=()=>l===n,e.Rt=()=>o,e.It=t=>{r.unshift(t)};e.Ae=e=>{e!==l&&(l=e,r.forEach(t=>t(e)))},(0,i.he)("focus",()=>{(o=!1,e.Ae)(n)}),(0,i.he)("blur",()=>(0,e.Ae)(s)),(0,i.he)("beforeunload",()=>{o=!0,(0,e.Ae)(s)}),(0,i.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?n:s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(1845);const r=i(8962),l=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(7770)),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=i(8e3);const a=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7410),e),s(i(7023),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(1098),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(1881),e),s(i(8023),e),s(i(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const b=i(6914),p=i(2018);function y(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n,s;try{var r=(0,b.te)(),l=(0,b.de)();if(r&&l&&l.currentScript){var o=l.currentScript.getAttribute("src"),u=null==(t=r.location)?void 0:t.href;if(o&&u){var a=new URL(o,u).searchParams,c=null!=(i=y("sdkKey",a))?i:y("apiKey",a);if(c){var h={},d=y("proxy",a),v=(d&&(h.networkConfig={api:d}),null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[c]);let t=null;if(t=v instanceof p.StatsigClient?v:t)e({sdkKey:c,client:t});else{var f=l.currentScript.dataset;const _=function(t,e){if(t)if(t in e&&"function"==typeof e[t])return e[t];return null}(null!=(s=f.onstatsiginit)?s:f.onStatsigInit,r),g=new p.StatsigClient(c,function(){var t=(0,b.te)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,b.Gt)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),h);g.initializeAsync().then(()=>{_&&_(g)}).catch(t=>{b.Log.error(t)}),e({sdkKey:c,client:g})}}}}}catch(t){b.Log.error("AutoInit failed",t)}}}},7262:(t,e,i)=>{$Q(e),e.Ne=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.Ne=function(t,e){var i;return(e=(0,n.P)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Kt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.O=t,this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.Ge=null,this.Le=new Set}reset(){this.Pe=null,this.Re=null,this.Ce="Loading",this.Ue=0,this.Fe=0,this.Ge=null}finalize(){this.Pe||(this.Ce="NoValues")}getValues(){return this.Re?(0,s.P)(this.Re,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.P)(t.data,"has_updates","EvaluationResponse"))&&(this.Ce=t.source,!0===(null==i?void 0:i.has_updates)&&(this.Re=t.data,this.Ue=i.time,this.Fe=t.receivedAt,this.Pe=i,this.Ge=this.Ke(t.source,i),t.source)&&i.user&&this.ze(e,i),!0)}getGate(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.param_stores,t)}Ke(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}qe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Be(null==i)}}ze(t,e){var i,n=s.StableID.get(this.O);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.Le.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.Le.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.Ce||"NoValues"===this.Ce?{reason:this.Ce}:(t={reason:this.Ce,lcut:this.Ue,receivedAt:this.Fe},0<this.Le.size&&(t.warnings=Array.from(this.Le)),t)}Be(t){var e=this.getCurrentSourceDetails();let i=e.reason;var n=null!=(n=e.warnings)?n:[],t=("Bootstrap"===this.Ce&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(t?"Unrecognized":"Recognized")),"Bootstrap"===this.Ce&&null!=(n=this.Ge)?n:void 0);return t&&(e.bootstrapMetadata=t),$P($P({},e),{reason:i})}}},8448:function(t,e,i){var l=this&&this.__awaiter||$A();$Q(e);const o=i(6914),u=i(7262);class n extends o.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Ve=new o.UrlConfiguration(o.Endpoint.qt,null==e?void 0:e.initializeUrl,null==e?void 0:e.api,null==e?void 0:e.initializeFallbackUrls)}fetchEvaluations(i,n,s,r){return l(this,void 0,void 0,function*(){var t=n?(0,o.P)(n,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.Je(i,t,e,s)})}Je(e,i,n,s){var r;return l(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,urlConfig:this.Ve,data:n,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))||!0!==n.deltasResponseRequested?t.body:"string"==typeof(t=(0,u.Ne)(i,t.body))?t:this.Je(e,i,$P($P($P({},n),t),{deltasResponseRequested:!1}),s)})}}e.default=n},3583:(t,e,i)=>{$Q(e),e.$e=void 0;const g=i(6914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function y(t,e){return null!=e&&!(0,g.Me)(t,e)}e.$e=function(v,f,_){return(t,e)=>{if(null==f)return e;var i,n,s,r,l,o,u,a,c,h,d=f[t];if(null==d||null!=e&&(0,g.zt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(_)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,u=e,a=_,y(c=(o=v).getDynamicConfig(h.config_name,b).get(h.param_name),u)?u:(p(a)&&o.getDynamicConfig(h.config_name),c);case"experiment":return u=d,a=e,o=_,y(l=(c=v).getExperiment(u.experiment_name,b).get(u.param_name),a)?a:(p(o)&&c.getExperiment(u.experiment_name),l);case"layer":return l=d,n=e,s=_,y(r=(i=v).getLayer(l.layer_name,b).get(l.param_name),n)?n:(p(s)&&i.getLayer(l.layer_name).get(l.param_name),r);default:return e}}}},8198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const l=i(6914),o=i(4845),u=i(8448),r=i(3583),a=i(4131);class n extends l.StatsigClientBase{static instance(t){var e=(0,l.l)().instance(t);return e instanceof n?e:(l.Log.warn((0,l.kt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){l.SDKType.ue(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.We=new o.default(t),this.He=(0,l.T)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.pe.start(),this.updateUserSync(this.He,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateUserSync(t,e){this.Xe(t);t=this.dataAdapter.getDataSync(this.He),this.We.setValues(t,this.He),this.Qe(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.Ze(null!=t?t:null,this.He)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Xe(i);var t=this.He,e=(l.Diagnostics.B(this.O),this.dataAdapter.getDataSync(t));if(this.We.setValues(e,this.He),this.me("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.He){let t=!1;null!=e&&(l.Diagnostics.W(this.O),t=this.We.setValues(e,this.He),l.Diagnostics.H(this.O,{success:t})),this.Qe(e),t||this.$emt({name:"initialization_failure"}),l.Diagnostics.V(this.O,t,this.We.getCurrentSourceDetails()),l.Diagnostics.tt(this.He,this.pe,this.O,this.m)}})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),user:JSON.parse(JSON.stringify(this.He)),errorBoundary:this.$t,session:l.StatsigSession.get(this.O),stableID:l.StableID.get(this.O)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.We.getGate(t),n=(0,l.Ee)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.Se)(this.He,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.De)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.Ie)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.We.getLayer(e),n=(0,l.ke)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.He,i);const r=(0,l.Te)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.ye(e,(0,l.Oe)(this.He,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.We.getParamStore(t);return this.pe.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.$e)(this,i,e)}}logEvent(t,e,i){this.pe.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.He,time:Date.now()}))}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return s(this,void 0,void 0,function*(){return l.Storage.isReady()||(yield l.Storage.isReadyResolver()),this.pe.start(),this.updateUserAsync(this.He,t)})}Qe(t){this.We.finalize(),this.me("Ready",t)}Ze(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{l.Log.error("An error occurred after update.",t)})}Xe(t){this.pe.reset(),this.We.reset(),this.He=(0,l.T)(t,this.m);t=null==(t=this.He.customIDs)?void 0:t.stableID;t&&l.StableID.setOverride(t,this.O)}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class l extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.ht=null,this.m=null}attach(t,e){super.attach(t,e),this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.D(t,(0,n.T)(e,this.m),i)}prefetchData(t,e){return this.A(t,e)}setData(t){var e=(0,n.P)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}R(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.ht)?void 0:s.fetchEvaluations(this.C(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}k(t){t=(0,n.o)(this.C(),t,null==(t=this.m)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=l},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(8198));e.StatsigClient=r.default,s(i(6914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__},8788:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const d=i(6914),s=i(759),r=i(1807),v=1048576;function l(t,e){new o(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){l(t,this.options)}},e.runStatsigSessionReplay=l;class o{constructor(t,e){this.tn=t,this.m=e,this.ti=null,this.ei=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.$t=t,this.$t.wrap(this),(0,d.kt)()||((t=(0,d.l)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.ii=this.ni(),this.si=new s.SessionReplayClient,this.tn.$on("pre_shutdown",()=>this.ri()),this.tn.$on("values_updated",()=>{var t;return this.li(null==(t=this.m)?void 0:t.forceRecording)}),this.tn.on("session_expired",()=>{this.si.stop(),d.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.oi("session_expired"),this.ii=this.ni()}),this.ui(),this.li(null==(t=this.m)?void 0:t.forceRecording)}ui(){const i=this.tn.getContext()["sdkKey"];(0,d.It)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof o&&e.ai(t)})}forceStartRecording(){this.li(!0)}ai(t){"background"===t&&(this.oi(),this.tn.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}ci(t,e){this.ti=e;var i,e=(0,r.hi)(t,10485760);10485760<e?d.Log.warn(`SessionReplay event is too large (~${e} bytes) and will not be logged`,t):(i=(0,r.hi)(this.ei,10240),this.ei.push(t),i+e<10240||((0,d.xe)()?this.di():this.oi()))}li(t=!1){var e=this.tn.getContext().values;t||!0===(null==e?void 0:e.can_record_session)?this.si.isRecording()||(d.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.record((t,e)=>this.ci(t,e),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{})):this.ri()}ri(){this.si.stop(),d.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.ei.length&&null!=this.ti&&this.di()}oi(e){0!==this.ei.length&&null!=this.ti&&(e=(0,d.Rt)()?"is_leaving_page":e,this.ii.then(t=>this.vi(t,e)).catch(t=>{this.$t.logError("SR::flush",t)}))}vi(e,i){var n=this.ti;if(null!==n&&0!==this.ei.length){var s,r,l,o=JSON.stringify(this.ei),u=function(e){var i=[];for(let t=0;t<e.length;t+=v)i.push(e.slice(t,t+v));return i}(o),a=1<u.length?(0,d.getUUID)():null;for(let t=0;t<u.length;t++){var c=u[t],h=function(t,e,i,n){n={session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:t,rrweb_payload_size:String(e.length),session_replay_sdk_version:d.SDK_VERSION};return{eventName:"statsig::session_recording",value:i,metadata:n}}(c,o,e,n);null!=a&&(s=h.metadata,r=t,l=u.length,c=c.length,s.sliced_id=a,s.slice_index=String(r),s.slice_count=String(l),s.slice_byte_size=String(c)),i&&(h.metadata[i]="true"),this.tn.logEvent(h),null!=a&&this.tn.flush().catch(t=>{d.Log.error(t)})}this.ei=[]}}di(){this.ii=this.ni(),this.oi()}ni(){return n(this,void 0,void 0,function*(){return this.tn.getContext().session.data.sessionID})}}e.SessionReplay=o},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(3331),s=i(6914);e.SessionReplayClient=class{constructor(){this.fi=null,this._i=null,this.gi=0,this.mi=0}record(i,t,e){null==(0,s.de)()||(this.fi=null,this._i=null,this.gi=0,this.mi=0,this.bi=e,this.pi)||(this.pi=(e=t=>{var e;null==this.fi&&(this.fi=t.timestamp),this._i=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.gi++,i($P($P({},t),{eventIndex:this.mi++}),{startTime:this.fi,endTime:this._i,clickCount:this.gi}),144e5<this._i-this.fi&&(null!=(e=this.pi)&&e.call(this),this.bi)&&this.bi()},t=t,("function"==typeof n?n:n.record)($P($P({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},1807:(t,o)=>{$Q2(o,"__esModule",{value:!0}),o.hi=void 0;o.hi=(e,i)=>{let n=0;var s=Object.keys(e);for(let t=0;t<s.length;t++){var r=s[t],l=e[r];if((n=(n+=r.length)+("object"==typeof l&&null!==l?(0,o.hi)(l,i)+2:String(l).length+1))>=i)return n}return n}},3447:(t,e,i)=>{$Q(e),e.StatsigSessionReplayPlugin=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(8788),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return n.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(759));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay,StatsigSessionReplayPlugin:n.StatsigSessionReplayPlugin})},4535:(t,e,i)=>{$Q(e),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),n=i(5423),s=i(6325),r=i(6901),l={submit:n.AutoCaptureEventName.FORM_SUBMIT,click:n.AutoCaptureEventName.CLICK};function o(t,e){return new u(t,e)}e.StatsigAutoCapturePlugin=class{constructor(t){this.m=t,this.__plugin="auto-capture"}bind(t){o(t,this.m)}},e.runStatsigAutoCapture=o;class u{constructor(t,e){this.tn=t,this.en=Date.now(),this.nn=0,this.rn={},this.sn=null;var{sdkKey:t,errorBoundary:i,values:n}=t.getContext(),n=(this.rn=null!=(n=null==(n=null==n?void 0:n.auto_capture_settings)?void 0:n.disabled_events)?n:{},this.$t=i,this.$t.wrap(this),this.ln=null==e?void 0:e.eventFilterFunc,(0,c.de)());(0,c.kt)()||((e=null!=(i=(__STATSIG__=(0,c.l)()).acInstances)?i:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==n?void 0:n.readyState)?n.addEventListener("DOMContentLoaded",()=>this.qt()):this.qt()}un(){const e=(0,c.te)();var t,i=(0,c.de)();e&&i&&(t=t=>{this.an(t||e.event)},(0,s.cn)(i,"click",t),(0,s.cn)(i,"submit",t),(0,s.cn)(e,"error",t),(0,s.cn)(e,"beforeunload",()=>this.hn()),(0,s.cn)(e,"scroll",()=>this.dn()))}vn(){var t=(0,c.te)(),e=(0,c.de)();t&&e&&((0,s.cn)(t,"popstate",()=>this.fn()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),this.fn())}an(t){var e,i=null==(i=t.type)?void 0:i.toLowerCase();"error"===i&&t instanceof ErrorEvent?this._n(t):(e=(0,s.gn)(t))&&(0,s.St)(t,e)&&(t=l[i])&&({value:i,metadata:e}=(0,s.pn)(e),this.bn(t,i,e))}qt(){this.un(),this.vn(),this.mn(),this.yn()}_n(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.bn(n.AutoCaptureEventName.ERROR,t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}mn(){var t=this.On();try{this.jn(t)&&this.bn(n.AutoCaptureEventName.SESSION_START,(0,s.Sn)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}catch(t){this.$t.logError("AC::logSession",t)}}fn(){var t=(0,s.wn)(),e=this.sn;e&&t.href===e.href||(this.sn=t,e=(0,r.Tn)(t),this.bn(n.AutoCaptureEventName.PAGE_VIEW,(0,s.Sn)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}))}yn(){const i=(0,c.te)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0<e.length&&e[0]instanceof PerformanceNavigationTiming&&(e=e[0],t.load_time_ms=e.duration,t.dom_interactive_time_ms=e.domInteractive-e.startTime,t.redirect_count=e.redirectCount,t.transfer_bytes=e.transferSize),i.performance.getEntriesByName("first-contentful-paint")),e=(e&&0<e.length&&e[0]instanceof PerformancePaintTiming&&(t.first_contentful_paint_time_ms=e[0].startTime),(0,s.kn)());e&&(t.effective_connection_type=e.effectiveType,t.rtt_ms=e.rtt,t.downlink_kbps=e.downlink,t.save_data=e.saveData),this.bn(n.AutoCaptureEventName.PERFORMANCE,(0,s.Sn)(),t)},1)}hn(){this.bn(n.AutoCaptureEventName.PAGE_VIEW_END,(0,s.Sn)(),{scrollDepth:this.nn,pageViewLength:Date.now()-this.en},{flushImmediately:!0})}bn(t,e,i,n){var s,r,l,o=t.slice("auto_capture::".length);if(!this.rn[t]&&!this.rn[o]){o=this.On();try{var u=$P({sessionID:o.data.sessionID,page_url:null!=(l=null==(r=null==(s=(0,c.te)())?void 0:s.location)?void 0:r.href)?l:""},i),a=(null!=n&&n.addNewSessionMetadata&&(u.isNewSession=String(this.jn(o))),{eventName:t,value:e,metadata:u});this.ln&&!this.ln(a)||(this.tn.logEvent(a),null!=n&&n.flushImmediately&&this.tn.flush().catch(t=>{c.Log.error(t)}))}catch(t){this.$t.logError("AC::enqueue",t)}}}dn(){var t=null!=(t=null==(t=(0,c.de)())?void 0:t.body.scrollHeight)?t:1,e=(0,c.te)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.nn=Math.max(this.nn,Math.min(100,Math.round((i+e)/t*100)))}jn(t){return Math.abs(t.data.startTime-Date.now())<1e3}On(){return this.tn.getContext().session}}e.AutoCapture=u},5423:(t,e)=>{$Q(e),e.AutoCaptureEventName=void 0,e.AutoCaptureEventName={PAGE_VIEW:"auto_capture::page_view",PAGE_VIEW_END:"auto_capture::page_view_end",ERROR:"auto_capture::error",SESSION_START:"auto_capture::session_start",PERFORMANCE:"auto_capture::performance",FORM_SUBMIT:"auto_capture::form_submit",CLICK:"auto_capture::click"}},6325:(t,e,i)=>{$Q(e),e.kn=e.cn=e.Sn=e.wn=e.St=e.gn=e.pn=e.In=void 0;const r=i(6914);function l(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.In=l,e.pn=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.Gt)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),o(t));return s&&(i.href=s.getAttribute("href")),"button"!==e&&!s||(i.content=(t.textContent||"").trim(),e=l(s||t),$P(i,e)),{value:n,metadata:i}},e.gn=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.St=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(o(e))return!0}return!1}},e.wn=function(){var t=null!=(t=null==(t=null==(t=(0,r.te)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.Sn=function(){return(0,r.Gt)()||""},e.cn=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.kn=function(){var t=(0,r.te)();return t&&t.navigator&&t.navigator.connection||null}},1964:(t,e,i)=>{$Q(e),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=e.AutoCaptureEventName=void 0;const n=i(4535);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return n.StatsigAutoCapturePlugin}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}});var s=i(5423);$Q2(e,"AutoCaptureEventName",{enumerable:!0,get:function(){return s.AutoCaptureEventName}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture,StatsigAutoCapturePlugin:n.StatsigAutoCapturePlugin}),e.default=__STATSIG__},6901:(t,e,i)=>{$Q(e),e.Tn=void 0;const a=i(6914);e.Tn=function(t){var e=(0,a.de)(),i=(0,a.te)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}o=r,l=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(o),o=o.searchParams.get("yahoo"===l?"p":"q")||"";var l={searchEngine:l,searchQuery:o},o=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const u={};return t.searchParams.forEach((t,e)=>{u[e]=t}),$P($P($P($P({},l),o),u),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",hostname:t.hostname||"unknown",pathname:t.pathname||"unknown",referrer:s,screen_width:(null==(l=null==i?void 0:i.screen)?void 0:l.width)||"unknown",screen_height:(null==(o=null==i?void 0:i.screen)?void 0:o.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const l=s(3447),o=s(1964);var r=s(2016);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new l.SessionReplay(t),new o.AutoCapture(t)})}return t.default})());
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,u=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var i={3331:t=>{t.exports=u},1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.l=void 0;const s=e(7512);i.l=()=>__STATSIG__||u,i.i=t=>(0,i.l)()[t];i.t=t=>{var e=(0,i.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&s.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var r="__STATSIG__",l="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=l[r])?n:e[r])?n:o[r])?n:{instance:i.t};l[r]=u,e[r]=u,o[r]=u},2137:(t,e,i)=>{$Q(e),e.o=e.u=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.u=n,e.o=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const u=i(7512),a=i(9122),r=i(8578),l=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new n}attach(t,e){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,r.T)(t,this.m),e=this.k(t),i=this.S.get(e,t);return i||((i=this.I(e))?(this.S.add(e,i),this.S.get(e,t)):null)}setData(t,e){var e=e&&(0,r.T)(e,this.m),i=this.k(e);this.S.add(i,h("Bootstrap",t,null,e))}D(e,i,n){return s(this,void 0,void 0,function*(){l.Storage.isReady()||(yield l.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.M(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.T)(i,this.m),e=this.k(t),t=yield this.D(null,t,n);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(r,l,o){return s(this,void 0,void 0,function*(){let t=null;r&&this.N(r,l)&&(t=r.data);var e=yield this.R(t,l,o);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.P)(e,"has_updates","Response"),n=this.C(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,l);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,l)}e=this.k(l);return this.S.add(e,s),this.U(e,s),s})}C(){return null!=this.O?this.O:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=l.Storage.getItem)?void 0:e.call(l.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){l.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,l.G)(this.j))?e:{},t=(e[t]=Date.now(),o(e,10));t&&(delete e[t],l.Storage.removeItem(t)),(0,l.L)(this.j,e)}};class n{constructor(){this.K={}}get(t,e){var t=this.K[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=o(this.K,9);i&&delete this.K[i],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function o(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt<i.receivedAt?e:t:n<i?e:t})}},8962:(t,r)=>{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function l(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={q:t=>n.get(t),B:t=>{l(t,s({},i,"overall"))},V:(t,e,i)=>{l(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},J:(t,e)=>{l(t,s(e,i,"initialize","network_request"))},$:(t,e)=>{l(t,s(e,"end","initialize","network_request"))},W:t=>{l(t,s({},i,"initialize","process"))},H:(t,e)=>{l(t,s(e,"end","initialize","process"))},Y:t=>{n.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,i,n){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.X(n)}},tt(t,e,i,n){var s=r.Diagnostics.q(i);null==s||s.length<=0||(r.Diagnostics.Y(i),i=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:s.slice(),statsigOptions:n}),e.enqueue(i))}}},8809:function(t,e){var i=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const s=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r="https://cloudflare-dns.com/dns-query",l=["i","e","d"],o=200;e.et=function(e){return i(this,void 0,void 0,function*(){var i=yield e(r,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:s});if(i.ok){var t,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((t,e)=>e<o&&"="===String.fromCharCode(t)&&l.includes(String.fromCharCode(n[e-1])));if(-1===i)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=i-1;t<n.length;t++)e+=String.fromCharCode(n[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,o,e){var i=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const n=e(7512),u=e(5902),a=e(8e3),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,i){this.O=t,this.m=e,this.nt=i,this.it=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.rt(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}rt(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.st(e,t)):i}catch(t){return this.st(e,t),null}}st(r,l){try{n.Log.warn("Caught error in "+r,{error:l});i(this,void 0,void 0,function*(){var t,e,i=l||Error(c),n=i instanceof Error,s=n?i.name:"No Name";this.it.has(s)||(this.it.add(s),null!=(t=null==(t=this.m)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.nt)&&t.call(this,{name:"error",error:l,tag:r}):(t=u.SDKType.lt(this.O),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.m)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:i}),null!=(n=this.nt)&&n.call(this,{name:"error",error:l,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),l=i(7512),o=i(7410),u=i(6830),a=i(1637),c=i(4534),h=i(1881),d=i(2397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static ot(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,i,n){this.O=t,this.nt=e,this.ht=i,this.m=n,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.bt=!0===(null==n?void 0:n.disableLogging),this.yt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.Ot=new h.UrlConfiguration(o.Endpoint.jt,null==e?void 0:e.logEventUrl,null==e?void 0:e.api,null==e?void 0:e.logEventFallbackUrls)}setLoggingDisabled(t){this.bt=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&_.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.vt={}}start(){(0,u.kt)()||(v[this.O]=this,(0,d.It)(t=>{"background"===t?_.ot(this.O):"foreground"===t&&_.ut(this.O)}),this.ct(f.Startup),this.Dt())}stop(){return n(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete v[this.O],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>_.ot(this.O),200)}St(t){if((0,u.kt)())return!1;if((0,a.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.u)(this.O,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),e=this.vt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=i}return!0}At(t){var e,i;return n(this,void 0,void 0,function*(){if(this.bt)return this.Nt(t),!1;try{return((0,d.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(i=null==(e=this.m)?void 0:e.networkConfig)?void 0:i.networkOverrideFunc)?yield this.Pt(t):yield this.Ct(t)).success?(this.nt({name:"logs_flushed",events:t}),!0):(l.Log.warn("Failed to flush events."),this.Nt(t),!1)}catch(t){return l.Log.warn("Failed to flush events."),!1}})}Ct(e){var i;return n(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(i=null==t?void 0:t.code)?i:-1;return{success:200<=t&&t<300}})}Pt(t){return n(this,void 0,void 0,function*(){return{success:yield this.ht.beacon(this.Ut(t))}})}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(t.length)}}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,c.L)(e,t)}catch(t){l.Log.warn("Unable to save failed logs to storage")}}ct(e){const i=this.o();n(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.G)(i);t&&(e===f.Startup&&c.Storage.removeItem(i),yield this.At(t))&&e===f.GainedFocus&&c.Storage.removeItem(i)}).catch(()=>{l.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,r.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));l.Log.debug("Enqueued Event:",i),this.dt.push(i)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=v[this.O];t&&t.Et===e?_.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=_},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.Lt=r.Kt=r.h=void 0;const l=e(6634);r.h=e=>{let i=0;for(let t=0;t<e.length;t++){var n=e.charCodeAt(t);i=(i<<5)-i+n,i&=i}return String(i>>>0)},r.Kt=(t,e)=>(0,r.h)(JSON.stringify((0,r.Lt)(t,e)));r.Lt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,l.zt)(e)?s[t]=e:s[t]=(0,r.Lt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,i){var y=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const l=i(1845),m=i(8962),S=i(7512),O=i(7410),n=i(308),o=i(5902),u=i(6830),a=i(4143),c=i(9122),j=i(2636),h=i(8e3),w=i(2397),T=500,I=3e4,k=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.Vt=1e4,this.Jt={},this.m={},this.$t=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new n.NetworkFallbackResolver(this.m)}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(n){return y(this,void 0,void 0,function*(){var t,e,i;return!!D(n)&&(e=this.Ht("POST",n),t=yield this.Yt(e,n.data),e=yield this.Xt(e),(i=navigator).sendBeacon.bind(i)(e,t))})}post(e){return y(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return t.body=yield this.Yt(t,e.data),e.isStatsigEncodable&&(t.body=this.Qt(t,t.body)),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(g){var b,p;return y(this,void 0,void 0,function*(){if(!D(g))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,attempt:s}=g,s=null!=s?s:1;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==r&&void 0!==r&&r.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=yield this.Xt(g);let o=null;var u,a=(0,w.Rt)();try{var c,h,d,v={method:e,body:i,headers:$P({},g.headers),signal:null===r||void 0===r?void 0:r.signal,priority:g.priority,keepalive:a},f=(u=s,(_=g).urlConfig.endpoint===O.Endpoint.qt&&m.Diagnostics.J(_.sdkKey,{attempt:u}),null!=(b=this.Jt.networkOverrideFunc)?b:fetch);if(o=yield f(l,v),clearTimeout(t),o.ok)return d=yield o.text(),E(g,o,s,d),this.Wt.tryBumpExpiryTime(g.sdkKey,g.urlConfig),{body:d,code:o.status};throw c=yield o.text().catch(()=>"No Text"),(h=new Error(`NetworkError: ${l} `+c)).name="NetworkError",h}catch(t){var i=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t),a=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(r),_=(E(g,o,s,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(g.sdkKey,g.urlConfig,i,a));return(_&&(g.fallbackUrl=this.Wt.getActiveFallbackUrl(g.sdkKey,g.urlConfig)),!n||n<s||!k.has(null!=(p=null===o||void 0===o?void 0:o.status)?p:500))?(null!=(p=this.nt)&&p.call(this,{name:"error",error:t,tag:j.ErrorTag.NetworkError,requestArgs:g}),S.Log.error(`A networking error occured during ${e} request to ${l}.`,i,t),null):(yield function(e){return y(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(T*(e*e),I)))})}(s),this.Zt($P($P({},g),{retries:n,attempt:s+1})))}})}Xt(n){var s;return y(this,void 0,void 0,function*(){var t=null!=(s=n.fallbackUrl)?s:n.urlConfig.getUrl();const e=$P({[O.NetworkParam.SdkKey]:n.sdkKey,[O.NetworkParam.SdkType]:o.SDKType.lt(n.sdkKey),[O.NetworkParam.SdkVersion]:h.SDK_VERSION,[O.NetworkParam.Time]:String(Date.now()),[O.NetworkParam.SessionID]:a.SessionID.get(n.sdkKey)},n.params);var i=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return t+(i?"?"+i:"")})}Yt(s,r){return y(this,void 0,void 0,function*(){var{sdkKey:t,fallbackUrl:e}=s,i=c.StableID.get(t),n=a.SessionID.get(t),t=o.SDKType.lt(t);return JSON.stringify($P($P({},r),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:t,fallbackUrl:e})}))})}Qt(e,i){var t,n,s=(0,u.te)();if(this.m.disableStatsigEncoding||null!=(0,l.i)("no-encode")||null==s||!s.btoa)return i;try{var r=null!=(t=s.btoa(i).split("").reverse().join(""))?t:i;return e.params=$P($P({},null!=(n=e.params)?n:{}),{[O.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return S.Log.warn("Request encoding failed for "+e.urlConfig.getUrl()),i}}Ht(t,e){var i=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig);return $P($P({},e),{method:t,fallbackUrl:i})}};const D=t=>!!t.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1);function E(t,e,i,n,s){t.urlConfig.endpoint===O.Endpoint.qt&&m.Diagnostics.$(t.sdkKey,m.Diagnostics.Z(e,i,n,s))}},308:function(t,e,i){var u=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const o=i(8809),n=i(1406),r=i(7512),l=i(4534);function a(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,n.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}function d(t){try{return new URL(t).pathname}catch(t){return null}}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var i=null==(i=this.ne)?void 0:i[e.endpoint];i&&(i.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:i})))}getActiveFallbackUrl(t,e){var i;let n=this.ne;null==n&&(n=null!=(s=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return r.Log.error("Failed to parse FallbackInfo"),null}}(t))?s:{},this.ne=n);var s=n[e.endpoint];return!s||Date.now()>(null!=(i=s.expiryTime)?i:0)?(delete n[e.endpoint],this.ne=n,h(t,this.ne),null):s.url||null}getFallbackFromProvided(t){var e=d(t);return e?t.replace(e,""):null}tryFetchUpdatedFallbackInfo(i,n,s,r){var l,o;return u(this,void 0,void 0,function*(){try{var t,e;return a(s,r)?(t=null==n.customUrl&&null==n.fallbackUrls?yield this.se(n):n.fallbackUrls,!!(e=this.le(null==(l=this.ne)?void 0:l[n.endpoint],t))&&(this.oe(i,n.endpoint,e),!0)):!1}catch(t){return null!=(o=this.$t)&&o.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,i){var i={url:i,expiryTime:Date.now()+6048e5,previous:[]},n=null==(n=this.ne)?void 0:n[e],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this.ne)?void 0:n[e])?void 0:n.url);null!=n&&i.previous.push(n),this.ne=$P($P({},this.ne),{[e]:i}),h(t,this.ne)}se(r){var l;return u(this,void 0,void 0,function*(){var t=this.ie[r.endpoint];if(t&&Date.now()<t)return null;this.ie[r.endpoint]=Date.now()+144e5;var e=[],t=yield(0,o.et)(null!=(l=this.re)?l:fetch),i=d(r.defaultUrl);for(const s of t)if(s.startsWith(r.endpointDnsKey+"=")){var n=s.split("=");if(1<n.length){let t=n[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+i)}}return e})}le(t,e){var i;if(null==e)return null;var n=new Set(null!=(i=null==t?void 0:t.previous)?i:[]),s=null==t?void 0:t.url;let r=null;for(const o of e){var l=o.endsWith("/")?o.slice(0,-1):o;if(!n.has(o)&&l!==s){r=l;break}}return r}},e.ee=a},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={lt:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},ue(t,e){i[t]=e},ae(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.Gt=n.ce=n.he=n.kt=n.de=n.te=void 0;n.te=()=>"undefined"!=typeof window?window:null,n.de=()=>{var t=(0,n.te)();return null!=(t=null==t?void 0:t.document)?t:null},n.kt=()=>{var t;return null===(0,n.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.he=(t,e)=>{var i=(0,n.te)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.ce=(t,e)=>{var i=(0,n.de)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.Gt=()=>{var t;try{return null==(t=(0,n.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(2137),r=i(7512),l=i(4534),o=i(8023),u=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=d(t);return(0,l.G)(t)}(t);var i=Date.now();e=e||{sessionID:(0,o.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>u}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,o.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,l.L)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,u),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(4534),l=i(8023),o={};function u(t){return"statsig.stable_id."+(0,n.o)(t)}function a(t,e){e=u(e);try{(0,r.L)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==o[e]){let t=function(t){t=u(t);return(0,r.G)(t)}(e);null==t&&a(t=(0,l.getUUID)(),e),o[e]=t}return o[e]},setOverride:(t,e)=>{a(o[e]=t,e)}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const l=i(1845),o=i(5542),u=i(7770),a=i(7512),c=i(6830),h=i(4143),d=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage._e(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.ge(n.storageProvider),this.O=t,this.m=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.pe=new u.EventLogger(t,r,i,n),this.$t=new o.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),i.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.be(),s=t,r=this,(0,c.kt)()||(i=(0,l.l)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.firstInstance||(i.firstInstance=r),i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,d.Storage._e(t.disableStorage))}flush(){return this.pe.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.fe[i.name]&&this.fe[i.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Se=e.xt=void 0;const s="statsig::config_exposure",r="statsig::gate_exposure",u="statsig::layer_exposure",a=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:l(i,n),secondaryExposures:s,time:Date.now()});e.xt=({eventName:t})=>t===r||t===s||t===u,e.Se=(t,e)=>{var i,n={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(n.configVersion=e.__evaluation.version),a(r,t,e.details,n,null!=(t=null==(i=e.__evaluation)?void 0:i.secondary_exposures)?t:[])},e.je=(t,e)=>{var i,n={config:e.name,ruleID:e.ruleID};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(n.configVersion=e.__evaluation.version),null!=(null==(i=e.__evaluation)?void 0:i.passed)&&(n.rulePassed=String(e.__evaluation.passed)),a(s,t,e.details,n,null!=(t=null==(i=e.__evaluation)?void 0:i.secondary_exposures)?t:[])};e.Oe=(t,e,i)=>{var n=e.__evaluation,s=!0===(null==(s=null==n?void 0:n.explicit_parameters)?void 0:s.includes(i));let r="",l=null!=(o=null==n?void 0:n.undelegated_secondary_exposures)?o:[];s&&(r=null!=(o=n.allocated_experiment_name)?o:"",l=n.secondary_exposures);var o={config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:r,isExplicitParameter:String(s)};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(o.configVersion=e.__evaluation.version),a(u,t,e.details,o,l)};const l=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.8.3";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const l=i(7512),o=i(6634),s="default";function r(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},r(t,e,i,n)),{get:u(t,null==i?void 0:i.value)})}function u(n,s,r){return(t,e)=>{var i=null!=(i=null==s?void 0:s[t])?i:null;return null==i?null!=e?e:null:null==e||(0,o.Me)(i,e)?(null!=r&&r(t),i):(l.Log.warn(`Parameter type mismatch. '${n}.${t}' was found to be type '${typeof i}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,i){return r(t,e,i,!0===(null==i?void 0:i.value))},e.De=n,e.Ie=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return $P($P({},r(t,e,i,void 0)),{get:u(t,null==i?void 0:i.value,n),groupName:null!=(e=null==i?void 0:i.group_name)?e:null,__value:null!=(t=null==i?void 0:i.value)?t:{}})},e.Te=function(t,e,i,n){return $P($P($P({},t),e),{get:u(t.name,i,n)})},e.we=u},1812:(t,e)=>{$Q(e)},8578:(t,e,i)=>{$Q(e),e.v=e.T=void 0;const n=i(1406),s=i(7512);e.T=function(t,e,i){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?n.statsigEnvironment=e.environment:null!=i&&(n.statsigEnvironment={tier:i}),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Kt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.L=i.G=i.Storage=void 0;var n=e(7512),e=e(6830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let l=null;try{const a=(0,e.te)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>a.localStorage.getItem(t),setItem:(t,e)=>a.localStorage.setItem(t,e),removeItem:t=>a.localStorage.removeItem(t),getAllKeys:()=>Object.keys(a.localStorage)})}catch(t){n.Log.warn("Failed to setup localStorageProvider.")}let o=null!==l&&void 0!==l?l:r,u=o;i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>{var e=()=>u.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.ge(r),null;throw t}},setItem:(t,e)=>u.setItem(t,e),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),ge:t=>{o=t,u=t},_e:t=>{u=t?r:o}},i.G=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.L=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.P=void 0;const s=i(7512);e.P=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,i)=>{$Q(e),e.UrlConfiguration=void 0;const s=i(7410),r={[s.Endpoint.qt]:"i",[s.Endpoint.jt]:"e",[s.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=r[t],e&&(this.customUrl=e),!e&&i&&(this.customUrl=i.endsWith("/")?""+i+t:i+"/"+t),n&&(this.fallbackUrls=n);e=s.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}}},2397:(t,e,i)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;i=i(6830);const n="foreground",s="background",r=[];let l=n,o=!1;e.xe=()=>l===n,e.Rt=()=>o,e.It=t=>{r.unshift(t)};e.Ae=e=>{e!==l&&(l=e,r.forEach(t=>t(e)))},(0,i.he)("focus",()=>{(o=!1,e.Ae)(n)}),(0,i.he)("blur",()=>(0,e.Ae)(s)),(0,i.he)("beforeunload",()=>{o=!0,(0,e.Ae)(s)}),(0,i.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?n:s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(1845);const r=i(8962),l=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(7770)),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=i(8e3);const a=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7410),e),s(i(7023),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(1098),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(1881),e),s(i(8023),e),s(i(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const b=i(6914),p=i(2018);function y(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n,s;try{var r=(0,b.te)(),l=(0,b.de)();if(r&&l&&l.currentScript){var o=l.currentScript.getAttribute("src"),u=null==(t=r.location)?void 0:t.href;if(o&&u){var a=new URL(o,u).searchParams,c=null!=(i=y("sdkKey",a))?i:y("apiKey",a);if(c){var h={},d=y("proxy",a),v=(d&&(h.networkConfig={api:d}),null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[c]);let t=null;if(t=v instanceof p.StatsigClient?v:t)e({sdkKey:c,client:t});else{var f=l.currentScript.dataset;const _=function(t,e){if(t)if(t in e&&"function"==typeof e[t])return e[t];return null}(null!=(s=f.onstatsiginit)?s:f.onStatsigInit,r),g=new p.StatsigClient(c,function(){var t=(0,b.te)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,b.Gt)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),h);g.initializeAsync().then(()=>{_&&_(g)}).catch(t=>{b.Log.error(t)}),e({sdkKey:c,client:g})}}}}}catch(t){b.Log.error("AutoInit failed",t)}}}},7262:(t,e,i)=>{$Q(e),e.Ne=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.Ne=function(t,e){var i;return(e=(0,n.P)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Kt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.O=t,this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.Ge=null,this.Le=new Set}reset(){this.Pe=null,this.Re=null,this.Ce="Loading",this.Ue=0,this.Fe=0,this.Ge=null}finalize(){this.Pe||(this.Ce="NoValues")}getValues(){return this.Re?(0,s.P)(this.Re,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.P)(t.data,"has_updates","EvaluationResponse"))&&(this.Ce=t.source,!0===(null==i?void 0:i.has_updates)&&(this.Re=t.data,this.Ue=i.time,this.Fe=t.receivedAt,this.Pe=i,this.Ge=this.Ke(t.source,i),t.source)&&i.user&&this.ze(e,i),!0)}getGate(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.param_stores,t)}Ke(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}qe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Be(null==i)}}ze(t,e){var i,n=s.StableID.get(this.O);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.Le.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.Le.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.Ce||"NoValues"===this.Ce?{reason:this.Ce}:(t={reason:this.Ce,lcut:this.Ue,receivedAt:this.Fe},0<this.Le.size&&(t.warnings=Array.from(this.Le)),t)}Be(t){var e=this.getCurrentSourceDetails();let i=e.reason;var n=null!=(n=e.warnings)?n:[],t=("Bootstrap"===this.Ce&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(t?"Unrecognized":"Recognized")),"Bootstrap"===this.Ce&&null!=(n=this.Ge)?n:void 0);return t&&(e.bootstrapMetadata=t),$P($P({},e),{reason:i})}}},8448:function(t,e,i){var l=this&&this.__awaiter||$A();$Q(e);const o=i(6914),u=i(7262);class n extends o.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Ve=new o.UrlConfiguration(o.Endpoint.qt,null==e?void 0:e.initializeUrl,null==e?void 0:e.api,null==e?void 0:e.initializeFallbackUrls)}fetchEvaluations(i,n,s,r){return l(this,void 0,void 0,function*(){var t=n?(0,o.P)(n,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.Je(i,t,e,s)})}Je(e,i,n,s){var r;return l(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,urlConfig:this.Ve,data:n,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))||!0!==n.deltasResponseRequested?t.body:"string"==typeof(t=(0,u.Ne)(i,t.body))?t:this.Je(e,i,$P($P($P({},n),t),{deltasResponseRequested:!1}),s)})}}e.default=n},3583:(t,e,i)=>{$Q(e),e.$e=void 0;const g=i(6914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function y(t,e){return null!=e&&!(0,g.Me)(t,e)}e.$e=function(v,f,_){return(t,e)=>{if(null==f)return e;var i,n,s,r,l,o,u,a,c,h,d=f[t];if(null==d||null!=e&&(0,g.zt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(_)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,u=e,a=_,y(c=(o=v).getDynamicConfig(h.config_name,b).get(h.param_name),u)?u:(p(a)&&o.getDynamicConfig(h.config_name),c);case"experiment":return u=d,a=e,o=_,y(l=(c=v).getExperiment(u.experiment_name,b).get(u.param_name),a)?a:(p(o)&&c.getExperiment(u.experiment_name),l);case"layer":return l=d,n=e,s=_,y(r=(i=v).getLayer(l.layer_name,b).get(l.param_name),n)?n:(p(s)&&i.getLayer(l.layer_name).get(l.param_name),r);default:return e}}}},8198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const l=i(6914),o=i(4845),u=i(8448),r=i(3583),a=i(4131);class n extends l.StatsigClientBase{static instance(t){var e=(0,l.l)().instance(t);return e instanceof n?e:(l.Log.warn((0,l.kt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){l.SDKType.ue(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.We=new o.default(t),this.He=(0,l.T)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.pe.start(),this.updateUserSync(this.He,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateUserSync(t,e){this.Xe(t);t=this.dataAdapter.getDataSync(this.He),this.We.setValues(t,this.He),this.Qe(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.Ze(null!=t?t:null,this.He)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Xe(i);var t=this.He,e=(l.Diagnostics.B(this.O),this.dataAdapter.getDataSync(t));if(this.We.setValues(e,this.He),this.me("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.He){let t=!1;null!=e&&(l.Diagnostics.W(this.O),t=this.We.setValues(e,this.He),l.Diagnostics.H(this.O,{success:t})),this.Qe(e),t||this.$emt({name:"initialization_failure"}),l.Diagnostics.V(this.O,t,this.We.getCurrentSourceDetails()),l.Diagnostics.tt(this.He,this.pe,this.O,this.m)}})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),user:JSON.parse(JSON.stringify(this.He)),errorBoundary:this.$t,session:l.StatsigSession.get(this.O),stableID:l.StableID.get(this.O)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.We.getGate(t),n=(0,l.Ee)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.Se)(this.He,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.De)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.Ie)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.We.getLayer(e),n=(0,l.ke)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.He,i);const r=(0,l.Te)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.ye(e,(0,l.Oe)(this.He,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.We.getParamStore(t);return this.pe.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.$e)(this,i,e)}}logEvent(t,e,i){this.pe.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.He,time:Date.now()}))}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return s(this,void 0,void 0,function*(){return l.Storage.isReady()||(yield l.Storage.isReadyResolver()),this.pe.start(),this.updateUserAsync(this.He,t)})}Qe(t){this.We.finalize(),this.me("Ready",t)}Ze(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{l.Log.error("An error occurred after update.",t)})}Xe(t){this.pe.reset(),this.We.reset(),this.He=(0,l.T)(t,this.m);t=null==(t=this.He.customIDs)?void 0:t.stableID;t&&l.StableID.setOverride(t,this.O)}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class l extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.ht=null,this.m=null}attach(t,e){super.attach(t,e),this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.D(t,(0,n.T)(e,this.m),i)}prefetchData(t,e){return this.A(t,e)}setData(t){var e=(0,n.P)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}R(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.ht)?void 0:s.fetchEvaluations(this.C(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}k(t){t=(0,n.o)(this.C(),t,null==(t=this.m)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=l},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(8198));e.StatsigClient=r.default,s(i(6914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__},8788:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const d=i(6914),s=i(759),r=i(1807),v=1048576;function l(t,e){new o(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){l(t,this.options)}},e.runStatsigSessionReplay=l;class o{constructor(t,e){this.tn=t,this.m=e,this.ti=null,this.ei=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.$t=t,this.$t.wrap(this),(0,d.kt)()||((t=(0,d.l)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.ii=this.ni(),this.si=new s.SessionReplayClient,this.tn.$on("pre_shutdown",()=>this.ri()),this.tn.$on("values_updated",()=>{var t;return this.li(null==(t=this.m)?void 0:t.forceRecording)}),this.tn.on("session_expired",()=>{this.si.stop(),d.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.oi("session_expired"),this.ii=this.ni()}),this.ui(),this.li(null==(t=this.m)?void 0:t.forceRecording)}ui(){const i=this.tn.getContext()["sdkKey"];(0,d.It)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof o&&e.ai(t)})}forceStartRecording(){this.li(!0)}ai(t){"background"===t&&(this.oi(),this.tn.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}ci(t,e){this.ti=e;var i,e=(0,r.hi)(t,10485760);10485760<e?d.Log.warn(`SessionReplay event is too large (~${e} bytes) and will not be logged`,t):(i=(0,r.hi)(this.ei,10240),this.ei.push(t),i+e<10240||((0,d.xe)()?this.di():this.oi()))}li(t=!1){var e=this.tn.getContext().values;t||!0===(null==e?void 0:e.can_record_session)?this.si.isRecording()||(d.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.record((t,e)=>this.ci(t,e),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{})):this.ri()}ri(){this.si.stop(),d.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.ei.length&&null!=this.ti&&this.di()}oi(e){0!==this.ei.length&&null!=this.ti&&(e=(0,d.Rt)()?"is_leaving_page":e,this.ii.then(t=>this.vi(t,e)).catch(t=>{this.$t.logError("SR::flush",t)}))}vi(e,i){var n=this.ti;if(null!==n&&0!==this.ei.length){var s,r,l,o=JSON.stringify(this.ei),u=function(e){var i=[];for(let t=0;t<e.length;t+=v)i.push(e.slice(t,t+v));return i}(o),a=1<u.length?(0,d.getUUID)():null;for(let t=0;t<u.length;t++){var c=u[t],h=function(t,e,i,n){n={session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:t,rrweb_payload_size:String(e.length),session_replay_sdk_version:d.SDK_VERSION};return{eventName:"statsig::session_recording",value:i,metadata:n}}(c,o,e,n);null!=a&&(s=h.metadata,r=t,l=u.length,c=c.length,s.sliced_id=a,s.slice_index=String(r),s.slice_count=String(l),s.slice_byte_size=String(c)),i&&(h.metadata[i]="true"),this.tn.logEvent(h),null!=a&&this.tn.flush().catch(t=>{d.Log.error(t)})}this.ei=[]}}di(){this.ii=this.ni(),this.oi()}ni(){return n(this,void 0,void 0,function*(){return this.tn.getContext().session.data.sessionID})}}e.SessionReplay=o},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(3331),s=i(6914);e.SessionReplayClient=class{constructor(){this.fi=null,this._i=null,this.gi=0,this.mi=0}record(i,t,e){null==(0,s.de)()||(this.fi=null,this._i=null,this.gi=0,this.mi=0,this.bi=e,this.pi)||(this.pi=(e=t=>{var e;null==this.fi&&(this.fi=t.timestamp),this._i=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.gi++,i($P($P({},t),{eventIndex:this.mi++}),{startTime:this.fi,endTime:this._i,clickCount:this.gi}),144e5<this._i-this.fi&&(null!=(e=this.pi)&&e.call(this),this.bi)&&this.bi()},t=t,("function"==typeof n?n:n.record)($P($P({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},1807:(t,o)=>{$Q2(o,"__esModule",{value:!0}),o.hi=void 0;o.hi=(e,i)=>{let n=0;var s=Object.keys(e);for(let t=0;t<s.length;t++){var r=s[t],l=e[r];if((n=(n+=r.length)+("object"==typeof l&&null!==l?(0,o.hi)(l,i)+2:String(l).length+1))>=i)return n}return n}},3447:(t,e,i)=>{$Q(e),e.StatsigSessionReplayPlugin=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(8788),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return n.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(759));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay,StatsigSessionReplayPlugin:n.StatsigSessionReplayPlugin})},4535:(t,e,i)=>{$Q(e),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),n=i(5423),s=i(6325),r=i(6901),l={submit:n.AutoCaptureEventName.FORM_SUBMIT,click:n.AutoCaptureEventName.CLICK};function o(t,e){return new u(t,e)}e.StatsigAutoCapturePlugin=class{constructor(t){this.m=t,this.__plugin="auto-capture"}bind(t){o(t,this.m)}},e.runStatsigAutoCapture=o;class u{constructor(t,e){this.tn=t,this.en=Date.now(),this.nn=0,this.rn={},this.sn=null;var{sdkKey:t,errorBoundary:i,values:n}=t.getContext(),n=(this.rn=null!=(n=null==(n=null==n?void 0:n.auto_capture_settings)?void 0:n.disabled_events)?n:{},this.$t=i,this.$t.wrap(this),this.ln=null==e?void 0:e.eventFilterFunc,(0,c.de)());(0,c.kt)()||((e=null!=(i=(__STATSIG__=(0,c.l)()).acInstances)?i:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==n?void 0:n.readyState)?n.addEventListener("DOMContentLoaded",()=>this.qt()):this.qt()}un(){const e=(0,c.te)();var t,i=(0,c.de)();e&&i&&(t=t=>{this.an(t||e.event)},(0,s.cn)(i,"click",t),(0,s.cn)(i,"submit",t),(0,s.cn)(e,"error",t),(0,s.cn)(e,"beforeunload",()=>this.hn()),(0,s.cn)(e,"scroll",()=>this.dn()))}vn(){var t=(0,c.te)(),e=(0,c.de)();t&&e&&((0,s.cn)(t,"popstate",()=>this.fn()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),this.fn())}an(t){var e,i=null==(i=t.type)?void 0:i.toLowerCase();"error"===i&&t instanceof ErrorEvent?this._n(t):(e=(0,s.gn)(t))&&(0,s.St)(t,e)&&(t=l[i])&&({value:i,metadata:e}=(0,s.pn)(e),this.bn(t,i,e))}qt(){this.un(),this.vn(),this.mn(),this.yn()}_n(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.bn(n.AutoCaptureEventName.ERROR,t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}mn(){var t=this.On();try{this.jn(t)&&this.bn(n.AutoCaptureEventName.SESSION_START,(0,s.Sn)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}catch(t){this.$t.logError("AC::logSession",t)}}fn(){var t=(0,s.wn)(),e=this.sn;e&&t.href===e.href||(this.sn=t,e=(0,r.Tn)(t),this.bn(n.AutoCaptureEventName.PAGE_VIEW,(0,s.Sn)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}))}yn(){const i=(0,c.te)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0<e.length&&e[0]instanceof PerformanceNavigationTiming&&(e=e[0],t.load_time_ms=e.duration,t.dom_interactive_time_ms=e.domInteractive-e.startTime,t.redirect_count=e.redirectCount,t.transfer_bytes=e.transferSize),i.performance.getEntriesByName("first-contentful-paint")),e=(e&&0<e.length&&e[0]instanceof PerformancePaintTiming&&(t.first_contentful_paint_time_ms=e[0].startTime),(0,s.kn)());e&&(t.effective_connection_type=e.effectiveType,t.rtt_ms=e.rtt,t.downlink_kbps=e.downlink,t.save_data=e.saveData),this.bn(n.AutoCaptureEventName.PERFORMANCE,(0,s.Sn)(),t)},1)}hn(){this.bn(n.AutoCaptureEventName.PAGE_VIEW_END,(0,s.Sn)(),{scrollDepth:this.nn,pageViewLength:Date.now()-this.en},{flushImmediately:!0})}bn(t,e,i,n){var s,r,l,o=t.slice("auto_capture::".length);if(!this.rn[t]&&!this.rn[o]){o=this.On();try{var u=$P({sessionID:o.data.sessionID,page_url:null!=(l=null==(r=null==(s=(0,c.te)())?void 0:s.location)?void 0:r.href)?l:""},i),a=(null!=n&&n.addNewSessionMetadata&&(u.isNewSession=String(this.jn(o))),{eventName:t,value:e,metadata:u});this.ln&&!this.ln(a)||(this.tn.logEvent(a),null!=n&&n.flushImmediately&&this.tn.flush().catch(t=>{c.Log.error(t)}))}catch(t){this.$t.logError("AC::enqueue",t)}}}dn(){var t=null!=(t=null==(t=(0,c.de)())?void 0:t.body.scrollHeight)?t:1,e=(0,c.te)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.nn=Math.max(this.nn,Math.min(100,Math.round((i+e)/t*100)))}jn(t){return Math.abs(t.data.startTime-Date.now())<1e3}On(){return this.tn.getContext().session}}e.AutoCapture=u},5423:(t,e)=>{$Q(e),e.AutoCaptureEventName=void 0,e.AutoCaptureEventName={PAGE_VIEW:"auto_capture::page_view",PAGE_VIEW_END:"auto_capture::page_view_end",ERROR:"auto_capture::error",SESSION_START:"auto_capture::session_start",PERFORMANCE:"auto_capture::performance",FORM_SUBMIT:"auto_capture::form_submit",CLICK:"auto_capture::click"}},6325:(t,e,i)=>{$Q(e),e.kn=e.cn=e.Sn=e.wn=e.St=e.gn=e.pn=e.In=void 0;const r=i(6914);function l(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.In=l,e.pn=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.Gt)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),o(t));return s&&(i.href=s.getAttribute("href")),"button"!==e&&!s||(i.content=(t.textContent||"").trim(),e=l(s||t),$P(i,e)),{value:n,metadata:i}},e.gn=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.St=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(o(e))return!0}return!1}},e.wn=function(){var t=null!=(t=null==(t=null==(t=(0,r.te)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.Sn=function(){return(0,r.Gt)()||""},e.cn=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.kn=function(){var t=(0,r.te)();return t&&t.navigator&&t.navigator.connection||null}},1964:(t,e,i)=>{$Q(e),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=e.AutoCaptureEventName=void 0;const n=i(4535);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return n.StatsigAutoCapturePlugin}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}});var s=i(5423);$Q2(e,"AutoCaptureEventName",{enumerable:!0,get:function(){return s.AutoCaptureEventName}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture,StatsigAutoCapturePlugin:n.StatsigAutoCapturePlugin}),e.default=__STATSIG__},6901:(t,e,i)=>{$Q(e),e.Tn=void 0;const a=i(6914);e.Tn=function(t){var e=(0,a.de)(),i=(0,a.te)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}o=r,l=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(o),o=o.searchParams.get("yahoo"===l?"p":"q")||"";var l={searchEngine:l,searchQuery:o},o=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const u={};return t.searchParams.forEach((t,e)=>{u[e]=t}),$P($P($P($P({},l),o),u),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",hostname:t.hostname||"unknown",pathname:t.pathname||"unknown",referrer:s,screen_width:(null==(l=null==i?void 0:i.screen)?void 0:l.width)||"unknown",screen_height:(null==(o=null==i?void 0:i.screen)?void 0:o.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const l=s(3447),o=s(1964);var r=s(2016);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new l.SessionReplay(t),new o.AutoCapture(t)})}return t.default})());
|