posthog-js 1.138.0 → 1.138.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/array.full.js +2 -2
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +1 -1
- package/dist/es.js.map +1 -1
- package/dist/lib/src/extensions/replay/rrweb-plugins/patch.d.ts +3 -0
- package/dist/lib/src/extensions/sentry-integration.d.ts +22 -2
- package/dist/lib/src/extensions/surveys/surveys-utils.d.ts +2 -0
- package/dist/lib/src/extensions/tracing-headers.d.ts +10 -0
- package/dist/lib/src/loader-recorder.d.ts +0 -3
- package/dist/lib/src/loader-tracing-headers.d.ts +1 -0
- package/dist/lib/src/posthog-core.d.ts +2 -1
- package/dist/lib/src/posthog-surveys-types.d.ts +2 -0
- package/dist/lib/src/types.d.ts +5 -0
- package/dist/module.d.ts +29 -2
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/surveys-module-previews.js +1 -1
- package/dist/surveys-module-previews.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/dist/tracing-headers.js +2 -0
- package/dist/tracing-headers.js.map +1 -0
- package/lib/package.json +2 -2
- package/lib/src/extensions/replay/rrweb-plugins/patch.d.ts +3 -0
- package/lib/src/extensions/replay/rrweb-plugins/patch.js +39 -0
- package/lib/src/extensions/replay/rrweb-plugins/patch.js.map +1 -0
- package/lib/src/extensions/sentry-integration.d.ts +22 -2
- package/lib/src/extensions/sentry-integration.js +55 -39
- package/lib/src/extensions/sentry-integration.js.map +1 -1
- package/lib/src/extensions/surveys/surveys-utils.d.ts +2 -0
- package/lib/src/extensions/surveys/surveys-utils.jsx +37 -3
- package/lib/src/extensions/surveys/surveys-utils.jsx.map +1 -1
- package/lib/src/extensions/surveys.jsx +5 -20
- package/lib/src/extensions/surveys.jsx.map +1 -1
- package/lib/src/extensions/tracing-headers.d.ts +10 -0
- package/lib/src/extensions/tracing-headers.js +51 -0
- package/lib/src/extensions/tracing-headers.js.map +1 -0
- package/lib/src/loader-recorder.d.ts +0 -3
- package/lib/src/loader-recorder.js +2 -42
- package/lib/src/loader-recorder.js.map +1 -1
- package/lib/src/loader-tracing-headers.d.ts +1 -0
- package/lib/src/loader-tracing-headers.js +87 -0
- package/lib/src/loader-tracing-headers.js.map +1 -0
- package/lib/src/posthog-core.d.ts +2 -1
- package/lib/src/posthog-core.js +5 -1
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-surveys-types.d.ts +2 -0
- package/lib/src/posthog-surveys-types.js.map +1 -1
- package/lib/src/types.d.ts +5 -0
- package/lib/src/types.js.map +1 -1
- package/package.json +2 -2
package/dist/recorder-v2.js
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
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})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),It=function(){function e(t){s(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return c(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},o=[],a=g(e);try{for(a.s();!(n=a.n()).done;){var i=n.value,s=void 0;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(function(e,t){return{rule:C(e),index:t}}))})),r.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){s(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return c(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var St=!1,At=new b;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.ignoreSelector,d=void 0===l?null:l,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,m=void 0===h?null:h,v=e.inlineStylesheet,y=void 0===v||v,I=e.maskAllInputs,C=e.maskInputOptions,S=e.slimDOMOptions,A=e.maskInputFn,w=e.maskTextFn,k=e.hooks,M=e.packFn,T=e.sampling,O=void 0===T?{}:T,N=e.dataURLOptions,E=void 0===N?{}:N,R=e.mousemoveWait,x=e.recordDOM,L=void 0===x||x,F=e.recordCanvas,D=void 0!==F&&F,B=e.recordCrossOriginIframes,W=void 0!==B&&B,G=e.recordAfter,V=void 0===G?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":G,Z=e.userTriggeredOnInput,U=void 0!==Z&&Z,K=e.collectFonts,_=void 0!==K&&K,j=e.inlineImages,P=void 0!==j&&j,H=e.plugins,Y=e.keepIframeSrcFn,q=void 0===Y?function(){return!1}:Y,Q=e.ignoreCSSAttributes,X=void 0===Q?new Set([]):Q;Le(e.errorHandler);var $=!W||window.parent===window,ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if($&&!t)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R),At.reset();var te,ne=!0===I?{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!==C?C:{password:!0},ie=!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===S,headMetaDescKeywords:"all"===S}:S||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var se=0,ue=function(e){var t,n=g(H||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return M&&!ee&&(e=M(e)),e};ht=function(e,o){var a;if(!(null===(a=Be[0])||void 0===a?void 0:a.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===Ie.Mutation||Be.forEach((function(e){return e.unfreeze()})),$)null==t||t(ue(e),o);else if(ee){var i={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===Ie.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&>(!0)}};var ce,le=function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Mutation},e)}))},he=function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Scroll},e)}))},ge=function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.CanvasMutation},e)}))},me=new It({mutationCb:le,adoptedStyleSheetCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.AdoptedStyleSheet},e)}))}}),ve=new ze({mirror:At,mutationCb:le,stylesheetManager:me,recordCrossOriginIframes:W,wrappedEmit:ht}),Ce=g(H||[]);try{for(Ce.s();!(ce=Ce.n()).done;){var be=ce.value;be.getMirror&&be.getMirror({nodeMirror:At,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror})}}catch(e){Ce.e(e)}finally{Ce.f()}var Se=new Ct;mt=new yt({recordCanvas:D,mutationCb:ge,win:window,blockClass:a,blockSelector:s,mirror:At,sampling:O.canvas,dataURLOptions:E});var Ae=new Qe({mutationCb:le,scrollCb:he,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:E,maskTextFn:w,maskInputFn:A,recordCanvas:D,inlineImages:P,sampling:O,slimDOMOptions:ie,iframeManager:ve,stylesheetManager:me,canvasManager:mt,keepIframeSrcFn:q,processedNodeManager:Se},mirror:At});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(L){ht(bt({type:ye.Meta,data:{href:window.location.href,width:ae(),height:oe()}}),e),me.reset(),Ae.init(),Be.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new b:r,a=n.blockClass,i=void 0===a?"rr-block":a,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,g=n.inlineImages,m=void 0!==g&&g,v=n.recordCanvas,y=void 0!==v&&v,I=n.maskAllInputs,C=void 0!==I&&I,S=n.maskTextFn,A=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,M=n.dataURLOptions,T=n.preserveWhiteSpace,O=n.onSerialize,N=n.onIframeLoad,E=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return J(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{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===C?{password:!0}:C,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:M,inlineImages:m,recordCanvas:y,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:At,blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:w,slimDOM:ie,dataURLOptions:E,recordCanvas:D,inlineImages:P,onSerialize:function(e){de(e,At)&&ve.addIframe(e),fe(e,At)&&me.trackLinkElement(e),pe(e)&&Ae.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ve.attachIframe(e,t),Ae.observeAttachShadow(e)},onStylesheetLoad:function(e,t){me.attachLinkElement(e,t)},keepIframeSrcFn:q});if(!t)return console.warn("Failed to snapshot the document");ht(bt({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),Be.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,At.getId(document))}};try{var we=[],ke=function(e){var t;return De(He)({mutationCb:le,mousemoveCb:function(e,t){return ht(bt({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.ViewportResize},e)}))},inputCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Input},e)}))},mediaInteractionCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Font},e)}))},selectionCb:function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Selection},e)}))},customElementCb:function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.CustomElement},e)}))},blockClass:a,ignoreClass:c,ignoreSelector:d,maskTextClass:p,maskTextSelector:m,maskInputOptions:ne,inlineStylesheet:y,sampling:O,recordDOM:L,recordCanvas:D,inlineImages:P,userTriggeredOnInput:U,collectFonts:_,doc:e,maskInputFn:A,maskTextFn:w,keepIframeSrcFn:q,blockSelector:s,slimDOMOptions:ie,dataURLOptions:E,mirror:At,iframeManager:ve,stylesheetManager:me,shadowDomManager:Ae,processedNodeManager:Se,canvasManager:mt,ignoreCSSAttributes:X,plugins:(null===(t=null==H?void 0:H.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return ht(bt({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};ve.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var Me=function(){gt(),we.push(ke(document)),St=!0};return"interactive"===document.readyState||"complete"===document.readyState?Me():(we.push(z("DOMContentLoaded",(function(){ht(bt({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===V&&Me()}))),we.push(z("load",(function(){ht(bt({type:ye.Load,data:{}})),"load"===V&&Me()}),window))),function(){we.forEach((function(e){return e()})),Se.destroy(),St=!1,Fe()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!St)throw new Error("please add custom event after start recording");ht(bt({type:ye.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){Be.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!St)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=At;var kt=function(){function e(t){s(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return c(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),Mt=/(^|@)\S+:\d+/,Tt=/^\s*at .*(\S+:\d+|\(native\))/m,Ot=/^(eval@)?(\[native code])?$/,Nt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Ot)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Rt(e[o])&&xt(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=Et(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Ft={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dt(e,t,n){var r,o=n?Object.assign({},Ft,n):Ft,a=o.logger;if(!a)return function(){};r="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var n=t.message,r=t.error,a=Nt.parse(r).map((function(e){return e.toString()})),i=[Lt(n,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var a=Nt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:r})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,f=g(o.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(r,u),!s){s=!0;try{var l=Nt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Lt(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:n,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Bt=Array.isArray,Wt=Object.prototype,Gt=Wt.hasOwnProperty,Vt=Wt.toString,Zt=Bt||function(e){return"[object Array]"===Vt.call(e)},Ut=function(e){return"function"==typeof e},Kt=function(e){return e===Object(e)&&!Zt(e)},_t=function(e){return void 0===e},jt=function(e){return"[object String]"==Vt.call(e)},Pt=function(e){return null===e},Ht=function(e){return _t(e)||Pt(e)},Yt=function(e){return"[object Boolean]"===Vt.call(e)},qt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},zt="undefined"!=typeof window?window:void 0,Qt="undefined"!=typeof globalThis?globalThis:zt,Xt=Array.prototype.forEach,$t=null==Qt?void 0:Qt.navigator;null==Qt||Qt.document,null==Qt||Qt.location,null==Qt||Qt.fetch,null!=Qt&&Qt.XMLHttpRequest&&"withCredentials"in new Qt.XMLHttpRequest&&Qt.XMLHttpRequest,null==Qt||Qt.AbortController,null==$t||$t.userAgent;var en=null!=zt?zt:{},tn="[PostHog.js]",nn={_log:function(e){if(zt&&en.POSTHOG_DEBUG&&!_t(zt.console)&&zt.console){for(var t=("__rrweb_original__"in zt.console[e]?zt.console[e].__rrweb_original__:zt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[tn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[tn].concat(n))},uninitializedWarning:function(e){nn.error("You must initialize PostHog before calling ".concat(e))}},rn={};function on(e,t,n){if(!Ht(e)){if(Zt(e))return function(e,t,n){if(Zt(e))if(Xt&&e.forEach===Xt)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===rn)return}(e,t,n);if(Jt(e)){var r,o=g(e.entries());try{for(o.s();!(r=o.n()).done;){var a=r.value;if(t.call(n,a[1],a[0])===rn)return}}catch(e){o.e(e)}finally{o.f()}}else for(var i in e)if(Gt.call(e,i)&&t.call(n,e[i],i)===rn)return}}var an=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return on(e,(function(e,r){_t(e)||_t(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},sn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},un=function(e){return"navigation"===e.entryType},cn=function(e){return"resource"===e.entryType};function ln(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Ut(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r},__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function dn(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function fn(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return un(e)||cn(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return In(e,void 0,void 0,{},!0)})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return un(e)||cn(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return In(e,void 0,void 0,{})}))})})),a=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return o.observe({entryTypes:a}),function(){o.disconnect()}}function pn(e,t){return!!t&&(Yt(t)||t[e])}function hn(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Yt(t))return!0;if(Zt(t))return r(t);var o=t[e];return Yt(o)?o:r(o)}function gn(e,t,n,r,o){return mn.apply(this,arguments)}function mn(){return mn=i(r().mark((function e(t,n,o,a,i){var s,u,c,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return nn.warn("Failed to get performance entry for request",{url:o,initiatorType:n}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(o),c=dn(u,(function(e){return cn(e)&&e.initiatorType===n&&(!a||e.startTime>=a)&&(!i||e.startTime<=i)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",gn(t,n,o,a,i,s+1));case 10:return e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)}))),mn.apply(this,arguments)}function vn(e){if(Ht(e))return null;if(jt(e))return e;if(qt(e))return e.textContent;if(Jt(e))return an(e);if(Kt(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var yn=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function In(e,t,r,o,a){var i=Math.floor(Date.now()-performance.now()),s=Math.floor(i+e.startTime),u=[n(n({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:i,timestamp:s,method:t,initiatorType:e.initiatorType,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(yn(e)){var c,l=g(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d=c.value;u.push({timeOrigin:i,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return u}var Cn=["video/","audio/"];function bn(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Cn.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Sn(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function An(e){return wn.apply(this,arguments)}function wn(){return(wn=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=bn(t),Pt(n)){e.next=3;break}return e.abrupt("return",Promise.resolve(n));case 3:return e.abrupt("return",Sn(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kn(e,t,o){if(!("performance"in t))return function(){};var a=o?Object.assign({},sn,o):sn,s=function(t){var r=[];t.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(n(n({},t),{},{requests:r}))},u=fn(s,t,a),c=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(c=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=pn("request",n.recordHeaders),o=pn("response",n.recordHeaders),a=ln(t.XMLHttpRequest.prototype,"open",(function(a){return function(i,s){var u,c,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),g={},m={},v=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return m[e]=t,v(e,t)},r&&(g.requestHeaders=m);var y=p.send.bind(p);p.send=function(e){return hn("request",n.recordBody,m)&&(_t(e)||Pt(e)?g.requestBody=null:g.requestBody=vn(e)),u=t.performance.now(),y(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),hn("response",n.recordBody,r)&&(Ht(p.response)?g.responseBody=null:g.responseBody=vn(p.response)),gn(t,"xmlhttprequest",h.url,u,c).then((function(t){if(!Pt(t)){var n=In(t,h.method,null==p?void 0:p.status,g);e({requests:n})}})).catch((function(){}))}})),a.call(p,i,s,l,d,f)}}));return function(){a()}}(s,t,a),l=function(e,t,n){if(!n.initiatorTypes.includes("fetch"))return function(){};var o=pn("request",n.recordHeaders),a=pn("response",n.recordHeaders),s=ln(t,"fetch",(function(s){return function(){var u=i(r().mark((function i(u,c){var l,d,f,p,h,g,m;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(l=new Request(u,c),f={},r.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(f.requestHeaders=g),!hn("request",n.recordBody,g)){r.next=10;break}return r.next=9,Sn(l);case 9:f.requestBody=r.sent;case 10:return p=t.performance.now(),r.next=13,s(l);case 13:if(d=r.sent,h=t.performance.now(),m={},d.headers.forEach((function(e,t){m[t]=e})),a&&(f.responseHeaders=m),!hn("response",n.recordBody,m)){r.next=22;break}return r.next=21,An(d);case 21:f.responseBody=r.sent;case 22:return r.abrupt("return",d);case 23:return r.prev=23,gn(t,"fetch",l.url,p,h).then((function(t){var n;if(!Pt(t)){var r=In(t,l.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),r.finish(23);case 26:case"end":return r.stop()}}),i,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,t,a)),function(){u(),c(),l()}}var Mn="rrweb/network@1",Tn=function(e){return{name:Mn,observer:kn,options:e}};zt&&(zt.rrweb={record:wt,version:"v2",rrwebVersion:"2.0.0-alpha.13"},zt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Dt,options:e}}},zt.getRecordNetworkPlugin=Tn),e.NETWORK_PLUGIN_NAME=Mn,e.default=wt,e.findLast=dn,e.getRecordNetworkPlugin=Tn,e.patch=ln,Object.defineProperty(e,"__esModule",{value:!0})}({});
|
|
16
|
+
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})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),It=function(){function e(t){s(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return c(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},o=[],a=g(e);try{for(a.s();!(n=a.n()).done;){var i=n.value,s=void 0;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(function(e,t){return{rule:C(e),index:t}}))})),r.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){s(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return c(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var St=!1,At=new b;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.ignoreSelector,d=void 0===l?null:l,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,m=void 0===h?null:h,v=e.inlineStylesheet,y=void 0===v||v,I=e.maskAllInputs,C=e.maskInputOptions,S=e.slimDOMOptions,A=e.maskInputFn,w=e.maskTextFn,k=e.hooks,M=e.packFn,T=e.sampling,O=void 0===T?{}:T,N=e.dataURLOptions,E=void 0===N?{}:N,R=e.mousemoveWait,x=e.recordDOM,L=void 0===x||x,F=e.recordCanvas,D=void 0!==F&&F,B=e.recordCrossOriginIframes,W=void 0!==B&&B,G=e.recordAfter,V=void 0===G?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":G,Z=e.userTriggeredOnInput,U=void 0!==Z&&Z,K=e.collectFonts,_=void 0!==K&&K,j=e.inlineImages,P=void 0!==j&&j,H=e.plugins,Y=e.keepIframeSrcFn,q=void 0===Y?function(){return!1}:Y,Q=e.ignoreCSSAttributes,X=void 0===Q?new Set([]):Q;Le(e.errorHandler);var $=!W||window.parent===window,ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if($&&!t)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R),At.reset();var te,ne=!0===I?{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!==C?C:{password:!0},ie=!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===S,headMetaDescKeywords:"all"===S}:S||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var se=0,ue=function(e){var t,n=g(H||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return M&&!ee&&(e=M(e)),e};ht=function(e,o){var a;if(!(null===(a=Be[0])||void 0===a?void 0:a.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===Ie.Mutation||Be.forEach((function(e){return e.unfreeze()})),$)null==t||t(ue(e),o);else if(ee){var i={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===Ie.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&>(!0)}};var ce,le=function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Mutation},e)}))},he=function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Scroll},e)}))},ge=function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.CanvasMutation},e)}))},me=new It({mutationCb:le,adoptedStyleSheetCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.AdoptedStyleSheet},e)}))}}),ve=new ze({mirror:At,mutationCb:le,stylesheetManager:me,recordCrossOriginIframes:W,wrappedEmit:ht}),Ce=g(H||[]);try{for(Ce.s();!(ce=Ce.n()).done;){var be=ce.value;be.getMirror&&be.getMirror({nodeMirror:At,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror})}}catch(e){Ce.e(e)}finally{Ce.f()}var Se=new Ct;mt=new yt({recordCanvas:D,mutationCb:ge,win:window,blockClass:a,blockSelector:s,mirror:At,sampling:O.canvas,dataURLOptions:E});var Ae=new Qe({mutationCb:le,scrollCb:he,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:E,maskTextFn:w,maskInputFn:A,recordCanvas:D,inlineImages:P,sampling:O,slimDOMOptions:ie,iframeManager:ve,stylesheetManager:me,canvasManager:mt,keepIframeSrcFn:q,processedNodeManager:Se},mirror:At});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(L){ht(bt({type:ye.Meta,data:{href:window.location.href,width:ae(),height:oe()}}),e),me.reset(),Ae.init(),Be.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new b:r,a=n.blockClass,i=void 0===a?"rr-block":a,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,g=n.inlineImages,m=void 0!==g&&g,v=n.recordCanvas,y=void 0!==v&&v,I=n.maskAllInputs,C=void 0!==I&&I,S=n.maskTextFn,A=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,M=n.dataURLOptions,T=n.preserveWhiteSpace,O=n.onSerialize,N=n.onIframeLoad,E=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return J(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{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===C?{password:!0}:C,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:M,inlineImages:m,recordCanvas:y,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:At,blockClass:a,blockSelector:s,maskTextClass:p,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:w,slimDOM:ie,dataURLOptions:E,recordCanvas:D,inlineImages:P,onSerialize:function(e){de(e,At)&&ve.addIframe(e),fe(e,At)&&me.trackLinkElement(e),pe(e)&&Ae.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ve.attachIframe(e,t),Ae.observeAttachShadow(e)},onStylesheetLoad:function(e,t){me.attachLinkElement(e,t)},keepIframeSrcFn:q});if(!t)return console.warn("Failed to snapshot the document");ht(bt({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),Be.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,At.getId(document))}};try{var we=[],ke=function(e){var t;return De(He)({mutationCb:le,mousemoveCb:function(e,t){return ht(bt({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.ViewportResize},e)}))},inputCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Input},e)}))},mediaInteractionCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Font},e)}))},selectionCb:function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.Selection},e)}))},customElementCb:function(e){ht(bt({type:ye.IncrementalSnapshot,data:Object.assign({source:Ie.CustomElement},e)}))},blockClass:a,ignoreClass:c,ignoreSelector:d,maskTextClass:p,maskTextSelector:m,maskInputOptions:ne,inlineStylesheet:y,sampling:O,recordDOM:L,recordCanvas:D,inlineImages:P,userTriggeredOnInput:U,collectFonts:_,doc:e,maskInputFn:A,maskTextFn:w,keepIframeSrcFn:q,blockSelector:s,slimDOMOptions:ie,dataURLOptions:E,mirror:At,iframeManager:ve,stylesheetManager:me,shadowDomManager:Ae,processedNodeManager:Se,canvasManager:mt,ignoreCSSAttributes:X,plugins:(null===(t=null==H?void 0:H.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return ht(bt({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};ve.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var Me=function(){gt(),we.push(ke(document)),St=!0};return"interactive"===document.readyState||"complete"===document.readyState?Me():(we.push(z("DOMContentLoaded",(function(){ht(bt({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===V&&Me()}))),we.push(z("load",(function(){ht(bt({type:ye.Load,data:{}})),"load"===V&&Me()}),window))),function(){we.forEach((function(e){return e()})),Se.destroy(),St=!1,Fe()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!St)throw new Error("please add custom event after start recording");ht(bt({type:ye.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){Be.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!St)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=At;var kt=function(){function e(t){s(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return c(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),Mt=/(^|@)\S+:\d+/,Tt=/^\s*at .*(\S+:\d+|\(native\))/m,Ot=/^(eval@)?(\[native code])?$/,Nt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Ot)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Rt(e[o])&&xt(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=Et(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Ft={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dt(e,t,n){var r,o=n?Object.assign({},Ft,n):Ft,a=o.logger;if(!a)return function(){};r="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var n=t.message,r=t.error,a=Nt.parse(r).map((function(e){return e.toString()})),i=[Lt(n,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var a=Nt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:r})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,f=g(o.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(r,u),!s){s=!0;try{var l=Nt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Lt(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:n,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Bt=Array.isArray,Wt=Object.prototype,Gt=Wt.hasOwnProperty,Vt=Wt.toString,Zt=Bt||function(e){return"[object Array]"===Vt.call(e)},Ut=function(e){return"function"==typeof e},Kt=function(e){return e===Object(e)&&!Zt(e)},_t=function(e){return void 0===e},jt=function(e){return"[object String]"==Vt.call(e)},Pt=function(e){return null===e},Ht=function(e){return _t(e)||Pt(e)},Yt=function(e){return"[object Boolean]"===Vt.call(e)},qt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},zt="undefined"!=typeof window?window:void 0,Qt="undefined"!=typeof globalThis?globalThis:zt,Xt=Array.prototype.forEach,$t=null==Qt?void 0:Qt.navigator;null==Qt||Qt.document,null==Qt||Qt.location,null==Qt||Qt.fetch,null!=Qt&&Qt.XMLHttpRequest&&"withCredentials"in new Qt.XMLHttpRequest&&Qt.XMLHttpRequest,null==Qt||Qt.AbortController,null==$t||$t.userAgent;var en=null!=zt?zt:{},tn="[PostHog.js]",nn={_log:function(e){if(zt&&en.POSTHOG_DEBUG&&!_t(zt.console)&&zt.console){for(var t=("__rrweb_original__"in zt.console[e]?zt.console[e].__rrweb_original__:zt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[tn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];nn._log.apply(nn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[tn].concat(n))},uninitializedWarning:function(e){nn.error("You must initialize PostHog before calling ".concat(e))}},rn={};function on(e,t,n){if(!Ht(e)){if(Zt(e))return function(e,t,n){if(Zt(e))if(Xt&&e.forEach===Xt)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===rn)return}(e,t,n);if(Jt(e)){var r,o=g(e.entries());try{for(o.s();!(r=o.n()).done;){var a=r.value;if(t.call(n,a[1],a[0])===rn)return}}catch(e){o.e(e)}finally{o.f()}}else for(var i in e)if(Gt.call(e,i)&&t.call(n,e[i],i)===rn)return}}var an=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return on(e,(function(e,r){_t(e)||_t(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},sn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6};function un(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Ut(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}var cn=function(e){return"navigation"===e.entryType},ln=function(e){return"resource"===e.entryType};function dn(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function fn(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return cn(e)||ln(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return In(e,void 0,void 0,{},!0)})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return cn(e)||ln(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return In(e,void 0,void 0,{})}))})})),a=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return o.observe({entryTypes:a}),function(){o.disconnect()}}function pn(e,t){return!!t&&(Yt(t)||t[e])}function hn(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Yt(t))return!0;if(Zt(t))return r(t);var o=t[e];return Yt(o)?o:r(o)}function gn(e,t,n,r,o){return mn.apply(this,arguments)}function mn(){return mn=i(r().mark((function e(t,n,o,a,i){var s,u,c,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return nn.warn("Failed to get performance entry for request",{url:o,initiatorType:n}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(o),c=dn(u,(function(e){return ln(e)&&e.initiatorType===n&&(!a||e.startTime>=a)&&(!i||e.startTime<=i)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",gn(t,n,o,a,i,s+1));case 10:return e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)}))),mn.apply(this,arguments)}function vn(e){if(Ht(e))return null;if(jt(e))return e;if(qt(e))return e.textContent;if(Jt(e))return an(e);if(Kt(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var yn=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function In(e,t,r,o,a){var i=Math.floor(Date.now()-performance.now()),s=Math.floor(i+e.startTime),u=[n(n({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:i,timestamp:s,method:t,initiatorType:e.initiatorType,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(yn(e)){var c,l=g(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d=c.value;u.push({timeOrigin:i,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return u}var Cn=["video/","audio/"];function bn(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Cn.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Sn(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function An(e){return wn.apply(this,arguments)}function wn(){return(wn=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=bn(t),Pt(n)){e.next=3;break}return e.abrupt("return",Promise.resolve(n));case 3:return e.abrupt("return",Sn(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kn(e,t,o){if(!("performance"in t))return function(){};var a=o?Object.assign({},sn,o):sn,s=function(t){var r=[];t.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(n(n({},t),{},{requests:r}))},u=fn(s,t,a),c=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(c=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=pn("request",n.recordHeaders),o=pn("response",n.recordHeaders),a=un(t.XMLHttpRequest.prototype,"open",(function(a){return function(i,s){var u,c,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),g={},m={},v=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return m[e]=t,v(e,t)},r&&(g.requestHeaders=m);var y=p.send.bind(p);p.send=function(e){return hn("request",n.recordBody,m)&&(_t(e)||Pt(e)?g.requestBody=null:g.requestBody=vn(e)),u=t.performance.now(),y(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),hn("response",n.recordBody,r)&&(Ht(p.response)?g.responseBody=null:g.responseBody=vn(p.response)),gn(t,"xmlhttprequest",h.url,u,c).then((function(t){if(!Pt(t)){var n=In(t,h.method,null==p?void 0:p.status,g);e({requests:n})}})).catch((function(){}))}})),a.call(p,i,s,l,d,f)}}));return function(){a()}}(s,t,a),l=function(e,t,n){if(!n.initiatorTypes.includes("fetch"))return function(){};var o=pn("request",n.recordHeaders),a=pn("response",n.recordHeaders),s=un(t,"fetch",(function(s){return function(){var u=i(r().mark((function i(u,c){var l,d,f,p,h,g,m;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(l=new Request(u,c),f={},r.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(f.requestHeaders=g),!hn("request",n.recordBody,g)){r.next=10;break}return r.next=9,Sn(l);case 9:f.requestBody=r.sent;case 10:return p=t.performance.now(),r.next=13,s(l);case 13:if(d=r.sent,h=t.performance.now(),m={},d.headers.forEach((function(e,t){m[t]=e})),a&&(f.responseHeaders=m),!hn("response",n.recordBody,m)){r.next=22;break}return r.next=21,An(d);case 21:f.responseBody=r.sent;case 22:return r.abrupt("return",d);case 23:return r.prev=23,gn(t,"fetch",l.url,p,h).then((function(t){var n;if(!Pt(t)){var r=In(t,l.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),r.finish(23);case 26:case"end":return r.stop()}}),i,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,t,a)),function(){u(),c(),l()}}var Mn="rrweb/network@1",Tn=function(e){return{name:Mn,observer:kn,options:e}};zt&&(zt.rrweb={record:wt,version:"v2",rrwebVersion:"2.0.0-alpha.13"},zt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Dt,options:e}}},zt.getRecordNetworkPlugin=Tn),e.NETWORK_PLUGIN_NAME=Mn,e.default=wt,e.findLast=dn,e.getRecordNetworkPlugin=Tn,Object.defineProperty(e,"__esModule",{value:!0})}({});
|
|
17
17
|
//# sourceMappingURL=recorder-v2.js.map
|