posthog-js 1.68.2 → 1.68.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.68.4 - 2023-06-22
2
+
3
+ - feat(components): Give option to not track events on feature component (#708)
4
+
5
+ ## 1.68.3 - 2023-06-22
6
+
7
+ - fix: PosthogProvider doesn't need to have the client be optional (#705)
8
+
1
9
  ## 1.68.2 - 2023-06-20
2
10
 
3
11
  - feat: Group rrweb events into one capture (#694)
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function x(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,a=i||"";return(t[n.toLowerCase()]||t[r])&&(a=o?o(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var E,C,O=1,T=new RegExp("[^a-z0-9-_:]"),F=-2;function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(P).join(""):null}catch(e){return null}}function P(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function D(e,t){return(e||"").replace(R,(function(e,n,r,i,o,a){var s,u=r||o||a,c=n||i||"";if(!u)return e;if(!N.test(u))return"url("+c+u+c+")";if(A.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var L,$,j,q,H,U,B=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?V(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,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(W),!(n>=t.length);){var o=r(B);if(","===o.slice(-1))o=V(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=V(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?D(r,z()):"object"===t&&"data"===n&&r?V(e,r):r:V(e,r)}function J(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!(!n||!e.matches(n))||J(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,J(e.parentNode,t,n)}function Q(t,n){var r,i,o,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,_=n.dataURLOptions,m=void 0===_?{}:_,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;i=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!!n&&e.matches(n)}(t,u,c),O=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),F={},P=0,R=Array.from(t.attributes);P<R.length;P++){var N=R[P],A=N.name,L=N.value;F[A]=G(s,O,A,L)}if("link"===O&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=M($)),j&&(delete F.rel,delete F.href,F._cssText=D(j,$.href))}if("style"===O&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=M(t.sheet))&&(F._cssText=D(j,z()));if("input"===O||"textarea"===O||"select"===O){L=t.value;"radio"!==F.type&&"checkbox"!==F.type&&"submit"!==F.type&&"button"!==F.type&&L?F.value=x({type:F.type,tagName:O,value:L,maskInputOptions:h,maskInputFn:g}):t.checked&&(F.checked=t.checked)}if("option"===O&&(t.selected&&!h.select?F.selected=!0:delete F.selected),"canvas"===O&&b)if("2d"===t.__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 i=t.getImageData,o=I in i?i[I]:i;if(new Uint32Array(o.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})(t)||(F.rr_dataURL=t.toDataURL(m.type,m.quality));else if(!("__context"in t)){var q=t.toDataURL(m.type,m.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,q!==H.toDataURL(m.type,m.quality)&&(F.rr_dataURL=q)}if("img"===O&&y){E||(E=s.createElement("canvas"),C=E.getContext("2d"));var U=t,B=U.crossOrigin;U.crossOrigin="anonymous";var W=function(){try{E.width=U.naturalWidth,E.height=U.naturalHeight,C.drawImage(U,0,0),F.rr_dataURL=E.toDataURL(m.type,m.quality)}catch(e){console.warn("Cannot inline img src="+U.currentSrc+"! Error: "+e)}B?F.crossOrigin=B:delete F.crossOrigin};U.complete&&0!==U.naturalWidth?W():U.onload=W}if("audio"!==O&&"video"!==O||(F.rr_mediaState=t.paused?"paused":"played",F.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(F.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(F.rr_scrollTop=t.scrollTop),S){var V=t.getBoundingClientRect(),Q=V.width,X=V.height;F={class:F.class,rr_width:Q+"px",rr_height:X+"px"}}return"iframe"!==O||w(F.src)||(t.contentDocument||(F.rr_src=F.src),delete F.src),{type:e.Element,tagName:O,attributes:F,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:i};case t.TEXT_NODE:var Y=t.parentNode&&t.parentNode.tagName,K=t.textContent,Z="STYLE"===Y||void 0,ee="SCRIPT"===Y||void 0;if(Z&&K){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(K=(o=t.parentNode.sheet).cssRules?Array.from(o.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}K=D(K,z())}return ee&&(K="SCRIPT_PLACEHOLDER"),!Z&&!ee&&J(t,l,d)&&K&&(K=v?v(K):K.replace(/[\S]/g,"*")),{type:e.Text,textContent:K||"",isStyle:Z,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function X(e){return void 0===e?"":e.toLowerCase()}function Y(t,n){var r,i=n.doc,o=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,_=n.maskInputFn,m=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,x=n.recordCanvas,I=void 0!==x&&x,E=n.onSerialize,C=n.onIframeLoad,T=n.iframeLoadTimeout,M=void 0===T?5e3:T,P=n.keepIframeSrcFn,R=void 0===P?function(){return!1}:P,N=n.preserveWhiteSpace,A=void 0===N||N,D=Q(t,{doc:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:R});if(!D)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(X(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(t.attributes.name)||"icon"===X(t.attributes.rel)||"apple-touch-icon"===X(t.attributes.rel)||"shortcut icon"===X(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&X(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(X(t.attributes.property).match(/^(og|twitter|fb):/)||X(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===X(t.attributes.name)||"googlebot"===X(t.attributes.name)||"bingbot"===X(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===X(t.attributes.name)||"generator"===X(t.attributes.name)||"framework"===X(t.attributes.name)||"publisher"===X(t.attributes.name)||"progid"===X(t.attributes.name)||X(t.attributes.property).match(/^article:/)||X(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===X(t.attributes.name)||"yandex-verification"===X(t.attributes.name)||"csrf-token"===X(t.attributes.name)||"p:domain_verify"===X(t.attributes.name)||"verify-v1"===X(t.attributes.name)||"verification"===X(t.attributes.name)||"shopify-checkout-api-token"===X(t.attributes.name)))return!0}}return!1}(D,m)&&(A||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?O++:F;var L=Object.assign(D,{id:r});if(t.__sn=L,r===F)return null;o[r]=t,E&&E(t);var $=!d;if(L.type===e.Element&&($=$&&!L.needBlock,delete L.needBlock,t.shadowRoot&&(L.isShadowHost=!0)),(L.type===e.Document||L.type===e.Element)&&$){m.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(A=!1);for(var j={doc:i,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:E,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R},q=0,H=Array.from(t.childNodes);q<H.length;q++){(W=Y(H[q],j))&&L.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var U=0,B=Array.from(t.shadowRoot.childNodes);U<B.length;U++){var W;(W=Y(B[U],j))&&(W.isShadow=!0,L.childNodes.push(W))}}return t.parentNode&&S(t.parentNode)&&(L.isShadow=!0),L.type===e.Element&&"iframe"===L.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&C){var n=Y(e,{doc:e,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:E,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R});n&&C(t,n)}}),M),L}function K(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(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"}(L||(L={})),function(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"}($||($={})),function(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"}(j||(j={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(q||(q={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(H||(H={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(U||(U={}));var Z="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.",ee={map:{},getId:function(){return console.error(Z),-1},getNode:function(){return console.error(Z),null},removeNodeFromMap:function(){console.error(Z)},has:function(){return console.error(Z),!1},reset:function(){console.error(Z)}};function te(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var a=Date.now();i||!1!==n.leading||(i=a);var s=t-(a-i),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function ne(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ne(e,t,o||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function ie(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===F}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function pe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(Z),Reflect.get(e,t,n)}}));var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var 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&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){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++},e.prototype.removeNode=function(e){var 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--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;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=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,i,o;if(!e.frozen&&!e.locked){for(var a=[],s=new fe,u=function(t){for(var n=t,r=F;r===F;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,o,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(i=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===i?void 0:i.host;)d=(null===(c=null===(o=null==d?void 0:d.getRootNode)||void 0===o?void 0:o.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=Y(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){le(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;me(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;ye(e.droppedSet,p)||me(e.removes,p,e.mirror)?ye(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}for(var v=null;s.length;){var g=null;if(v){var _=e.mirror.getId(v.value.parentNode),m=u(v.value);-1!==_&&-1!==m&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){_=e.mirror.getId(b.value.parentNode),m=u(b.value);if(-1!==_&&-1!==m){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,i,o,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:J(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=x({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var _=n(Array.from(l.style)),m=_.next();!m.done;m=_.next()){h=m.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}}else c.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),i=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(_e(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,i)]?_e(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function _e(e,t){e.delete(t),t.childNodes.forEach((function(t){return _e(e,t)}))}function me(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||me(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,we=[],ke="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,xe="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function Ee(e){try{if("composedPath"in e){var 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 Ce(e,t){var n,r,i=new be;we.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=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");a&&window[a]&&(o=window[a]);var s=new o(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Oe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.sampling;if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,s=[];return Object.keys(j).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var o=e.toLowerCase(),a=function(e){return function(n){var o=Ee(n);if(!ae(o,i)){var a=ce(n)?n.changedTouches[0]:n;if(a){var s=r.getId(o),u=a.clientX,c=a.clientY;t({type:j[e],id:s,x:u,y:c})}}}}(e);s.push(K(o,a,n))})),function(){s.forEach((function(e){return e()}))}}function Te(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass;return K("scroll",te((function(e){var o=Ee(e);if(o&&!ae(o,i)){var a=r.getId(o);if(o===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}}),e.sampling.scroll||100),n)}function Fe(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Pe=new WeakMap;function Re(e){return function(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||xe&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,o){var a,s;void 0===o&&(o={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,i([],r(e),!1)),n.apply(void 0,i([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],r(e),!1)),o.apply(void 0,i([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],r(e),!1)),a.apply(void 0,i([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],r(e),!1)),s.apply(void 0,i([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],r(e),!1)),u.apply(void 0,i([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],r(e),!1)),c.apply(void 0,i([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],r(e),!1)),l.apply(void 0,i([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],r(e),!1)),d.apply(void 0,i([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],r(e),!1)),p.apply(void 0,i([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],r(e),!1)),f.apply(void 0,i([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],r(e),!1)),h.apply(void 0,i([],r(e),!1))}}(e,o);var c=Ce(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=te((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null}),s),l=te((function(e){var t=Ee(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=Date.now()),u.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[K("mousemove",l,r),K("touchmove",l,r),K("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Oe(e),p=Te(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return K("resize",te((function(){var e=ie(),i=oe();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200),window)}(e),h=function(e){var n=e.inputCb,o=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Ee(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var i=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(i=x({maskInputOptions:c,tagName:t.tagName,type:r,value:i,maskInputFn:l})),h(t,Fe({text:i,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&o.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Fe({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var i=Pe.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pe.set(e,r);var o=a.getId(e);n(t(t({},r),{id:o}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return K(e,f,o)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),_=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,i([],r(_.map((function(e){return ne(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,o=function(e){return te((function(i){var o=Ee(i);if(o&&!ae(o,n)){var a=o,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(o),currentTime:s,volume:u,muted:c})}}),i.media||500)},a=[K("play",o(0)),K("pause",o(1)),K("seeked",o(2)),K("volumechange",o(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,o=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=o.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=o.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};ke?c.CSSGroupingRule=a.CSSGroupingRule:(Se&&(c.CSSMediaRule=a.CSSMediaRule),Ie&&(c.CSSConditionRule=a.CSSConditionRule),xe&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=o.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],r(Re(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=o.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],r(Re(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];i.prototype.insertRule=l[n].insertRule,i.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),_=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:i},index:Re(this.parentRule)}),o.apply(this,arguments)};var a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,o=r.getId(null===(i=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==o&&n({id:o,remove:{property:e},index:Re(this.parentRule)}),a.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),m=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(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};var s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),function(){i.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){we.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),_(),m(),y.forEach((function(e){return e()}))}}var Ae=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),De=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){Ce(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Te(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),je=0;je<Le.length;je++)$e[Le.charCodeAt(je)]=je;var qe=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Le[n[t]>>2],i+=Le[(3&n[t])<<4|n[t+1]>>4],i+=Le[(15&n[t+1])<<2|n[t+2]>>6],i+=Le[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},He=new Map;var Ue=function(e,t,n){if(e&&(Ve(e,t)||"object"===s(e))){var r=function(e,t){var n=He.get(e);return n||(n=new Map,He.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function Be(e,t,n){return e instanceof Array?e.map((function(e){return Be(e,t,n)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:qe(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Be(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Be(e.data,t,n),e.width,e.height]}:Ve(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:Ue(e,t,n)}:e}var We=function(e,t,n){return i([],r(e),!1).map((function(e){return Be(e,t,n)}))},Ve=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,o,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=re(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(Ue(p,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var f=We(i([],r(l),!1),u,e),h={type:t,property:n,args:f};o(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=ne(e,n,{set:function(e){o(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ge,Je,Qe=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(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)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=function(e,t){var n=[];try{var o=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],r(o),!1))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,o,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,o)||setTimeout((function(){var t=i([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var o=t[0],u=o.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,o.width,o.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:q["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:q["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,o){var a=[];return a.push.apply(a,i([],r(ze(t.WebGLRenderingContext.prototype,q.WebGL,e,n,o,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],r(ze(t.WebGL2RenderingContext.prototype,q.WebGL2,e,n,o,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){o(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var 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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Xe(e){return t(t({},e),{timestamp:Date.now()})}var Ye={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ke(e){void 0===e&&(e={});var i=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,_=e.inlineStylesheet,m=void 0===_||_,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,x=e.hooks,I=e.packFn,E=e.sampling,C=void 0===E?{}:E,O=e.mousemoveWait,T=e.recordCanvas,F=void 0!==T&&T,M=e.userTriggeredOnInput,P=void 0!==M&&M,R=e.collectFonts,N=void 0!==R&&R,A=e.inlineImages,D=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,H=void 0===q?function(){return!1}:q;if(!i)throw new Error("emit function is required");void 0!==O&&void 0===C.mousemove&&(C.mousemove=O);var U,B=!0===y?{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!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ge=function(e,t){var r;if(!(null===(r=we[0])||void 0===r?void 0:r.isFrozen())||e.type===L.FullSnapshot||e.type===L.IncrementalSnapshot&&e.data.source===$.Mutation||we.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var i=n(j||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===L.FullSnapshot)U=e,V=0;else if(e.type===L.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=o&&e.timestamp-U.timestamp>o;(s||u)&&Je(!0)}};var z=function(e){Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},J=function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},Q=new Ae({mutationCb:z}),X=new Qe({recordCanvas:F,mutationCb:J,win:window,blockClass:u,mirror:Ye}),Z=new De({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskInputOptions:B,maskTextFn:S,maskInputFn:k,recordCanvas:F,inlineImages:D,sampling:C,slimDOMOptions:W,iframeManager:Q,canvasManager:X},mirror:Ye});Je=function(e){var t,n,i,o;void 0===e&&(e=!1),Ge(Xe({type:L.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),we.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,a=void 0===o?null:o,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,_=n.maskAllInputs,m=void 0!==_&&_,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,x=n.preserveWhiteSpace,I=n.onSerialize,E=n.onIframeLoad,C=n.iframeLoadTimeout,O=n.keepIframeSrcFn,T={};return[Y(e,{doc:e,map:T,blockClass:i,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===m?{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===m?{password:!0}:m,maskTextFn:y,maskInputFn:b,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:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:x,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:C,keepIframeSrcFn:void 0===O?function(){return!1}:O}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskAllInputs:B,maskTextFn:S,slimDOM:W,recordCanvas:F,inlineImages:D,onSerialize:function(e){le(e)&&Q.addIframe(e),de(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){Q.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:H}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Ye.map=c,Ge(Xe({type:L.FullSnapshot,data:{node:s,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===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),we.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(K("DOMContentLoaded",(function(){Ge(Xe({type:L.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Xe({type:L.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:J,fontCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:B,inlineStylesheet:m,sampling:C,recordCanvas:F,inlineImages:D,userTriggeredOnInput:P,collectFonts:N,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Ye,iframeManager:Q,shadowDomManager:Z,canvasManager:X,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Xe({type:L.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},x)};Q.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Je(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(K("load",(function(){Ge(Xe({type:L.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ke.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Xe({type:L.Custom,data:{tag:e,payload:t}}))},Ke.freezePage=function(){we.forEach((function(e){return e.freeze()}))},Ke.takeFullSnapshot=function(e){if(!Je)throw new Error("please take full snapshot after start recording");Je(e)},Ke.mirror=Ye;var Ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},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),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ze({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),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 Ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ze({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[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=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ze({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!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 Ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function it(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,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function ot(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,i;if(0===t)return!0;var o=Object.keys(e);try{for(var a=n(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(ot(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1}function st(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(ot(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ot(e)&&at(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(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=it(u.length?u[0]:null):a[s]=u}return a}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 ut={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 ct(e,t,o){var a,s,u,c=o.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(o.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,i=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(o.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,o.stringifyOptions)}));++l<o.lengthThreshold?e({level:n,trace:c,payload:d}):l===o.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var lt="undefined"!=typeof window?window:{};lt.rrweb={record:Ke,version:"v1",rrwebVersion:"1.1.3"},lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:ct,options:e?Object.assign({},ut,e):ut}}};var dt={DEBUG:!1,LIB_VERSION:"1.68.2"};
15
+ ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function x(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,a=i||"";return(t[n.toLowerCase()]||t[r])&&(a=o?o(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var E,C,O=1,T=new RegExp("[^a-z0-9-_:]"),F=-2;function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(P).join(""):null}catch(e){return null}}function P(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function D(e,t){return(e||"").replace(R,(function(e,n,r,i,o,a){var s,u=r||o||a,c=n||i||"";if(!u)return e;if(!N.test(u))return"url("+c+u+c+")";if(A.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var L,$,j,q,H,U,B=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?V(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,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(W),!(n>=t.length);){var o=r(B);if(","===o.slice(-1))o=V(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=V(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?D(r,z()):"object"===t&&"data"===n&&r?V(e,r):r:V(e,r)}function J(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!(!n||!e.matches(n))||J(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,J(e.parentNode,t,n)}function Q(t,n){var r,i,o,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,_=n.dataURLOptions,m=void 0===_?{}:_,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;i=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!!n&&e.matches(n)}(t,u,c),O=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),F={},P=0,R=Array.from(t.attributes);P<R.length;P++){var N=R[P],A=N.name,L=N.value;F[A]=G(s,O,A,L)}if("link"===O&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=M($)),j&&(delete F.rel,delete F.href,F._cssText=D(j,$.href))}if("style"===O&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=M(t.sheet))&&(F._cssText=D(j,z()));if("input"===O||"textarea"===O||"select"===O){L=t.value;"radio"!==F.type&&"checkbox"!==F.type&&"submit"!==F.type&&"button"!==F.type&&L?F.value=x({type:F.type,tagName:O,value:L,maskInputOptions:h,maskInputFn:g}):t.checked&&(F.checked=t.checked)}if("option"===O&&(t.selected&&!h.select?F.selected=!0:delete F.selected),"canvas"===O&&b)if("2d"===t.__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 i=t.getImageData,o=I in i?i[I]:i;if(new Uint32Array(o.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})(t)||(F.rr_dataURL=t.toDataURL(m.type,m.quality));else if(!("__context"in t)){var q=t.toDataURL(m.type,m.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,q!==H.toDataURL(m.type,m.quality)&&(F.rr_dataURL=q)}if("img"===O&&y){E||(E=s.createElement("canvas"),C=E.getContext("2d"));var U=t,B=U.crossOrigin;U.crossOrigin="anonymous";var W=function(){try{E.width=U.naturalWidth,E.height=U.naturalHeight,C.drawImage(U,0,0),F.rr_dataURL=E.toDataURL(m.type,m.quality)}catch(e){console.warn("Cannot inline img src="+U.currentSrc+"! Error: "+e)}B?F.crossOrigin=B:delete F.crossOrigin};U.complete&&0!==U.naturalWidth?W():U.onload=W}if("audio"!==O&&"video"!==O||(F.rr_mediaState=t.paused?"paused":"played",F.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(F.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(F.rr_scrollTop=t.scrollTop),S){var V=t.getBoundingClientRect(),Q=V.width,X=V.height;F={class:F.class,rr_width:Q+"px",rr_height:X+"px"}}return"iframe"!==O||w(F.src)||(t.contentDocument||(F.rr_src=F.src),delete F.src),{type:e.Element,tagName:O,attributes:F,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:i};case t.TEXT_NODE:var Y=t.parentNode&&t.parentNode.tagName,K=t.textContent,Z="STYLE"===Y||void 0,ee="SCRIPT"===Y||void 0;if(Z&&K){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(K=(o=t.parentNode.sheet).cssRules?Array.from(o.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}K=D(K,z())}return ee&&(K="SCRIPT_PLACEHOLDER"),!Z&&!ee&&J(t,l,d)&&K&&(K=v?v(K):K.replace(/[\S]/g,"*")),{type:e.Text,textContent:K||"",isStyle:Z,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function X(e){return void 0===e?"":e.toLowerCase()}function Y(t,n){var r,i=n.doc,o=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,_=n.maskInputFn,m=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,x=n.recordCanvas,I=void 0!==x&&x,E=n.onSerialize,C=n.onIframeLoad,T=n.iframeLoadTimeout,M=void 0===T?5e3:T,P=n.keepIframeSrcFn,R=void 0===P?function(){return!1}:P,N=n.preserveWhiteSpace,A=void 0===N||N,D=Q(t,{doc:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:R});if(!D)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(X(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(t.attributes.name)||"icon"===X(t.attributes.rel)||"apple-touch-icon"===X(t.attributes.rel)||"shortcut icon"===X(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&X(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(X(t.attributes.property).match(/^(og|twitter|fb):/)||X(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===X(t.attributes.name)||"googlebot"===X(t.attributes.name)||"bingbot"===X(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===X(t.attributes.name)||"generator"===X(t.attributes.name)||"framework"===X(t.attributes.name)||"publisher"===X(t.attributes.name)||"progid"===X(t.attributes.name)||X(t.attributes.property).match(/^article:/)||X(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===X(t.attributes.name)||"yandex-verification"===X(t.attributes.name)||"csrf-token"===X(t.attributes.name)||"p:domain_verify"===X(t.attributes.name)||"verify-v1"===X(t.attributes.name)||"verification"===X(t.attributes.name)||"shopify-checkout-api-token"===X(t.attributes.name)))return!0}}return!1}(D,m)&&(A||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?O++:F;var L=Object.assign(D,{id:r});if(t.__sn=L,r===F)return null;o[r]=t,E&&E(t);var $=!d;if(L.type===e.Element&&($=$&&!L.needBlock,delete L.needBlock,t.shadowRoot&&(L.isShadowHost=!0)),(L.type===e.Document||L.type===e.Element)&&$){m.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(A=!1);for(var j={doc:i,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:E,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R},q=0,H=Array.from(t.childNodes);q<H.length;q++){(W=Y(H[q],j))&&L.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var U=0,B=Array.from(t.shadowRoot.childNodes);U<B.length;U++){var W;(W=Y(B[U],j))&&(W.isShadow=!0,L.childNodes.push(W))}}return t.parentNode&&S(t.parentNode)&&(L.isShadow=!0),L.type===e.Element&&"iframe"===L.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&C){var n=Y(e,{doc:e,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:_,slimDOMOptions:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:E,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R});n&&C(t,n)}}),M),L}function K(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(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"}(L||(L={})),function(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"}($||($={})),function(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"}(j||(j={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(q||(q={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(H||(H={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(U||(U={}));var Z="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.",ee={map:{},getId:function(){return console.error(Z),-1},getNode:function(){return console.error(Z),null},removeNodeFromMap:function(){console.error(Z)},has:function(){return console.error(Z),!1},reset:function(){console.error(Z)}};function te(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var a=Date.now();i||!1!==n.leading||(i=a);var s=t-(a-i),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function ne(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return ne(e,t,o||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function ie(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===F}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function pe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(Z),Reflect.get(e,t,n)}}));var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var 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&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){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++},e.prototype.removeNode=function(e){var 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--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;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=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,i,o;if(!e.frozen&&!e.locked){for(var a=[],s=new fe,u=function(t){for(var n=t,r=F;r===F;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,o,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(i=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===i?void 0:i.host;)d=(null===(c=null===(o=null==d?void 0:d.getRootNode)||void 0===o?void 0:o.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=Y(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){le(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;me(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;ye(e.droppedSet,p)||me(e.removes,p,e.mirror)?ye(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}for(var v=null;s.length;){var g=null;if(v){var _=e.mirror.getId(v.value.parentNode),m=u(v.value);-1!==_&&-1!==m&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){_=e.mirror.getId(b.value.parentNode),m=u(b.value);if(-1!==_&&-1!==m){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,i,o,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:J(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=x({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var _=n(Array.from(l.style)),m=_.next();!m.done;m=_.next()){h=m.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}}else c.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),i=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(_e(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,i)]?_e(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function _e(e,t){e.delete(t),t.childNodes.forEach((function(t){return _e(e,t)}))}function me(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||me(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,we=[],ke="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,xe="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function Ee(e){try{if("composedPath"in e){var 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 Ce(e,t){var n,r,i=new be;we.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=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");a&&window[a]&&(o=window[a]);var s=new o(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Oe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.sampling;if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,s=[];return Object.keys(j).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var o=e.toLowerCase(),a=function(e){return function(n){var o=Ee(n);if(!ae(o,i)){var a=ce(n)?n.changedTouches[0]:n;if(a){var s=r.getId(o),u=a.clientX,c=a.clientY;t({type:j[e],id:s,x:u,y:c})}}}}(e);s.push(K(o,a,n))})),function(){s.forEach((function(e){return e()}))}}function Te(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass;return K("scroll",te((function(e){var o=Ee(e);if(o&&!ae(o,i)){var a=r.getId(o);if(o===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}}),e.sampling.scroll||100),n)}function Fe(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Pe=new WeakMap;function Re(e){return function(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||xe&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,o){var a,s;void 0===o&&(o={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,i([],r(e),!1)),n.apply(void 0,i([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],r(e),!1)),o.apply(void 0,i([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],r(e),!1)),a.apply(void 0,i([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],r(e),!1)),s.apply(void 0,i([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],r(e),!1)),u.apply(void 0,i([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],r(e),!1)),c.apply(void 0,i([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],r(e),!1)),l.apply(void 0,i([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],r(e),!1)),d.apply(void 0,i([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],r(e),!1)),p.apply(void 0,i([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],r(e),!1)),f.apply(void 0,i([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],r(e),!1)),h.apply(void 0,i([],r(e),!1))}}(e,o);var c=Ce(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=te((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null}),s),l=te((function(e){var t=Ee(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=Date.now()),u.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[K("mousemove",l,r),K("touchmove",l,r),K("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Oe(e),p=Te(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return K("resize",te((function(){var e=ie(),i=oe();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200),window)}(e),h=function(e){var n=e.inputCb,o=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Ee(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var i=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(i=x({maskInputOptions:c,tagName:t.tagName,type:r,value:i,maskInputFn:l})),h(t,Fe({text:i,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&o.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Fe({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var i=Pe.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pe.set(e,r);var o=a.getId(e);n(t(t({},r),{id:o}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return K(e,f,o)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),_=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,i([],r(_.map((function(e){return ne(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,o=function(e){return te((function(i){var o=Ee(i);if(o&&!ae(o,n)){var a=o,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(o),currentTime:s,volume:u,muted:c})}}),i.media||500)},a=[K("play",o(0)),K("pause",o(1)),K("seeked",o(2)),K("volumechange",o(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,o=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=o.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=o.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};ke?c.CSSGroupingRule=a.CSSGroupingRule:(Se&&(c.CSSMediaRule=a.CSSMediaRule),Ie&&(c.CSSConditionRule=a.CSSConditionRule),xe&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=o.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],r(Re(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=o.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],r(Re(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];i.prototype.insertRule=l[n].insertRule,i.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),_=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:i},index:Re(this.parentRule)}),o.apply(this,arguments)};var a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,o=r.getId(null===(i=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==o&&n({id:o,remove:{property:e},index:Re(this.parentRule)}),a.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),m=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(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};var s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),function(){i.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){we.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),_(),m(),y.forEach((function(e){return e()}))}}var Ae=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),De=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){Ce(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Te(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),je=0;je<Le.length;je++)$e[Le.charCodeAt(je)]=je;var qe=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Le[n[t]>>2],i+=Le[(3&n[t])<<4|n[t+1]>>4],i+=Le[(15&n[t+1])<<2|n[t+2]>>6],i+=Le[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},He=new Map;var Ue=function(e,t,n){if(e&&(Ve(e,t)||"object"===s(e))){var r=function(e,t){var n=He.get(e);return n||(n=new Map,He.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function Be(e,t,n){return e instanceof Array?e.map((function(e){return Be(e,t,n)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:qe(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Be(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Be(e.data,t,n),e.width,e.height]}:Ve(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:Ue(e,t,n)}:e}var We=function(e,t,n){return i([],r(e),!1).map((function(e){return Be(e,t,n)}))},Ve=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,o,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=re(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(Ue(p,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var f=We(i([],r(l),!1),u,e),h={type:t,property:n,args:f};o(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=ne(e,n,{set:function(e){o(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ge,Je,Qe=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(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)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=function(e,t){var n=[];try{var o=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],r(o),!1))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,o,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,o)||setTimeout((function(){var t=i([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var o=t[0],u=o.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,o.width,o.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:q["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:q["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,o){var a=[];return a.push.apply(a,i([],r(ze(t.WebGLRenderingContext.prototype,q.WebGL,e,n,o,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],r(ze(t.WebGL2RenderingContext.prototype,q.WebGL2,e,n,o,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){o(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var 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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Xe(e){return t(t({},e),{timestamp:Date.now()})}var Ye={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ke(e){void 0===e&&(e={});var i=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,_=e.inlineStylesheet,m=void 0===_||_,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,x=e.hooks,I=e.packFn,E=e.sampling,C=void 0===E?{}:E,O=e.mousemoveWait,T=e.recordCanvas,F=void 0!==T&&T,M=e.userTriggeredOnInput,P=void 0!==M&&M,R=e.collectFonts,N=void 0!==R&&R,A=e.inlineImages,D=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,H=void 0===q?function(){return!1}:q;if(!i)throw new Error("emit function is required");void 0!==O&&void 0===C.mousemove&&(C.mousemove=O);var U,B=!0===y?{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!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ge=function(e,t){var r;if(!(null===(r=we[0])||void 0===r?void 0:r.isFrozen())||e.type===L.FullSnapshot||e.type===L.IncrementalSnapshot&&e.data.source===$.Mutation||we.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var i=n(j||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===L.FullSnapshot)U=e,V=0;else if(e.type===L.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=o&&e.timestamp-U.timestamp>o;(s||u)&&Je(!0)}};var z=function(e){Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},J=function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},Q=new Ae({mutationCb:z}),X=new Qe({recordCanvas:F,mutationCb:J,win:window,blockClass:u,mirror:Ye}),Z=new De({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskInputOptions:B,maskTextFn:S,maskInputFn:k,recordCanvas:F,inlineImages:D,sampling:C,slimDOMOptions:W,iframeManager:Q,canvasManager:X},mirror:Ye});Je=function(e){var t,n,i,o;void 0===e&&(e=!1),Ge(Xe({type:L.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),we.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,a=void 0===o?null:o,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,_=n.maskAllInputs,m=void 0!==_&&_,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,x=n.preserveWhiteSpace,I=n.onSerialize,E=n.onIframeLoad,C=n.iframeLoadTimeout,O=n.keepIframeSrcFn,T={};return[Y(e,{doc:e,map:T,blockClass:i,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===m?{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===m?{password:!0}:m,maskTextFn:y,maskInputFn:b,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:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:x,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:C,keepIframeSrcFn:void 0===O?function(){return!1}:O}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:m,maskAllInputs:B,maskTextFn:S,slimDOM:W,recordCanvas:F,inlineImages:D,onSerialize:function(e){le(e)&&Q.addIframe(e),de(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){Q.attachIframe(e,t),Z.observeAttachShadow(e)},keepIframeSrcFn:H}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Ye.map=c,Ge(Xe({type:L.FullSnapshot,data:{node:s,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===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),we.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(K("DOMContentLoaded",(function(){Ge(Xe({type:L.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ge(Xe({type:L.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:J,fontCb:function(e){return Ge(Xe({type:L.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:B,inlineStylesheet:m,sampling:C,recordCanvas:F,inlineImages:D,userTriggeredOnInput:P,collectFonts:N,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Ye,iframeManager:Q,shadowDomManager:Z,canvasManager:X,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Xe({type:L.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},x)};Q.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Je(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(K("load",(function(){Ge(Xe({type:L.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ke.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Xe({type:L.Custom,data:{tag:e,payload:t}}))},Ke.freezePage=function(){we.forEach((function(e){return e.freeze()}))},Ke.takeFullSnapshot=function(e){if(!Je)throw new Error("please take full snapshot after start recording");Je(e)},Ke.mirror=Ye;var Ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},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),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ze({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),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 Ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ze({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[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=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ze({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!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 Ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function it(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,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function ot(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,i;if(0===t)return!0;var o=Object.keys(e);try{for(var a=n(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(ot(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1}function st(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(ot(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ot(e)&&at(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(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=it(u.length?u[0]:null):a[s]=u}return a}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 ut={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 ct(e,t,o){var a,s,u,c=o.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(o.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,i=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(o.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,o.stringifyOptions)}));++l<o.lengthThreshold?e({level:n,trace:c,payload:d}):l===o.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var lt="undefined"!=typeof window?window:{};lt.rrweb={record:Ke,version:"v1",rrwebVersion:"1.1.3"},lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:ct,options:e?Object.assign({},ut,e):ut}}};var dt={DEBUG:!1,LIB_VERSION:"1.68.4"};
16
16
  /**
17
17
  * uuidv7: An experimental implementation of the proposed UUID Version 7
18
18
  *
package/dist/array.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y={DEBUG:!1,LIB_VERSION:"1.68.2"};
1
+ !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y={DEBUG:!1,LIB_VERSION:"1.68.4"};
2
2
  /**
3
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
4
4
  *
package/dist/es.js CHANGED
@@ -1,4 +1,4 @@
1
- function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y={DEBUG:!1,LIB_VERSION:"1.68.2"};
1
+ function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y={DEBUG:!1,LIB_VERSION:"1.68.4"};
2
2
  /**
3
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
4
4
  *
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var y={DEBUG:!1,LIB_VERSION:"1.68.2"};
1
+ "use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var y={DEBUG:!1,LIB_VERSION:"1.68.4"};
2
2
  /**
3
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
4
4
  *
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-js",
3
- "version": "1.68.2",
3
+ "version": "1.68.4",
4
4
  "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",
5
5
  "repository": "https://github.com/PostHog/posthog-js",
6
6
  "author": "hey@posthog.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-js",
3
- "version": "1.68.2",
3
+ "version": "1.68.4",
4
4
  "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",
5
5
  "repository": "https://github.com/PostHog/posthog-js",
6
6
  "author": "hey@posthog.com",
@@ -1,30 +1,28 @@
1
- import * as React from 'react';
2
- import React__default, { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
3
1
  import posthogJs from 'posthog-js';
2
+ import React, { createContext, useMemo, useContext, useState, useEffect, useRef, useCallback } from 'react';
4
3
 
5
- var PostHogContext = createContext({ client: undefined });
4
+ var PostHogContext = createContext({ client: posthogJs });
6
5
 
7
6
  function PostHogProvider(_a) {
8
7
  var children = _a.children, client = _a.client, apiKey = _a.apiKey, options = _a.options;
9
- var _b = useState(client), posthog = _b[0], setPosthog = _b[1];
10
- useEffect(function () {
8
+ var posthog = useMemo(function () {
11
9
  if (client && apiKey) {
12
10
  console.warn('You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client.');
13
11
  }
14
12
  if (client && options) {
15
13
  console.warn('You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client.');
16
14
  }
17
- if (posthog) {
18
- return;
19
- }
20
15
  if (client) {
21
- setPosthog(client);
16
+ return client;
22
17
  }
23
- else if (apiKey) {
18
+ if (apiKey) {
19
+ if (posthogJs.__loaded) {
20
+ console.warn('posthog was already loaded elsewhere. This may cause issues.');
21
+ }
24
22
  posthogJs.init(apiKey, options);
25
- setPosthog(posthogJs);
26
23
  }
27
- }, [posthog, client, apiKey, options]);
24
+ return posthogJs;
25
+ }, [client, apiKey]);
28
26
  return React.createElement(PostHogContext.Provider, { value: { client: posthog } }, children);
29
27
  }
30
28
 
@@ -37,9 +35,6 @@ function useFeatureFlagEnabled(flag) {
37
35
  var client = usePostHog();
38
36
  var _a = useState(), featureEnabled = _a[0], setFeatureEnabled = _a[1];
39
37
  useEffect(function () {
40
- if (!client) {
41
- return;
42
- }
43
38
  return client.onFeatureFlags(function () {
44
39
  setFeatureEnabled(client.isFeatureEnabled(flag));
45
40
  });
@@ -51,9 +46,6 @@ function useFeatureFlagPayload(flag) {
51
46
  var client = usePostHog();
52
47
  var _a = useState(), featureFlagPayload = _a[0], setFeatureFlagPayload = _a[1];
53
48
  useEffect(function () {
54
- if (!client) {
55
- return;
56
- }
57
49
  return client.onFeatureFlags(function () {
58
50
  setFeatureFlagPayload(client.getFeatureFlagPayload(flag));
59
51
  });
@@ -65,9 +57,6 @@ function useActiveFeatureFlags() {
65
57
  var client = usePostHog();
66
58
  var _a = useState(), featureFlags = _a[0], setFeatureFlags = _a[1];
67
59
  useEffect(function () {
68
- if (!client) {
69
- return;
70
- }
71
60
  return client.onFeatureFlags(function (flags) {
72
61
  setFeatureFlags(flags);
73
62
  });
@@ -79,9 +68,6 @@ function useFeatureFlagVariantKey(flag) {
79
68
  var client = usePostHog();
80
69
  var _a = useState(), featureFlagVariantKey = _a[0], setFeatureFlagVariantKey = _a[1];
81
70
  useEffect(function () {
82
- if (!client) {
83
- return;
84
- }
85
71
  return client.onFeatureFlags(function () {
86
72
  setFeatureFlagVariantKey(client.getFeatureFlag(flag));
87
73
  });
@@ -128,40 +114,42 @@ function __rest(s, e) {
128
114
  }
129
115
 
130
116
  function PostHogFeature(_a) {
131
- var flag = _a.flag, match = _a.match, children = _a.children, fallback = _a.fallback, visibilityObserverOptions = _a.visibilityObserverOptions, props = __rest(_a, ["flag", "match", "children", "fallback", "visibilityObserverOptions"]);
117
+ var flag = _a.flag, match = _a.match, children = _a.children, fallback = _a.fallback, visibilityObserverOptions = _a.visibilityObserverOptions, trackInteraction = _a.trackInteraction, trackView = _a.trackView, props = __rest(_a, ["flag", "match", "children", "fallback", "visibilityObserverOptions", "trackInteraction", "trackView"]);
132
118
  var payload = useFeatureFlagPayload(flag);
133
119
  var variant = useFeatureFlagVariantKey(flag);
120
+ var shouldTrackInteraction = trackInteraction !== null && trackInteraction !== void 0 ? trackInteraction : true;
121
+ var shouldTrackView = trackView !== null && trackView !== void 0 ? trackView : true;
134
122
  if (match === undefined || variant === match) {
135
123
  var childNode = typeof children === 'function' ? children(payload) : children;
136
- return (React__default.createElement(VisibilityAndClickTracker, __assign({ flag: flag, options: visibilityObserverOptions }, props), childNode));
124
+ return (React.createElement(VisibilityAndClickTracker, __assign({ flag: flag, options: visibilityObserverOptions, trackInteraction: shouldTrackInteraction, trackView: shouldTrackView }, props), childNode));
137
125
  }
138
- return React__default.createElement(React__default.Fragment, null, fallback);
126
+ return React.createElement(React.Fragment, null, fallback);
139
127
  }
140
- function trackClicks(flag, posthog) {
128
+ function captureFeatureInteraction(flag, posthog) {
141
129
  var _a;
142
- posthog === null || posthog === void 0 ? void 0 : posthog.capture('$feature_interaction', { feature_flag: flag, $set: (_a = {}, _a["$feature_interaction/" + flag] = true, _a) });
130
+ posthog.capture('$feature_interaction', { feature_flag: flag, $set: (_a = {}, _a["$feature_interaction/" + flag] = true, _a) });
143
131
  }
144
- function trackVisibility(flag, posthog) {
145
- posthog === null || posthog === void 0 ? void 0 : posthog.capture('$feature_view', { feature_flag: flag });
132
+ function captureFeatureView(flag, posthog) {
133
+ posthog.capture('$feature_view', { feature_flag: flag });
146
134
  }
147
135
  function VisibilityAndClickTracker(_a) {
148
- var flag = _a.flag, children = _a.children, options = _a.options, props = __rest(_a, ["flag", "children", "options"]);
136
+ var flag = _a.flag, children = _a.children, trackInteraction = _a.trackInteraction, trackView = _a.trackView, options = _a.options, props = __rest(_a, ["flag", "children", "trackInteraction", "trackView", "options"]);
149
137
  var ref = useRef(null);
150
138
  var posthog = usePostHog();
151
139
  var visibilityTrackedRef = useRef(false);
152
140
  var clickTrackedRef = useRef(false);
153
141
  var cachedOnClick = useCallback(function () {
154
- if (!clickTrackedRef.current) {
155
- trackClicks(flag, posthog);
142
+ if (!clickTrackedRef.current && trackInteraction) {
143
+ captureFeatureInteraction(flag, posthog);
156
144
  clickTrackedRef.current = true;
157
145
  }
158
- }, [flag, posthog]);
146
+ }, [flag, posthog, trackInteraction]);
159
147
  useEffect(function () {
160
- if (ref.current === null)
148
+ if (ref.current === null || !trackView)
161
149
  return;
162
150
  var onIntersect = function (entry) {
163
151
  if (!visibilityTrackedRef.current && entry.isIntersecting) {
164
- trackVisibility(flag, posthog);
152
+ captureFeatureView(flag, posthog);
165
153
  visibilityTrackedRef.current = true;
166
154
  }
167
155
  };
@@ -171,8 +159,8 @@ function VisibilityAndClickTracker(_a) {
171
159
  }, __assign({ threshold: 0.1 }, options));
172
160
  observer.observe(ref.current);
173
161
  return function () { return observer.disconnect(); };
174
- }, [flag, options, posthog, ref]);
175
- return (React__default.createElement("div", __assign({ ref: ref }, props, { onClick: cachedOnClick }), children));
162
+ }, [flag, options, posthog, ref, trackView]);
163
+ return (React.createElement("div", __assign({ ref: ref }, props, { onClick: cachedOnClick }), children));
176
164
  }
177
165
 
178
166
  export { PostHogContext, PostHogFeature, PostHogProvider, useActiveFeatureFlags, useFeatureFlagEnabled, useFeatureFlagPayload, useFeatureFlagVariantKey, usePostHog };
@@ -5,6 +5,8 @@ export declare type PostHogFeatureProps = React.HTMLProps<HTMLDivElement> & {
5
5
  fallback?: React.ReactNode;
6
6
  match?: string | boolean;
7
7
  visibilityObserverOptions?: IntersectionObserverInit;
8
+ trackInteraction?: boolean;
9
+ trackView?: boolean;
8
10
  };
9
- export declare function PostHogFeature({ flag, match, children, fallback, visibilityObserverOptions, ...props }: PostHogFeatureProps): JSX.Element | null;
11
+ export declare function PostHogFeature({ flag, match, children, fallback, visibilityObserverOptions, trackInteraction, trackView, ...props }: PostHogFeatureProps): JSX.Element | null;
10
12
  //# sourceMappingURL=PostHogFeature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostHogFeature.d.ts","sourceRoot":"","sources":["../../../src/components/PostHogFeature.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAG7D,oBAAY,mBAAmB,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG;IAChE,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB,yBAAyB,CAAC,EAAE,wBAAwB,CAAA;CACvD,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,yBAAyB,EACzB,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAa1C"}
1
+ {"version":3,"file":"PostHogFeature.d.ts","sourceRoot":"","sources":["../../../src/components/PostHogFeature.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAG7D,oBAAY,mBAAmB,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG;IAChE,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB,yBAAyB,CAAC,EAAE,wBAAwB,CAAA;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,yBAAyB,EACzB,gBAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAsB1C"}
@@ -2,6 +2,6 @@
2
2
  import posthogJs from 'posthog-js';
3
3
  export declare type PostHog = typeof posthogJs;
4
4
  export declare const PostHogContext: import("react").Context<{
5
- client?: import("posthog-js").PostHog | undefined;
5
+ client: PostHog;
6
6
  }>;
7
7
  //# sourceMappingURL=PostHogContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostHogContext.d.ts","sourceRoot":"","sources":["../../../src/context/PostHogContext.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,oBAAY,OAAO,GAAG,OAAO,SAAS,CAAA;AAEtC,eAAO,MAAM,cAAc;;EAA6D,CAAA"}
1
+ {"version":3,"file":"PostHogContext.d.ts","sourceRoot":"","sources":["../../../src/context/PostHogContext.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,oBAAY,OAAO,GAAG,OAAO,SAAS,CAAA;AAEtC,eAAO,MAAM,cAAc;YAA2B,OAAO;EAA0B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { PostHogConfig } from 'posthog-js';
2
- import * as React from 'react';
2
+ import React from 'react';
3
3
  import { PostHog } from './PostHogContext';
4
4
  export declare function PostHogProvider({ children, client, apiKey, options, }: {
5
5
  children?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"PostHogProvider.d.ts","sourceRoot":"","sources":["../../../src/context/PostHogProvider.tsx"],"names":[],"mappings":"AAAA,OAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAErD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AAE1D,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,GACV,EAAE;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;CAC/C,eA6BA"}
1
+ {"version":3,"file":"PostHogProvider.d.ts","sourceRoot":"","sources":["../../../src/context/PostHogProvider.tsx"],"names":[],"mappings":"AAAA,OAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAErD,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AAE1D,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,GACV,EAAE;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;CAC/C,eA6BA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useActiveFeatureFlags.d.ts","sourceRoot":"","sources":["../../../src/hooks/useActiveFeatureFlags.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,GAAG,SAAS,CAiB5D"}
1
+ {"version":3,"file":"useActiveFeatureFlags.d.ts","sourceRoot":"","sources":["../../../src/hooks/useActiveFeatureFlags.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,GAAG,SAAS,CAc5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlagEnabled.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagEnabled.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAiBvE"}
1
+ {"version":3,"file":"useFeatureFlagEnabled.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagEnabled.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAcvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlagPayload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAiBxE"}
1
+ {"version":3,"file":"useFeatureFlagPayload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAcxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFeatureFlagVariantKey.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagVariantKey.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAiBnF"}
1
+ {"version":3,"file":"useFeatureFlagVariantKey.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFeatureFlagVariantKey.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAcnF"}
@@ -1,3 +1,3 @@
1
1
  import { PostHog } from '../context';
2
- export declare const usePostHog: () => PostHog | undefined;
2
+ export declare const usePostHog: () => PostHog;
3
3
  //# sourceMappingURL=usePostHog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePostHog.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePostHog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAkB,MAAM,YAAY,CAAA;AAEpD,eAAO,MAAM,UAAU,QAAO,OAAO,GAAG,SAGvC,CAAA"}
1
+ {"version":3,"file":"usePostHog.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePostHog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAkB,MAAM,YAAY,CAAA;AAEpD,eAAO,MAAM,UAAU,QAAO,OAG7B,CAAA"}
@@ -1,59 +1,37 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('posthog-js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'posthog-js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PosthogReact = {}, global.React, global.posthogJs));
5
- }(this, (function (exports, React, posthogJs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('posthog-js'), require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'posthog-js', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PosthogReact = {}, global.posthogJs, global.React));
5
+ }(this, (function (exports, posthogJs, React) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
21
- });
22
- }
23
- });
24
- }
25
- n['default'] = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
31
9
  var posthogJs__default = /*#__PURE__*/_interopDefaultLegacy(posthogJs);
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
32
11
 
33
- var PostHogContext = React.createContext({ client: undefined });
12
+ var PostHogContext = React.createContext({ client: posthogJs__default['default'] });
34
13
 
35
14
  function PostHogProvider(_a) {
36
15
  var children = _a.children, client = _a.client, apiKey = _a.apiKey, options = _a.options;
37
- var _b = React.useState(client), posthog = _b[0], setPosthog = _b[1];
38
- React.useEffect(function () {
16
+ var posthog = React.useMemo(function () {
39
17
  if (client && apiKey) {
40
18
  console.warn('You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client.');
41
19
  }
42
20
  if (client && options) {
43
21
  console.warn('You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client.');
44
22
  }
45
- if (posthog) {
46
- return;
47
- }
48
23
  if (client) {
49
- setPosthog(client);
24
+ return client;
50
25
  }
51
- else if (apiKey) {
26
+ if (apiKey) {
27
+ if (posthogJs__default['default'].__loaded) {
28
+ console.warn('posthog was already loaded elsewhere. This may cause issues.');
29
+ }
52
30
  posthogJs__default['default'].init(apiKey, options);
53
- setPosthog(posthogJs__default['default']);
54
31
  }
55
- }, [posthog, client, apiKey, options]);
56
- return React__namespace.createElement(PostHogContext.Provider, { value: { client: posthog } }, children);
32
+ return posthogJs__default['default'];
33
+ }, [client, apiKey]);
34
+ return React__default['default'].createElement(PostHogContext.Provider, { value: { client: posthog } }, children);
57
35
  }
58
36
 
59
37
  var usePostHog = function () {
@@ -65,9 +43,6 @@
65
43
  var client = usePostHog();
66
44
  var _a = React.useState(), featureEnabled = _a[0], setFeatureEnabled = _a[1];
67
45
  React.useEffect(function () {
68
- if (!client) {
69
- return;
70
- }
71
46
  return client.onFeatureFlags(function () {
72
47
  setFeatureEnabled(client.isFeatureEnabled(flag));
73
48
  });
@@ -79,9 +54,6 @@
79
54
  var client = usePostHog();
80
55
  var _a = React.useState(), featureFlagPayload = _a[0], setFeatureFlagPayload = _a[1];
81
56
  React.useEffect(function () {
82
- if (!client) {
83
- return;
84
- }
85
57
  return client.onFeatureFlags(function () {
86
58
  setFeatureFlagPayload(client.getFeatureFlagPayload(flag));
87
59
  });
@@ -93,9 +65,6 @@
93
65
  var client = usePostHog();
94
66
  var _a = React.useState(), featureFlags = _a[0], setFeatureFlags = _a[1];
95
67
  React.useEffect(function () {
96
- if (!client) {
97
- return;
98
- }
99
68
  return client.onFeatureFlags(function (flags) {
100
69
  setFeatureFlags(flags);
101
70
  });
@@ -107,9 +76,6 @@
107
76
  var client = usePostHog();
108
77
  var _a = React.useState(), featureFlagVariantKey = _a[0], setFeatureFlagVariantKey = _a[1];
109
78
  React.useEffect(function () {
110
- if (!client) {
111
- return;
112
- }
113
79
  return client.onFeatureFlags(function () {
114
80
  setFeatureFlagVariantKey(client.getFeatureFlag(flag));
115
81
  });
@@ -156,40 +122,42 @@
156
122
  }
157
123
 
158
124
  function PostHogFeature(_a) {
159
- var flag = _a.flag, match = _a.match, children = _a.children, fallback = _a.fallback, visibilityObserverOptions = _a.visibilityObserverOptions, props = __rest(_a, ["flag", "match", "children", "fallback", "visibilityObserverOptions"]);
125
+ var flag = _a.flag, match = _a.match, children = _a.children, fallback = _a.fallback, visibilityObserverOptions = _a.visibilityObserverOptions, trackInteraction = _a.trackInteraction, trackView = _a.trackView, props = __rest(_a, ["flag", "match", "children", "fallback", "visibilityObserverOptions", "trackInteraction", "trackView"]);
160
126
  var payload = useFeatureFlagPayload(flag);
161
127
  var variant = useFeatureFlagVariantKey(flag);
128
+ var shouldTrackInteraction = trackInteraction !== null && trackInteraction !== void 0 ? trackInteraction : true;
129
+ var shouldTrackView = trackView !== null && trackView !== void 0 ? trackView : true;
162
130
  if (match === undefined || variant === match) {
163
131
  var childNode = typeof children === 'function' ? children(payload) : children;
164
- return (React__default['default'].createElement(VisibilityAndClickTracker, __assign({ flag: flag, options: visibilityObserverOptions }, props), childNode));
132
+ return (React__default['default'].createElement(VisibilityAndClickTracker, __assign({ flag: flag, options: visibilityObserverOptions, trackInteraction: shouldTrackInteraction, trackView: shouldTrackView }, props), childNode));
165
133
  }
166
134
  return React__default['default'].createElement(React__default['default'].Fragment, null, fallback);
167
135
  }
168
- function trackClicks(flag, posthog) {
136
+ function captureFeatureInteraction(flag, posthog) {
169
137
  var _a;
170
- posthog === null || posthog === void 0 ? void 0 : posthog.capture('$feature_interaction', { feature_flag: flag, $set: (_a = {}, _a["$feature_interaction/" + flag] = true, _a) });
138
+ posthog.capture('$feature_interaction', { feature_flag: flag, $set: (_a = {}, _a["$feature_interaction/" + flag] = true, _a) });
171
139
  }
172
- function trackVisibility(flag, posthog) {
173
- posthog === null || posthog === void 0 ? void 0 : posthog.capture('$feature_view', { feature_flag: flag });
140
+ function captureFeatureView(flag, posthog) {
141
+ posthog.capture('$feature_view', { feature_flag: flag });
174
142
  }
175
143
  function VisibilityAndClickTracker(_a) {
176
- var flag = _a.flag, children = _a.children, options = _a.options, props = __rest(_a, ["flag", "children", "options"]);
144
+ var flag = _a.flag, children = _a.children, trackInteraction = _a.trackInteraction, trackView = _a.trackView, options = _a.options, props = __rest(_a, ["flag", "children", "trackInteraction", "trackView", "options"]);
177
145
  var ref = React.useRef(null);
178
146
  var posthog = usePostHog();
179
147
  var visibilityTrackedRef = React.useRef(false);
180
148
  var clickTrackedRef = React.useRef(false);
181
149
  var cachedOnClick = React.useCallback(function () {
182
- if (!clickTrackedRef.current) {
183
- trackClicks(flag, posthog);
150
+ if (!clickTrackedRef.current && trackInteraction) {
151
+ captureFeatureInteraction(flag, posthog);
184
152
  clickTrackedRef.current = true;
185
153
  }
186
- }, [flag, posthog]);
154
+ }, [flag, posthog, trackInteraction]);
187
155
  React.useEffect(function () {
188
- if (ref.current === null)
156
+ if (ref.current === null || !trackView)
189
157
  return;
190
158
  var onIntersect = function (entry) {
191
159
  if (!visibilityTrackedRef.current && entry.isIntersecting) {
192
- trackVisibility(flag, posthog);
160
+ captureFeatureView(flag, posthog);
193
161
  visibilityTrackedRef.current = true;
194
162
  }
195
163
  };
@@ -199,7 +167,7 @@
199
167
  }, __assign({ threshold: 0.1 }, options));
200
168
  observer.observe(ref.current);
201
169
  return function () { return observer.disconnect(); };
202
- }, [flag, options, posthog, ref]);
170
+ }, [flag, options, posthog, ref, trackView]);
203
171
  return (React__default['default'].createElement("div", __assign({ ref: ref }, props, { onClick: cachedOnClick }), children));
204
172
  }
205
173