@launchdarkly/browser-telemetry 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.cjs.js +15 -1
- package/dist/cjs/bundle.cjs.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/BrowserTelemetryImpl.d.ts +2 -0
- package/dist/cjs/src/BrowserTelemetryImpl.d.ts.map +1 -1
- package/dist/cjs/src/api/BrowserTelemetry.d.ts +2 -0
- package/dist/cjs/src/api/BrowserTelemetry.d.ts.map +1 -1
- package/dist/cjs/src/collectors/rrweb/EventBuffer.d.ts +10 -0
- package/dist/cjs/src/collectors/rrweb/EventBuffer.d.ts.map +1 -0
- package/dist/cjs/src/collectors/rrweb/SessionBuffer.d.ts +18 -0
- package/dist/cjs/src/collectors/rrweb/SessionBuffer.d.ts.map +1 -0
- package/dist/cjs/src/collectors/rrweb/SessionReplay.d.ts +15 -0
- package/dist/cjs/src/collectors/rrweb/SessionReplay.d.ts.map +1 -0
- package/dist/cjs/src/collectors/rrweb/patches.d.ts +2 -0
- package/dist/cjs/src/collectors/rrweb/patches.d.ts.map +1 -0
- package/dist/cjs/src/index.d.ts +2 -0
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/esm/bundle.es.js +15 -1
- package/dist/esm/bundle.es.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/BrowserTelemetryImpl.d.ts +2 -0
- package/dist/esm/src/BrowserTelemetryImpl.d.ts.map +1 -1
- package/dist/esm/src/api/BrowserTelemetry.d.ts +2 -0
- package/dist/esm/src/api/BrowserTelemetry.d.ts.map +1 -1
- package/dist/esm/src/collectors/rrweb/EventBuffer.d.ts +10 -0
- package/dist/esm/src/collectors/rrweb/EventBuffer.d.ts.map +1 -0
- package/dist/esm/src/collectors/rrweb/SessionBuffer.d.ts +18 -0
- package/dist/esm/src/collectors/rrweb/SessionBuffer.d.ts.map +1 -0
- package/dist/esm/src/collectors/rrweb/SessionReplay.d.ts +15 -0
- package/dist/esm/src/collectors/rrweb/SessionReplay.d.ts.map +1 -0
- package/dist/esm/src/collectors/rrweb/patches.d.ts +2 -0
- package/dist/esm/src/collectors/rrweb/patches.d.ts.map +1 -0
- package/dist/esm/src/index.d.ts +2 -0
- package/dist/esm/src/index.d.ts.map +1 -1
- package/package.json +7 -3
package/dist/cjs/bundle.cjs.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
"use strict";class e{constructor(){window.addEventListener("click",(e=>{var t;const r=function(e){try{return e.target}catch(e){return}}(e);r&&(null===(t=this.destination)||void 0===t||t.addBreadcrumb({type:"click",target:{id:r.id}}))}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class t{constructor(){window.addEventListener("error",(e=>{var t;null===(t=this.destination)||void 0===t||t.captureErrorEvent(e)}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class r{constructor(r){this.pendingEvents=[],this.breadcrumbs=[],this.inspectorInstances=[],this.collectors=[],this.collectors.push(new t),this.collectors.push(...r.collectors),this.maxPendingEvents=r.maxPendingEvents,this.maxBreadcrumbs=r.breadcrumbs.maxBreadcrumbs,r.breadcrumbs.click&&this.collectors.push(new e),this.collectors.forEach((e=>e.register(this)));const s=[];!function(e,t,r){e.breadcrumbs.evaluations&&t.push({type:"flag-used",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t,s){r.addBreadcrumb({type:"flag-evaluated",flagKey:e,value:t.value,timestamp:(new Date).getTime()})}}),e.breadcrumbs.flagChange&&t.push({type:"flag-detail-changed",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t){r.addBreadcrumb({type:"flag-detail-changed",flagKey:e,detail:t})}})}(r,s,this),this.inspectorInstances.push(...s)}register(e){this.client=e}inspectors(){return this.inspectorInstances}capture(e){var t;void 0===this.client&&(this.pendingEvents.push(e),this.pendingEvents.length>this.maxPendingEvents&&this.pendingEvents.shift()),null===(t=this.client)||void 0===t||t.track("$ld:telemetry",e)}captureError(e){this.capture({type:"exception",message:e.message,name:e.name,stack:e.stack,breadcrumbs:[...this.breadcrumbs]})}captureErrorEvent(e){this.captureError(e.error)}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}close(){this.collectors.forEach((e=>e.unregister()))}}function s(e,t){return null!=e?e:t}exports.initializeTelemetry=function(e){const t=function(e){var t,r,a,n;const i={breadcrumbs:{maxBreadcrumbs:50,evaluations:!0,flagChange:!0,click:!0},maxPendingEvents:100,collectors:[]};return{breadcrumbs:{maxBreadcrumbs:s(null===(t=e.breadcrumbs)||void 0===t?void 0:t.maxBreadcrumbs,i.breadcrumbs.maxBreadcrumbs),evaluations:s(null===(r=e.breadcrumbs)||void 0===r?void 0:r.evaluations,i.breadcrumbs.evaluations),flagChange:s(null===(a=e.breadcrumbs)||void 0===a?void 0:a.flagChange,i.breadcrumbs.flagChange),click:s(null===(n=e.breadcrumbs)||void 0===n?void 0:n.click,i.breadcrumbs.click)},maxPendingEvents:s(e.maxPendingEvents,i.maxPendingEvents),collectors:[...s(e.collectors,i.collectors)]}}(e||{});return new r(t)};
|
|
1
|
+
"use strict";class e{constructor(){window.addEventListener("click",(e=>{var t;const n=function(e){try{return e.target}catch(e){return}}(e);n&&(null===(t=this.destination)||void 0===t||t.addBreadcrumb({type:"click",target:{id:n.id}}))}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class t{constructor(){window.addEventListener("error",(e=>{var t;null===(t=this.destination)||void 0===t||t.captureErrorEvent(e)}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class n{constructor(n){this.pendingEvents=[],this.breadcrumbs=[],this.inspectorInstances=[],this.collectors=[],this.collectors.push(new t),this.collectors.push(...n.collectors),this.maxPendingEvents=n.maxPendingEvents,this.maxBreadcrumbs=n.breadcrumbs.maxBreadcrumbs,n.breadcrumbs.click&&this.collectors.push(new e),this.collectors.forEach((e=>e.register(this)));const r=[];!function(e,t,n){e.breadcrumbs.evaluations&&t.push({type:"flag-used",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t,r){n.addBreadcrumb({type:"flag-evaluated",flagKey:e,value:t.value,timestamp:(new Date).getTime()})}}),e.breadcrumbs.flagChange&&t.push({type:"flag-detail-changed",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t){n.addBreadcrumb({type:"flag-detail-changed",flagKey:e,detail:t})}})}(n,r,this),this.inspectorInstances.push(...r)}register(e){this.client=e}inspectors(){return this.inspectorInstances}capture(e,t){var n;void 0===this.client&&(this.pendingEvents.push(e),this.pendingEvents.length>this.maxPendingEvents&&this.pendingEvents.shift()),null===(n=this.client)||void 0===n||n.track(`$ld:telemetry:${t}`,e)}captureError(e){this.capture({message:e.message,name:e.name,stack:e.stack,breadcrumbs:[...this.breadcrumbs]},"error")}captureErrorEvent(e){this.captureError(e.error)}captureSession(e){this.capture(Object.assign(Object.assign({},e),{breadcrumbs:[...this.breadcrumbs]}),"sessionCapture")}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}close(){this.collectors.forEach((e=>e.unregister()))}}var r;function o(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function i(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(a).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function a(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=i(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(r||(r={}));var c=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function l(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(i=s?s(i):"*".repeat(i.length)),i}var d="__rrweb_original__";var u,h,p=1,g=new RegExp("[^a-z0-9-_:]"),m=-2;function I(){return p++}var C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,f=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,y=/^(data:)([^,]*),(.*)/i;function b(e,t){return(e||"").replace(C,(function(e,n,r,o,s,i){var a,c=r||s||i,l=n||o||"";if(!c)return e;if(!f.test(c))return"url(".concat(l).concat(c).concat(l,")");if(y.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var d=t.split("/"),u=c.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(l).concat(d.join("/")).concat(l,")")}))}var v=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function A(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function k(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function w(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?A(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(S),!(n>=t.length);){var s=r(v);if(","===s.slice(-1))s=A(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=A(e,s);for(var a=!1;;){var c=t.charAt(n);if(""===c){o.push((s+i).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,o.push((s+i).trim());break}"("===c&&(a=!0)}i+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?b(r,w()):"object"===t&&"data"===n&&r?A(e,r):r:A(e,r)}function T(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&T(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&T(e.parentNode,t,n)}function R(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(T(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function N(e,t){var n=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,c=t.maskTextClass,p=t.maskTextSelector,m=t.inlineStylesheet,I=t.maskInputOptions,C=void 0===I?{}:I,f=t.maskTextFn,y=t.maskInputFn,v=t.dataURLOptions,S=void 0===v?{}:v,A=t.inlineImages,T=t.recordCanvas,N=t.keepIframeSrcFn,E=t.newlyAddedElement,O=void 0!==E&&E,x=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:r.Document,childNodes:[],compatMode:e.compatMode}:{type:r.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:r.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,o=t.blockClass,s=t.blockSelector,a=t.inlineStylesheet,c=t.maskInputOptions,p=void 0===c?{}:c,m=t.maskInputFn,I=t.dataURLOptions,C=void 0===I?{}:I,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,S=t.newlyAddedElement,A=void 0!==S&&S,T=t.rootId,R=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(e,o,s),N=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}(e),E={},O=e.attributes.length,x=0;x<O;x++){var F=e.attributes[x];E[F.name]=M(n,N,F.name,F.value)}if("link"===N&&a){var L=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),D=null;L&&(D=i(L)),D&&(delete E.rel,delete E.href,E._cssText=b(D,L.href))}if("style"===N&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=i(e.sheet))&&(E._cssText=b(D,w()))}if("input"===N||"textarea"===N||"select"===N){var B=e.value,W=e.checked;"radio"!==E.type&&"checkbox"!==E.type&&"submit"!==E.type&&"button"!==E.type&&B?E.value=l({type:E.type,tagName:N,value:B,maskInputOptions:p,maskInputFn:m}):W&&(E.checked=W)}"option"===N&&(e.selected&&!p.select?E.selected=!0:delete E.selected);if("canvas"===N&&y)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,s=d in o?o[d]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(E.rr_dataURL=e.toDataURL(C.type,C.quality));else if(!("__context"in e)){var Z=e.toDataURL(C.type,C.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,Z!==G.toDataURL(C.type,C.quality)&&(E.rr_dataURL=Z)}if("img"===N&&f){u||(u=n.createElement("canvas"),h=u.getContext("2d"));var V=e,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{u.width=V.naturalWidth,u.height=V.naturalHeight,h.drawImage(V,0,0),E.rr_dataURL=u.toDataURL(C.type,C.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?E.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==N&&"video"!==N||(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime);A||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop));if(R){var Y=e.getBoundingClientRect(),_=Y.width,z=Y.height;E={class:E.class,rr_width:"".concat(_,"px"),rr_height:"".concat(z,"px")}}"iframe"!==N||v(E.src)||(e.contentDocument||(E.rr_src=E.src),delete E.src);return{type:r.Element,tagName:N,attributes:E,childNodes:[],isSVG:k(e)||void 0,needBlock:R,rootId:T}}(e,{doc:n,blockClass:s,blockSelector:a,inlineStylesheet:m,maskInputOptions:C,maskInputFn:y,dataURLOptions:S,inlineImages:A,recordCanvas:T,keepIframeSrcFn:N,newlyAddedElement:O,rootId:x});case e.TEXT_NODE:return function(e,t){var n,o=t.maskTextClass,s=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,d="STYLE"===c||void 0,u="SCRIPT"===c||void 0;if(d&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=b(l,w())}var h;u&&(l="SCRIPT_PLACEHOLDER");!d&&!u&&l&&R(e,o,s)&&(l=i?i(l):l.replace(/[\S]/g,"*"));return{type:r.Text,textContent:l||"",isStyle:d,rootId:a}}(e,{maskTextClass:c,maskTextSelector:p,maskTextFn:f,rootId:x});case e.CDATA_SECTION_NODE:return{type:r.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:r.Comment,textContent:e.textContent||"",rootId:x};default:return!1}}function E(e){return void 0===e?"":e.toLowerCase()}function O(e,t){var n,i=t.doc,a=t.mirror,c=t.blockClass,l=t.blockSelector,d=t.maskTextClass,u=t.maskTextSelector,h=t.skipChild,p=void 0!==h&&h,g=t.inlineStylesheet,C=void 0===g||g,f=t.maskInputOptions,y=void 0===f?{}:f,b=t.maskTextFn,v=t.maskInputFn,S=t.slimDOMOptions,A=t.dataURLOptions,k=void 0===A?{}:A,w=t.inlineImages,M=void 0!==w&&w,T=t.recordCanvas,R=void 0!==T&&T,x=t.onSerialize,F=t.onIframeLoad,L=t.iframeLoadTimeout,D=void 0===L?5e3:L,B=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,Z=void 0===W?5e3:W,G=t.keepIframeSrcFn,V=void 0===G?function(){return!1}:G,U=t.newlyAddedElement,K=void 0!==U&&U,Y=t.preserveWhiteSpace,_=void 0===Y||Y,z=N(e,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,dataURLOptions:k,inlineImages:M,recordCanvas:R,keepIframeSrcFn:V,newlyAddedElement:K});if(!z)return console.warn(e,"not serialized"),null;n=a.hasNode(e)?a.getId(e):!function(e,t){if(t.comment&&e.type===r.Comment)return!0;if(e.type===r.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(E(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===E(e.attributes.name)||"icon"===E(e.attributes.rel)||"apple-touch-icon"===E(e.attributes.rel)||"shortcut icon"===E(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&E(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(E(e.attributes.property).match(/^(og|twitter|fb):/)||E(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===E(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===E(e.attributes.name)||"googlebot"===E(e.attributes.name)||"bingbot"===E(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===E(e.attributes.name)||"generator"===E(e.attributes.name)||"framework"===E(e.attributes.name)||"publisher"===E(e.attributes.name)||"progid"===E(e.attributes.name)||E(e.attributes.property).match(/^article:/)||E(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===E(e.attributes.name)||"yandex-verification"===E(e.attributes.name)||"csrf-token"===E(e.attributes.name)||"p:domain_verify"===E(e.attributes.name)||"verify-v1"===E(e.attributes.name)||"verification"===E(e.attributes.name)||"shopify-checkout-api-token"===E(e.attributes.name)))return!0}}return!1}(z,S)&&(_||z.type!==r.Text||z.isStyle||z.textContent.replace(/^\s+|\s+$/gm,"").length)?I():m;var P=Object.assign(z,{id:n});if(a.add(e,P),n===m)return null;x&&x(e);var J=!p;if(P.type===r.Element){J=J&&!P.needBlock,delete P.needBlock;var Q=e.shadowRoot;Q&&s(Q)&&(P.isShadowHost=!0)}if((P.type===r.Document||P.type===r.Element)&&J){S.headWhitespace&&P.type===r.Element&&"head"===P.tagName&&(_=!1);for(var H={doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:p,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:R,preserveWhiteSpace:_,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V},X=0,j=Array.from(e.childNodes);X<j.length;X++){(ee=O(j[X],H))&&P.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var q=0,$=Array.from(e.shadowRoot.childNodes);q<$.length;q++){var ee;(ee=O($[q],H))&&(s(e.shadowRoot)&&(ee.isShadow=!0),P.childNodes.push(ee))}}return e.parentNode&&o(e.parentNode)&&s(e.parentNode)&&(P.isShadow=!0),P.type===r.Element&&"iframe"===P.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((function(){s||(t(),s=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&F){var n=O(t,{doc:t,mirror:a,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:R,preserveWhiteSpace:_,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});n&&F(e,n)}}),D),P.type===r.Element&&"link"===P.tagName&&"stylesheet"===P.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}(e,(function(){if(B){var t=O(e,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:R,preserveWhiteSpace:_,onSerialize:x,onIframeLoad:F,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});t&&B(e,t)}}),Z),P}function x(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const F="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let L={map:{},getId:()=>(console.error(F),-1),getNode:()=>(console.error(F),null),removeNodeFromMap(){console.error(F)},has:()=>(console.error(F),!1),reset(){console.error(F)}};function D(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=i,e.apply(c,s)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,s)}),a))}}function B(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>B(e,t,s||{},!0)}function W(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function G(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(T(o,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function U(e,t){return t.getId(e)===m}function K(e,t){if(o(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Y(e){return Boolean(e.changedTouches)}function _(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function z(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function P(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(L=new Proxy(L,{get:(e,t,n)=>("map"===t&&console.error(F),Reflect.get(e,t,n))}));class J{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 Q=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Q||{}),H=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(H||{}),X=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(X||{}),j=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(j||{});function q(e){return"__ln"in e}class ${constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&q(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&q(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const ee=(e,t)=>`${e}@${t}`;class te{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;const e=[],t=new $,n=e=>{let t=e,n=m;for(;n===m;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var s,i,a,c;let l=null;(null===(i=null===(s=r.getRootNode)||void 0===s?void 0:s.call(r))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(l=r.getRootNode().host);let d=l;for(;(null===(c=null===(a=null==d?void 0:d.getRootNode)||void 0===a?void 0:a.call(d))||void 0===c?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(r)||d&&this.doc.contains(d));if(!r.parentNode||u)return;const h=o(r.parentNode)?this.mirror.getId(l):this.mirror.getId(r.parentNode),p=n(r);if(-1===h||-1===p)return t.addNode(r);const g=O(r,{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:e=>{_(e,this.mirror)&&this.iframeManager.addIframe(e),z(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),P(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:h,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))re(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))se(this.droppedSet,e)||re(this.removes,e,this.mirror)?se(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),r=n(s.value);-1!==t&&-1!==r&&(e=s)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),r(e.value)}const i={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!U(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;V(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:R(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=l({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),V(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const o=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(o[e]=""===s?r:[r,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else r.attributes[e.attributeName]=M(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(V(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=o(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);V(e.target,this.blockClass,this.blockSelector,!1)||U(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ne(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ee(n,r)]?ne(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!o(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(U(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ee(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);V(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}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 ne(e,t){e.delete(t),t.childNodes.forEach((t=>ne(e,t)))}function re(e,t,n){return 0!==e.length&&oe(e,t,n)}function oe(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some((e=>e.id===o))||oe(e,r,n)}function se(e,t){return 0!==e.size&&ie(e,t)}function ie(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||ie(e,n))}const ae=[],ce="undefined"!=typeof CSSGroupingRule,le="undefined"!=typeof CSSMediaRule,de="undefined"!=typeof CSSSupportsRule,ue="undefined"!=typeof CSSConditionRule;function he(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function pe(e,t){var n,r;const o=new te;ae.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function ge({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(X).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((s=>{const i=s.toLowerCase(),c=(t=>s=>{const i=he(s);if(V(i,r,o,!0))return;const a=Y(s)?s.changedTouches[0]:s;if(!a)return;const c=n.getId(i),{clientX:l,clientY:d}=a;e({type:X[t],id:c,x:l,y:d})})(s);a.push(x(i,c,t))})),()=>{a.forEach((e=>e()))}}function me({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){return x("scroll",D((s=>{const i=he(s);if(!i||V(i,r,o,!0))return;const a=n.getId(i);if(i===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),s.scroll||100),t)}function Ie(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ce=["INPUT","TEXTAREA","SELECT"],fe=new WeakMap;function ye(e){return function(e,t){if(ce&&e.parentRule instanceof CSSGroupingRule||le&&e.parentRule instanceof CSSMediaRule||de&&e.parentRule instanceof CSSSupportsRule||ue&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function be(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ve({mirror:e,stylesheetManager:t},n){var r,o,s;let i=null;i="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(s=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function Se(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=pe(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const c=D((t=>{const n=Date.now()-i;e(a.map((e=>(e.timeOffset-=n,e))),t),a=[],i=null}),s),l=D((e=>{const t=he(e),{clientX:n,clientY:o}=Y(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?H.Drag:e instanceof MouseEvent?H.MouseMove:H.TouchMove)}),o,{trailing:!1}),d=[x("mousemove",l,n),x("touchmove",l,n),x("drag",l,n)];return()=>{d.forEach((e=>e()))}}(e),s=ge(e),i=me(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return x("resize",D((()=>{const r=Z(),o=G();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)}),200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:c,userTriggeredOnInput:d}){function u(e){let n=he(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Ce.indexOf(n.tagName)<0||V(n,r,o,!0))return;const u=n.type;if(n.classList.contains(s))return;let p=n.value,g=!1;"radio"===u||"checkbox"===u?g=n.checked:(i[n.tagName.toLowerCase()]||i[u])&&(p=l({maskInputOptions:i,tagName:n.tagName,type:u,value:p,maskInputFn:a})),h(n,Ie({text:p,isChecked:g,userTriggered:c},d));const m=n.name;"radio"===u&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==n&&h(e,Ie({text:e.value,isChecked:!g,userTriggered:!1},d))}))}function h(t,r){const o=fe.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){fe.set(t,r);const o=n.getId(t);e(Object.assign(Object.assign({},r),{id:o}))}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>x(e,u,t))),g=t.defaultView;if(!g)return()=>{p.forEach((e=>e()))};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),I=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...I.map((e=>B(e[0],e[1],{set(){u({target:this})}},!1,g)))),()=>{p.forEach((e=>e()))}}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const s=s=>D((o=>{const i=he(o);if(!i||V(i,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:d}=i;e({type:s,id:r.getId(i),currentTime:a,volume:c,muted:l,playbackRate:d})}),o.media||500),i=[x("play",s(0)),x("pause",s(1)),x("seeked",s(2)),x("volumechange",s(3)),x("ratechange",s(4))];return()=>{i.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,s){const{id:i,styleId:a}=be(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:s}]}),o.apply(this,[r,s])};const s=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:o,styleId:i}=be(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:r}]}),s.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:o,styleId:s}=be(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:o,styleId:s}=be(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:r}),a.apply(this,[r])});const c={};ce?c.CSSGroupingRule=r.CSSGroupingRule:(le&&(c.CSSMediaRule=r.CSSMediaRule),ue&&(c.CSSConditionRule=r.CSSConditionRule),de&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=be(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...ye(this),s||0]}]}),l[r].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=be(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...ye(this),o]}]}),l[r].deleteRule.apply(this,[o])}})),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}}(e,{win:n}),h=ve(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var c;if(n.has(o))return s.apply(this,[o,i,a]);const{id:l,styleId:d}=be(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,set:{property:o,value:i,priority:a},index:ye(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(n.has(o))return i.apply(this,[o]);const{id:a,styleId:c}=be(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,remove:{property:o},index:ye(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),g=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=W(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=s})),r.push(i),()=>{r.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:c,endContainer:l,endOffset:d}=s;V(i,r,o,!0)||V(l,r,o,!0)||a.push({start:n.getId(i),startOffset:c,end:n.getId(l),endOffset:d})}s({ranges:a})};return a(),x("selectionchange",a)}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,n,t.options));return()=>{ae.forEach((e=>e.reset())),r.disconnect(),o(),s(),i(),a(),c(),d(),u(),h(),p(),g(),m(),I.forEach((e=>e()))}}class Ae{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ke{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ae(I),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ae(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,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.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("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Q.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Q.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return t;case Q.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Q.IncrementalSnapshot:switch(t.data.source){case H.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.Drag:case H.TouchMove:case H.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(t.data,e,["id"]),t;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case H.Font:return t;case H.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case H.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class we{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(W(Element.prototype,"attachShadow",(function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),pe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),me(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)),ve({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(W(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(r){const o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function Me(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))}for(var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Re="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ne=0;Ne<64;Ne++)Re[Te.charCodeAt(Ne)]=Ne;const Ee=new Map;const Oe=(e,t,n)=>{if(!e||!Le(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ee.get(e);return n||(n=new Map,Ee.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function xe(e,t,n){if(e instanceof Array)return e.map((e=>xe(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Te[n[t]>>2],o+=Te[(3&n[t])<<4|n[t+1]>>4],o+=Te[(15&n[t+1])<<2|n[t+2]>>6],o+=Te[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[xe(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[xe(e.data,t,n),e.width,e.height]}}if(Le(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Oe(e,t,n)}}return e}const Fe=(e,t,n)=>[...e].map((e=>xe(e,t,n))),Le=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function De(e,t,n){const r=[];try{const o=W(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r,...o){return V(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}}));r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function Be(e,t,n,r,o,s,i){const a=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=W(e,s,(function(e){return function(...a){const c=e.apply(this,a);if(Oe(c,i,this),!V(this.canvas,r,o,!0)){const e=Fe([...a],i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const o=B(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var We=null;try{var Ze="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");We=Ze.Worker}catch(e){}function Ge(e,t,n){var r=void 0===t?null:t,o=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),s=o.indexOf("\n",10)+1,i=o.substring(s)+(r?"//# sourceMappingURL="+r:"");return function(e){return new We(i,Object.assign({},e,{eval:!0}))}}function Ve(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),s=o.indexOf("\n",10)+1,i=o.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var Ue="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ke,Ye,_e,ze=(Ke="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ye=null,_e=!1,Ue?Ge(Ke,Ye,_e):function(e,t,n){var r;return function(o){return r=r||Ve(e,t,n),new Worker(r,o)}}(Ke,Ye,_e));class Pe{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const s=De(t,n,r),i=new Map,a=new ze;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:j["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{V(t,n,r,!0)||e.push(t)})),e})().forEach((e=>Me(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))))),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=De(e,t,n),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=W(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(...s){return V(this.canvas,n,r,!0)||setTimeout((()=>{const n=Fe([...s],t,this);e(this.canvas,{type:j["2D"],property:i,args:n})}),0),o.apply(this,s)}}));o.push(s)}catch(n){const r=B(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:j["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r,o){const s=[];return s.push(...Be(t.WebGLRenderingContext.prototype,j.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Be(t.WebGL2RenderingContext.prototype,j.WebGL2,e,n,r,0,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Je{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new J,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map(((e,t)=>({rule:a(e),index:t})))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Qe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let He,Xe,je,qe=!1;const $e=new c;function et(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:I,packFn:C,sampling:f={},dataURLOptions:y={},mousemoveWait:b,recordCanvas:v=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:w=!1,plugins:M,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:R=new Set([])}=e,N=!S||window.parent===window;let E=!1;if(!N)try{window.parent.document,E=!1}catch(e){E=!0}if(N&&!t)throw new Error("emit function is required");void 0!==b&&void 0===f.mousemove&&(f.mousemove=b),$e.reset();const F=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let D;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const W=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return C&&(e=C(e)),e};He=(e,o)=>{var s;if(!(null===(s=ae[0])||void 0===s?void 0:s.isFrozen())||e.type===Q.FullSnapshot||e.type===Q.IncrementalSnapshot&&e.data.source===H.Mutation||ae.forEach((e=>e.unfreeze())),N)null==t||t(W(e),o);else if(E){const t={type:"rrweb",event:W(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===Q.FullSnapshot)D=e,B=0;else if(e.type===Q.IncrementalSnapshot){if(e.data.source===H.Mutation&&e.data.isAttachIframe)return;B++;const t=r&&B>=r,o=n&&e.timestamp-D.timestamp>n;(t||o)&&Xe(!0)}};const V=e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Mutation},e)}))},U=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Scroll},e)})),K=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.CanvasMutation},e)})),Y=new Je({mutationCb:V,adoptedStyleSheetCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.AdoptedStyleSheet},e)}))}),J=new ke({mirror:$e,mutationCb:V,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:He});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:$e,crossOriginIframeMirror:J.crossOriginIframeMirror,crossOriginIframeStyleMirror:J.crossOriginIframeStyleMirror});je=new Pe({recordCanvas:v,mutationCb:K,win:window,blockClass:o,blockSelector:s,mirror:$e,sampling:f.canvas,dataURLOptions:y});const X=new we({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:F,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:v,inlineImages:w,sampling:f,slimDOMOptions:L,iframeManager:J,stylesheetManager:Y,canvasManager:je,keepIframeSrcFn:T},mirror:$e});Xe=(e=!1)=>{var t,n,r,i,u,h;He(Qe({type:Q.Meta,data:{href:window.location.href,width:G(),height:Z()}}),e),Y.reset(),ae.forEach((e=>e.lock()));const p=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new c:r,s=n.blockClass,i=void 0===s?"rr-block":s,a=n.blockSelector,l=void 0===a?null:a,d=n.maskTextClass,u=void 0===d?"rr-mask":d,h=n.maskTextSelector,p=void 0===h?null:h,g=n.inlineStylesheet,m=void 0===g||g,I=n.inlineImages,C=void 0!==I&&I,f=n.recordCanvas,y=void 0!==f&&f,b=n.maskAllInputs,v=void 0!==b&&b,S=n.maskTextFn,A=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,M=n.dataURLOptions,T=n.preserveWhiteSpace,R=n.onSerialize,N=n.onIframeLoad,E=n.iframeLoadTimeout,x=n.onStylesheetLoad,F=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return O(e,{doc:e,mirror:o,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:C,recordCanvas:y,preserveWhiteSpace:T,onSerialize:R,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:F,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:$e,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskAllInputs:F,maskTextFn:m,slimDOM:L,dataURLOptions:y,recordCanvas:v,inlineImages:w,onSerialize:e=>{_(e,$e)&&J.addIframe(e),z(e,$e)&&Y.trackLinkElement(e),P(e)&&X.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{J.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");He(Qe({type:Q.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),ae.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,$e.getId(document))};try{const e=[];e.push(x("DOMContentLoaded",(()=>{He(Qe({type:Q.DomContentLoaded,data:{}}))})));const t=e=>{var t;return Se({mutationCb:V,mousemoveCb:(e,t)=>He(Qe({type:Q.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MouseInteraction},e)})),scrollCb:U,viewportResizeCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.ViewportResize},e)})),inputCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Input},e)})),mediaInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MediaInteraction},e)})),styleSheetRuleCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleSheetRule},e)})),styleDeclarationCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleDeclaration},e)})),canvasMutationCb:K,fontCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Font},e)})),selectionCb:e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:F,inlineStylesheet:d,sampling:f,recordCanvas:v,inlineImages:w,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:T,blockSelector:s,slimDOMOptions:L,dataURLOptions:y,mirror:$e,iframeManager:J,stylesheetManager:Y,shadowDomManager:X,canvasManager:je,ignoreCSSAttributes:R,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>He(Qe({type:Q.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},I)};J.addLoadListener((n=>{e.push(t(n.contentDocument))}));const n=()=>{Xe(),e.push(t(document)),qe=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(x("load",(()=>{He(Qe({type:Q.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e())),qe=!1}}catch(e){console.warn(e)}}et.addCustomEvent=(e,t)=>{if(!qe)throw new Error("please add custom event after start recording");He(Qe({type:Q.Custom,data:{tag:e,payload:t}}))},et.freezePage=()=>{ae.forEach((e=>e.freeze()))},et.takeFullSnapshot=e=>{if(!qe)throw new Error("please take full snapshot after start recording");Xe(e)},et.mirror=$e;const tt=`session-id/${crypto.randomUUID()}`;class nt extends XMLHttpRequest{constructor(){super(...arguments),this.tagsHeaderSet=!1,this.isLikelyLdSdk=!1}setRequestHeader(e,t){"x-launchdarkly-user-agent"===e.toLowerCase()&&(this.isLikelyLdSdk=!0);const n="x-launchdarkly-tags"===e,r=n?`${t} ${tt}`:t;super.setRequestHeader(e,r),n&&(this.tagsHeaderSet=!0)}send(e){!this.tagsHeaderSet&&this.isLikelyLdSdk&&super.setRequestHeader("x-launchdarkly-tags",tt),super.send(e)}}class rt{constructor(e){this.content=[],this.size=e}push(e){this.content.length<this.size&&this.content.push(e)}hasSpace(){return this.content.length<this.size}isPopulated(){return 0!==this.content.length}clear(){this.content=[]}}class ot{constructor(e,t){this.buffers=[],this.writePointer=0,this.headPointer=0;for(let n=0;n<t;n+=1)this.buffers.push(new rt(e))}push(e){const t=this.buffers[this.writePointer];if(!t.hasSpace())return this.writePointer<this.buffers.length-1?this.writePointer+=1:this.writePointer=0,this.buffers[this.writePointer].clear(),this.writePointer===this.headPointer&&(this.headPointer+=1,this.headPointer>=this.buffers.length-1&&(this.headPointer=0)),void this.push(e);t.push(e)}toArray(){const e=[],t=this.buffers.reduce(((e,t)=>t.isPopulated()?e+1:e),0);for(let n=this.headPointer;n<this.headPointer+t;n+=1){const t=n%this.buffers.length;e.push(...this.buffers[t].content)}return e}}function st(e,t){return null!=e?e:t}exports.SessionReplay=class{constructor(e,t){window.XMLHttpRequest=nt,this.buffer=new ot(e,t);const{buffer:n}=this;et({checkoutEveryNth:e,emit(e){n.push(e)}})}register(e){this.telemetry=e}unregister(){this.telemetry=void 0}capture(){var e;null===(e=this.telemetry)||void 0===e||e.captureSession({id:crypto.randomUUID(),events:this.buffer.toArray()})}},exports.initializeTelemetry=function(e){const t=function(e){var t,n,r,o;const s={breadcrumbs:{maxBreadcrumbs:50,evaluations:!0,flagChange:!0,click:!0},maxPendingEvents:100,collectors:[]};return{breadcrumbs:{maxBreadcrumbs:st(null===(t=e.breadcrumbs)||void 0===t?void 0:t.maxBreadcrumbs,s.breadcrumbs.maxBreadcrumbs),evaluations:st(null===(n=e.breadcrumbs)||void 0===n?void 0:n.evaluations,s.breadcrumbs.evaluations),flagChange:st(null===(r=e.breadcrumbs)||void 0===r?void 0:r.flagChange,s.breadcrumbs.flagChange),click:st(null===(o=e.breadcrumbs)||void 0===o?void 0:o.click,s.breadcrumbs.click)},maxPendingEvents:st(e.maxPendingEvents,s.maxPendingEvents),collectors:[...st(e.collectors,s.collectors)]}}(e||{});return new n(t)};
|
|
2
16
|
//# sourceMappingURL=bundle.cjs.js.map
|