alphana-sdk 1.6.6 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/alphana-sdk.global.js +4 -4
- package/dist/index.d.mts +41 -12
- package/dist/index.d.ts +41 -12
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +41 -12
- package/dist/react/index.d.ts +41 -12
- package/dist/react/index.js +4 -4
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +4 -4
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var dt=Object.defineProperty;var Dr=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Br=Object.prototype.hasOwnProperty;var _r=(t,e)=>{for(var r in e)dt(t,r,{get:e[r],enumerable:!0})},Vr=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Wr(e))!Br.call(t,n)&&n!==r&&dt(t,n,{get:()=>e[n],enumerable:!(i=Dr(e,n))||i.enumerable});return t};var Ur=t=>Vr(dt({},"__esModule",{value:!0}),t);var Yi={};_r(Yi,{UserTrackerProvider:()=>wr,useAbTests:()=>ct,useAbVariant:()=>Fr,useFeatureFlagEnabled:()=>Lr,useFeatureFlags:()=>Nt,useHeatmapData:()=>Rr,useIsAbVariant:()=>Pr,usePageView:()=>Tr,usePageViews:()=>Er,useTimeSpent:()=>Or,useTrackGoal:()=>Mr,useTrackJourneyStep:()=>Nr,useTrackRevenue:()=>xr,useTracker:()=>kr});module.exports=Ur(Yi);var at=require("react");function ut(t){return t.replace(/\/events\/?$/,"")}var Ot="__ut_vid__";function Te(){return typeof crypto!="undefined"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Lt(){if(typeof localStorage=="undefined")return Te();try{let t=localStorage.getItem(Ot);if(t)return t;let e=Te();return localStorage.setItem(Ot,e),e}catch(t){return Te()}}function A(t){if(!t)return t;let e=t.indexOf("?"),r=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e):"",n=r;for(let a=0;a<5;a++)try{let o=decodeURIComponent(n);if(o===n)break;n=o}catch(o){break}let s=i;for(let a=0;a<5;a++)try{let o=decodeURIComponent(s);if(o===s)break;s=o}catch(o){break}return n+s}var Dt="__ut_last_pv_path__",Wt="__ut_last_pv_entry_ms__";function Ft(t){if(typeof sessionStorage=="undefined")return null;try{return sessionStorage.getItem(t)}catch(e){return null}}function Pt(t,e){if(typeof sessionStorage!="undefined")try{sessionStorage.setItem(t,e)}catch(r){}}function Gr(t,e){Pt(Dt,t),Pt(Wt,String(e))}function Hr(){if(typeof performance=="undefined")return;let e=performance.getEntriesByType("navigation")[0];if(e!=null&&e.type)return e.type;let r=performance.navigation;if((r==null?void 0:r.type)===2)return"back_forward"}var Re=class Re{constructor({emit:e,sessionId:r}){this.previousPath="";this.originalPushState=null;this.originalReplaceState=null;this.pageEntryTime=0;this.handlePopState=()=>{this.handleNavigation()};this.emit=e,this.sessionId=r}init(){let e=A(window.location.pathname+window.location.search);Hr()==="back_forward"&&this.tryEmitMpaHistoryTraversalUturn(e),this.recordPageView(e),window.addEventListener("popstate",this.handlePopState),this.originalPushState=history.pushState.bind(history);let r=this.originalPushState;history.pushState=(n,s,a)=>{r(n,s,a),this.handleNavigation()},this.originalReplaceState=history.replaceState.bind(history);let i=this.originalReplaceState;history.replaceState=(n,s,a)=>{i(n,s,a),this.handleNavigation()}}destroy(){window.removeEventListener("popstate",this.handlePopState),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState)}tryEmitMpaHistoryTraversalUturn(e){let r=Ft(Dt),i=Ft(Wt),n=i?Number(i):0;if(!r||!Number.isFinite(n)||n<=0||A(r)===e)return;let s=Date.now()-n;s<0||s>Re.UTURN_THRESHOLD_MS||this.emitUturn(A(r),e,s)}handleNavigation(){let e=A(window.location.pathname+window.location.search);if(e!==this.previousPath){if(this.previousPath&&this.pageEntryTime>0){let r=Date.now()-this.pageEntryTime;r<=Re.UTURN_THRESHOLD_MS&&this.emitUturn(this.previousPath,e,r)}this.recordPageView(e)}}emitUturn(e,r,i){this.emit({type:"uturn",data:{fromPath:e,toPath:r,timeOnPageMs:i,timestamp:Date.now(),sessionId:this.sessionId}})}recordPageView(e){let r=A(e);this.previousPath=r,this.pageEntryTime=Date.now(),Gr(r,this.pageEntryTime),this.emit({type:"pageview",data:{path:r,title:document.title,timestamp:Date.now(),sessionId:this.sessionId,referrer:document.referrer||void 0}}),window.dispatchEvent(new CustomEvent("tracker:navigate",{detail:{path:r,title:document.title}}))}};Re.UTURN_THRESHOLD_MS=5e3;var Fe=Re;var Pe=class{constructor({emit:e,sessionId:r}){this.currentPath="";this.startTime=0;this.tracking=!1;this.handleNavigate=e=>{this.stopTracking(),this.currentPath=A(e.detail.path),this.startTracking()};this.handleVisibilityChange=()=>{document.hidden?this.stopTracking():this.startTracking()};this.handleUnload=()=>{this.stopTracking()};this.emit=e,this.sessionId=r}init(){this.currentPath=A(window.location.pathname+window.location.search),this.startTracking(),window.addEventListener("tracker:navigate",this.handleNavigate),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleUnload),window.addEventListener("pagehide",this.handleUnload)}destroy(){this.stopTracking(),window.removeEventListener("tracker:navigate",this.handleNavigate),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload)}startTracking(){this.startTime=Date.now(),this.tracking=!0}stopTracking(){if(!this.tracking||!this.currentPath)return;let e=Date.now()-this.startTime;if(e<100){this.tracking=!1;return}this.emit({type:"timespent",data:{path:this.currentPath,duration:e,sessionId:this.sessionId,timestamp:Date.now()}}),this.tracking=!1}};function ht(t,e){let r=0;return(...i)=>{let n=Date.now();n-r>=e&&(r=n,t(...i))}}var le=class le{constructor({emit:e,sessionId:r,sampleRate:i=.3,maxPoints:n=2e3,allowedPaths:s}){this.currentPath="";this.pointCounts={};this.recentClicks=[];this.handleMouseMove=e=>{if(Math.random()>this.sampleRate)return;let r=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight,n=e.clientY+window.scrollY;this.recordPoint({x:e.clientX,y:n,xPct:r>0?e.clientX/r*100:0,yPct:i>0?n/i*100:0,pw:r,ph:i,type:"move"})};this.handleClick=e=>{if(Date.now()-this.lastTouchTime<500)return;let r=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight,n=e.clientY+window.scrollY,s=this.getClickTarget(e);this.recordPoint({x:e.clientX,y:n,xPct:r>0?e.clientX/r*100:0,yPct:i>0?n/i*100:0,pw:r,ph:i,type:"click",...s?{target:s}:{}}),this.checkRageClick(e.clientX,n,this.currentPath)};this.lastTouchTime=0;this.handleTouchEnd=e=>{let r=e.changedTouches[0];if(!r)return;let i=document.documentElement.scrollWidth,n=document.documentElement.scrollHeight,s=r.clientY+window.scrollY;this.lastTouchTime=Date.now(),this.recordPoint({x:r.clientX,y:s,xPct:i>0?r.clientX/i*100:0,yPct:n>0?s/n*100:0,pw:i,ph:n,type:"click"}),this.checkRageClick(r.clientX,s,this.currentPath)};this.handleScroll=()=>{if(Math.random()>this.sampleRate)return;let e=document.documentElement.scrollWidth,r=document.documentElement.scrollHeight,i=window.innerWidth,n=window.scrollX,s=window.scrollY,a=n+i/2;this.recordPoint({x:i/2,y:s,xPct:e>0?a/e*100:50,yPct:r>0?s/r*100:0,pw:e,ph:r,type:"scroll"})};this.handleNavigate=e=>{this.currentPath=A(e.detail.path)};this.emit=e,this.sessionId=r,this.sampleRate=i,this.maxPoints=n,this.allowedPaths=s&&s.length>0?new Set(s.map(a=>A(a))):null,this.throttledMouseMove=ht(this.handleMouseMove,50),this.throttledScroll=ht(this.handleScroll,100)}init(){this.currentPath=A(window.location.pathname+window.location.search),document.addEventListener("mousemove",this.throttledMouseMove),document.addEventListener("click",this.handleClick),document.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),window.addEventListener("scroll",this.throttledScroll,{passive:!0}),window.addEventListener("tracker:navigate",this.handleNavigate)}destroy(){document.removeEventListener("mousemove",this.throttledMouseMove),document.removeEventListener("click",this.handleClick),document.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("scroll",this.throttledScroll),window.removeEventListener("tracker:navigate",this.handleNavigate)}canRecord(){var e;return this.allowedPaths!==null&&!this.allowedPaths.has(this.currentPath)?!1:((e=this.pointCounts[this.currentPath])!=null?e:0)<this.maxPoints}recordPoint(e){var r;this.canRecord()&&(this.pointCounts[this.currentPath]=((r=this.pointCounts[this.currentPath])!=null?r:0)+1,this.emit({type:"heatmap",data:{...e,path:this.currentPath,timestamp:Date.now()}}))}getClickTarget(e){var n,s,a,o;let r=e.target;return r&&(r.getAttribute("aria-label")||((n=r.closest("[aria-label]"))==null?void 0:n.getAttribute("aria-label"))||r.getAttribute("data-track-label")||r.getAttribute("id")||(r instanceof HTMLButtonElement||r instanceof HTMLAnchorElement?(s=r.innerText)==null?void 0:s.trim().slice(0,60):(o=(a=r.closest("button, a"))==null?void 0:a.textContent)==null?void 0:o.trim().slice(0,60)))||void 0}checkRageClick(e,r,i){let n=Date.now();this.recentClicks=this.recentClicks.filter(a=>n-a.t<le.RAGE_WINDOW_MS),this.recentClicks.push({x:e,y:r,t:n});let s=this.recentClicks.filter(a=>Math.hypot(a.x-e,a.y-r)<=le.RAGE_RADIUS_PX);s.length>=le.RAGE_THRESHOLD&&(this.emit({type:"rageclik",data:{path:i,x:e,y:r,count:s.length,timestamp:n,sessionId:this.sessionId}}),this.recentClicks=[])}};le.RAGE_THRESHOLD=3,le.RAGE_WINDOW_MS=1e3,le.RAGE_RADIUS_PX=50;var De=le;var We=class{constructor(e){this.prevOnError=null;this.prevOnUnhandledRejection=null;this.initialized=!1;try{let r=new URL(e.endpoint),i=r.pathname.replace(/\/$/,"").split("/");i.pop(),r.pathname=i.join("/")||"/",this.endpoint=r.toString().replace(/\/$/,"")}catch(r){this.endpoint=e.endpoint}this.sessionId=e.sessionId,this.appId=e.appId,this.authHeaders=e.secretKey?{Authorization:`Bearer ${e.secretKey}`}:{}}init(){typeof window=="undefined"||this.initialized||(this.origInfo=console.info.bind(console),this.origWarn=console.warn.bind(console),this.origError=console.error.bind(console),console.info=(...e)=>{this.origInfo(...e),this.send("info",this.format(e))},console.warn=(...e)=>{this.origWarn(...e),this.send("warn",this.format(e))},console.error=(...e)=>{this.origError(...e);let[r]=e,i=r instanceof Error?r.stack:void 0;this.send("error",this.format(e),{stack:i})},this.prevOnError=window.onerror,window.onerror=(e,r,i,n,s)=>(this.send("error",String(e),{stack:s==null?void 0:s.stack,meta:{src:r,line:i,col:n}}),typeof this.prevOnError=="function"?this.prevOnError(e,r,i,n,s):!1),this.prevOnUnhandledRejection=e=>{let r=e.reason,i=r instanceof Error?r.message:String(r!=null?r:"Unhandled promise rejection");this.send("error",i,{stack:r instanceof Error?r.stack:void 0})},window.addEventListener("unhandledrejection",this.prevOnUnhandledRejection),this.initialized=!0)}destroy(){this.initialized&&(console.info=this.origInfo,console.warn=this.origWarn,console.error=this.origError,window.onerror=this.prevOnError,this.prevOnUnhandledRejection&&window.removeEventListener("unhandledrejection",this.prevOnUnhandledRejection),this.initialized=!1)}capture(e,r,i){this.send(e,r,i)}format(e){return e.map(r=>{if(r instanceof Error)return r.message;if(typeof r=="object")try{return JSON.stringify(r)}catch(i){return String(r)}return String(r)}).join(" ")}send(e,r,i){let n={sessionId:this.sessionId,...this.appId?{appId:this.appId}:{},level:e,message:r,url:typeof window!="undefined"?window.location.href:void 0,stack:i==null?void 0:i.stack,meta:i==null?void 0:i.meta,timestamp:Date.now()},s=`${this.endpoint}/logs/ingest`,a=JSON.stringify(n);fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders},body:a,keepalive:!0}).catch(o=>{this.origError&&this.origError("[user-tracker] Failed to send log:",o)})}};var F;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(F||(F={}));function Zr(t){return t.nodeType===t.ELEMENT_NODE}function ge(t){var e=t==null?void 0:t.host;return(e==null?void 0:e.shadowRoot)===t}function pe(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Kr(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function pt(t){try{var e=t.rules||t.cssRules;return e?Kr(Array.from(e).map(ft).join("")):null}catch(r){return null}}function ft(t){var e=t.cssText;if(zr(t))try{e=pt(t.styleSheet)||e}catch(r){}return e}function zr(t){return"styleSheet"in t}var Vt=(function(){function t(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return t.prototype.getId=function(e){var r;if(!e)return-1;var i=(r=this.getMeta(e))===null||r===void 0?void 0:r.id;return i!=null?i:-1},t.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},t.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},t.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.prototype.removeNodeFromMap=function(e){var r=this,i=this.getId(e);this.idNodeMap.delete(i),e.childNodes&&e.childNodes.forEach(function(n){return r.removeNodeFromMap(n)})},t.prototype.has=function(e){return this.idNodeMap.has(e)},t.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},t.prototype.add=function(e,r){var i=r.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,r)},t.prototype.replace=function(e,r){var i=this.getNode(e);if(i){var n=this.nodeMetaMap.get(i);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(e,r)},t.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t})();function Ut(){return new Vt}function xe(t){var e=t.maskInputOptions,r=t.tagName,i=t.type,n=t.value,s=t.maskInputFn,a=n||"";return(e[r.toLowerCase()]||e[i])&&(s?a=s(a):a="*".repeat(a.length)),a}var Bt="__rrweb_original__";function Yr(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,i=0;i<t.width;i+=r)for(var n=0;n<t.height;n+=r){var s=e.getImageData,a=Bt in s?s[Bt]:s,o=new Uint32Array(a.call(e,i,n,Math.min(r,t.width-i),Math.min(r,t.height-n)).data.buffer);if(o.some(function(c){return c!==0}))return!1}return!0}var Jr=1,jr=new RegExp("[^a-z0-9-_:]"),fe=-2;function gt(){return Jr++}function Qr(t){if(t instanceof HTMLFormElement)return"form";var e=t.tagName.toLowerCase().trim();return jr.test(e)?"div":e}function Xr(t){return t.cssRules?Array.from(t.cssRules).map(function(e){return e.cssText||""}).join(""):""}function qr(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var Ce,_t,$r=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ei=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,ti=/^(data:)([^,]*),(.*)/i;function Be(t,e){return(t||"").replace($r,function(r,i,n,s,a,o){var c=n||a||o,l=i||s||"";if(!c)return r;if(!ei.test(c)||ti.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(qr(e)+c).concat(l,")");var d=e.split("/"),u=c.split("/");d.pop();for(var p=0,f=u;p<f.length;p++){var h=f[p];h!=="."&&(h===".."?d.pop():d.push(h))}return"url(".concat(l).concat(d.join("/")).concat(l,")")})}var ri=/^[^ \t\n\r\u000c]+/,ii=/^[, \t\n\r\u000c]+/;function ni(t,e){if(e.trim()==="")return e;var r=0;function i(l){var d,u=l.exec(e.substring(r));return u?(d=u[0],r+=d.length,d):""}for(var n=[];i(ii),!(r>=e.length);){var s=i(ri);if(s.slice(-1)===",")s=be(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=be(t,s);for(var o=!1;;){var c=e.charAt(r);if(c===""){n.push((s+a).trim());break}else if(o)c===")"&&(o=!1);else if(c===","){r+=1,n.push((s+a).trim());break}else c==="("&&(o=!0);a+=c,r+=1}}}return n.join(", ")}function be(t,e){if(!e||e.trim()==="")return e;var r=t.createElement("a");return r.href=e,r.href}function si(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function mt(){var t=document.createElement("a");return t.href="",t.href}function vt(t,e,r,i){return r==="src"||r==="href"&&i&&!(e==="use"&&i[0]==="#")||r==="xlink:href"&&i&&i[0]!=="#"||r==="background"&&i&&(e==="table"||e==="td"||e==="th")?be(t,i):r==="srcset"&&i?ni(t,i):r==="style"&&i?Be(i,mt()):e==="object"&&r==="data"&&i?be(t,i):i}function oi(t,e,r){if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return r?t.matches(r):!1}function Ee(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?Ee(t.parentNode,e,r):!1;for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return r?Ee(t.parentNode,e,r):!1}function yt(t,e,r){var i=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(i===null)return!1;if(typeof e=="string"){if(i.classList.contains(e)||i.closest(".".concat(e)))return!0}else if(Ee(i,e,!0))return!0;return!!(r&&(i.matches(r)||i.closest(r)))}function ai(t,e,r){var i=t.contentWindow;if(i){var n=!1,s;try{s=i.document.readyState}catch(c){return}if(s!=="complete"){var a=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(a),n=!0,e()});return}var o="about:blank";if(i.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function ci(t,e,r){var i=!1,n;try{n=t.sheet}catch(a){return}if(!n){var s=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(s),i=!0,e()})}}function li(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,c=e.inlineStylesheet,l=e.maskInputOptions,d=l===void 0?{}:l,u=e.maskTextFn,p=e.maskInputFn,f=e.dataURLOptions,h=f===void 0?{}:f,v=e.inlineImages,C=e.recordCanvas,y=e.keepIframeSrcFn,g=e.newlyAddedElement,m=g===void 0?!1:g,k=di(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:F.Document,childNodes:[],compatMode:t.compatMode}:{type:F.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:F.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return hi(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:c,maskInputOptions:d,maskInputFn:p,dataURLOptions:h,inlineImages:v,recordCanvas:C,keepIframeSrcFn:y,newlyAddedElement:m,rootId:k});case t.TEXT_NODE:return ui(t,{maskTextClass:a,maskTextSelector:o,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:F.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:F.Comment,textContent:t.textContent||"",rootId:k};default:return!1}}function di(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function ui(t,e){var r,i=e.maskTextClass,n=e.maskTextSelector,s=e.maskTextFn,a=e.rootId,o=t.parentNode&&t.parentNode.tagName,c=t.textContent,l=o==="STYLE"?!0:void 0,d=o==="SCRIPT"?!0:void 0;if(l&&c){try{t.nextSibling||t.previousSibling||!((r=t.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=Xr(t.parentNode.sheet))}catch(u){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(u),t)}c=Be(c,mt())}return d&&(c="SCRIPT_PLACEHOLDER"),!l&&!d&&c&&yt(t,i,n)&&(c=s?s(c):c.replace(/[\S]/g,"*")),{type:F.Text,textContent:c||"",isStyle:l,rootId:a}}function hi(t,e){for(var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.inlineStylesheet,a=e.maskInputOptions,o=a===void 0?{}:a,c=e.maskInputFn,l=e.dataURLOptions,d=l===void 0?{}:l,u=e.inlineImages,p=e.recordCanvas,f=e.keepIframeSrcFn,h=e.newlyAddedElement,v=h===void 0?!1:h,C=e.rootId,y=oi(t,i,n),g=Qr(t),m={},k=t.attributes.length,B=0;B<k;B++){var P=t.attributes[B];m[P.name]=vt(r,g,P.name,P.value)}if(g==="link"&&s){var D=Array.from(r.styleSheets).find(function(J){return J.href===t.href}),T=null;D&&(T=pt(D)),T&&(delete m.rel,delete m.href,m._cssText=Be(T,D.href))}if(g==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){var T=pt(t.sheet);T&&(m._cssText=Be(T,mt()))}if(g==="input"||g==="textarea"||g==="select"){var K=t.value,z=t.checked;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&K?m.value=xe({type:m.type,tagName:g,value:K,maskInputOptions:o,maskInputFn:c}):z&&(m.checked=z)}if(g==="option"&&(t.selected&&!o.select?m.selected=!0:delete m.selected),g==="canvas"&&p){if(t.__context==="2d")Yr(t)||(m.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var Q=t.toDataURL(d.type,d.quality),X=document.createElement("canvas");X.width=t.width,X.height=t.height;var q=X.toDataURL(d.type,d.quality);Q!==q&&(m.rr_dataURL=Q)}}if(g==="img"&&u){Ce||(Ce=r.createElement("canvas"),_t=Ce.getContext("2d"));var O=t,Y=O.crossOrigin;O.crossOrigin="anonymous";var $=function(){try{Ce.width=O.naturalWidth,Ce.height=O.naturalHeight,_t.drawImage(O,0,0),m.rr_dataURL=Ce.toDataURL(d.type,d.quality)}catch(J){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(J))}Y?m.crossOrigin=Y:O.removeAttribute("crossorigin")};O.complete&&O.naturalWidth!==0?$():O.onload=$}if((g==="audio"||g==="video")&&(m.rr_mediaState=t.paused?"paused":"played",m.rr_mediaCurrentTime=t.currentTime),v||(t.scrollLeft&&(m.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(m.rr_scrollTop=t.scrollTop)),y){var ne=t.getBoundingClientRect(),oe=ne.width,G=ne.height;m={class:m.class,rr_width:"".concat(oe,"px"),rr_height:"".concat(G,"px")}}return g==="iframe"&&!f(m.src)&&(t.contentDocument||(m.rr_src=m.src),delete m.src),{type:F.Element,tagName:g,attributes:m,childNodes:[],isSVG:si(t)||void 0,needBlock:y,rootId:C}}function R(t){return t===void 0?"":t.toLowerCase()}function pi(t,e){if(e.comment&&t.type===F.Comment)return!0;if(t.type===F.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&t.attributes.rel==="preload"&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(R(t.attributes.name).match(/^msapplication-tile(image|color)$/)||R(t.attributes.name)==="application-name"||R(t.attributes.rel)==="icon"||R(t.attributes.rel)==="apple-touch-icon"||R(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&R(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(R(t.attributes.property).match(/^(og|twitter|fb):/)||R(t.attributes.name).match(/^(og|twitter):/)||R(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(R(t.attributes.name)==="robots"||R(t.attributes.name)==="googlebot"||R(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(R(t.attributes.name)==="author"||R(t.attributes.name)==="generator"||R(t.attributes.name)==="framework"||R(t.attributes.name)==="publisher"||R(t.attributes.name)==="progid"||R(t.attributes.property).match(/^article:/)||R(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(R(t.attributes.name)==="google-site-verification"||R(t.attributes.name)==="yandex-verification"||R(t.attributes.name)==="csrf-token"||R(t.attributes.name)==="p:domain_verify"||R(t.attributes.name)==="verify-v1"||R(t.attributes.name)==="verification"||R(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function he(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,c=e.skipChild,l=c===void 0?!1:c,d=e.inlineStylesheet,u=d===void 0?!0:d,p=e.maskInputOptions,f=p===void 0?{}:p,h=e.maskTextFn,v=e.maskInputFn,C=e.slimDOMOptions,y=e.dataURLOptions,g=y===void 0?{}:y,m=e.inlineImages,k=m===void 0?!1:m,B=e.recordCanvas,P=B===void 0?!1:B,D=e.onSerialize,T=e.onIframeLoad,K=e.iframeLoadTimeout,z=K===void 0?5e3:K,Q=e.onStylesheetLoad,X=e.stylesheetLoadTimeout,q=X===void 0?5e3:X,O=e.keepIframeSrcFn,Y=O===void 0?function(){return!1}:O,$=e.newlyAddedElement,ne=$===void 0?!1:$,oe=e.preserveWhiteSpace,G=oe===void 0?!0:oe,J=li(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,dataURLOptions:g,inlineImages:k,recordCanvas:P,keepIframeSrcFn:Y,newlyAddedElement:ne});if(!J)return console.warn(t,"not serialized"),null;var ce;i.hasNode(t)?ce=i.getId(t):pi(J,C)||!G&&J.type===F.Text&&!J.isStyle&&!J.textContent.replace(/^\s+|\s+$/gm,"").length?ce=fe:ce=gt();var N=Object.assign(J,{id:ce});if(i.add(t,N),ce===fe)return null;D&&D(t);var ee=!l;if(N.type===F.Element){ee=ee&&!N.needBlock,delete N.needBlock;var se=t.shadowRoot;se&&pe(se)&&(N.isShadowHost=!0)}if((N.type===F.Document||N.type===F.Element)&&ee){C.headWhitespace&&N.type===F.Element&&N.tagName==="head"&&(G=!1);for(var Ie={doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:Q,stylesheetLoadTimeout:q,keepIframeSrcFn:Y},I=0,_=Array.from(t.childNodes);I<_.length;I++){var H=_[I],E=he(H,Ie);E&&N.childNodes.push(E)}if(Zr(t)&&t.shadowRoot)for(var j=0,w=Array.from(t.shadowRoot.childNodes);j<w.length;j++){var H=w[j],E=he(H,Ie);E&&(pe(t.shadowRoot)&&(E.isShadow=!0),N.childNodes.push(E))}}return t.parentNode&&ge(t.parentNode)&&pe(t.parentNode)&&(N.isShadow=!0),N.type===F.Element&&N.tagName==="iframe"&&ai(t,function(){var Z=t.contentDocument;if(Z&&T){var ke=he(Z,{doc:Z,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:Q,stylesheetLoadTimeout:q,keepIframeSrcFn:Y});ke&&T(t,ke)}},z),N.type===F.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&ci(t,function(){if(Q){var Z=he(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:Q,stylesheetLoadTimeout:q,keepIframeSrcFn:Y});Z&&Q(t,Z)}},q),N}function Gt(t,e){var r=e||{},i=r.mirror,n=i===void 0?new Vt:i,s=r.blockClass,a=s===void 0?"rr-block":s,o=r.blockSelector,c=o===void 0?null:o,l=r.maskTextClass,d=l===void 0?"rr-mask":l,u=r.maskTextSelector,p=u===void 0?null:u,f=r.inlineStylesheet,h=f===void 0?!0:f,v=r.inlineImages,C=v===void 0?!1:v,y=r.recordCanvas,g=y===void 0?!1:y,m=r.maskAllInputs,k=m===void 0?!1:m,B=r.maskTextFn,P=r.maskInputFn,D=r.slimDOM,T=D===void 0?!1:D,K=r.dataURLOptions,z=r.preserveWhiteSpace,Q=r.onSerialize,X=r.onIframeLoad,q=r.iframeLoadTimeout,O=r.onStylesheetLoad,Y=r.stylesheetLoadTimeout,$=r.keepIframeSrcFn,ne=$===void 0?function(){return!1}:$,oe=k===!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}:k===!1?{password:!0}:k,G=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T;return he(t,{doc:t,mirror:n,blockClass:a,blockSelector:c,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:oe,maskTextFn:B,maskInputFn:P,slimDOMOptions:G,dataURLOptions:K,inlineImages:C,recordCanvas:g,preserveWhiteSpace:z,onSerialize:Q,onIframeLoad:X,iframeLoadTimeout:q,onStylesheetLoad:O,stylesheetLoadTimeout:Y,keepIframeSrcFn:ne,newlyAddedElement:!1})}var fi=/([^\\]):hover/,cn=new RegExp(fi.source,"g");function W(t,e,r=document){let i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var Se=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
"use strict";var pt=Object.defineProperty;var Qr=Object.getOwnPropertyDescriptor;var jr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var qr=(t,e)=>{for(var r in e)pt(t,r,{get:e[r],enumerable:!0})},$r=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jr(e))!Xr.call(t,n)&&n!==r&&pt(t,n,{get:()=>e[n],enumerable:!(i=Qr(e,n))||i.enumerable});return t};var ei=t=>$r(pt({},"__esModule",{value:!0}),t);var dn={};qr(dn,{UserTrackerProvider:()=>Dr,useAbTests:()=>ut,useAbVariant:()=>Yr,useFeatureFlagEnabled:()=>zr,useFeatureFlags:()=>Bt,useHeatmapData:()=>Ur,useIsAbVariant:()=>Jr,usePageView:()=>_r,usePageViews:()=>Vr,useTimeSpent:()=>Kr,useTrackGoal:()=>Hr,useTrackJourneyStep:()=>Zr,useTrackRevenue:()=>Gr,useTracker:()=>Wr});module.exports=ei(dn);var dt=require("react");function Fe(t){return t.replace(/\/events\/?$/,"")}function De(t){return`${Fe(t)}/collect`}function ft(t,e){return{...e.appId?{appId:e.appId}:{},visitorId:e.visitorId,events:t.map(r=>({sessionId:e.sessionId,type:r.type,data:r.data}))}}function gt(t){return{...t.appId?{appId:t.appId}:{},visitorId:t.visitorId,heartbeat:{sessionId:t.sessionId,visitorId:t.visitorId,path:t.path,active:t.active,...t.appId?{appId:t.appId}:{}}}}function Wt(t){return{...t.appId?{appId:t.appId}:{},log:t}}var _t="__ut_vid__";function Re(){return typeof crypto!="undefined"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Ut(){if(typeof localStorage=="undefined")return Re();try{let t=localStorage.getItem(_t);if(t)return t;let e=Re();return localStorage.setItem(_t,e),e}catch(t){return Re()}}function k(t){if(!t)return t;let e=t.indexOf("?"),r=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e):"",n=r;for(let a=0;a<5;a++)try{let o=decodeURIComponent(n);if(o===n)break;n=o}catch(o){break}let s=i;for(let a=0;a<5;a++)try{let o=decodeURIComponent(s);if(o===s)break;s=o}catch(o){break}return n+s}var Ht="__ut_last_pv_path__",Zt="__ut_last_pv_entry_ms__";function Vt(t){if(typeof sessionStorage=="undefined")return null;try{return sessionStorage.getItem(t)}catch(e){return null}}function Gt(t,e){if(typeof sessionStorage!="undefined")try{sessionStorage.setItem(t,e)}catch(r){}}function ti(t,e){Gt(Ht,t),Gt(Zt,String(e))}function ri(){if(typeof performance=="undefined")return;let e=performance.getEntriesByType("navigation")[0];if(e!=null&&e.type)return e.type;let r=performance.navigation;if((r==null?void 0:r.type)===2)return"back_forward"}var Ee=class Ee{constructor({emit:e,sessionId:r}){this.previousPath="";this.originalPushState=null;this.originalReplaceState=null;this.pageEntryTime=0;this.handlePopState=()=>{this.handleNavigation()};this.emit=e,this.sessionId=r}init(){let e=k(window.location.pathname+window.location.search);ri()==="back_forward"&&this.tryEmitMpaHistoryTraversalUturn(e),this.recordPageView(e),window.addEventListener("popstate",this.handlePopState),this.originalPushState=history.pushState.bind(history);let r=this.originalPushState;history.pushState=(n,s,a)=>{r(n,s,a),this.handleNavigation()},this.originalReplaceState=history.replaceState.bind(history);let i=this.originalReplaceState;history.replaceState=(n,s,a)=>{i(n,s,a),this.handleNavigation()}}destroy(){window.removeEventListener("popstate",this.handlePopState),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState)}tryEmitMpaHistoryTraversalUturn(e){let r=Vt(Ht),i=Vt(Zt),n=i?Number(i):0;if(!r||!Number.isFinite(n)||n<=0||k(r)===e)return;let s=Date.now()-n;s<0||s>Ee.UTURN_THRESHOLD_MS||this.emitUturn(k(r),e,s)}handleNavigation(){let e=k(window.location.pathname+window.location.search);if(e!==this.previousPath){if(this.previousPath&&this.pageEntryTime>0){let r=Date.now()-this.pageEntryTime;r<=Ee.UTURN_THRESHOLD_MS&&this.emitUturn(this.previousPath,e,r)}this.recordPageView(e)}}emitUturn(e,r,i){this.emit({type:"uturn",data:{fromPath:e,toPath:r,timeOnPageMs:i,timestamp:Date.now(),sessionId:this.sessionId}})}recordPageView(e){let r=k(e);this.previousPath=r,this.pageEntryTime=Date.now(),ti(r,this.pageEntryTime),this.emit({type:"pageview",data:{path:r,title:document.title,timestamp:Date.now(),sessionId:this.sessionId,referrer:document.referrer||void 0}}),window.dispatchEvent(new CustomEvent("tracker:navigate",{detail:{path:r,title:document.title}}))}};Ee.UTURN_THRESHOLD_MS=5e3;var Be=Ee;var We=class{constructor({emit:e,sessionId:r}){this.currentPath="";this.startTime=0;this.tracking=!1;this.handleNavigate=e=>{this.stopTracking(),this.currentPath=k(e.detail.path),this.startTracking()};this.handleVisibilityChange=()=>{document.hidden?this.stopTracking():this.startTracking()};this.handleUnload=()=>{this.stopTracking()};this.emit=e,this.sessionId=r}init(){this.currentPath=k(window.location.pathname+window.location.search),this.startTracking(),window.addEventListener("tracker:navigate",this.handleNavigate),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleUnload),window.addEventListener("pagehide",this.handleUnload)}destroy(){this.stopTracking(),window.removeEventListener("tracker:navigate",this.handleNavigate),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload)}startTracking(){this.startTime=Date.now(),this.tracking=!0}stopTracking(){if(!this.tracking||!this.currentPath)return;let e=Date.now()-this.startTime;if(e<100){this.tracking=!1;return}this.emit({type:"timespent",data:{path:this.currentPath,duration:e,sessionId:this.sessionId,timestamp:Date.now()}}),this.tracking=!1}};function mt(t,e){let r=0;return(...i)=>{let n=Date.now();n-r>=e&&(r=n,t(...i))}}var ii="a,button,input,select,textarea,label,summary,img,[role],[onclick],[data-track-label],[data-test-target],[id],h1,h2,h3,h4,h5,h6",Kt=/^[A-Za-z][\w-]*$/;function ni(t){if(!t||t.nodeType!==1)return"";let e=t.id;if(e&&Kt.test(e))return"#"+e;let r=[],i=t,n=0;for(;i&&i.nodeType===1&&i!==document.body&&n<5;){let s=i.id;if(s&&Kt.test(s)){r.unshift("#"+s);break}let a=i.tagName.toLowerCase(),o=1,c=i.previousElementSibling;for(;c;)c.tagName===i.tagName&&o++,c=c.previousElementSibling;r.unshift(a+":nth-of-type("+o+")"),i=i.parentElement,n++}return r.join(">")}function zt(t,e,r){let i=t instanceof Element?t:null;if(!i)return{};let n=i.closest(ii);if(!n)return{};let s=ni(n);if(!s)return{};let a=n.getBoundingClientRect();if(a.width<=0||a.height<=0)return{selector:s};let o=Math.min(1,Math.max(0,(e-a.left)/a.width)),c=Math.min(1,Math.max(0,(r-a.top)/a.height));return{selector:s,relX:Math.round(o*1e3)/1e3,relY:Math.round(c*1e3)/1e3}}var le=class le{constructor({emit:e,sessionId:r,sampleRate:i=.3,maxPoints:n=2e3,allowedPaths:s}){this.currentPath="";this.pointCounts={};this.maxScrollDepth={};this.recentClicks=[];this.handleMouseMove=e=>{if(Math.random()>this.sampleRate)return;let r=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight,n=e.clientY+window.scrollY;this.recordPoint({x:e.clientX,y:n,xPct:r>0?e.clientX/r*100:0,yPct:i>0?n/i*100:0,pw:r,ph:i,vw:window.innerWidth,type:"move"})};this.handleClick=e=>{if(Date.now()-this.lastTouchTime<500)return;let r=document.documentElement.scrollWidth,i=document.documentElement.scrollHeight,n=e.clientY+window.scrollY,s=this.getClickTarget(e),a=zt(e.target,e.clientX,e.clientY);this.recordPoint({x:e.clientX,y:n,xPct:r>0?e.clientX/r*100:0,yPct:i>0?n/i*100:0,pw:r,ph:i,vw:window.innerWidth,type:"click",...s?{target:s}:{},...a}),this.checkRageClick(e.clientX,n,this.currentPath)};this.lastTouchTime=0;this.handleTouchEnd=e=>{let r=e.changedTouches[0];if(!r)return;let i=document.documentElement.scrollWidth,n=document.documentElement.scrollHeight,s=r.clientY+window.scrollY;this.lastTouchTime=Date.now();let a=zt(e.target,r.clientX,r.clientY);this.recordPoint({x:r.clientX,y:s,xPct:i>0?r.clientX/i*100:0,yPct:n>0?s/n*100:0,pw:i,ph:n,vw:window.innerWidth,type:"click",...a}),this.checkRageClick(r.clientX,s,this.currentPath)};this.handleScroll=()=>{var p;let e=document.documentElement.scrollWidth,r=document.documentElement.scrollHeight,i=window.innerWidth,n=window.innerHeight,s=window.scrollX,a=window.scrollY,o=Math.min(r,a+n),c=r>0?o/r*100:0,l=(p=this.maxScrollDepth[this.currentPath])!=null?p:0,d=c>l+1;if(d&&(this.maxScrollDepth[this.currentPath]=c),!d&&Math.random()>this.sampleRate)return;let u=s+i/2;this.recordPoint({x:i/2,y:o,xPct:e>0?u/e*100:50,yPct:c,pw:e,ph:r,vw:i,type:"scroll"})};this.handleNavigate=e=>{this.currentPath=k(e.detail.path)};this.emit=e,this.sessionId=r,this.sampleRate=i,this.maxPoints=n,this.allowedPaths=s&&s.length>0?new Set(s.map(a=>k(a))):null,this.throttledMouseMove=mt(this.handleMouseMove,50),this.throttledScroll=mt(this.handleScroll,100)}init(){this.currentPath=k(window.location.pathname+window.location.search),document.addEventListener("mousemove",this.throttledMouseMove),document.addEventListener("click",this.handleClick),document.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),window.addEventListener("scroll",this.throttledScroll,{passive:!0}),window.addEventListener("tracker:navigate",this.handleNavigate)}destroy(){document.removeEventListener("mousemove",this.throttledMouseMove),document.removeEventListener("click",this.handleClick),document.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("scroll",this.throttledScroll),window.removeEventListener("tracker:navigate",this.handleNavigate)}canRecord(){var e;return this.allowedPaths!==null&&!this.allowedPaths.has(this.currentPath)?!1:((e=this.pointCounts[this.currentPath])!=null?e:0)<this.maxPoints}recordPoint(e){var r;this.canRecord()&&(this.pointCounts[this.currentPath]=((r=this.pointCounts[this.currentPath])!=null?r:0)+1,this.emit({type:"heatmap",data:{...e,path:this.currentPath,timestamp:Date.now()}}))}getClickTarget(e){var n,s,a,o;let r=e.target;return r&&(r.getAttribute("aria-label")||((n=r.closest("[aria-label]"))==null?void 0:n.getAttribute("aria-label"))||r.getAttribute("data-track-label")||r.getAttribute("id")||(r instanceof HTMLButtonElement||r instanceof HTMLAnchorElement?(s=r.innerText)==null?void 0:s.trim().slice(0,60):(o=(a=r.closest("button, a"))==null?void 0:a.textContent)==null?void 0:o.trim().slice(0,60)))||void 0}checkRageClick(e,r,i){let n=Date.now();this.recentClicks=this.recentClicks.filter(a=>n-a.t<le.RAGE_WINDOW_MS),this.recentClicks.push({x:e,y:r,t:n});let s=this.recentClicks.filter(a=>Math.hypot(a.x-e,a.y-r)<=le.RAGE_RADIUS_PX);s.length>=le.RAGE_THRESHOLD&&(this.emit({type:"rageclik",data:{path:i,x:e,y:r,count:s.length,timestamp:n,sessionId:this.sessionId}}),this.recentClicks=[])}};le.RAGE_THRESHOLD=3,le.RAGE_WINDOW_MS=1e3,le.RAGE_RADIUS_PX=50;var _e=le;var vt="application/x-alphana-gzip";function si(){return typeof CompressionStream!="undefined"}async function Yt(t){if(!si())return null;try{let e=new TextEncoder().encode(t),r=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(r).arrayBuffer())}catch(e){return null}}var jt=1024;async function Jt(t,e,r=!1){var s;let i=(s=e.compressionThresholdBytes)!=null?s:jt;if(!r&&e.compressPayloads!==!1&&t.length>=i){let a=await Yt(t);if(a)return{codec:"gzip",body:a,contentType:vt}}return{codec:"json",body:t,contentType:"application/json"}}async function Qt(t,e,r){var n,s;let i={"Content-Type":e.contentType,...e.codec==="gzip"?{Accept:vt}:{},...(n=r.authHeaders)!=null?n:{}};return fetch(t,{method:"POST",headers:i,body:e.body,keepalive:(s=r.keepalive)!=null?s:!1})}async function he(t,e,r={}){try{let i=await Jt(e,r),n=await Qt(t,i,r);if(i.codec==="gzip"&&(n.status===415||n.status===400)){let s=await Jt(e,r,!0);n=await Qt(t,s,r)}}catch(i){}}function yt(t,e,r={}){var s,a;let i=(s=r.compressionThresholdBytes)!=null?s:jt;if(r.compressPayloads!==!1&&e.length>=i||Object.keys((a=r.authHeaders)!=null?a:{}).length>0){he(t,e,{...r,keepalive:!0});return}if(typeof navigator!="undefined"&&navigator.sendBeacon){let o=new Blob([e],{type:"application/json"});if(navigator.sendBeacon(t,o))return}he(t,e,{...r,keepalive:!0})}var Ue=class{constructor(e){this.prevOnError=null;this.prevOnUnhandledRejection=null;this.initialized=!1;var r,i,n;this.collectUrl=(r=e.collectEndpoint)!=null?r:De(e.endpoint),this.sessionId=e.sessionId,this.appId=e.appId,this.authHeaders=e.secretKey?{Authorization:`Bearer ${e.secretKey}`}:{},this.compressPayloads=(i=e.compressPayloads)!=null?i:!0,this.compressionThresholdBytes=(n=e.compressionThresholdBytes)!=null?n:1024}init(){typeof window=="undefined"||this.initialized||(this.origInfo=console.info.bind(console),this.origWarn=console.warn.bind(console),this.origError=console.error.bind(console),console.info=(...e)=>{this.origInfo(...e),this.send("info",this.format(e))},console.warn=(...e)=>{this.origWarn(...e),this.send("warn",this.format(e))},console.error=(...e)=>{this.origError(...e);let[r]=e,i=r instanceof Error?r.stack:void 0;this.send("error",this.format(e),{stack:i})},this.prevOnError=window.onerror,window.onerror=(e,r,i,n,s)=>(this.send("error",String(e),{stack:s==null?void 0:s.stack,meta:{src:r,line:i,col:n}}),typeof this.prevOnError=="function"?this.prevOnError(e,r,i,n,s):!1),this.prevOnUnhandledRejection=e=>{let r=e.reason,i=r instanceof Error?r.message:String(r!=null?r:"Unhandled promise rejection");this.send("error",i,{stack:r instanceof Error?r.stack:void 0})},window.addEventListener("unhandledrejection",this.prevOnUnhandledRejection),this.initialized=!0)}destroy(){this.initialized&&(console.info=this.origInfo,console.warn=this.origWarn,console.error=this.origError,window.onerror=this.prevOnError,this.prevOnUnhandledRejection&&window.removeEventListener("unhandledrejection",this.prevOnUnhandledRejection),this.initialized=!1)}capture(e,r,i){this.send(e,r,i)}format(e){return e.map(r=>{if(r instanceof Error)return r.message;if(typeof r=="object")try{return JSON.stringify(r)}catch(i){return String(r)}return String(r)}).join(" ")}send(e,r,i){let n={sessionId:this.sessionId,...this.appId?{appId:this.appId}:{},level:e,message:r,url:typeof window!="undefined"?window.location.href:void 0,stack:i==null?void 0:i.stack,meta:i==null?void 0:i.meta,timestamp:Date.now()},s=JSON.stringify(Wt(n));he(this.collectUrl,s,{compressPayloads:this.compressPayloads,compressionThresholdBytes:this.compressionThresholdBytes,authHeaders:this.authHeaders,keepalive:!0}).catch(a=>{this.origError&&this.origError("[user-tracker] Failed to send log:",a)})}};var L;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(L||(L={}));function oi(t){return t.nodeType===t.ELEMENT_NODE}function me(t){var e=t==null?void 0:t.host;return(e==null?void 0:e.shadowRoot)===t}function fe(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function ai(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function It(t){try{var e=t.rules||t.cssRules;return e?ai(Array.from(e).map(Ct).join("")):null}catch(r){return null}}function Ct(t){var e=t.cssText;if(ci(t))try{e=It(t.styleSheet)||e}catch(r){}return e}function ci(t){return"styleSheet"in t}var $t=(function(){function t(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return t.prototype.getId=function(e){var r;if(!e)return-1;var i=(r=this.getMeta(e))===null||r===void 0?void 0:r.id;return i!=null?i:-1},t.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},t.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},t.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.prototype.removeNodeFromMap=function(e){var r=this,i=this.getId(e);this.idNodeMap.delete(i),e.childNodes&&e.childNodes.forEach(function(n){return r.removeNodeFromMap(n)})},t.prototype.has=function(e){return this.idNodeMap.has(e)},t.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},t.prototype.add=function(e,r){var i=r.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,r)},t.prototype.replace=function(e,r){var i=this.getNode(e);if(i){var n=this.nodeMetaMap.get(i);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(e,r)},t.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t})();function er(){return new $t}function Me(t){var e=t.maskInputOptions,r=t.tagName,i=t.type,n=t.value,s=t.maskInputFn,a=n||"";return(e[r.toLowerCase()]||e[i])&&(s?a=s(a):a="*".repeat(a.length)),a}var Xt="__rrweb_original__";function li(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,i=0;i<t.width;i+=r)for(var n=0;n<t.height;n+=r){var s=e.getImageData,a=Xt in s?s[Xt]:s,o=new Uint32Array(a.call(e,i,n,Math.min(r,t.width-i),Math.min(r,t.height-n)).data.buffer);if(o.some(function(c){return c!==0}))return!1}return!0}var di=1,ui=new RegExp("[^a-z0-9-_:]"),ge=-2;function bt(){return di++}function hi(t){if(t instanceof HTMLFormElement)return"form";var e=t.tagName.toLowerCase().trim();return ui.test(e)?"div":e}function pi(t){return t.cssRules?Array.from(t.cssRules).map(function(e){return e.cssText||""}).join(""):""}function fi(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var be,qt,gi=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mi=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,vi=/^(data:)([^,]*),(.*)/i;function Ve(t,e){return(t||"").replace(gi,function(r,i,n,s,a,o){var c=n||a||o,l=i||s||"";if(!c)return r;if(!mi.test(c)||vi.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(fi(e)+c).concat(l,")");var d=e.split("/"),u=c.split("/");d.pop();for(var p=0,f=u;p<f.length;p++){var h=f[p];h!=="."&&(h===".."?d.pop():d.push(h))}return"url(".concat(l).concat(d.join("/")).concat(l,")")})}var yi=/^[^ \t\n\r\u000c]+/,Ii=/^[, \t\n\r\u000c]+/;function Ci(t,e){if(e.trim()==="")return e;var r=0;function i(l){var d,u=l.exec(e.substring(r));return u?(d=u[0],r+=d.length,d):""}for(var n=[];i(Ii),!(r>=e.length);){var s=i(yi);if(s.slice(-1)===",")s=Se(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Se(t,s);for(var o=!1;;){var c=e.charAt(r);if(c===""){n.push((s+a).trim());break}else if(o)c===")"&&(o=!1);else if(c===","){r+=1,n.push((s+a).trim());break}else c==="("&&(o=!0);a+=c,r+=1}}}return n.join(", ")}function Se(t,e){if(!e||e.trim()==="")return e;var r=t.createElement("a");return r.href=e,r.href}function bi(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function St(){var t=document.createElement("a");return t.href="",t.href}function wt(t,e,r,i){return r==="src"||r==="href"&&i&&!(e==="use"&&i[0]==="#")||r==="xlink:href"&&i&&i[0]!=="#"||r==="background"&&i&&(e==="table"||e==="td"||e==="th")?Se(t,i):r==="srcset"&&i?Ci(t,i):r==="style"&&i?Ve(i,St()):e==="object"&&r==="data"&&i?Se(t,i):i}function Si(t,e,r){if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return r?t.matches(r):!1}function xe(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?xe(t.parentNode,e,r):!1;for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return r?xe(t.parentNode,e,r):!1}function At(t,e,r){var i=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(i===null)return!1;if(typeof e=="string"){if(i.classList.contains(e)||i.closest(".".concat(e)))return!0}else if(xe(i,e,!0))return!0;return!!(r&&(i.matches(r)||i.closest(r)))}function wi(t,e,r){var i=t.contentWindow;if(i){var n=!1,s;try{s=i.document.readyState}catch(c){return}if(s!=="complete"){var a=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(a),n=!0,e()});return}var o="about:blank";if(i.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function Ai(t,e,r){var i=!1,n;try{n=t.sheet}catch(a){return}if(!n){var s=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(s),i=!0,e()})}}function ki(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,c=e.inlineStylesheet,l=e.maskInputOptions,d=l===void 0?{}:l,u=e.maskTextFn,p=e.maskInputFn,f=e.dataURLOptions,h=f===void 0?{}:f,v=e.inlineImages,C=e.recordCanvas,y=e.keepIframeSrcFn,g=e.newlyAddedElement,m=g===void 0?!1:g,A=Ti(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:L.Document,childNodes:[],compatMode:t.compatMode}:{type:L.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:L.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:A};case t.ELEMENT_NODE:return Ei(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:c,maskInputOptions:d,maskInputFn:p,dataURLOptions:h,inlineImages:v,recordCanvas:C,keepIframeSrcFn:y,newlyAddedElement:m,rootId:A});case t.TEXT_NODE:return Ri(t,{maskTextClass:a,maskTextSelector:o,maskTextFn:u,rootId:A});case t.CDATA_SECTION_NODE:return{type:L.CDATA,textContent:"",rootId:A};case t.COMMENT_NODE:return{type:L.Comment,textContent:t.textContent||"",rootId:A};default:return!1}}function Ti(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function Ri(t,e){var r,i=e.maskTextClass,n=e.maskTextSelector,s=e.maskTextFn,a=e.rootId,o=t.parentNode&&t.parentNode.tagName,c=t.textContent,l=o==="STYLE"?!0:void 0,d=o==="SCRIPT"?!0:void 0;if(l&&c){try{t.nextSibling||t.previousSibling||!((r=t.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=pi(t.parentNode.sheet))}catch(u){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(u),t)}c=Ve(c,St())}return d&&(c="SCRIPT_PLACEHOLDER"),!l&&!d&&c&&At(t,i,n)&&(c=s?s(c):c.replace(/[\S]/g,"*")),{type:L.Text,textContent:c||"",isStyle:l,rootId:a}}function Ei(t,e){for(var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.inlineStylesheet,a=e.maskInputOptions,o=a===void 0?{}:a,c=e.maskInputFn,l=e.dataURLOptions,d=l===void 0?{}:l,u=e.inlineImages,p=e.recordCanvas,f=e.keepIframeSrcFn,h=e.newlyAddedElement,v=h===void 0?!1:h,C=e.rootId,y=Si(t,i,n),g=hi(t),m={},A=t.attributes.length,W=0;W<A;W++){var F=t.attributes[W];m[F.name]=wt(r,g,F.name,F.value)}if(g==="link"&&s){var D=Array.from(r.styleSheets).find(function(J){return J.href===t.href}),T=null;D&&(T=It(D)),T&&(delete m.rel,delete m.href,m._cssText=Ve(T,D.href))}if(g==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){var T=It(t.sheet);T&&(m._cssText=Ve(T,St()))}if(g==="input"||g==="textarea"||g==="select"){var K=t.value,z=t.checked;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&K?m.value=Me({type:m.type,tagName:g,value:K,maskInputOptions:o,maskInputFn:c}):z&&(m.checked=z)}if(g==="option"&&(t.selected&&!o.select?m.selected=!0:delete m.selected),g==="canvas"&&p){if(t.__context==="2d")li(t)||(m.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var j=t.toDataURL(d.type,d.quality),X=document.createElement("canvas");X.width=t.width,X.height=t.height;var q=X.toDataURL(d.type,d.quality);j!==q&&(m.rr_dataURL=j)}}if(g==="img"&&u){be||(be=r.createElement("canvas"),qt=be.getContext("2d"));var O=t,Y=O.crossOrigin;O.crossOrigin="anonymous";var $=function(){try{be.width=O.naturalWidth,be.height=O.naturalHeight,qt.drawImage(O,0,0),m.rr_dataURL=be.toDataURL(d.type,d.quality)}catch(J){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(J))}Y?m.crossOrigin=Y:O.removeAttribute("crossorigin")};O.complete&&O.naturalWidth!==0?$():O.onload=$}if((g==="audio"||g==="video")&&(m.rr_mediaState=t.paused?"paused":"played",m.rr_mediaCurrentTime=t.currentTime),v||(t.scrollLeft&&(m.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(m.rr_scrollTop=t.scrollTop)),y){var ne=t.getBoundingClientRect(),oe=ne.width,G=ne.height;m={class:m.class,rr_width:"".concat(oe,"px"),rr_height:"".concat(G,"px")}}return g==="iframe"&&!f(m.src)&&(t.contentDocument||(m.rr_src=m.src),delete m.src),{type:L.Element,tagName:g,attributes:m,childNodes:[],isSVG:bi(t)||void 0,needBlock:y,rootId:C}}function R(t){return t===void 0?"":t.toLowerCase()}function xi(t,e){if(e.comment&&t.type===L.Comment)return!0;if(t.type===L.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&t.attributes.rel==="preload"&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(R(t.attributes.name).match(/^msapplication-tile(image|color)$/)||R(t.attributes.name)==="application-name"||R(t.attributes.rel)==="icon"||R(t.attributes.rel)==="apple-touch-icon"||R(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&R(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(R(t.attributes.property).match(/^(og|twitter|fb):/)||R(t.attributes.name).match(/^(og|twitter):/)||R(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(R(t.attributes.name)==="robots"||R(t.attributes.name)==="googlebot"||R(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(R(t.attributes.name)==="author"||R(t.attributes.name)==="generator"||R(t.attributes.name)==="framework"||R(t.attributes.name)==="publisher"||R(t.attributes.name)==="progid"||R(t.attributes.property).match(/^article:/)||R(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(R(t.attributes.name)==="google-site-verification"||R(t.attributes.name)==="yandex-verification"||R(t.attributes.name)==="csrf-token"||R(t.attributes.name)==="p:domain_verify"||R(t.attributes.name)==="verify-v1"||R(t.attributes.name)==="verification"||R(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function pe(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,c=e.skipChild,l=c===void 0?!1:c,d=e.inlineStylesheet,u=d===void 0?!0:d,p=e.maskInputOptions,f=p===void 0?{}:p,h=e.maskTextFn,v=e.maskInputFn,C=e.slimDOMOptions,y=e.dataURLOptions,g=y===void 0?{}:y,m=e.inlineImages,A=m===void 0?!1:m,W=e.recordCanvas,F=W===void 0?!1:W,D=e.onSerialize,T=e.onIframeLoad,K=e.iframeLoadTimeout,z=K===void 0?5e3:K,j=e.onStylesheetLoad,X=e.stylesheetLoadTimeout,q=X===void 0?5e3:X,O=e.keepIframeSrcFn,Y=O===void 0?function(){return!1}:O,$=e.newlyAddedElement,ne=$===void 0?!1:$,oe=e.preserveWhiteSpace,G=oe===void 0?!0:oe,J=ki(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,dataURLOptions:g,inlineImages:A,recordCanvas:F,keepIframeSrcFn:Y,newlyAddedElement:ne});if(!J)return console.warn(t,"not serialized"),null;var ce;i.hasNode(t)?ce=i.getId(t):xi(J,C)||!G&&J.type===L.Text&&!J.isStyle&&!J.textContent.replace(/^\s+|\s+$/gm,"").length?ce=ge:ce=bt();var N=Object.assign(J,{id:ce});if(i.add(t,N),ce===ge)return null;D&&D(t);var ee=!l;if(N.type===L.Element){ee=ee&&!N.needBlock,delete N.needBlock;var se=t.shadowRoot;se&&fe(se)&&(N.isShadowHost=!0)}if((N.type===L.Document||N.type===L.Element)&&ee){C.headWhitespace&&N.type===L.Element&&N.tagName==="head"&&(G=!1);for(var Ce={doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:A,recordCanvas:F,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:j,stylesheetLoadTimeout:q,keepIframeSrcFn:Y},I=0,_=Array.from(t.childNodes);I<_.length;I++){var H=_[I],E=pe(H,Ce);E&&N.childNodes.push(E)}if(oi(t)&&t.shadowRoot)for(var Q=0,w=Array.from(t.shadowRoot.childNodes);Q<w.length;Q++){var H=w[Q],E=pe(H,Ce);E&&(fe(t.shadowRoot)&&(E.isShadow=!0),N.childNodes.push(E))}}return t.parentNode&&me(t.parentNode)&&fe(t.parentNode)&&(N.isShadow=!0),N.type===L.Element&&N.tagName==="iframe"&&wi(t,function(){var Z=t.contentDocument;if(Z&&T){var Te=pe(Z,{doc:Z,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:A,recordCanvas:F,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:j,stylesheetLoadTimeout:q,keepIframeSrcFn:Y});Te&&T(t,Te)}},z),N.type===L.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&Ai(t,function(){if(j){var Z=pe(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:C,dataURLOptions:g,inlineImages:A,recordCanvas:F,preserveWhiteSpace:G,onSerialize:D,onIframeLoad:T,iframeLoadTimeout:z,onStylesheetLoad:j,stylesheetLoadTimeout:q,keepIframeSrcFn:Y});Z&&j(t,Z)}},q),N}function tr(t,e){var r=e||{},i=r.mirror,n=i===void 0?new $t:i,s=r.blockClass,a=s===void 0?"rr-block":s,o=r.blockSelector,c=o===void 0?null:o,l=r.maskTextClass,d=l===void 0?"rr-mask":l,u=r.maskTextSelector,p=u===void 0?null:u,f=r.inlineStylesheet,h=f===void 0?!0:f,v=r.inlineImages,C=v===void 0?!1:v,y=r.recordCanvas,g=y===void 0?!1:y,m=r.maskAllInputs,A=m===void 0?!1:m,W=r.maskTextFn,F=r.maskInputFn,D=r.slimDOM,T=D===void 0?!1:D,K=r.dataURLOptions,z=r.preserveWhiteSpace,j=r.onSerialize,X=r.onIframeLoad,q=r.iframeLoadTimeout,O=r.onStylesheetLoad,Y=r.stylesheetLoadTimeout,$=r.keepIframeSrcFn,ne=$===void 0?function(){return!1}:$,oe=A===!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}:A===!1?{password:!0}:A,G=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T;return pe(t,{doc:t,mirror:n,blockClass:a,blockSelector:c,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:oe,maskTextFn:W,maskInputFn:F,slimDOMOptions:G,dataURLOptions:K,inlineImages:C,recordCanvas:g,preserveWhiteSpace:z,onSerialize:j,onIframeLoad:X,iframeLoadTimeout:q,onStylesheetLoad:O,stylesheetLoadTimeout:Y,keepIframeSrcFn:ne,newlyAddedElement:!1})}var Mi=/([^\\]):hover/,Nn=new RegExp(Mi.source,"g");function B(t,e,r=document){let i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var we=`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.`,Ht={map:{},getId(){return console.error(Se),-1},getNode(){return console.error(Se),null},removeNodeFromMap(){console.error(Se)},has(){return console.error(Se),!1},reset(){console.error(Se)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ht=new Proxy(Ht,{get(t,e,r){return e==="map"&&console.error(Se),Reflect.get(t,e,r)}}));function we(t,e,r={}){let i=null,n=0;return function(...s){let a=Date.now();!n&&r.leading===!1&&(n=a);let o=e-(a-n),c=this;o<=0||o>e?(i&&(clearTimeout(i),i=null),n=a,t.apply(c,s)):!i&&r.trailing!==!1&&(i=setTimeout(()=>{n=r.leading===!1?0:Date.now(),i=null,t.apply(c,s)},o))}}function me(t,e,r,i,n=window){let s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>me(t,e,s||{},!0)}function te(t,e,r){try{if(!(e in t))return()=>{};let i=t[e],n=r(i);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(i){return()=>{}}}function Ve(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ue(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function x(t,e,r,i){if(!t)return!1;let n=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!n)return!1;if(typeof e=="string"){if(n.classList.contains(e)||i&&n.closest("."+e)!==null)return!0}else if(Ee(n,e,i))return!0;return!!(r&&(t.matches(r)||i&&n.closest(r)!==null))}function Zt(t,e){return e.getId(t)!==-1}function Ge(t,e){return e.getId(t)===fe}function It(t,e){if(ge(t))return!1;let r=e.getId(t);return e.has(r)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?It(t.parentNode,e):!0:!0}function Ct(t){return!!t.changedTouches}function Kt(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let r=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function He(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Ze(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Ke(t){return!!(t!=null&&t.shadowRoot)}var _e=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var r;return(r=this.styleIDMap.get(e))!==null&&r!==void 0?r:-1}has(e){return this.styleIDMap.has(e)}add(e,r){if(this.has(e))return this.getId(e);let i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};var S=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(S||{}),b=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t))(b||{}),ze=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(ze||{}),ae=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ae||{});function zt(t){return"__ln"in t}var bt=class{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let i=0;i<e;i++)r=(r==null?void 0:r.next)||null;return r}addNode(e){let r={value:e,previous:null,next:null};if(e.__ln=r,e.previousSibling&&zt(e.previousSibling)){let i=e.previousSibling.__ln.next;r.next=i,r.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=r,i&&(i.previous=r)}else if(e.nextSibling&&zt(e.nextSibling)&&e.nextSibling.__ln.previous){let i=e.nextSibling.__ln.previous;r.previous=i,r.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=r,i&&(i.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(e){let r=e.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}},Yt=(t,e)=>`${t}@${e}`,Ye=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],r=new bt,i=o=>{let c=o,l=fe;for(;l===fe;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},n=o=>{var c,l,d,u;let p=null;((l=(c=o.getRootNode)===null||c===void 0?void 0:c.call(o))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(p=o.getRootNode().host);let f=p;for(;((u=(d=f==null?void 0:f.getRootNode)===null||d===void 0?void 0:d.call(f))===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&f.getRootNode().host;)f=f.getRootNode().host;let h=!this.doc.contains(o)&&(!f||!this.doc.contains(f));if(!o.parentNode||h)return;let v=ge(o.parentNode)?this.mirror.getId(p):this.mirror.getId(o.parentNode),C=i(o);if(v===-1||C===-1)return r.addNode(o);let y=he(o,{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:g=>{He(g,this.mirror)&&this.iframeManager.addIframe(g),Ze(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Ke(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)}});y&&e.push({parentId:v,nextId:C,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let o of Array.from(this.movedSet.values()))Jt(this.removes,o,this.mirror)&&!this.movedSet.has(o.parentNode)||n(o);for(let o of Array.from(this.addedSet.values()))!jt(this.droppedSet,o)&&!Jt(this.removes,o,this.mirror)||jt(this.movedSet,o)?n(o):this.droppedSet.add(o);let s=null;for(;r.length;){let o=null;if(s){let c=this.mirror.getId(s.value.parentNode),l=i(s.value);c!==-1&&l!==-1&&(o=s)}if(!o)for(let c=r.length-1;c>=0;c--){let l=r.get(c);if(l){let d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){o=l;break}else{let p=l.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=p.parentNode.host;if(this.mirror.getId(f)!==-1){o=l;break}}}}}if(!o){for(;r.head;)r.removeNode(r.head.value);break}s=o.previous,r.removeNode(o.value),n(o.value)}let a={texts:this.texts.map(o=>({id:this.mirror.getId(o.node),value:o.value})).filter(o=>this.mirror.has(o.id)),attributes:this.attributes.map(o=>({id:this.mirror.getId(o.node),attributes:o.attributes})).filter(o=>this.mirror.has(o.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!Ge(e.target,this.mirror))switch(e.type){case"characterData":{let r=e.target.textContent;!x(e.target,this.blockClass,this.blockSelector,!1)&&r!==e.oldValue&&this.texts.push({value:yt(e.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break}case"attributes":{let r=e.target,i=e.target.getAttribute(e.attributeName);if(e.attributeName==="value"&&(i=xe({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:i,maskInputFn:this.maskInputFn})),x(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributes.find(s=>s.node===e.target);if(r.tagName==="IFRAME"&&e.attributeName==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)e.attributeName="rr_src";else return;if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),e.attributeName==="style"){let s=this.doc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue),(n.attributes.style===void 0||n.attributes.style===null)&&(n.attributes.style={});let a=n.attributes.style;for(let o of Array.from(r.style)){let c=r.style.getPropertyValue(o),l=r.style.getPropertyPriority(o);(c!==s.style.getPropertyValue(o)||l!==s.style.getPropertyPriority(o))&&(l===""?a[o]=c:a[o]=[c,l])}for(let o of Array.from(s.style))r.style.getPropertyValue(o)===""&&(a[o]=!1)}else n.attributes[e.attributeName]=vt(this.doc,r.tagName,e.attributeName,i);break}case"childList":{if(x(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(r=>this.genAdds(r,e.target)),e.removedNodes.forEach(r=>{let i=this.mirror.getId(r),n=ge(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);x(e.target,this.blockClass,this.blockSelector,!1)||Ge(r,this.mirror)||!Zt(r,this.mirror)||(this.addedSet.has(r)?(St(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(e.target)&&i===-1||It(e.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Yt(i,n)]?St(this.movedSet,r):this.removes.push({parentId:n,id:i,isShadow:ge(e.target)&&pe(e.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(e,r)=>{if(this.mirror.hasNode(e)){if(Ge(e,this.mirror))return;this.movedSet.add(e);let i=null;r&&this.mirror.hasNode(r)&&(i=this.mirror.getId(r)),i&&i!==-1&&(this.movedMap[Yt(this.mirror.getId(e),i)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);x(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(i=>this.genAdds(i))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=e[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 St(t,e){t.delete(e),e.childNodes.forEach(r=>St(t,r))}function Jt(t,e,r){return t.length===0?!1:Qt(t,e,r)}function Qt(t,e,r){let{parentNode:i}=e;if(!i)return!1;let n=r.getId(i);return t.some(s=>s.id===n)?!0:Qt(t,i,r)}function jt(t,e){return t.size===0?!1:Xt(t,e)}function Xt(t,e){let{parentNode:r}=e;return r?t.has(r)?!0:Xt(t,r):!1}var ue=[],er=typeof CSSGroupingRule!="undefined",tr=typeof CSSMediaRule!="undefined",rr=typeof CSSSupportsRule!="undefined",ir=typeof CSSConditionRule!="undefined";function Me(t){try{if("composedPath"in t){let e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch(e){return t.target}}function wt(t,e){var r,i;let n=new Ye;ue.push(n),n.init(t);let s=window.MutationObserver||window.__rrMutationObserver,a=(i=(r=window==null?void 0:window.Zone)===null||r===void 0?void 0:r.__symbol__)===null||i===void 0?void 0:i.call(r,"MutationObserver");a&&window[a]&&(s=window[a]);let o=new s(n.processMutations.bind(n));return o.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function gi({mousemoveCb:t,sampling:e,doc:r,mirror:i}){if(e.mousemove===!1)return()=>{};let n=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],o,c=we(u=>{let p=Date.now()-o;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],o=null},s),l=we(u=>{let p=Me(u),{clientX:f,clientY:h}=Ct(u)?u.changedTouches[0]:u;o||(o=Date.now()),a.push({x:f,y:h,id:i.getId(p),timeOffset:Date.now()-o}),c(typeof DragEvent!="undefined"&&u instanceof DragEvent?b.Drag:u instanceof MouseEvent?b.MouseMove:b.TouchMove)},n,{trailing:!1}),d=[W("mousemove",l,r),W("touchmove",l,r),W("drag",l,r)];return()=>{d.forEach(u=>u())}}function mi({mouseInteractionCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,o=[],c=l=>d=>{let u=Me(d);if(x(u,i,n,!0))return;let p=Ct(d)?d.changedTouches[0]:d;if(!p)return;let f=r.getId(u),{clientX:h,clientY:v}=p;t({type:ze[l],id:f,x:h,y:v})};return Object.keys(ze).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let d=l.toLowerCase(),u=c(l);o.push(W(d,u,e))}),()=>{o.forEach(l=>l())}}function At({scrollCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,sampling:s}){let a=we(o=>{let c=Me(o);if(!c||x(c,i,n,!0))return;let l=r.getId(c);if(c===e){let d=e.scrollingElement||e.documentElement;t({id:l,x:d.scrollLeft,y:d.scrollTop})}else t({id:l,x:c.scrollLeft,y:c.scrollTop})},s.scroll||100);return W("scroll",a,e)}function vi({viewportResizeCb:t}){let e=-1,r=-1,i=we(()=>{let n=Ve(),s=Ue();(e!==n||r!==s)&&(t({width:Number(s),height:Number(n)}),e=n,r=s)},200);return W("resize",i,window)}function qt(t,e){let r=Object.assign({},t);return e||delete r.userTriggered,r}var yi=["INPUT","TEXTAREA","SELECT"],$t=new WeakMap;function Ii({inputCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,ignoreClass:s,maskInputOptions:a,maskInputFn:o,sampling:c,userTriggeredOnInput:l}){function d(y){let g=Me(y),m=y.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||yi.indexOf(g.tagName)<0||x(g,i,n,!0))return;let k=g.type;if(g.classList.contains(s))return;let B=g.value,P=!1;k==="radio"||k==="checkbox"?P=g.checked:(a[g.tagName.toLowerCase()]||a[k])&&(B=xe({maskInputOptions:a,tagName:g.tagName,type:k,value:B,maskInputFn:o})),u(g,qt({text:B,isChecked:P,userTriggered:m},l));let D=g.name;k==="radio"&&D&&P&&e.querySelectorAll(`input[type="radio"][name="${D}"]`).forEach(T=>{T!==g&&u(T,qt({text:T.value,isChecked:!P,userTriggered:!1},l))})}function u(y,g){let m=$t.get(y);if(!m||m.text!==g.text||m.isChecked!==g.isChecked){$t.set(y,g);let k=r.getId(y);t(Object.assign(Object.assign({},g),{id:k}))}}let f=(c.input==="last"?["change"]:["input","change"]).map(y=>W(y,d,e)),h=e.defaultView;if(!h)return()=>{f.forEach(y=>y())};let v=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),C=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&f.push(...C.map(y=>me(y[0],y[1],{set(){d({target:this})}},!1,h))),()=>{f.forEach(y=>y())}}function Je(t){let e=[];function r(i,n){if(er&&i.parentRule instanceof CSSGroupingRule||tr&&i.parentRule instanceof CSSMediaRule||rr&&i.parentRule instanceof CSSSupportsRule||ir&&i.parentRule instanceof CSSConditionRule){let a=Array.from(i.parentRule.cssRules).indexOf(i);n.unshift(a)}else if(i.parentStyleSheet){let a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);n.unshift(a)}return n}return r(t,e)}function de(t,e,r){let i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Ci({styleSheetRuleCb:t,mirror:e,stylesheetManager:r},{win:i}){let n=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(d,u){let{id:p,styleId:f}=de(this,e,r.styleMirror);return(p&&p!==-1||f&&f!==-1)&&t({id:p,styleId:f,adds:[{rule:d,index:u}]}),n.apply(this,[d,u])};let s=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,removes:[{index:d}]}),s.apply(this,[d])};let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,replace:d}),a.apply(this,[d])});let o;i.CSSStyleSheet.prototype.replaceSync&&(o=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,replaceSync:d}),o.apply(this,[d])});let c={};er?c.CSSGroupingRule=i.CSSGroupingRule:(tr&&(c.CSSMediaRule=i.CSSMediaRule),ir&&(c.CSSConditionRule=i.CSSConditionRule),rr&&(c.CSSSupportsRule=i.CSSSupportsRule));let l={};return Object.entries(c).forEach(([d,u])=>{l[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=function(p,f){let{id:h,styleId:v}=de(this.parentStyleSheet,e,r.styleMirror);return(h&&h!==-1||v&&v!==-1)&&t({id:h,styleId:v,adds:[{rule:p,index:[...Je(this),f||0]}]}),l[d].insertRule.apply(this,[p,f])},u.prototype.deleteRule=function(p){let{id:f,styleId:h}=de(this.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&t({id:f,styleId:h,removes:[{index:[...Je(this),p]}]}),l[d].deleteRule.apply(this,[p])}}),()=>{i.CSSStyleSheet.prototype.insertRule=n,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),o&&(i.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(([d,u])=>{u.prototype.insertRule=l[d].insertRule,u.prototype.deleteRule=l[d].deleteRule})}}function kt({mirror:t,stylesheetManager:e},r){var i,n,s;let a=null;r.nodeName==="#document"?a=t.getId(r):a=t.getId(r.host);let o=r.nodeName==="#document"?(i=r.defaultView)===null||i===void 0?void 0:i.Document:(s=(n=r.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||s===void 0?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets");return a===null||a===-1||!o||!c?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var d;let u=(d=c.set)===null||d===void 0?void 0:d.call(this,l);if(a!==null&&a!==-1)try{e.adoptStyleSheets(l,a)}catch(p){}return u}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function bi({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:r,stylesheetManager:i},{win:n}){let s=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(o,c,l){var d;if(r.has(o))return s.apply(this,[o,c,l]);let{id:u,styleId:p}=de((d=this.parentRule)===null||d===void 0?void 0:d.parentStyleSheet,e,i.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,set:{property:o,value:c,priority:l},index:Je(this.parentRule)}),s.apply(this,[o,c,l])};let a=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(o){var c;if(r.has(o))return a.apply(this,[o]);let{id:l,styleId:d}=de((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,e,i.styleMirror);return(l&&l!==-1||d&&d!==-1)&&t({id:l,styleId:d,remove:{property:o},index:Je(this.parentRule)}),a.apply(this,[o])},()=>{n.CSSStyleDeclaration.prototype.setProperty=s,n.CSSStyleDeclaration.prototype.removeProperty=a}}function Si({mediaInteractionCb:t,blockClass:e,blockSelector:r,mirror:i,sampling:n}){let s=o=>we(c=>{let l=Me(c);if(!l||x(l,e,r,!0))return;let{currentTime:d,volume:u,muted:p,playbackRate:f}=l;t({type:o,id:i.getId(l),currentTime:d,volume:u,muted:p,playbackRate:f})},n.media||500),a=[W("play",s(0)),W("pause",s(1)),W("seeked",s(2)),W("volumechange",s(3)),W("ratechange",s(4))];return()=>{a.forEach(o=>o())}}function wi({fontCb:t,doc:e}){let r=e.defaultView;if(!r)return()=>{};let i=[],n=new WeakMap,s=r.FontFace;r.FontFace=function(c,l,d){let u=new s(c,l,d);return n.set(u,{family:c,buffer:typeof l!="string",descriptors:d,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};let a=te(e.fonts,"add",function(o){return function(c){return setTimeout(()=>{let l=n.get(c);l&&(t(l),n.delete(c))},0),o.apply(this,[c])}});return i.push(()=>{r.FontFace=s}),i.push(a),()=>{i.forEach(o=>o())}}function Ai(t){let{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,a=!0,o=()=>{let c=e.getSelection();if(!c||a&&(c!=null&&c.isCollapsed))return;a=c.isCollapsed||!1;let l=[],d=c.rangeCount||0;for(let u=0;u<d;u++){let p=c.getRangeAt(u),{startContainer:f,startOffset:h,endContainer:v,endOffset:C}=p;x(f,i,n,!0)||x(v,i,n,!0)||l.push({start:r.getId(f),startOffset:h,end:r.getId(v),endOffset:C})}s({ranges:l})};return o(),W("selectionchange",o)}function ki(t,e){let{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:a,inputCb:o,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:f}=t;t.mutationCb=(...h)=>{e.mutation&&e.mutation(...h),r(...h)},t.mousemoveCb=(...h)=>{e.mousemove&&e.mousemove(...h),i(...h)},t.mouseInteractionCb=(...h)=>{e.mouseInteraction&&e.mouseInteraction(...h),n(...h)},t.scrollCb=(...h)=>{e.scroll&&e.scroll(...h),s(...h)},t.viewportResizeCb=(...h)=>{e.viewportResize&&e.viewportResize(...h),a(...h)},t.inputCb=(...h)=>{e.input&&e.input(...h),o(...h)},t.mediaInteractionCb=(...h)=>{e.mediaInteaction&&e.mediaInteaction(...h),c(...h)},t.styleSheetRuleCb=(...h)=>{e.styleSheetRule&&e.styleSheetRule(...h),l(...h)},t.styleDeclarationCb=(...h)=>{e.styleDeclaration&&e.styleDeclaration(...h),d(...h)},t.canvasMutationCb=(...h)=>{e.canvasMutation&&e.canvasMutation(...h),u(...h)},t.fontCb=(...h)=>{e.font&&e.font(...h),p(...h)},t.selectionCb=(...h)=>{e.selection&&e.selection(...h),f(...h)}}function nr(t,e={}){let r=t.doc.defaultView;if(!r)return()=>{};ki(t,e);let i=wt(t,t.doc),n=gi(t),s=mi(t),a=At(t),o=vi(t),c=Ii(t),l=Si(t),d=Ci(t,{win:r}),u=kt(t,t.doc),p=bi(t,{win:r}),f=t.collectFonts?wi(t):()=>{},h=Ai(t),v=[];for(let C of t.plugins)v.push(C.observer(C.callback,r,C.options));return()=>{ue.forEach(C=>C.reset()),i.disconnect(),n(),s(),a(),o(),c(),l(),d(),u(),p(),f(),h(),v.forEach(C=>C())}}var Ne=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,r,i,n){let s=i||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),o=s.get(r);return o||(o=this.generateIdFn(),s.set(r,o),a.set(o,r)),o}getIds(e,r){let i=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return r.map(s=>this.getId(e,s,i,n))}getRemoteId(e,r,i){let n=i||this.getRemoteIdToIdMap(e);if(typeof r!="number")return r;let s=n.get(r);return s||-1}getRemoteIds(e,r){let i=this.getRemoteIdToIdMap(e);return r.map(n=>this.getRemoteId(e,n,i))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let r=this.iframeIdToRemoteIdMap.get(e);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(e,r)),r}getRemoteIdToIdMap(e){let r=this.iframeRemoteIdToIdMap.get(e);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(e,r)),r}};var je=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ne(gt),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ne(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,r){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(i=this.loadListener)===null||i===void 0||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if(e.data.type==="rrweb"){if(!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,r){var i;switch(r.type){case S.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(r.data.node,e),{timestamp:r.timestamp,type:S.IncrementalSnapshot,data:{source:b.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case S.Meta:case S.Load:case S.DomContentLoaded:return!1;case S.Plugin:return r;case S.Custom:return this.replaceIds(r.data.payload,e,["id","parentId","previousId","nextId"]),r;case S.IncrementalSnapshot:switch(r.data.source){case b.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e)}),r.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),r;case b.Drag:case b.TouchMove:case b.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),r;case b.ViewportResize:return!1;case b.MediaInteraction:case b.MouseInteraction:case b.Scroll:case b.CanvasMutation:case b.Input:return this.replaceIds(r.data,e,["id"]),r;case b.StyleSheetRule:case b.StyleDeclaration:return this.replaceIds(r.data,e,["id"]),this.replaceStyleIds(r.data,e,["styleId"]),r;case b.Font:return r;case b.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),r;case b.AdoptedStyleSheet:return this.replaceIds(r.data,e,["id"]),this.replaceStyleIds(r.data,e,["styleIds"]),(i=r.data.styles)===null||i===void 0||i.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),r}}}replace(e,r,i,n){for(let s of n)!Array.isArray(r[s])&&typeof r[s]!="number"||(Array.isArray(r[s])?r[s]=e.getIds(i,r[s]):r[s]=e.getId(i,r[s]));return r}replaceIds(e,r,i){return this.replace(this.crossOriginIframeMirror,e,r,i)}replaceStyleIds(e,r,i){return this.replace(this.crossOriginIframeStyleMirror,e,r,i)}replaceIdOnNode(e,r){this.replaceIds(e,r,["id"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,r)})}};var Qe=class{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;let r=this;this.restorePatches.push(te(Element.prototype,"attachShadow",function(i){return function(n){let s=i.call(this,n);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(e,r){pe(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),wt(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),At(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),kt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){let r=this;this.restorePatches.push(te(e.contentWindow.HTMLElement.prototype,"attachShadow",function(i){return function(n){let s=i.call(this,n);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}};function sr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function or(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(d){try{l(i.next(d))}catch(u){a(u)}}function c(d){try{l(i.throw(d))}catch(u){a(u)}}function l(d){d.done?s(d.value):n(d.value).then(o,c)}l((i=i.apply(t,e||[])).next())})}var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ti=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Oe=0;Oe<Ae.length;Oe++)Ti[Ae.charCodeAt(Oe)]=Oe;var Oe,ar=function(t){var e=new Uint8Array(t),r,i=e.length,n="";for(r=0;r<i;r+=3)n+=Ae[e[r]>>2],n+=Ae[(e[r]&3)<<4|e[r+1]>>4],n+=Ae[(e[r+1]&15)<<2|e[r+2]>>6],n+=Ae[e[r+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n};var cr=new Map;function Ri(t,e){let r=cr.get(t);return r||(r=new Map,cr.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}var Tt=(t,e,r)=>{if(!t||!(lr(t,e)||typeof t=="object"))return;let i=t.constructor.name,n=Ri(r,i),s=n.indexOf(t);return s===-1&&(s=n.length,n.push(t)),s};function Xe(t,e,r){if(t instanceof Array)return t.map(i=>Xe(i,e,r));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){let i=t.constructor.name,n=ar(t);return{rr_type:i,base64:n}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Xe(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){let i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}else if(t instanceof HTMLCanvasElement){let i="HTMLImageElement",n=t.toDataURL();return{rr_type:i,src:n}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[Xe(t.data,e,r),t.width,t.height]};if(lr(t,e)||typeof t=="object"){let i=t.constructor.name,n=Tt(t,e,r);return{rr_type:i,index:n}}}}return t}var qe=(t,e,r)=>[...t].map(i=>Xe(i,e,r)),lr=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof e[n]=="function").find(n=>t instanceof e[n]);function dr(t,e,r,i){let n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let a of s)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;let o=te(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return x(this.canvas,r,i,!0)||setTimeout(()=>{let d=qe([...l],e,this);t(this.canvas,{type:ae["2D"],property:a,args:d})},0),c.apply(this,l)}});n.push(o)}catch(o){let c=me(e.CanvasRenderingContext2D.prototype,a,{set(l){t(this.canvas,{type:ae["2D"],property:a,args:[l],setter:!0})}});n.push(c)}return()=>{n.forEach(a=>a())}}function Rt(t,e,r){let i=[];try{let n=te(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...o){return x(this,e,r,!0)||"__context"in this||(this.__context=a),s.apply(this,[a,...o])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ur(t,e,r,i,n,s,a){let o=[],c=Object.getOwnPropertyNames(t);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof t[l]!="function")continue;let d=te(t,l,function(u){return function(...p){let f=u.apply(this,p);if(Tt(f,a,this),!x(this.canvas,i,n,!0)){let h=qe([...p],a,this),v={type:e,property:l,args:h};r(this.canvas,v)}return f}});o.push(d)}catch(d){let u=me(t,l,{set(p){r(this.canvas,{type:e,property:l,args:[p],setter:!0})}});o.push(u)}return o}function hr(t,e,r,i,n){let s=[];return s.push(...ur(e.WebGLRenderingContext.prototype,ae.WebGL,t,r,i,n,e)),typeof e.WebGL2RenderingContext!="undefined"&&s.push(...ur(e.WebGL2RenderingContext.prototype,ae.WebGL2,t,r,i,n,e)),()=>{s.forEach(a=>a())}}var Et=null;try{pr=typeof module!="undefined"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads"),Et=pr.Worker}catch(t){}var pr;function Ei(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}function fr(t,e,r){var i=e===void 0?null:e,n=r===void 0?!1:r,s=Ei(t,n),a=s.indexOf(`
|
|
4
|
-
`,10)+1,o=s.substring(a)+(i?"//# sourceMappingURL="+i:"");return function(l){return new
|
|
5
|
-
`,10)+1,o=s.substring(a)+(i?"//# sourceMappingURL="+i:""),c=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(c)}function gr(t,e,r){var i;return function(s){return i=i||Mi(t,e,r),new Worker(i,s)}}var Ni=Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]";function mr(){return Ni}function vr(t,e,r){return mr()?fr(t,e,r):gr(t,e,r)}var yr=vr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var $e=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:r="all",win:i,blockClass:n,blockSelector:s,recordCanvas:a,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&r==="all"&&this.initCanvasMutationObserver(i,n,s),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o})}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(e,r,i,n,s){let a=Rt(r,i,n),o=new Map,c=new yr;c.onmessage=h=>{let{id:v}=h.data;if(o.set(v,!1),!("base64"in h.data))return;let{base64:C,type:y,width:g,height:m}=h.data;this.mutationCb({id:v,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,g,m]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:y}]},0,0]}]})};let l=1e3/e,d=0,u,p=()=>{let h=[];return r.document.querySelectorAll("canvas").forEach(v=>{x(v,i,n,!0)||h.push(v)}),h},f=h=>{if(d&&h-d<l){u=requestAnimationFrame(f);return}d=h,p().forEach(v=>or(this,void 0,void 0,function*(){var C;let y=this.mirror.getId(v);if(o.get(y))return;if(o.set(y,!0),["webgl","webgl2"].includes(v.__context)){let m=v.getContext(v.__context);((C=m==null?void 0:m.getContextAttributes())===null||C===void 0?void 0:C.preserveDrawingBuffer)===!1&&(m==null||m.clear(m.COLOR_BUFFER_BIT))}let g=yield createImageBitmap(v);c.postMessage({id:y,bitmap:g,width:v.width,height:v.height,dataURLOptions:s.dataURLOptions},[g])})),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=Rt(e,r,i),s=dr(this.processMutation.bind(this),e,r,i),a=hr(this.processMutation.bind(this),e,r,i,this.mirror);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=r=>{this.rafStamps.latestId=r,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,r)=>{let i=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,r){if(this.frozen||this.locked)return;let i=this.pendingCanvasMutations.get(e);if(!i||r===-1)return;let n=i.map(a=>sr(a,["type"])),{type:s}=i[0];this.mutationCb({id:r,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}};var et=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new _e,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,r){if(e.length===0)return;let i={id:r,styleIds:[]},n=[];for(let s of e){let a;if(this.styleMirror.has(s))a=this.styleMirror.getId(s);else{a=this.styleMirror.add(s);let o=Array.from(s.rules||CSSRule);n.push({styleId:a,rules:o.map((c,l)=>({rule:ft(c),index:l}))})}i.styleIds.push(a)}n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}};function L(t){return Object.assign(Object.assign({},t),{timestamp:Date.now()})}var M,tt,xt,rt=!1,re=Ut();function ve(t={}){let{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",maskTextClass:o="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:p,maskInputFn:f,maskTextFn:h,hooks:v,packFn:C,sampling:y={},dataURLOptions:g={},mousemoveWait:m,recordCanvas:k=!1,recordCrossOriginIframes:B=!1,userTriggeredOnInput:P=!1,collectFonts:D=!1,inlineImages:T=!1,plugins:K,keepIframeSrcFn:z=()=>!1,ignoreCSSAttributes:Q=new Set([])}=t,X=B?window.parent===window:!0,q=!1;if(!X)try{window.parent.document,q=!1}catch(I){q=!0}if(X&&!e)throw new Error("emit function is required");m!==void 0&&y.mousemove===void 0&&(y.mousemove=m),re.reset();let O=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}:u!==void 0?u:{password:!0},Y=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all"}:p||{};Kt();let $,ne=0,oe=I=>{for(let _ of K||[])_.eventProcessor&&(I=_.eventProcessor(I));return C&&(I=C(I)),I};M=(I,_)=>{var H;if(!((H=ue[0])===null||H===void 0)&&H.isFrozen()&&I.type!==S.FullSnapshot&&!(I.type===S.IncrementalSnapshot&&I.data.source===b.Mutation)&&ue.forEach(E=>E.unfreeze()),X)e==null||e(oe(I),_);else if(q){let E={type:"rrweb",event:oe(I),isCheckout:_};window.parent.postMessage(E,"*")}if(I.type===S.FullSnapshot)$=I,ne=0;else if(I.type===S.IncrementalSnapshot){if(I.data.source===b.Mutation&&I.data.isAttachIframe)return;ne++;let E=i&&ne>=i,j=r&&I.timestamp-$.timestamp>r;(E||j)&&tt(!0)}};let G=I=>{M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.Mutation},I)}))},J=I=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.Scroll},I)})),ce=I=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.CanvasMutation},I)})),N=I=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.AdoptedStyleSheet},I)})),ee=new et({mutationCb:G,adoptedStyleSheetCb:N}),se=new je({mirror:re,mutationCb:G,stylesheetManager:ee,recordCrossOriginIframes:B,wrappedEmit:M});for(let I of K||[])I.getMirror&&I.getMirror({nodeMirror:re,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror});xt=new $e({recordCanvas:k,mutationCb:ce,win:window,blockClass:n,blockSelector:s,mirror:re,sampling:y.canvas,dataURLOptions:g});let Ie=new Qe({mutationCb:G,scrollCb:J,bypassOptions:{blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:O,dataURLOptions:g,maskTextFn:h,maskInputFn:f,recordCanvas:k,inlineImages:T,sampling:y,slimDOMOptions:Y,iframeManager:se,stylesheetManager:ee,canvasManager:xt,keepIframeSrcFn:z},mirror:re});tt=(I=!1)=>{var _,H,E,j,w,Z;M(L({type:S.Meta,data:{href:window.location.href,width:Ue(),height:Ve()}}),I),ee.reset(),ue.forEach(V=>V.lock());let ke=Gt(document,{mirror:re,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:O,maskTextFn:h,slimDOM:Y,dataURLOptions:g,recordCanvas:k,inlineImages:T,onSerialize:V=>{He(V,re)&&se.addIframe(V),Ze(V,re)&&ee.trackLinkElement(V),Ke(V)&&Ie.addShadowRoot(V.shadowRoot,document)},onIframeLoad:(V,lt)=>{se.attachIframe(V,lt),Ie.observeAttachShadow(V)},onStylesheetLoad:(V,lt)=>{ee.attachLinkElement(V,lt)},keepIframeSrcFn:z});if(!ke)return console.warn("Failed to snapshot the document");M(L({type:S.FullSnapshot,data:{node:ke,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:(document==null?void 0:document.documentElement.scrollLeft)||((H=(_=document==null?void 0:document.body)===null||_===void 0?void 0:_.parentElement)===null||H===void 0?void 0:H.scrollLeft)||((E=document==null?void 0:document.body)===null||E===void 0?void 0:E.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:(document==null?void 0:document.documentElement.scrollTop)||((w=(j=document==null?void 0:document.body)===null||j===void 0?void 0:j.parentElement)===null||w===void 0?void 0:w.scrollTop)||((Z=document==null?void 0:document.body)===null||Z===void 0?void 0:Z.scrollTop)||0}}})),ue.forEach(V=>V.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let I=[];I.push(W("DOMContentLoaded",()=>{M(L({type:S.DomContentLoaded,data:{}}))}));let _=E=>{var j;return nr({mutationCb:G,mousemoveCb:(w,Z)=>M(L({type:S.IncrementalSnapshot,data:{source:Z,positions:w}})),mouseInteractionCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.MouseInteraction},w)})),scrollCb:J,viewportResizeCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.ViewportResize},w)})),inputCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.Input},w)})),mediaInteractionCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.MediaInteraction},w)})),styleSheetRuleCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.StyleSheetRule},w)})),styleDeclarationCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.StyleDeclaration},w)})),canvasMutationCb:ce,fontCb:w=>M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.Font},w)})),selectionCb:w=>{M(L({type:S.IncrementalSnapshot,data:Object.assign({source:b.Selection},w)}))},blockClass:n,ignoreClass:a,maskTextClass:o,maskTextSelector:c,maskInputOptions:O,inlineStylesheet:l,sampling:y,recordCanvas:k,inlineImages:T,userTriggeredOnInput:P,collectFonts:D,doc:E,maskInputFn:f,maskTextFn:h,keepIframeSrcFn:z,blockSelector:s,slimDOMOptions:Y,dataURLOptions:g,mirror:re,iframeManager:se,stylesheetManager:ee,shadowDomManager:Ie,canvasManager:xt,ignoreCSSAttributes:Q,plugins:((j=K==null?void 0:K.filter(w=>w.observer))===null||j===void 0?void 0:j.map(w=>({observer:w.observer,options:w.options,callback:Z=>M(L({type:S.Plugin,data:{plugin:w.name,payload:Z}}))})))||[]},v)};se.addLoadListener(E=>{I.push(_(E.contentDocument))});let H=()=>{tt(),I.push(_(document)),rt=!0};return document.readyState==="interactive"||document.readyState==="complete"?H():I.push(W("load",()=>{M(L({type:S.Load,data:{}})),H()},window)),()=>{I.forEach(E=>E()),rt=!1}}catch(I){console.warn(I)}}ve.addCustomEvent=(t,e)=>{if(!rt)throw new Error("please add custom event after start recording");M(L({type:S.Custom,data:{tag:t,payload:e}}))};ve.freezePage=()=>{ue.forEach(t=>t.freeze())};ve.takeFullSnapshot=t=>{if(!rt)throw new Error("please take full snapshot after start recording");tt(t)};ve.mirror=re;var it=class{constructor(e){this.opts=e;this.seq=0;this.buffer=[];this.stopRecording=null;this.flushTimer=null}start(){var r,i,n;if(typeof document=="undefined"||this.stopRecording)return;let e={emit:s=>{this.buffer.push(s),this.buffer.length>=this.opts.maxEventsPerBatch&&this.flush()},checkoutEveryNms:(r=this.opts.checkoutEveryNms)!=null?r:6e5,inlineStylesheet:(i=this.opts.inlineStylesheet)!=null?i:!1,maskAllInputs:this.opts.maskAllInputs,maskTextClass:this.opts.maskTextClass,blockClass:this.opts.blockClass};this.stopRecording=(n=ve(e))!=null?n:null,this.flushTimer=setInterval(()=>{this.buffer.length>0&&this.flush()},this.opts.flushIntervalMs)}flush(){if(this.buffer.length===0)return;let e=this.buffer.splice(0,this.buffer.length);this.opts.emit({type:"session_replay",data:{seq:this.seq++,events:e}})}destroy(){var e;this.flushTimer!==null&&(clearInterval(this.flushTimer),this.flushTimer=null),this.flush(),(e=this.stopRecording)==null||e.call(this),this.stopRecording=null}};var Ir="1.0.2";function Cr(t){var r,i;let e=t.toLowerCase();return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|android|iphone|ipod|windows phone/i.test(e)?"mobile":typeof navigator!="undefined"&&navigator.maxTouchPoints>0&&typeof window!="undefined"&&((i=(r=window.matchMedia)==null?void 0:r.call(window,"(pointer: coarse)"))==null?void 0:i.matches)&&/macintosh|mac os x/i.test(e)?"tablet":"desktop"}function Oi(t){return/windows/i.test(t)?"Windows":/android/i.test(t)?"Android":/iphone|ipad|ipod/i.test(t)?"iOS":/mac os x|macintosh/i.test(t)?"macOS":/linux/i.test(t)?"Linux":"Other"}function Li(t){return/edg\//i.test(t)?"Edge":/opr\/|opera/i.test(t)?"Opera":/chrome\/[0-9]/i.test(t)&&!/chromium/i.test(t)?"Chrome":/firefox\/[0-9]/i.test(t)?"Firefox":/safari\/[0-9]/i.test(t)&&!/chrome/i.test(t)?"Safari":"Other"}function Fi(){let e=navigator.userAgentData;return e?{mobile:e.mobile,platform:e.platform}:{}}function Pi(t,e){var i;let r=((i=e.platform)!=null?i:"").toLowerCase();return r==="ios"||r==="ipados"||r==="android"?e.mobile?"mobile":"tablet":e.mobile===!0?"mobile":Cr(t)}function br(t){var o,c,l,d,u,p,f,h,v,C,y,g;if(typeof window=="undefined"||typeof navigator=="undefined")return{sessionId:t,timestamp:Date.now(),device:"desktop",os:"Other",browser:"Other",language:"",languages:[],colorScheme:"",screenWidth:0,screenHeight:0,viewportWidth:0,viewportHeight:0,devicePixelRatio:1,timeZone:"",sdkVersion:Ir};let e=navigator.userAgent||"",r=Fi(),i=r.mobile!==void 0||r.platform?Pi(e,r):Cr(e),n="";(c=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: dark)"))!=null&&c.matches?n="dark":(d=(l=window.matchMedia)==null?void 0:l.call(window,"(prefers-color-scheme: light)"))!=null&&d.matches&&(n="light");let s="";try{s=(u=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?u:""}catch(m){s=""}let a=typeof navigator.languages!="undefined"&&navigator.languages.length?[...navigator.languages]:navigator.language?[navigator.language]:[];return{sessionId:t,timestamp:Date.now(),device:i,os:Oi(e),browser:Li(e),language:navigator.language||"",languages:a,colorScheme:n,screenWidth:(f=(p=window.screen)==null?void 0:p.width)!=null?f:0,screenHeight:(v=(h=window.screen)==null?void 0:h.height)!=null?v:0,viewportWidth:(C=window.innerWidth)!=null?C:0,viewportHeight:(y=window.innerHeight)!=null?y:0,devicePixelRatio:(g=window.devicePixelRatio)!=null?g:1,timeZone:s,sdkVersion:Ir}}var Di="https://api.alphana.ir/api/events",Wi={endpoint:Di,trackNavigation:!0,trackTime:!0,trackHeatmap:!0,trackLogs:!0,mouseSampleRate:.1,maxHeatmapPoints:2e3,batchSize:20,flushInterval:5e3,sessionReplay:!0,sessionReplayCheckoutEveryNms:6e5,sessionReplayInlineStylesheet:!1,sessionReplayMaxEventsPerBatch:48,sessionReplayFlushIntervalMs:4e3,sessionReplayMaskAllInputs:!0,sessionReplayMaskTextClass:"alphana-mask",sessionReplayBlockClass:"alphana-block"},Le="__alphana_first_touch__",nt="__alphana_last_touch__",Bi={utm_source:"source",utm_medium:"medium",utm_campaign:"campaign",utm_term:"term",utm_content:"content"},_i=["gclid","fbclid","ttclid","msclkid"];function Vi(t){if(typeof localStorage=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function Ui(t,e){if(typeof localStorage!="undefined")try{localStorage.setItem(t,e)}catch(r){}}function ye(t){let e=Vi(t);if(e)try{let r=JSON.parse(e);return typeof r.landingPage=="string"&&typeof r.capturedAt=="number"?r:void 0}catch(r){return}}function Sr(t,e){Ui(t,JSON.stringify(e))}function Gi(t){if(t)try{return new URL(t).hostname.replace(/^www\./,"").toLowerCase()}catch(e){return}}function Hi(){return typeof window=="undefined"?new URLSearchParams:new URLSearchParams(window.location.search)}function Zi(t){var r;let e={};for(let[i,n]of Object.entries(Bi)){let s=(r=t.get(i))==null?void 0:r.trim();s&&(e[n]=s)}return Object.keys(e).length>0?e:void 0}function Ki(t){var r;let e={};for(let i of _i){let n=(r=t.get(i))==null?void 0:r.trim();n&&(e[i]=n)}return Object.keys(e).length>0?e:void 0}function zi(t){switch(t.type){case"pageview":return{type:"pageview",data:{...t.data,path:A(t.data.path)}};case"timespent":return{type:"timespent",data:{...t.data,path:A(t.data.path)}};case"heatmap":return{type:"heatmap",data:{...t.data,path:A(t.data.path)}};case"rageclik":return{type:"rageclik",data:{...t.data,path:A(t.data.path)}};case"uturn":return{type:"uturn",data:{...t.data,fromPath:A(t.data.fromPath),toPath:A(t.data.toPath)}};case"identify":return t;case"revenue":return t;case"goal":return{type:"goal",data:{...t.data,path:A(t.data.path)}};case"journey_step":return{type:"journey_step",data:{...t.data,path:A(t.data.path)}};case"client_context":return t;case"session_replay":return t;default:return t}}var st=class{constructor(e={}){this.initialized=!1;this.subscribers=new Set;this.queue=[];this.flushTimer=null;this.heartbeatTimer=null;this.userProperties={};this.flags={};this.flagSubscribers=new Set;this.abVariants={};this.abTestSubscribers=new Set;this.handleVisibilityChange=()=>{var e;document.visibilityState==="hidden"&&((e=this.sessionReplay)==null||e.flush(),this.queue.length>0&&this.flushBeacon(),this.sendDeactivate())};this.handlePageHide=()=>{var e;(e=this.sessionReplay)==null||e.flush(),this.queue.length>0&&this.flushBeacon(),this.sendDeactivate()};this.handleNavigate=e=>{};var r;this.cfg={...Wi,...e};try{new URL(this.cfg.endpoint)}catch(i){throw new Error(`[alpha-tracker] Invalid endpoint URL: "${this.cfg.endpoint}"`)}this.session={id:(r=e.sessionId)!=null?r:Te(),visitorId:Lt(),startedAt:Date.now(),pageViews:[],timeSpent:{},heatmap:{},userProperties:{},attribution:{firstTouch:ye(Le),lastTouch:ye(nt)}}}updateAttributionForPageView(e,r){let i=Hi(),n=Zi(i),s=Ki(i),a=ye(Le),c=!!(n||s||r)?{landingPage:e,referrer:r,referrerHost:Gi(r),utm:n,clickIds:s,capturedAt:Date.now()}:void 0;!a&&c&&Sr(Le,c),c&&Sr(nt,c);let l={firstTouch:ye(Le),lastTouch:ye(nt)};return this.session.attribution=l,l}currentAttribution(){let e={firstTouch:ye(Le),lastTouch:ye(nt)};return this.session.attribution=e,e}init(){if(typeof window=="undefined"||this.initialized)return this;let e=this.emit.bind(this),{id:r}=this.session;return e({type:"client_context",data:br(r)}),this.cfg.trackNavigation&&(this.navigation=new Fe({emit:e,sessionId:r}),this.navigation.init()),this.cfg.trackTime&&(this.time=new Pe({emit:e,sessionId:r}),this.time.init()),this.cfg.trackHeatmap&&(this.heatmap=new De({emit:e,sessionId:r,sampleRate:this.cfg.mouseSampleRate,maxPoints:this.cfg.maxHeatmapPoints,allowedPaths:this.cfg.heatmapPages}),this.heatmap.init()),this.cfg.sessionReplay&&(this.sessionReplay=new it({emit:e,checkoutEveryNms:this.cfg.sessionReplayCheckoutEveryNms,inlineStylesheet:this.cfg.sessionReplayInlineStylesheet,maxEventsPerBatch:this.cfg.sessionReplayMaxEventsPerBatch,flushIntervalMs:this.cfg.sessionReplayFlushIntervalMs,maskAllInputs:this.cfg.sessionReplayMaskAllInputs,maskTextClass:this.cfg.sessionReplayMaskTextClass,blockClass:this.cfg.sessionReplayBlockClass}),this.sessionReplay.start()),this.cfg.endpoint&&(this.flushTimer=setInterval(()=>{this.queue.length>0&&this.flushQueue()},this.cfg.flushInterval),window.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("pagehide",this.handlePageHide),this.heartbeatTimer=setInterval(()=>{document.visibilityState!=="hidden"&&this.sendHeartbeat()},3e4),this.cfg.trackLogs&&(this.logCapture=new We({endpoint:this.cfg.endpoint,sessionId:this.session.id,secretKey:this.cfg.secretKey,appId:this.cfg.appId}),this.logCapture.init())),this.initialized=!0,this.fetchFlags(),this.fetchAbTests(),this}destroy(){var e,r,i,n,s;this.flushTimer!==null&&(clearInterval(this.flushTimer),this.flushTimer=null),this.heartbeatTimer!==null&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),typeof window!="undefined"&&(window.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("pagehide",this.handlePageHide)),(e=this.navigation)==null||e.destroy(),(r=this.time)==null||r.destroy(),(i=this.heatmap)==null||i.destroy(),(n=this.sessionReplay)==null||n.destroy(),this.sessionReplay=void 0,(s=this.logCapture)==null||s.destroy(),typeof window!="undefined"&&window.removeEventListener("tracker:navigate",this.handleNavigate),this.queue.length>0&&this.cfg.endpoint&&this.flushBeacon(),this.initialized=!1}async sendHeartbeat(){if(!this.cfg.endpoint)return;let e=`${this.cfg.endpoint}/heartbeat`,r=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{},i=JSON.stringify({sessionId:this.session.id,visitorId:this.session.visitorId,path:A(typeof window!="undefined"?window.location.pathname+window.location.search:"/"),active:!0,...this.cfg.appId?{appId:this.cfg.appId}:{}});try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:i,keepalive:!0})}catch(n){}}sendDeactivate(){if(!this.cfg.endpoint)return;let e=`${this.cfg.endpoint}/heartbeat`,r=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{},i=JSON.stringify({sessionId:this.session.id,visitorId:this.session.visitorId,path:A(typeof window!="undefined"?window.location.pathname+window.location.search:"/"),active:!1,...this.cfg.appId?{appId:this.cfg.appId}:{}});!this.cfg.secretKey&&typeof navigator!="undefined"&&navigator.sendBeacon?navigator.sendBeacon(e,new Blob([i],{type:"application/json"})):fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:i,keepalive:!0}).catch(()=>{})}emit(e){var r,i,n,s;if(e=zi(e),e.type==="pageview"){let a=this.updateAttributionForPageView(e.data.path,e.data.referrer);e={type:"pageview",data:{...e.data,utm:(r=a.lastTouch)==null?void 0:r.utm,attribution:a}}}switch(e.type){case"pageview":this.session.pageViews.push(e.data);break;case"timespent":{let a=(i=this.session.timeSpent[e.data.path])!=null?i:0;this.session.timeSpent[e.data.path]=a+e.data.duration;break}case"heatmap":{let a=e.data.path;this.session.heatmap[a]||(this.session.heatmap[a]=[]);let o=this.session.heatmap[a];o.length<this.cfg.maxHeatmapPoints&&o.push(e.data);break}case"rageclik":case"uturn":case"identify":case"revenue":case"goal":case"journey_step":case"client_context":case"session_replay":break}this.subscribers.forEach(a=>a(e)),(s=(n=this.cfg).onEvent)==null||s.call(n,e),this.cfg.endpoint&&(this.queue.push(e),this.queue.length>=this.cfg.batchSize&&this.flushQueue())}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}trackPageView(e){let r=A(e!=null?e:typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"pageview",data:{path:r,title:typeof document!="undefined"?document.title:"",timestamp:Date.now(),sessionId:this.session.id,referrer:typeof document!="undefined"&&document.referrer||void 0}}),typeof window!="undefined"&&window.dispatchEvent(new CustomEvent("tracker:navigate",{detail:{path:r,title:document.title}}))}trackRevenue(e){var r,i;this.emit({type:"revenue",data:{...e,eventName:(r=e.eventName)!=null?r:"purchase",status:(i=e.status)!=null?i:"paid",sessionId:this.session.id,visitorId:this.session.visitorId,timestamp:Date.now(),attribution:this.currentAttribution()}})}trackGoal(e){let r=A(typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"goal",data:{...e,sessionId:this.session.id,visitorId:this.session.visitorId,path:r,timestamp:Date.now()}})}trackJourneyStep(e){var i;let r=A((i=e.path)!=null?i:typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"journey_step",data:{...e,path:r,sessionId:this.session.id,visitorId:this.session.visitorId,timestamp:Date.now()}})}identify(e){this.userProperties={...this.userProperties,...e},this.session.userProperties={...this.userProperties},this.emit({type:"identify",data:{properties:{...this.userProperties},visitorId:this.session.visitorId,timestamp:Date.now()}}),this.fetchFlags()}getFlags(){return{...this.flags}}isFeatureEnabled(e){return this.flags[e]===!0}onFlagsChange(e){return this.flagSubscribers.add(e),()=>this.flagSubscribers.delete(e)}async fetchFlags(){if(!this.cfg.endpoint||!this.cfg.secretKey)return;let e=ut(this.cfg.endpoint)+"/feature-flags/evaluate";try{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.cfg.secretKey}`},body:JSON.stringify({userProperties:this.userProperties})});if(!r.ok)return;let i=await r.json();this.flags=i,this.flagSubscribers.forEach(n=>n({...this.flags}))}catch(r){}}getAbVariants(){return{...this.abVariants}}getAbVariant(e){let r=this.abVariants[e];return r!=null?r:null}isAbVariant(e,r){return this.abVariants[e]===r}onAbTestsChange(e){return this.abTestSubscribers.add(e),()=>this.abTestSubscribers.delete(e)}async fetchAbTests(e){if(!this.cfg.endpoint||!this.cfg.secretKey)return;let r=ut(this.cfg.endpoint)+"/ab-tests/evaluate";try{let i={visitorId:this.session.visitorId};e!=null&&e.length&&(i.keys=e);let n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.cfg.secretKey}`},body:JSON.stringify(i)});if(!n.ok)return;let s=await n.json();this.abVariants=e!=null&&e.length?{...this.abVariants,...s}:{...s},this.abTestSubscribers.forEach(a=>a({...this.abVariants}))}catch(i){}}getSession(){return this.session}getPageViews(){return[...this.session.pageViews]}getTimeSpent(){return{...this.session.timeSpent}}getHeatmapData(e){var r;return e!==void 0?[...(r=this.session.heatmap[e])!=null?r:[]]:Object.entries(this.session.heatmap).reduce((i,[n,s])=>(i[n]=[...s],i),{})}flush(){this.flushQueue()}async flushQueue(){if(this.queue.length===0)return;let e=this.queue.splice(0);await this.sendBatch(e)}flushBeacon(){if(this.queue.length===0)return;let e=this.queue.splice(0);if(this.cfg.secretKey){this.sendBatch(e);return}let r=`${this.cfg.endpoint}/batch`,i=this.buildBatchBody(e),n=new Blob([i],{type:"application/json"});typeof navigator!="undefined"&&navigator.sendBeacon?navigator.sendBeacon(r,n)||this.sendBatch(e):this.sendBatch(e)}buildBatchBody(e){return JSON.stringify({...this.cfg.appId?{appId:this.cfg.appId}:{},visitorId:this.session.visitorId,events:e.map(r=>({sessionId:this.session.id,type:r.type,data:r.data}))})}async sendBatch(e){let r=`${this.cfg.endpoint}/batch`,i=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{};try{await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...i},body:this.buildBatchBody(e)})}catch(n){}}};var ot=require("react"),Mt=(0,ot.createContext)(null);function ie(){return(0,ot.useContext)(Mt)}var Ar=require("react/jsx-runtime");function wr({config:t={},children:e}){let r=(0,at.useRef)(null);return r.current===null&&(r.current=new st(t)),(0,at.useEffect)(()=>{let i=r.current;return i.init(),()=>i.destroy()},[]),(0,Ar.jsx)(Mt.Provider,{value:r.current,children:e})}var U=require("react");function kr(){return ie()}function Tr(t){let e=ie();(0,U.useEffect)(()=>{e&&t!==void 0&&e.trackPageView(t)},[t])}function Rr(t,e=500){let r=ie(),[i,n]=(0,U.useState)([]),s=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{if(!r)return;let a=A(t!=null?t:typeof window!="undefined"?window.location.pathname+window.location.search:"/"),o=()=>{n(r.getHeatmapData(a)),s.current=!1};return o(),r.subscribe(l=>{l.type==="heatmap"&&A(l.data.path)===a&&(s.current||(s.current=!0,setTimeout(o,e)))})},[r,t]),i}function Er(){let t=ie(),[e,r]=(0,U.useState)([]);return(0,U.useEffect)(()=>t?(r(t.getPageViews()),t.subscribe(n=>{n.type==="pageview"&&r(t.getPageViews())})):void 0,[t]),e}function xr(){let t=ie();return e=>{t==null||t.trackRevenue(e)}}function Mr(){let t=ie();return e=>{t==null||t.trackGoal(e)}}function Nr(){let t=ie();return e=>{t==null||t.trackJourneyStep(e)}}function Or(){let t=ie(),[e,r]=(0,U.useState)({});return(0,U.useEffect)(()=>t?(r(t.getTimeSpent()),t.subscribe(n=>{n.type==="timespent"&&r(t.getTimeSpent())})):void 0,[t]),e}function Nt(){let t=ie(),[e,r]=(0,U.useState)(()=>{var i;return(i=t==null?void 0:t.getFlags())!=null?i:{}});return(0,U.useEffect)(()=>{if(!t)return;r(t.getFlags());let i=t.onFlagsChange(r);return t.fetchFlags(),i},[t]),e}function Lr(t){return Nt()[t]===!0}function ct(){let t=ie(),[e,r]=(0,U.useState)(()=>{var i;return(i=t==null?void 0:t.getAbVariants())!=null?i:{}});return(0,U.useEffect)(()=>{if(!t)return;r(t.getAbVariants());let i=t.onAbTestsChange(r);return t.fetchAbTests(),i},[t]),e}function Fr(t){let r=ct()[t];return r!=null?r:null}function Pr(t,e){return ct()[t]===e}0&&(module.exports={UserTrackerProvider,useAbTests,useAbVariant,useFeatureFlagEnabled,useFeatureFlags,useHeatmapData,useIsAbVariant,usePageView,usePageViews,useTimeSpent,useTrackGoal,useTrackJourneyStep,useTrackRevenue,useTracker});
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`,rr={map:{},getId(){return console.error(we),-1},getNode(){return console.error(we),null},removeNodeFromMap(){console.error(we)},has(){return console.error(we),!1},reset(){console.error(we)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(rr=new Proxy(rr,{get(t,e,r){return e==="map"&&console.error(we),Reflect.get(t,e,r)}}));function Ae(t,e,r={}){let i=null,n=0;return function(...s){let a=Date.now();!n&&r.leading===!1&&(n=a);let o=e-(a-n),c=this;o<=0||o>e?(i&&(clearTimeout(i),i=null),n=a,t.apply(c,s)):!i&&r.trailing!==!1&&(i=setTimeout(()=>{n=r.leading===!1?0:Date.now(),i=null,t.apply(c,s)},o))}}function ve(t,e,r,i,n=window){let s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>ve(t,e,s||{},!0)}function te(t,e,r){try{if(!(e in t))return()=>{};let i=t[e],n=r(i);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(i){return()=>{}}}function He(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ze(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function x(t,e,r,i){if(!t)return!1;let n=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!n)return!1;if(typeof e=="string"){if(n.classList.contains(e)||i&&n.closest("."+e)!==null)return!0}else if(xe(n,e,i))return!0;return!!(r&&(t.matches(r)||i&&n.closest(r)!==null))}function ir(t,e){return e.getId(t)!==-1}function Ke(t,e){return e.getId(t)===ge}function kt(t,e){if(me(t))return!1;let r=e.getId(t);return e.has(r)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?kt(t.parentNode,e):!0:!0}function Tt(t){return!!t.changedTouches}function nr(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let r=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function ze(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Ye(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Je(t){return!!(t!=null&&t.shadowRoot)}var Ge=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var r;return(r=this.styleIDMap.get(e))!==null&&r!==void 0?r:-1}has(e){return this.styleIDMap.has(e)}add(e,r){if(this.has(e))return this.getId(e);let i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};var S=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(S||{}),b=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t))(b||{}),Qe=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Qe||{}),ae=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ae||{});function sr(t){return"__ln"in t}var Rt=class{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let i=0;i<e;i++)r=(r==null?void 0:r.next)||null;return r}addNode(e){let r={value:e,previous:null,next:null};if(e.__ln=r,e.previousSibling&&sr(e.previousSibling)){let i=e.previousSibling.__ln.next;r.next=i,r.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=r,i&&(i.previous=r)}else if(e.nextSibling&&sr(e.nextSibling)&&e.nextSibling.__ln.previous){let i=e.nextSibling.__ln.previous;r.previous=i,r.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=r,i&&(i.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(e){let r=e.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}},or=(t,e)=>`${t}@${e}`,je=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],r=new Rt,i=o=>{let c=o,l=ge;for(;l===ge;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},n=o=>{var c,l,d,u;let p=null;((l=(c=o.getRootNode)===null||c===void 0?void 0:c.call(o))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(p=o.getRootNode().host);let f=p;for(;((u=(d=f==null?void 0:f.getRootNode)===null||d===void 0?void 0:d.call(f))===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&f.getRootNode().host;)f=f.getRootNode().host;let h=!this.doc.contains(o)&&(!f||!this.doc.contains(f));if(!o.parentNode||h)return;let v=me(o.parentNode)?this.mirror.getId(p):this.mirror.getId(o.parentNode),C=i(o);if(v===-1||C===-1)return r.addNode(o);let y=pe(o,{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:g=>{ze(g,this.mirror)&&this.iframeManager.addIframe(g),Ye(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Je(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)}});y&&e.push({parentId:v,nextId:C,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let o of Array.from(this.movedSet.values()))ar(this.removes,o,this.mirror)&&!this.movedSet.has(o.parentNode)||n(o);for(let o of Array.from(this.addedSet.values()))!cr(this.droppedSet,o)&&!ar(this.removes,o,this.mirror)||cr(this.movedSet,o)?n(o):this.droppedSet.add(o);let s=null;for(;r.length;){let o=null;if(s){let c=this.mirror.getId(s.value.parentNode),l=i(s.value);c!==-1&&l!==-1&&(o=s)}if(!o)for(let c=r.length-1;c>=0;c--){let l=r.get(c);if(l){let d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){o=l;break}else{let p=l.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=p.parentNode.host;if(this.mirror.getId(f)!==-1){o=l;break}}}}}if(!o){for(;r.head;)r.removeNode(r.head.value);break}s=o.previous,r.removeNode(o.value),n(o.value)}let a={texts:this.texts.map(o=>({id:this.mirror.getId(o.node),value:o.value})).filter(o=>this.mirror.has(o.id)),attributes:this.attributes.map(o=>({id:this.mirror.getId(o.node),attributes:o.attributes})).filter(o=>this.mirror.has(o.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!Ke(e.target,this.mirror))switch(e.type){case"characterData":{let r=e.target.textContent;!x(e.target,this.blockClass,this.blockSelector,!1)&&r!==e.oldValue&&this.texts.push({value:At(e.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break}case"attributes":{let r=e.target,i=e.target.getAttribute(e.attributeName);if(e.attributeName==="value"&&(i=Me({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:i,maskInputFn:this.maskInputFn})),x(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributes.find(s=>s.node===e.target);if(r.tagName==="IFRAME"&&e.attributeName==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)e.attributeName="rr_src";else return;if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),e.attributeName==="style"){let s=this.doc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue),(n.attributes.style===void 0||n.attributes.style===null)&&(n.attributes.style={});let a=n.attributes.style;for(let o of Array.from(r.style)){let c=r.style.getPropertyValue(o),l=r.style.getPropertyPriority(o);(c!==s.style.getPropertyValue(o)||l!==s.style.getPropertyPriority(o))&&(l===""?a[o]=c:a[o]=[c,l])}for(let o of Array.from(s.style))r.style.getPropertyValue(o)===""&&(a[o]=!1)}else n.attributes[e.attributeName]=wt(this.doc,r.tagName,e.attributeName,i);break}case"childList":{if(x(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(r=>this.genAdds(r,e.target)),e.removedNodes.forEach(r=>{let i=this.mirror.getId(r),n=me(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);x(e.target,this.blockClass,this.blockSelector,!1)||Ke(r,this.mirror)||!ir(r,this.mirror)||(this.addedSet.has(r)?(Et(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(e.target)&&i===-1||kt(e.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[or(i,n)]?Et(this.movedSet,r):this.removes.push({parentId:n,id:i,isShadow:me(e.target)&&fe(e.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(e,r)=>{if(this.mirror.hasNode(e)){if(Ke(e,this.mirror))return;this.movedSet.add(e);let i=null;r&&this.mirror.hasNode(r)&&(i=this.mirror.getId(r)),i&&i!==-1&&(this.movedMap[or(this.mirror.getId(e),i)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);x(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(i=>this.genAdds(i))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=e[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 Et(t,e){t.delete(e),e.childNodes.forEach(r=>Et(t,r))}function ar(t,e,r){return t.length===0?!1:lr(t,e,r)}function lr(t,e,r){let{parentNode:i}=e;if(!i)return!1;let n=r.getId(i);return t.some(s=>s.id===n)?!0:lr(t,i,r)}function cr(t,e){return t.size===0?!1:dr(t,e)}function dr(t,e){let{parentNode:r}=e;return r?t.has(r)?!0:dr(t,r):!1}var ue=[],pr=typeof CSSGroupingRule!="undefined",fr=typeof CSSMediaRule!="undefined",gr=typeof CSSSupportsRule!="undefined",mr=typeof CSSConditionRule!="undefined";function Ne(t){try{if("composedPath"in t){let e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch(e){return t.target}}function xt(t,e){var r,i;let n=new je;ue.push(n),n.init(t);let s=window.MutationObserver||window.__rrMutationObserver,a=(i=(r=window==null?void 0:window.Zone)===null||r===void 0?void 0:r.__symbol__)===null||i===void 0?void 0:i.call(r,"MutationObserver");a&&window[a]&&(s=window[a]);let o=new s(n.processMutations.bind(n));return o.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function Ni({mousemoveCb:t,sampling:e,doc:r,mirror:i}){if(e.mousemove===!1)return()=>{};let n=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],o,c=Ae(u=>{let p=Date.now()-o;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],o=null},s),l=Ae(u=>{let p=Ne(u),{clientX:f,clientY:h}=Tt(u)?u.changedTouches[0]:u;o||(o=Date.now()),a.push({x:f,y:h,id:i.getId(p),timeOffset:Date.now()-o}),c(typeof DragEvent!="undefined"&&u instanceof DragEvent?b.Drag:u instanceof MouseEvent?b.MouseMove:b.TouchMove)},n,{trailing:!1}),d=[B("mousemove",l,r),B("touchmove",l,r),B("drag",l,r)];return()=>{d.forEach(u=>u())}}function Oi({mouseInteractionCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,o=[],c=l=>d=>{let u=Ne(d);if(x(u,i,n,!0))return;let p=Tt(d)?d.changedTouches[0]:d;if(!p)return;let f=r.getId(u),{clientX:h,clientY:v}=p;t({type:Qe[l],id:f,x:h,y:v})};return Object.keys(Qe).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let d=l.toLowerCase(),u=c(l);o.push(B(d,u,e))}),()=>{o.forEach(l=>l())}}function Mt({scrollCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,sampling:s}){let a=Ae(o=>{let c=Ne(o);if(!c||x(c,i,n,!0))return;let l=r.getId(c);if(c===e){let d=e.scrollingElement||e.documentElement;t({id:l,x:d.scrollLeft,y:d.scrollTop})}else t({id:l,x:c.scrollLeft,y:c.scrollTop})},s.scroll||100);return B("scroll",a,e)}function Pi({viewportResizeCb:t}){let e=-1,r=-1,i=Ae(()=>{let n=He(),s=Ze();(e!==n||r!==s)&&(t({width:Number(s),height:Number(n)}),e=n,r=s)},200);return B("resize",i,window)}function ur(t,e){let r=Object.assign({},t);return e||delete r.userTriggered,r}var Li=["INPUT","TEXTAREA","SELECT"],hr=new WeakMap;function Fi({inputCb:t,doc:e,mirror:r,blockClass:i,blockSelector:n,ignoreClass:s,maskInputOptions:a,maskInputFn:o,sampling:c,userTriggeredOnInput:l}){function d(y){let g=Ne(y),m=y.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Li.indexOf(g.tagName)<0||x(g,i,n,!0))return;let A=g.type;if(g.classList.contains(s))return;let W=g.value,F=!1;A==="radio"||A==="checkbox"?F=g.checked:(a[g.tagName.toLowerCase()]||a[A])&&(W=Me({maskInputOptions:a,tagName:g.tagName,type:A,value:W,maskInputFn:o})),u(g,ur({text:W,isChecked:F,userTriggered:m},l));let D=g.name;A==="radio"&&D&&F&&e.querySelectorAll(`input[type="radio"][name="${D}"]`).forEach(T=>{T!==g&&u(T,ur({text:T.value,isChecked:!F,userTriggered:!1},l))})}function u(y,g){let m=hr.get(y);if(!m||m.text!==g.text||m.isChecked!==g.isChecked){hr.set(y,g);let A=r.getId(y);t(Object.assign(Object.assign({},g),{id:A}))}}let f=(c.input==="last"?["change"]:["input","change"]).map(y=>B(y,d,e)),h=e.defaultView;if(!h)return()=>{f.forEach(y=>y())};let v=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),C=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&f.push(...C.map(y=>ve(y[0],y[1],{set(){d({target:this})}},!1,h))),()=>{f.forEach(y=>y())}}function Xe(t){let e=[];function r(i,n){if(pr&&i.parentRule instanceof CSSGroupingRule||fr&&i.parentRule instanceof CSSMediaRule||gr&&i.parentRule instanceof CSSSupportsRule||mr&&i.parentRule instanceof CSSConditionRule){let a=Array.from(i.parentRule.cssRules).indexOf(i);n.unshift(a)}else if(i.parentStyleSheet){let a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);n.unshift(a)}return n}return r(t,e)}function de(t,e,r){let i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Di({styleSheetRuleCb:t,mirror:e,stylesheetManager:r},{win:i}){let n=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(d,u){let{id:p,styleId:f}=de(this,e,r.styleMirror);return(p&&p!==-1||f&&f!==-1)&&t({id:p,styleId:f,adds:[{rule:d,index:u}]}),n.apply(this,[d,u])};let s=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,removes:[{index:d}]}),s.apply(this,[d])};let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,replace:d}),a.apply(this,[d])});let o;i.CSSStyleSheet.prototype.replaceSync&&(o=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=function(d){let{id:u,styleId:p}=de(this,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,replaceSync:d}),o.apply(this,[d])});let c={};pr?c.CSSGroupingRule=i.CSSGroupingRule:(fr&&(c.CSSMediaRule=i.CSSMediaRule),mr&&(c.CSSConditionRule=i.CSSConditionRule),gr&&(c.CSSSupportsRule=i.CSSSupportsRule));let l={};return Object.entries(c).forEach(([d,u])=>{l[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=function(p,f){let{id:h,styleId:v}=de(this.parentStyleSheet,e,r.styleMirror);return(h&&h!==-1||v&&v!==-1)&&t({id:h,styleId:v,adds:[{rule:p,index:[...Xe(this),f||0]}]}),l[d].insertRule.apply(this,[p,f])},u.prototype.deleteRule=function(p){let{id:f,styleId:h}=de(this.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&t({id:f,styleId:h,removes:[{index:[...Xe(this),p]}]}),l[d].deleteRule.apply(this,[p])}}),()=>{i.CSSStyleSheet.prototype.insertRule=n,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),o&&(i.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(([d,u])=>{u.prototype.insertRule=l[d].insertRule,u.prototype.deleteRule=l[d].deleteRule})}}function Nt({mirror:t,stylesheetManager:e},r){var i,n,s;let a=null;r.nodeName==="#document"?a=t.getId(r):a=t.getId(r.host);let o=r.nodeName==="#document"?(i=r.defaultView)===null||i===void 0?void 0:i.Document:(s=(n=r.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||s===void 0?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets");return a===null||a===-1||!o||!c?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var d;let u=(d=c.set)===null||d===void 0?void 0:d.call(this,l);if(a!==null&&a!==-1)try{e.adoptStyleSheets(l,a)}catch(p){}return u}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function Bi({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:r,stylesheetManager:i},{win:n}){let s=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(o,c,l){var d;if(r.has(o))return s.apply(this,[o,c,l]);let{id:u,styleId:p}=de((d=this.parentRule)===null||d===void 0?void 0:d.parentStyleSheet,e,i.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,set:{property:o,value:c,priority:l},index:Xe(this.parentRule)}),s.apply(this,[o,c,l])};let a=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(o){var c;if(r.has(o))return a.apply(this,[o]);let{id:l,styleId:d}=de((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,e,i.styleMirror);return(l&&l!==-1||d&&d!==-1)&&t({id:l,styleId:d,remove:{property:o},index:Xe(this.parentRule)}),a.apply(this,[o])},()=>{n.CSSStyleDeclaration.prototype.setProperty=s,n.CSSStyleDeclaration.prototype.removeProperty=a}}function Wi({mediaInteractionCb:t,blockClass:e,blockSelector:r,mirror:i,sampling:n}){let s=o=>Ae(c=>{let l=Ne(c);if(!l||x(l,e,r,!0))return;let{currentTime:d,volume:u,muted:p,playbackRate:f}=l;t({type:o,id:i.getId(l),currentTime:d,volume:u,muted:p,playbackRate:f})},n.media||500),a=[B("play",s(0)),B("pause",s(1)),B("seeked",s(2)),B("volumechange",s(3)),B("ratechange",s(4))];return()=>{a.forEach(o=>o())}}function _i({fontCb:t,doc:e}){let r=e.defaultView;if(!r)return()=>{};let i=[],n=new WeakMap,s=r.FontFace;r.FontFace=function(c,l,d){let u=new s(c,l,d);return n.set(u,{family:c,buffer:typeof l!="string",descriptors:d,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};let a=te(e.fonts,"add",function(o){return function(c){return setTimeout(()=>{let l=n.get(c);l&&(t(l),n.delete(c))},0),o.apply(this,[c])}});return i.push(()=>{r.FontFace=s}),i.push(a),()=>{i.forEach(o=>o())}}function Ui(t){let{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,a=!0,o=()=>{let c=e.getSelection();if(!c||a&&(c!=null&&c.isCollapsed))return;a=c.isCollapsed||!1;let l=[],d=c.rangeCount||0;for(let u=0;u<d;u++){let p=c.getRangeAt(u),{startContainer:f,startOffset:h,endContainer:v,endOffset:C}=p;x(f,i,n,!0)||x(v,i,n,!0)||l.push({start:r.getId(f),startOffset:h,end:r.getId(v),endOffset:C})}s({ranges:l})};return o(),B("selectionchange",o)}function Vi(t,e){let{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:a,inputCb:o,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:f}=t;t.mutationCb=(...h)=>{e.mutation&&e.mutation(...h),r(...h)},t.mousemoveCb=(...h)=>{e.mousemove&&e.mousemove(...h),i(...h)},t.mouseInteractionCb=(...h)=>{e.mouseInteraction&&e.mouseInteraction(...h),n(...h)},t.scrollCb=(...h)=>{e.scroll&&e.scroll(...h),s(...h)},t.viewportResizeCb=(...h)=>{e.viewportResize&&e.viewportResize(...h),a(...h)},t.inputCb=(...h)=>{e.input&&e.input(...h),o(...h)},t.mediaInteractionCb=(...h)=>{e.mediaInteaction&&e.mediaInteaction(...h),c(...h)},t.styleSheetRuleCb=(...h)=>{e.styleSheetRule&&e.styleSheetRule(...h),l(...h)},t.styleDeclarationCb=(...h)=>{e.styleDeclaration&&e.styleDeclaration(...h),d(...h)},t.canvasMutationCb=(...h)=>{e.canvasMutation&&e.canvasMutation(...h),u(...h)},t.fontCb=(...h)=>{e.font&&e.font(...h),p(...h)},t.selectionCb=(...h)=>{e.selection&&e.selection(...h),f(...h)}}function vr(t,e={}){let r=t.doc.defaultView;if(!r)return()=>{};Vi(t,e);let i=xt(t,t.doc),n=Ni(t),s=Oi(t),a=Mt(t),o=Pi(t),c=Fi(t),l=Wi(t),d=Di(t,{win:r}),u=Nt(t,t.doc),p=Bi(t,{win:r}),f=t.collectFonts?_i(t):()=>{},h=Ui(t),v=[];for(let C of t.plugins)v.push(C.observer(C.callback,r,C.options));return()=>{ue.forEach(C=>C.reset()),i.disconnect(),n(),s(),a(),o(),c(),l(),d(),u(),p(),f(),h(),v.forEach(C=>C())}}var Oe=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,r,i,n){let s=i||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),o=s.get(r);return o||(o=this.generateIdFn(),s.set(r,o),a.set(o,r)),o}getIds(e,r){let i=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return r.map(s=>this.getId(e,s,i,n))}getRemoteId(e,r,i){let n=i||this.getRemoteIdToIdMap(e);if(typeof r!="number")return r;let s=n.get(r);return s||-1}getRemoteIds(e,r){let i=this.getRemoteIdToIdMap(e);return r.map(n=>this.getRemoteId(e,n,i))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let r=this.iframeIdToRemoteIdMap.get(e);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(e,r)),r}getRemoteIdToIdMap(e){let r=this.iframeRemoteIdToIdMap.get(e);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(e,r)),r}};var qe=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Oe(bt),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Oe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,r){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(i=this.loadListener)===null||i===void 0||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if(e.data.type==="rrweb"){if(!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,r){var i;switch(r.type){case S.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(r.data.node,e),{timestamp:r.timestamp,type:S.IncrementalSnapshot,data:{source:b.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case S.Meta:case S.Load:case S.DomContentLoaded:return!1;case S.Plugin:return r;case S.Custom:return this.replaceIds(r.data.payload,e,["id","parentId","previousId","nextId"]),r;case S.IncrementalSnapshot:switch(r.data.source){case b.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e)}),r.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),r;case b.Drag:case b.TouchMove:case b.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),r;case b.ViewportResize:return!1;case b.MediaInteraction:case b.MouseInteraction:case b.Scroll:case b.CanvasMutation:case b.Input:return this.replaceIds(r.data,e,["id"]),r;case b.StyleSheetRule:case b.StyleDeclaration:return this.replaceIds(r.data,e,["id"]),this.replaceStyleIds(r.data,e,["styleId"]),r;case b.Font:return r;case b.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),r;case b.AdoptedStyleSheet:return this.replaceIds(r.data,e,["id"]),this.replaceStyleIds(r.data,e,["styleIds"]),(i=r.data.styles)===null||i===void 0||i.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),r}}}replace(e,r,i,n){for(let s of n)!Array.isArray(r[s])&&typeof r[s]!="number"||(Array.isArray(r[s])?r[s]=e.getIds(i,r[s]):r[s]=e.getId(i,r[s]));return r}replaceIds(e,r,i){return this.replace(this.crossOriginIframeMirror,e,r,i)}replaceStyleIds(e,r,i){return this.replace(this.crossOriginIframeStyleMirror,e,r,i)}replaceIdOnNode(e,r){this.replaceIds(e,r,["id"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,r)})}};var $e=class{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;let r=this;this.restorePatches.push(te(Element.prototype,"attachShadow",function(i){return function(n){let s=i.call(this,n);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(e,r){fe(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),xt(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Mt(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Nt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){let r=this;this.restorePatches.push(te(e.contentWindow.HTMLElement.prototype,"attachShadow",function(i){return function(n){let s=i.call(this,n);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}};function yr(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Ir(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(d){try{l(i.next(d))}catch(u){a(u)}}function c(d){try{l(i.throw(d))}catch(u){a(u)}}function l(d){d.done?s(d.value):n(d.value).then(o,c)}l((i=i.apply(t,e||[])).next())})}var ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gi=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(Pe=0;Pe<ke.length;Pe++)Gi[ke.charCodeAt(Pe)]=Pe;var Pe,Cr=function(t){var e=new Uint8Array(t),r,i=e.length,n="";for(r=0;r<i;r+=3)n+=ke[e[r]>>2],n+=ke[(e[r]&3)<<4|e[r+1]>>4],n+=ke[(e[r+1]&15)<<2|e[r+2]>>6],n+=ke[e[r+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n};var br=new Map;function Hi(t,e){let r=br.get(t);return r||(r=new Map,br.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}var Ot=(t,e,r)=>{if(!t||!(Sr(t,e)||typeof t=="object"))return;let i=t.constructor.name,n=Hi(r,i),s=n.indexOf(t);return s===-1&&(s=n.length,n.push(t)),s};function et(t,e,r){if(t instanceof Array)return t.map(i=>et(i,e,r));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){let i=t.constructor.name,n=Cr(t);return{rr_type:i,base64:n}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[et(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){let i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}else if(t instanceof HTMLCanvasElement){let i="HTMLImageElement",n=t.toDataURL();return{rr_type:i,src:n}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[et(t.data,e,r),t.width,t.height]};if(Sr(t,e)||typeof t=="object"){let i=t.constructor.name,n=Ot(t,e,r);return{rr_type:i,index:n}}}}return t}var tt=(t,e,r)=>[...t].map(i=>et(i,e,r)),Sr=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof e[n]=="function").find(n=>t instanceof e[n]);function wr(t,e,r,i){let n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let a of s)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;let o=te(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return x(this.canvas,r,i,!0)||setTimeout(()=>{let d=tt([...l],e,this);t(this.canvas,{type:ae["2D"],property:a,args:d})},0),c.apply(this,l)}});n.push(o)}catch(o){let c=ve(e.CanvasRenderingContext2D.prototype,a,{set(l){t(this.canvas,{type:ae["2D"],property:a,args:[l],setter:!0})}});n.push(c)}return()=>{n.forEach(a=>a())}}function Pt(t,e,r){let i=[];try{let n=te(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...o){return x(this,e,r,!0)||"__context"in this||(this.__context=a),s.apply(this,[a,...o])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Ar(t,e,r,i,n,s,a){let o=[],c=Object.getOwnPropertyNames(t);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof t[l]!="function")continue;let d=te(t,l,function(u){return function(...p){let f=u.apply(this,p);if(Ot(f,a,this),!x(this.canvas,i,n,!0)){let h=tt([...p],a,this),v={type:e,property:l,args:h};r(this.canvas,v)}return f}});o.push(d)}catch(d){let u=ve(t,l,{set(p){r(this.canvas,{type:e,property:l,args:[p],setter:!0})}});o.push(u)}return o}function kr(t,e,r,i,n){let s=[];return s.push(...Ar(e.WebGLRenderingContext.prototype,ae.WebGL,t,r,i,n,e)),typeof e.WebGL2RenderingContext!="undefined"&&s.push(...Ar(e.WebGL2RenderingContext.prototype,ae.WebGL2,t,r,i,n,e)),()=>{s.forEach(a=>a())}}var Lt=null;try{Tr=typeof module!="undefined"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads"),Lt=Tr.Worker}catch(t){}var Tr;function Zi(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}function Rr(t,e,r){var i=e===void 0?null:e,n=r===void 0?!1:r,s=Zi(t,n),a=s.indexOf(`
|
|
4
|
+
`,10)+1,o=s.substring(a)+(i?"//# sourceMappingURL="+i:"");return function(l){return new Lt(o,Object.assign({},l,{eval:!0}))}}function Ki(t,e){var r=atob(t);if(e){for(var i=new Uint8Array(r.length),n=0,s=r.length;n<s;++n)i[n]=r.charCodeAt(n);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return r}function zi(t,e,r){var i=e===void 0?null:e,n=r===void 0?!1:r,s=Ki(t,n),a=s.indexOf(`
|
|
5
|
+
`,10)+1,o=s.substring(a)+(i?"//# sourceMappingURL="+i:""),c=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(c)}function Er(t,e,r){var i;return function(s){return i=i||zi(t,e,r),new Worker(i,s)}}var Yi=Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]";function xr(){return Yi}function Mr(t,e,r){return xr()?Rr(t,e,r):Er(t,e,r)}var Nr=Mr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var rt=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:r="all",win:i,blockClass:n,blockSelector:s,recordCanvas:a,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&r==="all"&&this.initCanvasMutationObserver(i,n,s),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o})}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(e,r,i,n,s){let a=Pt(r,i,n),o=new Map,c=new Nr;c.onmessage=h=>{let{id:v}=h.data;if(o.set(v,!1),!("base64"in h.data))return;let{base64:C,type:y,width:g,height:m}=h.data;this.mutationCb({id:v,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,g,m]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:y}]},0,0]}]})};let l=1e3/e,d=0,u,p=()=>{let h=[];return r.document.querySelectorAll("canvas").forEach(v=>{x(v,i,n,!0)||h.push(v)}),h},f=h=>{if(d&&h-d<l){u=requestAnimationFrame(f);return}d=h,p().forEach(v=>Ir(this,void 0,void 0,function*(){var C;let y=this.mirror.getId(v);if(o.get(y))return;if(o.set(y,!0),["webgl","webgl2"].includes(v.__context)){let m=v.getContext(v.__context);((C=m==null?void 0:m.getContextAttributes())===null||C===void 0?void 0:C.preserveDrawingBuffer)===!1&&(m==null||m.clear(m.COLOR_BUFFER_BIT))}let g=yield createImageBitmap(v);c.postMessage({id:y,bitmap:g,width:v.width,height:v.height,dataURLOptions:s.dataURLOptions},[g])})),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=Pt(e,r,i),s=wr(this.processMutation.bind(this),e,r,i),a=kr(this.processMutation.bind(this),e,r,i,this.mirror);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=r=>{this.rafStamps.latestId=r,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,r)=>{let i=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,r){if(this.frozen||this.locked)return;let i=this.pendingCanvasMutations.get(e);if(!i||r===-1)return;let n=i.map(a=>yr(a,["type"])),{type:s}=i[0];this.mutationCb({id:r,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}};var it=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ge,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,r){if(e.length===0)return;let i={id:r,styleIds:[]},n=[];for(let s of e){let a;if(this.styleMirror.has(s))a=this.styleMirror.getId(s);else{a=this.styleMirror.add(s);let o=Array.from(s.rules||CSSRule);n.push({styleId:a,rules:o.map((c,l)=>({rule:Ct(c),index:l}))})}i.styleIds.push(a)}n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}};function P(t){return Object.assign(Object.assign({},t),{timestamp:Date.now()})}var M,nt,Ft,st=!1,re=er();function ye(t={}){let{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",maskTextClass:o="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:p,maskInputFn:f,maskTextFn:h,hooks:v,packFn:C,sampling:y={},dataURLOptions:g={},mousemoveWait:m,recordCanvas:A=!1,recordCrossOriginIframes:W=!1,userTriggeredOnInput:F=!1,collectFonts:D=!1,inlineImages:T=!1,plugins:K,keepIframeSrcFn:z=()=>!1,ignoreCSSAttributes:j=new Set([])}=t,X=W?window.parent===window:!0,q=!1;if(!X)try{window.parent.document,q=!1}catch(I){q=!0}if(X&&!e)throw new Error("emit function is required");m!==void 0&&y.mousemove===void 0&&(y.mousemove=m),re.reset();let O=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}:u!==void 0?u:{password:!0},Y=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all"}:p||{};nr();let $,ne=0,oe=I=>{for(let _ of K||[])_.eventProcessor&&(I=_.eventProcessor(I));return C&&(I=C(I)),I};M=(I,_)=>{var H;if(!((H=ue[0])===null||H===void 0)&&H.isFrozen()&&I.type!==S.FullSnapshot&&!(I.type===S.IncrementalSnapshot&&I.data.source===b.Mutation)&&ue.forEach(E=>E.unfreeze()),X)e==null||e(oe(I),_);else if(q){let E={type:"rrweb",event:oe(I),isCheckout:_};window.parent.postMessage(E,"*")}if(I.type===S.FullSnapshot)$=I,ne=0;else if(I.type===S.IncrementalSnapshot){if(I.data.source===b.Mutation&&I.data.isAttachIframe)return;ne++;let E=i&&ne>=i,Q=r&&I.timestamp-$.timestamp>r;(E||Q)&&nt(!0)}};let G=I=>{M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.Mutation},I)}))},J=I=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.Scroll},I)})),ce=I=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.CanvasMutation},I)})),N=I=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.AdoptedStyleSheet},I)})),ee=new it({mutationCb:G,adoptedStyleSheetCb:N}),se=new qe({mirror:re,mutationCb:G,stylesheetManager:ee,recordCrossOriginIframes:W,wrappedEmit:M});for(let I of K||[])I.getMirror&&I.getMirror({nodeMirror:re,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror});Ft=new rt({recordCanvas:A,mutationCb:ce,win:window,blockClass:n,blockSelector:s,mirror:re,sampling:y.canvas,dataURLOptions:g});let Ce=new $e({mutationCb:G,scrollCb:J,bypassOptions:{blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:O,dataURLOptions:g,maskTextFn:h,maskInputFn:f,recordCanvas:A,inlineImages:T,sampling:y,slimDOMOptions:Y,iframeManager:se,stylesheetManager:ee,canvasManager:Ft,keepIframeSrcFn:z},mirror:re});nt=(I=!1)=>{var _,H,E,Q,w,Z;M(P({type:S.Meta,data:{href:window.location.href,width:Ze(),height:He()}}),I),ee.reset(),ue.forEach(U=>U.lock());let Te=tr(document,{mirror:re,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:O,maskTextFn:h,slimDOM:Y,dataURLOptions:g,recordCanvas:A,inlineImages:T,onSerialize:U=>{ze(U,re)&&se.addIframe(U),Ye(U,re)&&ee.trackLinkElement(U),Je(U)&&Ce.addShadowRoot(U.shadowRoot,document)},onIframeLoad:(U,ht)=>{se.attachIframe(U,ht),Ce.observeAttachShadow(U)},onStylesheetLoad:(U,ht)=>{ee.attachLinkElement(U,ht)},keepIframeSrcFn:z});if(!Te)return console.warn("Failed to snapshot the document");M(P({type:S.FullSnapshot,data:{node:Te,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:(document==null?void 0:document.documentElement.scrollLeft)||((H=(_=document==null?void 0:document.body)===null||_===void 0?void 0:_.parentElement)===null||H===void 0?void 0:H.scrollLeft)||((E=document==null?void 0:document.body)===null||E===void 0?void 0:E.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:(document==null?void 0:document.documentElement.scrollTop)||((w=(Q=document==null?void 0:document.body)===null||Q===void 0?void 0:Q.parentElement)===null||w===void 0?void 0:w.scrollTop)||((Z=document==null?void 0:document.body)===null||Z===void 0?void 0:Z.scrollTop)||0}}})),ue.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let I=[];I.push(B("DOMContentLoaded",()=>{M(P({type:S.DomContentLoaded,data:{}}))}));let _=E=>{var Q;return vr({mutationCb:G,mousemoveCb:(w,Z)=>M(P({type:S.IncrementalSnapshot,data:{source:Z,positions:w}})),mouseInteractionCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.MouseInteraction},w)})),scrollCb:J,viewportResizeCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.ViewportResize},w)})),inputCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.Input},w)})),mediaInteractionCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.MediaInteraction},w)})),styleSheetRuleCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.StyleSheetRule},w)})),styleDeclarationCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.StyleDeclaration},w)})),canvasMutationCb:ce,fontCb:w=>M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.Font},w)})),selectionCb:w=>{M(P({type:S.IncrementalSnapshot,data:Object.assign({source:b.Selection},w)}))},blockClass:n,ignoreClass:a,maskTextClass:o,maskTextSelector:c,maskInputOptions:O,inlineStylesheet:l,sampling:y,recordCanvas:A,inlineImages:T,userTriggeredOnInput:F,collectFonts:D,doc:E,maskInputFn:f,maskTextFn:h,keepIframeSrcFn:z,blockSelector:s,slimDOMOptions:Y,dataURLOptions:g,mirror:re,iframeManager:se,stylesheetManager:ee,shadowDomManager:Ce,canvasManager:Ft,ignoreCSSAttributes:j,plugins:((Q=K==null?void 0:K.filter(w=>w.observer))===null||Q===void 0?void 0:Q.map(w=>({observer:w.observer,options:w.options,callback:Z=>M(P({type:S.Plugin,data:{plugin:w.name,payload:Z}}))})))||[]},v)};se.addLoadListener(E=>{I.push(_(E.contentDocument))});let H=()=>{nt(),I.push(_(document)),st=!0};return document.readyState==="interactive"||document.readyState==="complete"?H():I.push(B("load",()=>{M(P({type:S.Load,data:{}})),H()},window)),()=>{I.forEach(E=>E()),st=!1}}catch(I){console.warn(I)}}ye.addCustomEvent=(t,e)=>{if(!st)throw new Error("please add custom event after start recording");M(P({type:S.Custom,data:{tag:t,payload:e}}))};ye.freezePage=()=>{ue.forEach(t=>t.freeze())};ye.takeFullSnapshot=t=>{if(!st)throw new Error("please take full snapshot after start recording");nt(t)};ye.mirror=re;var ot=class{constructor(e){this.opts=e;this.seq=0;this.buffer=[];this.stopRecording=null;this.flushTimer=null}start(){var r,i,n;if(typeof document=="undefined"||this.stopRecording)return;let e={emit:s=>{this.buffer.push(s),this.buffer.length>=this.opts.maxEventsPerBatch&&this.flush()},checkoutEveryNms:(r=this.opts.checkoutEveryNms)!=null?r:6e5,inlineStylesheet:(i=this.opts.inlineStylesheet)!=null?i:!1,maskAllInputs:this.opts.maskAllInputs,maskTextClass:this.opts.maskTextClass,blockClass:this.opts.blockClass};this.stopRecording=(n=ye(e))!=null?n:null,this.flushTimer=setInterval(()=>{this.buffer.length>0&&this.flush()},this.opts.flushIntervalMs)}flush(){if(this.buffer.length===0)return;let e=this.buffer.splice(0,this.buffer.length);this.opts.emit({type:"session_replay",data:{seq:this.seq++,events:e}})}destroy(){var e;this.flushTimer!==null&&(clearInterval(this.flushTimer),this.flushTimer=null),this.flush(),(e=this.stopRecording)==null||e.call(this),this.stopRecording=null}};var Or="1.0.2";function Pr(t){var r,i;let e=t.toLowerCase();return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|android|iphone|ipod|windows phone/i.test(e)?"mobile":typeof navigator!="undefined"&&navigator.maxTouchPoints>0&&typeof window!="undefined"&&((i=(r=window.matchMedia)==null?void 0:r.call(window,"(pointer: coarse)"))==null?void 0:i.matches)&&/macintosh|mac os x/i.test(e)?"tablet":"desktop"}function Ji(t){return/windows/i.test(t)?"Windows":/android/i.test(t)?"Android":/iphone|ipad|ipod/i.test(t)?"iOS":/mac os x|macintosh/i.test(t)?"macOS":/linux/i.test(t)?"Linux":"Other"}function Qi(t){return/edg\//i.test(t)?"Edge":/opr\/|opera/i.test(t)?"Opera":/chrome\/[0-9]/i.test(t)&&!/chromium/i.test(t)?"Chrome":/firefox\/[0-9]/i.test(t)?"Firefox":/safari\/[0-9]/i.test(t)&&!/chrome/i.test(t)?"Safari":"Other"}function ji(){let e=navigator.userAgentData;return e?{mobile:e.mobile,platform:e.platform}:{}}function Xi(t,e){var i;let r=((i=e.platform)!=null?i:"").toLowerCase();return r==="ios"||r==="ipados"||r==="android"?e.mobile?"mobile":"tablet":e.mobile===!0?"mobile":Pr(t)}function Lr(t){var o,c,l,d,u,p,f,h,v,C,y,g;if(typeof window=="undefined"||typeof navigator=="undefined")return{sessionId:t,timestamp:Date.now(),device:"desktop",os:"Other",browser:"Other",language:"",languages:[],colorScheme:"",screenWidth:0,screenHeight:0,viewportWidth:0,viewportHeight:0,devicePixelRatio:1,timeZone:"",sdkVersion:Or};let e=navigator.userAgent||"",r=ji(),i=r.mobile!==void 0||r.platform?Xi(e,r):Pr(e),n="";(c=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: dark)"))!=null&&c.matches?n="dark":(d=(l=window.matchMedia)==null?void 0:l.call(window,"(prefers-color-scheme: light)"))!=null&&d.matches&&(n="light");let s="";try{s=(u=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?u:""}catch(m){s=""}let a=typeof navigator.languages!="undefined"&&navigator.languages.length?[...navigator.languages]:navigator.language?[navigator.language]:[];return{sessionId:t,timestamp:Date.now(),device:i,os:Ji(e),browser:Qi(e),language:navigator.language||"",languages:a,colorScheme:n,screenWidth:(f=(p=window.screen)==null?void 0:p.width)!=null?f:0,screenHeight:(v=(h=window.screen)==null?void 0:h.height)!=null?v:0,viewportWidth:(C=window.innerWidth)!=null?C:0,viewportHeight:(y=window.innerHeight)!=null?y:0,devicePixelRatio:(g=window.devicePixelRatio)!=null?g:1,timeZone:s,sdkVersion:Or}}var qi="https://api.alphana.ir/api/events",$i={endpoint:qi,trackNavigation:!0,trackTime:!0,trackHeatmap:!0,trackLogs:!0,mouseSampleRate:.1,maxHeatmapPoints:2e3,batchSize:20,flushInterval:5e3,compressPayloads:!0,compressionThresholdBytes:1024,sessionReplay:!0,sessionReplayCheckoutEveryNms:6e5,sessionReplayInlineStylesheet:!1,sessionReplayMaxEventsPerBatch:48,sessionReplayFlushIntervalMs:4e3,sessionReplayMaskAllInputs:!0,sessionReplayMaskTextClass:"alphana-mask",sessionReplayBlockClass:"alphana-block"},Le="__alphana_first_touch__",at="__alphana_last_touch__",en={utm_source:"source",utm_medium:"medium",utm_campaign:"campaign",utm_term:"term",utm_content:"content"},tn=["gclid","fbclid","ttclid","msclkid"];function rn(t){if(typeof localStorage=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function nn(t,e){if(typeof localStorage!="undefined")try{localStorage.setItem(t,e)}catch(r){}}function Ie(t){let e=rn(t);if(e)try{let r=JSON.parse(e);return typeof r.landingPage=="string"&&typeof r.capturedAt=="number"?r:void 0}catch(r){return}}function Fr(t,e){nn(t,JSON.stringify(e))}function sn(t){if(t)try{return new URL(t).hostname.replace(/^www\./,"").toLowerCase()}catch(e){return}}function on(){return typeof window=="undefined"?new URLSearchParams:new URLSearchParams(window.location.search)}function an(t){var r;let e={};for(let[i,n]of Object.entries(en)){let s=(r=t.get(i))==null?void 0:r.trim();s&&(e[n]=s)}return Object.keys(e).length>0?e:void 0}function cn(t){var r;let e={};for(let i of tn){let n=(r=t.get(i))==null?void 0:r.trim();n&&(e[i]=n)}return Object.keys(e).length>0?e:void 0}function ln(t){switch(t.type){case"pageview":return{type:"pageview",data:{...t.data,path:k(t.data.path)}};case"timespent":return{type:"timespent",data:{...t.data,path:k(t.data.path)}};case"heatmap":return{type:"heatmap",data:{...t.data,path:k(t.data.path)}};case"rageclik":return{type:"rageclik",data:{...t.data,path:k(t.data.path)}};case"uturn":return{type:"uturn",data:{...t.data,fromPath:k(t.data.fromPath),toPath:k(t.data.toPath)}};case"identify":return t;case"revenue":return t;case"goal":return{type:"goal",data:{...t.data,path:k(t.data.path)}};case"journey_step":return{type:"journey_step",data:{...t.data,path:k(t.data.path)}};case"client_context":return t;case"session_replay":return t;default:return t}}var ct=class{constructor(e={}){this.initialized=!1;this.subscribers=new Set;this.queue=[];this.flushTimer=null;this.heartbeatTimer=null;this.userProperties={};this.flags={};this.flagSubscribers=new Set;this.abVariants={};this.abTestSubscribers=new Set;this.handleVisibilityChange=()=>{var e;document.visibilityState==="hidden"&&((e=this.sessionReplay)==null||e.flush(),this.queue.length>0&&this.flushBeacon(),this.sendDeactivate())};this.handlePageHide=()=>{var e;(e=this.sessionReplay)==null||e.flush(),this.queue.length>0&&this.flushBeacon(),this.sendDeactivate()};this.handleNavigate=e=>{};var r;this.cfg={...$i,...e};try{new URL(this.cfg.endpoint)}catch(i){throw new Error(`[alpha-tracker] Invalid endpoint URL: "${this.cfg.endpoint}"`)}this.session={id:(r=e.sessionId)!=null?r:Re(),visitorId:Ut(),startedAt:Date.now(),pageViews:[],timeSpent:{},heatmap:{},userProperties:{},attribution:{firstTouch:Ie(Le),lastTouch:Ie(at)}}}updateAttributionForPageView(e,r){let i=on(),n=an(i),s=cn(i),a=Ie(Le),c=!!(n||s||r)?{landingPage:e,referrer:r,referrerHost:sn(r),utm:n,clickIds:s,capturedAt:Date.now()}:void 0;!a&&c&&Fr(Le,c),c&&Fr(at,c);let l={firstTouch:Ie(Le),lastTouch:Ie(at)};return this.session.attribution=l,l}currentAttribution(){let e={firstTouch:Ie(Le),lastTouch:Ie(at)};return this.session.attribution=e,e}init(){if(typeof window=="undefined"||this.initialized)return this;let e=this.emit.bind(this),{id:r}=this.session;return e({type:"client_context",data:Lr(r)}),this.cfg.trackNavigation&&(this.navigation=new Be({emit:e,sessionId:r}),this.navigation.init()),this.cfg.trackTime&&(this.time=new We({emit:e,sessionId:r}),this.time.init()),this.cfg.trackHeatmap&&(this.heatmap=new _e({emit:e,sessionId:r,sampleRate:this.cfg.mouseSampleRate,maxPoints:this.cfg.maxHeatmapPoints}),this.heatmap.init()),this.cfg.sessionReplay&&(this.sessionReplay=new ot({emit:e,checkoutEveryNms:this.cfg.sessionReplayCheckoutEveryNms,inlineStylesheet:this.cfg.sessionReplayInlineStylesheet,maxEventsPerBatch:this.cfg.sessionReplayMaxEventsPerBatch,flushIntervalMs:this.cfg.sessionReplayFlushIntervalMs,maskAllInputs:this.cfg.sessionReplayMaskAllInputs,maskTextClass:this.cfg.sessionReplayMaskTextClass,blockClass:this.cfg.sessionReplayBlockClass}),this.sessionReplay.start()),this.cfg.endpoint&&(this.flushTimer=setInterval(()=>{this.queue.length>0&&this.flushQueue()},this.cfg.flushInterval),window.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("pagehide",this.handlePageHide),this.heartbeatTimer=setInterval(()=>{document.visibilityState!=="hidden"&&this.sendHeartbeat()},3e4),this.cfg.trackLogs&&(this.logCapture=new Ue({endpoint:this.cfg.endpoint,collectEndpoint:this.collectUrl,sessionId:this.session.id,secretKey:this.cfg.secretKey,appId:this.cfg.appId,compressPayloads:this.cfg.compressPayloads,compressionThresholdBytes:this.cfg.compressionThresholdBytes}),this.logCapture.init())),this.initialized=!0,this.fetchFlags(),this.fetchAbTests(),this}destroy(){var e,r,i,n,s;this.flushTimer!==null&&(clearInterval(this.flushTimer),this.flushTimer=null),this.heartbeatTimer!==null&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),typeof window!="undefined"&&(window.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("pagehide",this.handlePageHide)),(e=this.navigation)==null||e.destroy(),(r=this.time)==null||r.destroy(),(i=this.heatmap)==null||i.destroy(),(n=this.sessionReplay)==null||n.destroy(),this.sessionReplay=void 0,(s=this.logCapture)==null||s.destroy(),typeof window!="undefined"&&window.removeEventListener("tracker:navigate",this.handleNavigate),this.queue.length>0&&this.cfg.endpoint&&this.flushBeacon(),this.initialized=!1}async sendHeartbeat(){if(!this.cfg.endpoint)return;let e=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{},r=JSON.stringify(gt({sessionId:this.session.id,visitorId:this.session.visitorId,path:this.currentPath(),active:!0,appId:this.cfg.appId}));try{await he(this.collectUrl,r,{compressPayloads:this.cfg.compressPayloads,compressionThresholdBytes:this.cfg.compressionThresholdBytes,authHeaders:e,keepalive:!0})}catch(i){}}sendDeactivate(){if(!this.cfg.endpoint)return;let e=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{},r=JSON.stringify(gt({sessionId:this.session.id,visitorId:this.session.visitorId,path:this.currentPath(),active:!1,appId:this.cfg.appId}));yt(this.collectUrl,r,{compressPayloads:this.cfg.compressPayloads,compressionThresholdBytes:this.cfg.compressionThresholdBytes,authHeaders:e})}emit(e){var r,i,n,s;if(e=ln(e),e.type==="pageview"){let a=this.updateAttributionForPageView(e.data.path,e.data.referrer);e={type:"pageview",data:{...e.data,utm:(r=a.lastTouch)==null?void 0:r.utm,attribution:a}}}switch(e.type){case"pageview":this.session.pageViews.push(e.data);break;case"timespent":{let a=(i=this.session.timeSpent[e.data.path])!=null?i:0;this.session.timeSpent[e.data.path]=a+e.data.duration;break}case"heatmap":{let a=e.data.path;this.session.heatmap[a]||(this.session.heatmap[a]=[]);let o=this.session.heatmap[a];o.length<this.cfg.maxHeatmapPoints&&o.push(e.data);break}case"rageclik":case"uturn":case"identify":case"revenue":case"goal":case"journey_step":case"client_context":case"session_replay":break}this.subscribers.forEach(a=>a(e)),(s=(n=this.cfg).onEvent)==null||s.call(n,e),this.cfg.endpoint&&(this.queue.push(e),this.queue.length>=this.cfg.batchSize&&this.flushQueue())}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}trackPageView(e){let r=k(e!=null?e:typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"pageview",data:{path:r,title:typeof document!="undefined"?document.title:"",timestamp:Date.now(),sessionId:this.session.id,referrer:typeof document!="undefined"&&document.referrer||void 0}}),typeof window!="undefined"&&window.dispatchEvent(new CustomEvent("tracker:navigate",{detail:{path:r,title:document.title}}))}trackRevenue(e){var r,i;this.emit({type:"revenue",data:{...e,eventName:(r=e.eventName)!=null?r:"purchase",status:(i=e.status)!=null?i:"paid",sessionId:this.session.id,visitorId:this.session.visitorId,timestamp:Date.now(),attribution:this.currentAttribution()}})}trackGoal(e){let r=k(typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"goal",data:{...e,sessionId:this.session.id,visitorId:this.session.visitorId,path:r,timestamp:Date.now()}})}trackJourneyStep(e){var i;let r=k((i=e.path)!=null?i:typeof window!="undefined"?window.location.pathname+window.location.search:"/");this.emit({type:"journey_step",data:{...e,path:r,sessionId:this.session.id,visitorId:this.session.visitorId,timestamp:Date.now()}})}identify(e){this.userProperties={...this.userProperties,...e},this.session.userProperties={...this.userProperties},this.emit({type:"identify",data:{properties:{...this.userProperties},visitorId:this.session.visitorId,timestamp:Date.now()}}),this.fetchFlags()}getFlags(){return{...this.flags}}isFeatureEnabled(e){return this.flags[e]===!0}onFlagsChange(e){return this.flagSubscribers.add(e),()=>this.flagSubscribers.delete(e)}async fetchFlags(){if(!this.cfg.endpoint||!this.cfg.secretKey)return;let e=Fe(this.cfg.endpoint)+"/feature-flags/evaluate";try{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.cfg.secretKey}`},body:JSON.stringify({userProperties:this.userProperties})});if(!r.ok)return;let i=await r.json();this.flags=i,this.flagSubscribers.forEach(n=>n({...this.flags}))}catch(r){}}getAbVariants(){return{...this.abVariants}}getAbVariant(e){let r=this.abVariants[e];return r!=null?r:null}isAbVariant(e,r){return this.abVariants[e]===r}onAbTestsChange(e){return this.abTestSubscribers.add(e),()=>this.abTestSubscribers.delete(e)}async fetchAbTests(e){if(!this.cfg.endpoint||!this.cfg.secretKey)return;let r=Fe(this.cfg.endpoint)+"/ab-tests/evaluate";try{let i={visitorId:this.session.visitorId};e!=null&&e.length&&(i.keys=e);let n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.cfg.secretKey}`},body:JSON.stringify(i)});if(!n.ok)return;let s=await n.json();this.abVariants=e!=null&&e.length?{...this.abVariants,...s}:{...s},this.abTestSubscribers.forEach(a=>a({...this.abVariants}))}catch(i){}}getSession(){return this.session}getPageViews(){return[...this.session.pageViews]}getTimeSpent(){return{...this.session.timeSpent}}getHeatmapData(e){var r;return e!==void 0?[...(r=this.session.heatmap[e])!=null?r:[]]:Object.entries(this.session.heatmap).reduce((i,[n,s])=>(i[n]=[...s],i),{})}get collectUrl(){var e;return(e=this.cfg.collectEndpoint)!=null?e:De(this.cfg.endpoint)}currentPath(){return k(typeof window!="undefined"?window.location.pathname+window.location.search:"/")}flush(){this.flushQueue()}async flushQueue(){if(this.queue.length===0)return;let e=this.queue.splice(0);await this.sendBatch(e)}flushBeacon(){if(this.queue.length===0)return;let e=this.queue.splice(0),r=JSON.stringify(ft(e,{appId:this.cfg.appId,visitorId:this.session.visitorId,sessionId:this.session.id})),i=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{};yt(this.collectUrl,r,{compressPayloads:this.cfg.compressPayloads,compressionThresholdBytes:this.cfg.compressionThresholdBytes,authHeaders:i})}async sendBatch(e){let r=this.cfg.secretKey?{Authorization:`Bearer ${this.cfg.secretKey}`}:{},i=JSON.stringify(ft(e,{appId:this.cfg.appId,visitorId:this.session.visitorId,sessionId:this.session.id}));await he(this.collectUrl,i,{compressPayloads:this.cfg.compressPayloads,compressionThresholdBytes:this.cfg.compressionThresholdBytes,authHeaders:r})}};var lt=require("react"),Dt=(0,lt.createContext)(null);function ie(){return(0,lt.useContext)(Dt)}var Br=require("react/jsx-runtime");function Dr({config:t={},children:e}){let r=(0,dt.useRef)(null);return r.current===null&&(r.current=new ct(t)),(0,dt.useEffect)(()=>{let i=r.current;return i.init(),()=>i.destroy()},[]),(0,Br.jsx)(Dt.Provider,{value:r.current,children:e})}var V=require("react");function Wr(){return ie()}function _r(t){let e=ie();(0,V.useEffect)(()=>{e&&t!==void 0&&e.trackPageView(t)},[t])}function Ur(t,e=500){let r=ie(),[i,n]=(0,V.useState)([]),s=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{if(!r)return;let a=k(t!=null?t:typeof window!="undefined"?window.location.pathname+window.location.search:"/"),o=()=>{n(r.getHeatmapData(a)),s.current=!1};return o(),r.subscribe(l=>{l.type==="heatmap"&&k(l.data.path)===a&&(s.current||(s.current=!0,setTimeout(o,e)))})},[r,t]),i}function Vr(){let t=ie(),[e,r]=(0,V.useState)([]);return(0,V.useEffect)(()=>t?(r(t.getPageViews()),t.subscribe(n=>{n.type==="pageview"&&r(t.getPageViews())})):void 0,[t]),e}function Gr(){let t=ie();return e=>{t==null||t.trackRevenue(e)}}function Hr(){let t=ie();return e=>{t==null||t.trackGoal(e)}}function Zr(){let t=ie();return e=>{t==null||t.trackJourneyStep(e)}}function Kr(){let t=ie(),[e,r]=(0,V.useState)({});return(0,V.useEffect)(()=>t?(r(t.getTimeSpent()),t.subscribe(n=>{n.type==="timespent"&&r(t.getTimeSpent())})):void 0,[t]),e}function Bt(){let t=ie(),[e,r]=(0,V.useState)(()=>{var i;return(i=t==null?void 0:t.getFlags())!=null?i:{}});return(0,V.useEffect)(()=>{if(!t)return;r(t.getFlags());let i=t.onFlagsChange(r);return t.fetchFlags(),i},[t]),e}function zr(t){return Bt()[t]===!0}function ut(){let t=ie(),[e,r]=(0,V.useState)(()=>{var i;return(i=t==null?void 0:t.getAbVariants())!=null?i:{}});return(0,V.useEffect)(()=>{if(!t)return;r(t.getAbVariants());let i=t.onAbTestsChange(r);return t.fetchAbTests(),i},[t]),e}function Yr(t){let r=ut()[t];return r!=null?r:null}function Jr(t,e){return ut()[t]===e}0&&(module.exports={UserTrackerProvider,useAbTests,useAbVariant,useFeatureFlagEnabled,useFeatureFlags,useHeatmapData,useIsAbVariant,usePageView,usePageViews,useTimeSpent,useTrackGoal,useTrackJourneyStep,useTrackRevenue,useTracker});
|
|
6
6
|
/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
rrweb/es/rrweb/ext/tslib/tslib.es6.js:
|