window.NOIBUJS_CONFIG={"scriptID":"c9a54a41cb4a44f786ff7907d72aa1358b684121"};(()=>{var e={327:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},171:(e,t,n)=>{var r=n(217),i=n(327);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=["metroplexSocketBase","metroplexHTTPBase"],t=["innerText","textContent","value","title"],r=["Image","EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];function i(){return window.NOIBUJS_CONFIG?window.NOIBUJS_CONFIG:{}}const o=["i.noibu","i.staging.noibu","input.staging.noibu","input.b.noibu","input.noibu","vf.staging.noibu","vf.noibu"];function s(){const e=i();return e.scriptID?e.scriptID:"default"}function a(){try{const e="wss://input.noibu.com";return e.endsWith("/")?e.slice(0,-1):e}catch(e){return"ws://localhost:3000"}}function c(){try{const e="https://input.noibu.com";return e.endsWith("/")?e.slice(0,-1):e}catch(e){return"http://localhost:3000"}}function u(){return c()+"/pv"}function l(){try{return"prod"}catch(e){return"test"}}const d=/("href":["']([^"]*\.css[^"]*)["'])/gi;var p=n(171),h=n.n(p);const f=(e,t,n)=>{if(!(t in e))return;const r=e[t],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:r},__noibu_wrapped__:{enumerable:!1,value:i}})}catch(e){}e[t]=i};function m(e){return e.split("\n").reduce((function(e,t){var n=function(e){var t=v.exec(e);if(!t)return null;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),i=g.exec(t[2]);r&&null!=i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]);return{file:n?null:t[2],methodName:t[1]||"<unknown>",arguments:n?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}(t)||function(e){var t=y.exec(e);if(!t)return null;return{file:t[2],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}(t)||function(e){var t=b.exec(e);if(!t)return null;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=w.exec(t[3]);n&&null!=r&&(t[3]=r[1],t[4]=r[2],t[5]=null);return{file:t[3],methodName:t[1]||"<unknown>",arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}(t)||function(e){var t=C.exec(e);if(!t)return null;return{file:t[2],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}(t)||function(e){var t=S.exec(e);if(!t)return null;return{file:t[3],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}}(t);return n&&e.push(n),e}),[])}var v=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,g=/\((\S*)(?::(\d+))(?::(\d+))\)/;var y=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var b=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,w=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;var S=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;var C=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function k(e,t=1024){return e?e.length<t?e:e.substring(0,t):e}function I(){let e=window.location.href;return window.location.href.startsWith("http")?e=window.location.href:window.parent&&window.parent.location&&window.parent.location.href.startsWith("http")&&(e=window.parent.location.href),k(e)}function _(e){let t=[{line:"_",mname:"_",file:"_"}];if("object"!=typeof e||!e)return{frames:t,msg:""};e.stack?t=m(e.stack).map(e=>{const t={line:"_",mname:"_",file:"_"};return e.lineNumber&&"<unknown>"!==e.lineNumber&&(t.line=String(e.lineNumber)),e.methodName&&"<unknown>"!==e.methodName&&(t.mname=String(e.methodName)),e.file&&"<unknown>"!==e.file&&(t.file=String(e.file)),e.column&&"number"==typeof e.column&&(t.column=e.column),t}):(e.fileName&&"string"==typeof e.fileName&&(t[0].file=e.fileName),e.lineNumber&&(t[0].line=String(e.lineNumber)),e.columnNumber&&Number.isInteger(e.columnNumber)&&(t[0].column=e.columnNumber)),t.length>=50&&(t=t.slice(0,50));return{frames:t,msg:e.message?k(e.message):""}}function T(e){if(Array.prototype.toJSON){const t=Array.prototype.toJSON;delete Array.prototype.toJSON;const n=JSON.stringify(e);return Array.prototype.toJSON=t,n}return JSON.stringify(e)}function E(e,t,n,r,i,o){if(o){const e=T(n),i=new Blob([e]).size;return!window.fetch||i>59e3?new Promise(e=>{e()}):fetch(t,{method:"POST",headers:r,body:T(n),keepalive:!0})}return new Promise((o,s)=>{const a=new XMLHttpRequest;a.open(e,t),a.timeout=i,Object.keys(r).forEach(e=>{a.setRequestHeader(e,r[e])}),a.onload=()=>{a.status>=200&&a.status<300?o(a.response):s(new Error("Custom Request failed: "+a.statusText))},a.onerror=()=>{s(new Error("Custom Request failed: "+a.statusText))},n?a.send(T(n)):a.send()})}function x(){const e=i();return e.sel&&Array.isArray(e.sel)}function M(){const e=i();return!!function(){const e=i();return"undefined"!==e.nid_cookie&&null!=e.nid_cookie}()&&e.nid_cookie}function D(){const e=i(),t=[".noibu-blocked",".creditCard"];return x()&&t.push(...e.sel),""+t.join(",")}function N(){const e="1"===window.navigator.doNotTrack,t=function(e){let t=e;return t||(t=window.navigator.userAgent),t=t.toLowerCase(),new RegExp("(bot|crawl(er)?|sp(i|y)der|search|worm|fetch|nutch|headless|baidu|teoma|yandex|woorankreview|pingdom|synthetic|dataprovider|qaautomation|morningscore|wappalyzer|foregenix|StatusCake|SpeedCurve|Outlook-iOS|bitdiscovery|testing|webflow|bingpreview|(r|R)igor|facebookexternalhit/\\d+\\.\\d+)","i").test(t)}(null);return e||t}function O(e){return e?"object"==typeof e?T(e):String(e):""}function R(e){let t=k(window.location.href);return e&&""!==e.trim()&&"undefined"!==e&&(t=O(k(e))),t}const L={"input.noibu.com":!0,"input.staging.noibu.com":!0,"vf.noibu.com":!0,"vf.staging.noibu.com":!0,"cdn.noibu.com":!0};function P(e){return window&&window.localStorage&&navigator.cookieEnabled?window.localStorage.getItem(e):null}function A(e,t){if(!window||!window.localStorage)throw new Error("window or window.localStorage do not exist");if(!navigator.cookieEnabled)throw new Error("cookies disabled");return window.localStorage.setItem(e,t)}function F(e){window&&window.localStorage&&navigator.cookieEnabled&&window.localStorage.removeItem(e)}class V{constructor(e){this.pageVisitId=h()(),this.isClientDisabled=null,this.browserId=null,this.pageVisitSeq=null,this.lastActiveTime=new Date,this.noibuErrorURL=e,this._setupLocalStorageVars(),this.cltErrorPostCounter=0,this.maxSocketInactiveTime=2100}static configureInstance(e){this.instance||(this.noibuErrorURL=e,this.instance=new V(e),this.instance.noibuErrorURL=e)}static getInstance(){if(!this.instance)throw new Error("ClientConfig was not configured");return this.instance}setupBrowserIDCookie(){M()&&(document.cookie="noibuID="+this.browserId)}lockClient(e,t){const n=new Date;n.setMinutes(n.getMinutes()+e);const r=this._getClientState();r.DisabledStatus=!0,r.ClientUnlockTime=n,this._storeBrowserData(r),this.postNoibuErrorAndOptionallyDisableClient(t,!0,"warn")}lockClientUntilNextPage(e){this.postNoibuErrorAndOptionallyDisableClient(e,!0,"warn")}updateLastActiveTime(e){this.lastActiveTime=e;const t=this._getLsObject();t.LastActive=e,this._storeBrowserData(t)}getPageVisitSeq(){if(this._pageVisitSeqNeedsReset()){this.pageVisitSeq=0;const e=this._getLsObject();e.CurrentPageVisitCount=this.pageVisitSeq+1,e.LastActive=new Date,this._storeBrowserData(e)}return this.pageVisitSeq}_getLsObject(){const e=P("n_browser_data");if(!e)return this._generateAndStoreData();let t={};try{t=JSON.parse(e)}catch(e){return this._generateAndStoreData()}return null==t.BrowserId||null==t.DisabledStatus||null==t.CurrentPageVisitCount||null==t.LastActive?this._generateAndStoreData():t}_pageVisitSeqNeedsReset(){const e=this._getClientState(),t=new Date;return t.setMinutes(t.getMinutes()-45),new Date(e.LastActive)<t}_setupLocalStorageVars(){const e=this._getClientState();if(this._pageVisitSeqNeedsReset()&&(e.CurrentPageVisitCount=0),this.browserId=e.BrowserId,this.pageVisitSeq=e.CurrentPageVisitCount,this.isClientDisabled=e.DisabledStatus,this.isClientDisabled||(e.CurrentPageVisitCount+=1,e.LastActive=new Date),l().includes("video")&&(e.pvId=this.pageVisitId),e.CurrentPageVisitCount>=300){V.getInstance().postNoibuErrorAndOptionallyDisableClient("Hit max page visits, disabling client",!0,"error");const t=new Date;t.setMinutes(t.getMinutes()+45),e.ClientUnlockTime=t}null===this._storeBrowserData(e).BrowserId&&(V.getInstance().postNoibuErrorAndOptionallyDisableClient("Null browser in local storage, disabling client",!0,"error"),this.browserId=null)}_getClientState(){const e=this._getLsObject();return e.ClientUnlockTime&&new Date(e.ClientUnlockTime)<=new Date&&(e.ClientUnlockTime=null,e.DisabledStatus=!1,this._storeBrowserData(e)),e}_generateAndStoreData(){return this._storeBrowserData(this._generateNewBrowserData())}_generateNewBrowserData(){const e={DisabledStatus:!1,BrowserId:h()(),CurrentPageVisitCount:0,ClientUnlockTime:null,LastActive:new Date};return l().includes("video")&&(e.pvId=this.pageVisitId),e}_storeBrowserData(e){try{return A("n_browser_data",T(e)),e}catch(e){this.postNoibuErrorAndOptionallyDisableClient("Error writing browser data to local storage, disabling client: "+e.message,!0,"error");return{DisabledStatus:!0,BrowserId:null,CurrentPageVisitCount:0}}}postNoibuErrorAndOptionallyDisableClient(e,t,n,r=!1){if(this.isClientDisabled)return;t&&(this.isClientDisabled=!0);let i=`Noibu Browser ID(${this.browserId?this.browserId:""}), PV ID ${this.pageVisitId}, Script ID ${s()}, and User Agent ${window.navigator.userAgent} error: ${O(e)}`;if(this.cltErrorPostCounter>=50){const e=new Date;e.setMinutes(e.getMinutes()+10);const t=this._getClientState();t.DisabledStatus=!0,t.ClientUnlockTime=e,this._storeBrowserData(t),this.isClientDisabled=!0,i="Shutting collect off, we reached the maximum limit of collect errors sent."}const o={url:window.location.href,err_msg:i,sev:n},a={"content-type":"application/json"};r?fetch(this.noibuErrorURL,{method:"POST",headers:a,body:T(o),keepalive:!0}):E("POST",this.noibuErrorURL,o,a,2e3,!1).catch(()=>{}),"error"===n&&(this.cltErrorPostCounter+=1)}isInactive(){const e=new Date;return e.setSeconds(e.getSeconds()-this.maxSocketInactiveTime),this.lastActiveTime<e}}class ${constructor(){this.expectedVideoLength=0,this.expectedVfSeq=0,this.expectedPvPart=0,this.videoClicks=0,this.pvClicks=0,this.errCount=0,this.httpCount=0,this.didCutPv=!1,this.didCutVideo=!1,this.writeTimeout=null,this._setupListeners()}static getInstance(){return this.instance||(this.instance=new $),this.instance}addVideoFragData(e,t){this.expectedVfSeq=e,this.expectedVideoLength=t}setPvPart(e){this.expectedPvPart=e}addVideoClick(){this.videoClicks+=1}addPvClick(){this.pvClicks+=1}addError(){this.errCount+=1}addHttpEvent(){this.httpCount+=1}setDidCutVideo(){this.didCutVideo=!0}setDidCutPv(){this.didCutPv=!0}_setupListeners(){["unload","pagehide"].forEach(e=>window.addEventListener(e,()=>{this._postMetricsIfActive(e)}))}_postMetricsIfActive(e){V.getInstance().isClientDisabled||V.getInstance().isInactive()||this.postMetrics(e)}postMetrics(e){const t={br_id:V.getInstance().browserId,pv_id:V.getInstance().pageVisitId,cv:2,v:1,exp_vid_len:this.expectedVideoLength,exp_vf_seq:this.expectedVfSeq,exp_pc_seq:this.expectedPvPart,vid_clicks:this.videoClicks,pv_clicks:this.pvClicks,did_cut_pv:this.didCutPv,did_cut_vid:this.didCutVideo,exp_http:this.httpCount,exp_err:this.errCount,on_url:document.location.href};window.dispatchEvent(new CustomEvent("noibuPostMetrics",{detail:e})),window.fetch&&window.fetch(c()+"/metrics",{method:"POST",headers:{"content-type":"application/json"},body:T(t),keepalive:!0})}}class q{constructor(){this.isLocalStorageSupported=this._testLocalStorageSupported(),this.latestPageVisitFrag=null,this.writeTimeout=null,this.flushedLocalStorage=!1,this.isLocalStorageSupported&&this._postPreviousPageVisit()}static getInstance(){return this.instance||(this.instance=new q),this.instance}checkAndStoreRetryQueue(e,t){const{type:n,payload:r}=e[e.length-1];if("p"!==n||!r.pvp)return;(r.pvp.events?r.pvp.events:[]).filter(e=>"userstep"===e.type||"err"===e.type||"loc"===e.type).length>0&&this.writePageVisitsFromRetryQueue(e,t)}writePageVisitsFromRetryQueue(e,t){const n=[];for(let t=0;t<e.length;t+=1){const{type:r,payload:i}=e[t];if("p"===r){const e=i.pvp;n.push(e)}}this._writePageVisitFrags(n,t)}_writePageVisitFrags(e,t){const n=T({pageVisitFrags:e,pageVisitInfo:t,timestamp:new Date});if(!(n.length>5242880))try{A("n_stored_page_visit",n)}catch(e){F("n_stored_page_visit");const t=function(){if(!window||!window.localStorage||!window.localStorage.key)return 0;if(!navigator.cookieEnabled)return 0;let e=0;for(let t=0;t<window.localStorage.length;t+=1){const n=window.localStorage.key(t);if(n){const t=P(n);t&&(e+=t.length)}}return e}();V.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error writing page visit to local storage: ${e}, UserAgent: ${navigator.userAgent},  json size: ${n.length}, LS size: ${t}, `,!1,"error")}}_getPostData(){const e=P("n_stored_page_visit");if(!e)return null;let t={};try{t=JSON.parse(e)}catch(t){return F("n_stored_page_visit"),V.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error parsing page visit string '${e}': ${t}`,!1,"error"),null}if(t.timestamp){const e=new Date;if(e.setSeconds(e.getSeconds()-2100),e>=Date.parse(t.timestamp))return null}const n={pvi:t.pageVisitInfo,pvp:[],pvvf:[]};n.pvi.last=!0;for(let e=0;e<t.pageVisitFrags.length;e+=1)n.pvp.push(t.pageVisitFrags[e]);return n}_testLocalStorageSupported(){try{A("n_key","N".repeat(512))}catch(e){return!1}return F("n_key"),!0}_postPreviousPageVisit(){this._getPostPageVisitPromise().then(()=>{this._updateLocalStorageFlushed()}).catch(()=>{this._updateLocalStorageFlushed()})}_updateLocalStorageFlushed(){this.flushedLocalStorage=!0,F("n_stored_page_visit")}_getPostPageVisitPromise(){return new Promise((e,t)=>{const n=this._getPostData();if(!n)return void e();E("POST",u(),n,{"content-type":"application/json"},2e3,!0).then(()=>{e()}).catch(e=>{t(new Error("Page visit post request rejected due to: ",e))})})}}function j(){return!("now"in Date)||("number"!=typeof Date.now()||(!("toISOString"in new Date)||"string"!=typeof(new Date).toISOString()))}function U(e){if("number"!=typeof e&&j()){if(Date.prototype.hasOwnProperty("valueOf")&&"function"==typeof e.valueOf&&"number"==typeof e.valueOf())return e.valueOf();V.getInstance().postNoibuErrorAndOptionallyDisableClient("The date object has been overwritten and can't be processed properly.\n      Client has been disabled.",!0,"error",!0)}return e}function z(){return window.performance&&window.performance.now?window.performance.now():U(Date.now())}class W{constructor(e){const t=a();this.forceClosed=!1,this.socket=null,this.socketInstanceId=null,this.previousMessageType="",this.currentConnectionAttempts=0,this.connectionCount=0,this.sessionStartTime=z(),this.connectionPromise=null,this.pageVisitInfoSent=!1,this.connectionURL=t+"/pv_part",this.postURL=u(),this.messageSequenceNum=0,this.latestReceivedSeqNumber=-1,this.isRetryLoopDisabled=!1,this.retryMessageQueue=[],this.metroplexTypeLock={},this.initialURL=I(),this.initialReferingURL=window.document.referrer?k(window.document.referrer):"",this.sessionTimestamp=new Date,this.latestReceivedSeqNumStoredTime=new Date,this.instanceId=h()(),this.scriptInstanceId=e,this.sessionLength=0,this.socketCloseCodes=[],this.socketOpens=[]}static getInstance(e){return this.instance||(this.instance=new W(e),this.instance.start()),this.instance}start(){this.connectSocket().finally(new Promise(e=>{this._setupOffloadEvents(),e()}))}_addSeqNumToPayload(e){e.pvp?this._setSeqNumInPayloadAndIncrementSeqNum("pvp",e):e.pvvf?this._setSeqNumInPayloadAndIncrementSeqNum("pvvf",e):e.pvm&&this._setSeqNumInPayloadAndIncrementSeqNum("pvm",e)}_setSeqNumInPayloadAndIncrementSeqNum(e,t){t[e].seq_num=this.messageSequenceNum,this.messageSequenceNum+=1}sendMessage(e,t){if(e in this.metroplexTypeLock||V.getInstance().isClientDisabled)return;const n=t;if(this._addSeqNumToPayload(n),this.retryMessageQueue.push({payload:n,type:e}),q.getInstance().checkAndStoreRetryQueue(this.retryMessageQueue,this.getPageInformation()),this.isConnected()&&this.pageVisitInfoSent&&this._sendSocketMessage(n),this.previousMessageType=e,"p"===e&&t.pvp){const e=t.pvp.events?t.pvp.events:[];this._updateLatestPvTimestamp(e)}}_updateLatestPvTimestamp(e){e.filter(e=>"userstep"===e.type).length>0&&V.getInstance().updateLastActiveTime(new Date)}isConnected(){return null!==this.socket&&1===this.socket.readyState}isConnecting(){return null!==this.socket&&0===this.socket.readyState}close(){this.forceClosed=!0,(this.isConnected()||this.isConnecting())&&this.socket.close(1e3)}handleConnect(e,t){(t||!this.isConnected()&&!this.isConnecting())&&(this.currentConnectionAttempts+=1,this.socket=new WebSocket(this.connectionURL),this.socketInstanceId=h()(),this.socket.onerror=()=>{},this.socket.onclose=t=>{this.pageVisitInfoSent=!1,this.forceClosed||(this.socketCloseCodes.push(`${j()?"":(new Date).toISOString()}:${t.code}`),this.isConnecting()||(clearInterval(this.retryMetroplexInterval),this.currentConnectionAttempts>=function(){try{return 20}catch(e){return 2}}()?V.getInstance().lockClientUntilNextPage("Too many reconnection attempts, locking until next page"):this.connectionCount>=100?V.getInstance().lockClientUntilNextPage("Too many connections, locking until next page"):setTimeout(()=>{this.handleConnect(e,!1)},this.currentConnectionAttempts**2*function(){try{return METROPLEX_CONSECUTIVE_CONNECTION_DELAY}catch(e){return 1e3}}())))},this.socket.onmessage=e=>{this._onSocketMessage(e)},this.socket.onopen=()=>{this.socketOpens.push(""+(j()?"":(new Date).toISOString())),this._onSocketOpen(),e()})}connectSocket(){return this.isConnected()||this.isConnecting()||(this.connectionPromise=new Promise(e=>{this.handleConnect(e,!1),window.addEventListener("visibilitychange",()=>{if(this.forceClosed)return;const t="visible"===document.visibilityState;t&&(this.isConnected()||this.isConnecting())&&(this.socket.onclose=()=>{},this.socket.close(1e3)),this.handleConnect(e,t)})})),this.connectionPromise}addEndTimeToPayload(e,t){const n=Math.ceil(z()-this.sessionStartTime);t&&(this.sessionLength=n);const r=new Date(this.sessionTimestamp.getTime()+n).toISOString();e.end_at=r}_onSocketOpen(){this.isConnected()&&!V.getInstance().isClientDisabled&&(this._sendSocketMessage(this.getPageInformation()),this.pageVisitInfoSent=!0,this.currentConnectionAttempts=0,this.previousMessageType="",this._sendUnconfirmedMessages(),this.setupRetryMechanism(),this.connectionCount+=1)}_onSocketMessage(e){switch(e.data){case"vid_block":this.metroplexTypeLock.v=!0,$.getInstance().setDidCutVideo();break;case"pv_block":this.metroplexTypeLock.p=!0,$.getInstance().setDidCutPv();break;case"full_block":V.getInstance().lockClient(1440,"Metroplex blocked script"),this.close();break;case"close_conn":this.close();break;case"ok":break;default:if(e.data.includes("seq_num")){const t=e.data.split("seq_num:");if(t.length<2){V.getInstance().postNoibuErrorAndOptionallyDisableClient("Invalid message received from metroplex while clearing retry queue "+e.data,!1,"error");break}const n=parseInt(t[1],10);n<=this.latestReceivedSeqNumber?this.isRetryLoopDisabled=!0:(this.isRetryLoopDisabled=!1,this.latestReceivedSeqNumber=n,this._clearRetryQueue(n))}}}_messagePayloadHasLargerSeqNum(e,t,n){return e.payload[t]&&e.payload[t].seq_num&&e.payload[t].seq_num>n}_clearRetryQueue(e){this.latestReceivedSeqNumStoredTime=new Date,this.retryMessageQueue=this.retryMessageQueue.filter(t=>this._messagePayloadHasLargerSeqNum(t,"pvp",e)||this._messagePayloadHasLargerSeqNum(t,"pvvf",e))}_sendUnconfirmedMessages(){if(!this.isConnected()||V.getInstance().isClientDisabled||this.isConnecting())return;const e=new Date;if(e.setSeconds(e.getSeconds()-3e4),!(e>=this.latestReceivedSeqNumStoredTime||this.isRetryLoopDisabled)){this.retryMessageQueue=this.retryMessageQueue.filter(e=>!(e.type in this.metroplexTypeLock));for(let e=0;e<this.retryMessageQueue.length;e+=1){const{type:t,payload:n}=this.retryMessageQueue[e];if(!this._sendSocketMessage(n))break;this.previousMessageType=t}}}setupRetryMechanism(){this.retryMetroplexInterval=setInterval(()=>{this._sendUnconfirmedMessages()},3e4)}_setupOffloadEvents(){window.addEventListener("unload",()=>{this._handleUnload()})}_handleUnload(){this.close(),V.getInstance().isClientDisabled||V.getInstance().isInactive()||this.postFullPageVisit(59e3)}postFullPageVisit(e){if(0===this.retryMessageQueue.length)return;const t=[],n={v:0,p:0};let r=0,i={pvi:this.getPageInformation(),pvp:[],pvvf:[],vpnum:this.connectionCount};if(i.pvi.last=!0,this.retryMessageQueue.forEach(o=>{let{type:s,payload:a}=o;const c=new Blob([T(a)]).size;if(c>e)n[s]+=1;else{if(r+=c,r>=e){this.postMessage(i);let e="Vid: "+i.pvvf.length;e+=` PV: ${i.pvp.length},`,t.push(e),i={pvi:this.getPageInformation(),pvp:[],pvvf:[],vpnum:i.vpnum},i.pvi.last=!0,r=0}switch(s){case"v":i.pvvf.push(a.pvvf);break;case"p":i.pvp.push(a.pvp)}}}),this.postMessage(i),this.retryMessageQueue.length>100){let e="Vid: "+i.pvvf.length;e+=` PV: ${i.pvp.length},`,t.push(e);let r="POST Full PV complete";r+=", POSTs count: "+t.length,r+=", POSTs info: "+T(t),r+=", Retry message queue size: "+this.retryMessageQueue.length,n.v>0&&(r+=", Video parts dropped: "+n.v),n.p>0&&(r+=", Page visit parts dropped: "+n.p),r+=", Sequence Info: Latest "+this.messageSequenceNum,r+=` Ack'd ${this.latestReceivedSeqNumStoredTime} ${this.latestReceivedSeqNumber}`;const o=V.getInstance().isClientDisabled;V.getInstance().isClientDisabled=!1,V.getInstance().postNoibuErrorAndOptionallyDisableClient(r,o,"warn")}}postMessage(e){const t=e;t.vpnum+=1,"test"===l()?navigator.sendBeacon(this.postURL,T(t)):window.fetch&&fetch(this.postURL,{method:"POST",headers:{"content-type":"application/json"},body:T(t),keepalive:!0})}_sendSocketMessage(e){return!this.closeIfInactive()&&(this.socket.send(T(e)),!0)}closeIfInactive(){const e=V.getInstance().isInactive();return e&&!V.getInstance().isClientDisabled&&(V.getInstance().lockClientUntilNextPage("Session is inactive, locking until next page"),this.close(),$.getInstance().postMetrics("inactive"),this.postFullPageVisit(59e3)),e}getPageInformation(){const e={br_id:V.getInstance().browserId,pv_id:V.getInstance().pageVisitId,v:5,seq:V.getInstance().getPageVisitSeq(),on_url:this.initialURL,ref_url:this.initialReferingURL,start_at:this.sessionTimestamp.toISOString(),conc:this.connectionCount,cv:2,last:!1,script_id:s(),script_inst_id:this.scriptInstanceId,mp_sock_inst_id:this.instanceId,sock_inst_id:this.socketInstanceId},t=function(){const e=window.navigator.userLanguage||window.navigator.language;return""!==e&&e?e.toLowerCase():null}();return t&&(e.lang=t),e}}var H,B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Q(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 J(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.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 s}function X(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(J(arguments[t]));return e}function G(e){return e.nodeType===e.ELEMENT_NODE}function K(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function Y(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,s=i||"";return(t[n.toLowerCase()]||t[r])&&(s=o?o(s):"*".repeat(s.length)),s}!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"}(H||(H={}));var Z=1,ee=RegExp("[^a-z0-9-_:]");function te(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(ne).join(""):null}catch(e){return null}}function ne(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=te(e.styleSheet)||t}catch(e){}return t}var re=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ie=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,oe=/^(data:)([^,]*),(.*)/i;function se(e,t){return(e||"").replace(re,(function(e,n,r,i,o,s){var a,c=r||o||s,u=n||i||"";if(!c)return e;if(!ie.test(c))return"url("+u+c+u+")";if(oe.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)+u+")";var l=t.split("/"),d=c.split("/");l.pop();for(var p=0,h=d;p<h.length;p++){var f=h[p];"."!==f&&(".."===f?l.pop():l.push(f))}return"url("+u+l.join("/")+u+")"}))}var ae=/^[^ \t\n\r\u000c]+/,ce=/^[, \t\n\r\u000c]+/;function ue(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function le(){var e=document.createElement("a");return e.href="",e.href}function de(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?ue(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(ce),!(n>=t.length);){var o=r(ae);if(","===o.slice(-1))o=ue(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=ue(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?se(r,le()):r:ue(e,r)}function pe(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 e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!n||!e.matches(n))||pe(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,pe(e.parentNode,t,n)}function he(e,t){var n,r,i,o,s=t.doc,a=t.blockClass,c=t.blockSelector,u=t.maskTextClass,l=t.maskTextSelector,d=t.inlineStylesheet,p=t.maskInputOptions,h=void 0===p?{}:p,f=t.maskTextFn,m=t.maskInputFn,v=t.recordCanvas,g=t.keepIframeSrcFn;if(s.__sn){var y=s.__sn.id;r=1===y?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:H.Document,childNodes:[],compatMode:e.compatMode,rootId:r}:{type:H.Document,childNodes:[],rootId:r};case e.DOCUMENT_TYPE_NODE:return{type:H.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:r};case e.ELEMENT_NODE:for(var b=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)}(e,a,c),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return ee.test(t)?"div":t}(e),S={},C=0,k=Array.from(e.attributes);C<k.length;C++){var I=k[C],_=I.name,T=I.value;S[_]=de(s,w,_,T)}if("link"===w&&d){var E,x=Array.from(s.styleSheets).find((function(t){return t.href===e.href}));(E=te(x))&&(delete S.rel,delete S.href,S._cssText=se(E,x.href))}if("style"===w&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(E=te(e.sheet))&&(S._cssText=se(E,le()));if("input"===w||"textarea"===w||"select"===w){T=e.value;"radio"!==S.type&&"checkbox"!==S.type&&"submit"!==S.type&&"button"!==S.type&&T?S.value=Y({type:S.type,tagName:w,value:T,maskInputOptions:h,maskInputFn:m}):e.checked&&(S.checked=e.checked)}if("option"===w&&(e.selected?S.selected=!0:delete S.selected),"canvas"===w&&v&&(S.rr_dataURL=e.toDataURL()),"audio"!==w&&"video"!==w||(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var M=e.getBoundingClientRect(),D=M.width,N=M.height;S={class:S.class,rr_width:D+"px",rr_height:N+"px"}}return"iframe"!==w||g(S.src)||(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:H.Element,tagName:w,attributes:S,childNodes:[],isSVG:(o=e,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:b,rootId:r};case e.TEXT_NODE:var O=e.parentNode&&e.parentNode.tagName,R=e.textContent,L="STYLE"===O||void 0,P="SCRIPT"===O||void 0;if(L&&R){try{(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(R=(i=e.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}R=se(R,le())}return P&&(R="SCRIPT_PLACEHOLDER"),!L&&!P&&pe(e,u,l)&&R&&(R=f?f(R):R.replace(/[\S]/g,"*")),{type:H.Text,textContent:R||"",isStyle:L,rootId:r};case e.CDATA_SECTION_NODE:return{type:H.CDATA,textContent:"",rootId:r};case e.COMMENT_NODE:return{type:H.Comment,textContent:e.textContent||"",rootId:r};default:return!1}}function fe(e){return void 0===e?"":e.toLowerCase()}function me(e,t){var n,r=t.doc,i=t.map,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,c=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,d=t.inlineStylesheet,p=void 0===d||d,h=t.maskInputOptions,f=void 0===h?{}:h,m=t.maskTextFn,v=t.maskInputFn,g=t.slimDOMOptions,y=t.recordCanvas,b=void 0!==y&&y,w=t.onSerialize,S=t.onIframeLoad,C=t.iframeLoadTimeout,k=void 0===C?5e3:C,I=t.keepIframeSrcFn,_=void 0===I?function(){return!1}:I,T=t.preserveWhiteSpace,E=void 0===T||T,x=he(e,{doc:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:v,recordCanvas:b,keepIframeSrcFn:_});if(!x)return console.warn(e,"not serialized"),null;n="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===H.Comment)return!0;if(e.type===H.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===fe(e.attributes.name)||"icon"===fe(e.attributes.rel)||"apple-touch-icon"===fe(e.attributes.rel)||"shortcut icon"===fe(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(fe(e.attributes.property).match(/^(og|twitter|fb):/)||fe(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===fe(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===fe(e.attributes.name)||"googlebot"===fe(e.attributes.name)||"bingbot"===fe(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===fe(e.attributes.name)||"generator"===fe(e.attributes.name)||"framework"===fe(e.attributes.name)||"publisher"===fe(e.attributes.name)||"progid"===fe(e.attributes.name)||fe(e.attributes.property).match(/^article:/)||fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===fe(e.attributes.name)||"yandex-verification"===fe(e.attributes.name)||"csrf-token"===fe(e.attributes.name)||"p:domain_verify"===fe(e.attributes.name)||"verify-v1"===fe(e.attributes.name)||"verification"===fe(e.attributes.name)||"shopify-checkout-api-token"===fe(e.attributes.name)))return!0}}return!1}(x,g)&&(E||x.type!==H.Text||x.isStyle||x.textContent.replace(/^\s+|\s+$/gm,"").length)?Z++:-2;var M=Object.assign(x,{id:n});if(!Object.isExtensible(e))return null;if(e.__sn=M,-2===n)return null;i[n]=e,w&&w(e);var D=!l;if(M.type===H.Element&&(D=D&&!M.needBlock,delete M.needBlock),(M.type===H.Document||M.type===H.Element)&&D){g.headWhitespace&&x.type===H.Element&&"head"===x.tagName&&(E=!1);for(var N={doc:r,map:i,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:l,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:v,slimDOMOptions:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:k,keepIframeSrcFn:_},O=0,R=Array.from(e.childNodes);O<R.length;O++){(A=me(R[O],N))&&M.childNodes.push(A)}if(G(e)&&e.shadowRoot){M.isShadowHost=!0;for(var L=0,P=Array.from(e.shadowRoot.childNodes);L<P.length;L++){var A;(A=me(P[L],N))&&(A.isShadow=!0,M.childNodes.push(A))}}}return e.parentNode&&K(e.parentNode)&&(M.isShadow=!0),M.type===H.Element&&"iframe"===M.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){"about:blank"===r.location.href&&"about:blank"!==e.src&&""!==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()}))}}}(e,(function(){var t=e.contentDocument;if(t&&S){var n=me(t,{doc:t,map:i,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:v,slimDOMOptions:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:k,keepIframeSrcFn:_});n&&S(e,n)}}),k),M}var ve,ge,ye,be,we,Se=/([^\\]):hover/;new RegExp(Se,"g");function Ce(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"}(ve||(ve={})),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"}(ge||(ge={})),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"}(ye||(ye={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(be||(be={})),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"}(we||(we={}));var ke="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.",Ie={map:{},getId:function(){return console.error(ke),-1},getNode:function(){return console.error(ke),null},removeNodeFromMap:function(){console.error(ke)},has:function(){return console.error(ke),!1},reset:function(){console.error(ke)}};function _e(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var s=Date.now();i||!1!==n.leading||(i=s);var a=t-(s-i),c=this,u=arguments;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(c,u)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(c,u)}),a))}}function Te(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 Te(e,t,o||{},!0)}}function Ee(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 xe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Me(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function De(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var r=!1;return"string"==typeof t?r=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(r=!0)})),n&&(r=e.matches(n)),r||De(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,De(e.parentNode,t,n)}function Ne(e){return"__sn"in e&&-2===e.__sn.id}function Oe(e){return Boolean(e.changedTouches)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ie=new Proxy(Ie,{get:function(e,t,n){return"map"===t&&console.error(ke),Reflect.get(e,t,n)}}));!function(){function e(){this.reset()}e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),o=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&o(e.__sn.id)}))},s=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return s(e)}));var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),s(i)):(delete this.tree[i.id],this.indexes.delete(i.id),s(i)):(this.removeNodeMutations.push(e),o(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,o=this.tree,s=this.removeNodeMutations,a=this.textMutations,c=this.attributeMutations,u={source:ge.Mutation,removes:s,texts:a,attributes:c,adds:[]},l=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return l(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return l(e,!1)})))};Object.values(o).forEach((function(e){return l(e,!1)}));try{for(var d=Q(this.scrollMap.keys()),p=d.next();!p.done;p=d.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var f=Q(this.inputMap.keys()),m=f.next();!m.done;m=f.next()){h=m.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}var v=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:v,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)}}();function Re(e){return"__sn"in e&&(e.__sn.type===H.Element&&"iframe"===e.__sn.tagName)}function Le(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function Pe(e){return"__ln"in e}var Ae=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}(),Fe=function(e,t){return e+"@"+t};function Ve(e){return"__sn"in e}function $e(e,t){e.delete(t),t.childNodes.forEach((function(t){return $e(e,t)}))}function qe(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}))||qe(e,r,n)}function je(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||je(e,n))}const Ue=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,n,r,i;if(!e.frozen&&!e.locked){for(var o=[],s=new Ae,a=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){var n,r=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,i=!(e.doc.contains(t)||r instanceof Node&&e.doc.contains(r));if(t.parentNode&&!i){var c=K(t.parentNode)?e.mirror.getId(r):e.mirror.getId(t.parentNode),u=a(t);if(-1===c||-1===u)return s.addNode(t);var l=me(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,onSerialize:function(n){Re(n)&&e.iframeManager.addIframe(n),Le(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n)}});l&&o.push({parentId:c,nextId:u,node:l})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var u=Q(e.movedSet),l=u.next();!l.done;l=u.next()){var d=l.value;qe(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var p=Q(e.addedSet),h=p.next();!h.done;h=p.next()){d=h.value;je(e.droppedSet,d)||qe(e.removes,d,e.mirror)?je(e.movedSet,d)?c(d):e.droppedSet.add(d):c(d)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}for(var f=null;s.length;){var m=null;if(f){var v=e.mirror.getId(f.value.parentNode),g=a(f.value);-1!==v&&-1!==g&&(m=f)}if(!m)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){v=e.mirror.getId(b.value.parentNode),g=a(b.value);if(-1!==v&&-1!==g){m=b;break}}}if(!m){for(;s.head;)s.removeNode(s.head.value);break}f=m.previous,s.removeNode(m.value),c(m.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:o};(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.emissionCallback(w))}},this.processMutation=function(t){var n,r,i,o;if(!Ne(t.target))switch(t.type){case"characterData":var s=t.target.textContent;De(t.target,e.blockClass,e.blockSelector)||s===t.oldValue||e.texts.push({value:pe(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var a=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=Y({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),De(t.target,e.blockClass,e.blockSelector)||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 u=e.doc.createElement("span");t.oldValue&&u.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var l=c.attributes.style;try{for(var d=Q(Array.from(a.style)),p=d.next();!p.done;p=d.next()){var h=p.value,f=a.style.getPropertyValue(h),m=a.style.getPropertyPriority(h);f===u.style.getPropertyValue(h)&&m===u.style.getPropertyPriority(h)||(l[h]=""===m?f:[f,m])}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var v=Q(Array.from(u.style)),g=v.next();!g.done;g=v.next()){h=g.value;""!==a.style.getPropertyValue(h)&&a.style.getPropertyValue(h)||(l[h]=!1)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=de(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=K(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);De(t.target,e.blockClass,e.blockSelector)||Ne(n)||(e.addedSet.has(n)?($e(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||function e(t,n){if(K(t))return!1;var r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[Fe(r,i)]?$e(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!K(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!De(n,e.blockClass,e.blockSelector)){if(Ve(t)){if(Ne(t))return;e.movedSet.add(t);var r=null;n&&Ve(n)&&(r=n.__sn.id),r&&(e.movedMap[Fe(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);De(t,e.blockClass,e.blockSelector)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,r,i,o,s,a,c,u,l,d,p,h,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=i,this.inlineStylesheet=o,this.maskInputOptions=s,this.maskTextFn=a,this.maskInputFn=c,this.recordCanvas=u,this.slimDOMOptions=l,this.emissionCallback=e,this.doc=d,this.mirror=p,this.iframeManager=h,this.shadowDomManager=f},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1,this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1,this.emit()},e}();var ze=[],We="undefined"!=typeof CSSGroupingRule,He="undefined"!=typeof CSSMediaRule,Be="undefined"!=typeof CSSSupportsRule,Qe="undefined"!=typeof CSSConditionRule;function Je(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 Xe(e,t,n,r,i,o,s,a,c,u,l,d,p,h,f,m){var v,g,y,b=new Ue;ze.push(b),b.init(e,n,r,i,o,s,a,c,u,l,d,t,p,h,f);var w=window.MutationObserver||window.__rrMutationObserver,S=null===(y=null===(g=null===(v=window)||void 0===v?void 0:v.Zone)||void 0===g?void 0:g.__symbol__)||void 0===y?void 0:y.call(g,"MutationObserver");S&&window[S]&&(w=window[S]);var C=new w(b.processMutations.bind(b));return C.observe(m,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function Ge(e,t,n,r,i,o){if(!1===o.mouseInteraction)return function(){};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];return Object.keys(ye).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(o){var s=o.toLowerCase(),c=function(t){return function(o){var s=Je(o);if(!De(s,r,i)){var a=Oe(o)?o.changedTouches[0]:o;if(a){var c=n.getId(s),u=a.clientX,l=a.clientY;e({type:ye[t],id:c,x:u,y:l})}}}}(o);a.push(Ce(s,c,t))})),function(){a.forEach((function(e){return e()}))}}function Ke(e,t,n,r,i,o){return Ce("scroll",_e((function(o){var s=Je(o);if(s&&!De(s,r,i)){var a=n.getId(s);if(s===t){var c=t.scrollingElement||t.documentElement;e({id:a,x:c.scrollLeft,y:c.scrollTop})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}}),o.scroll||100),t)}function Ye(e,t){var n=B({},e);return t||delete n.userTriggered,n}var Ze=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function(e,t){if(We&&e.parentRule instanceof CSSGroupingRule||He&&e.parentRule instanceof CSSMediaRule||Be&&e.parentRule instanceof CSSSupportsRule||Qe&&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 nt(e,t){var n,r;void 0===t&&(t={});var i=e.doc.defaultView;if(!i)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,s=e.viewportResizeCb,a=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,X(e)),n.apply(void 0,X(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,X(e)),r.apply(void 0,X(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,X(e)),i.apply(void 0,X(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,X(e)),o.apply(void 0,X(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,X(e)),s.apply(void 0,X(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,X(e)),a.apply(void 0,X(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,X(e)),c.apply(void 0,X(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,X(e)),u.apply(void 0,X(e))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,X(e)),l.apply(void 0,X(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,X(e)),d.apply(void 0,X(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,X(e)),p.apply(void 0,X(e))}}(e,t);var o,s,a,c=Xe(e.mutationCb,e.doc,e.blockClass,e.blockSelector,e.maskTextClass,e.maskTextSelector,e.inlineStylesheet,e.maskInputOptions,e.maskTextFn,e.maskInputFn,e.recordCanvas,e.slimDOMOptions,e.mirror,e.iframeManager,e.shadowDomManager,e.doc),u=function(e,t,n,r){if(!1===t.mousemove)return function(){};var i,o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,a=[],c=_e((function(t){var n=Date.now()-i;e(a.map((function(e){return e.timeOffset-=n,e})),t),a=[],i=null}),s),u=_e((function(e){var t=Je(e),n=Oe(e)?e.changedTouches[0]:e,o=n.clientX,s=n.clientY;i||(i=Date.now()),a.push({x:o,y:s,id:r.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ge.Drag:e instanceof MouseEvent?ge.MouseMove:ge.TouchMove)}),o,{trailing:!1}),l=[Ce("mousemove",u,n),Ce("touchmove",u,n),Ce("drag",u,n)];return function(){l.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling,e.doc,e.mirror),l=Ge(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.blockSelector,e.sampling),d=Ke(e.scrollCb,e.doc,e.mirror,e.blockClass,e.blockSelector,e.sampling),p=(o=e.viewportResizeCb,s=-1,a=-1,Ce("resize",_e((function(){var e=xe(),t=Me();s===e&&a===t||(o({width:Number(t),height:Number(e)}),s=e,a=t)}),200),window)),h=function(e,t,n,r,i,o,s,a,c,u){function l(e){var n=Je(e),c=e.isTrusted;if(n&&n.tagName&&!(Ze.indexOf(n.tagName)<0)&&!De(n,r,i)){var l=n.type;if(!n.classList.contains(o)){var p=n.value,h=!1;"radio"===l||"checkbox"===l?h=n.checked:(s[n.tagName.toLowerCase()]||s[l])&&(p=Y({maskInputOptions:s,tagName:n.tagName,type:l,value:p,maskInputFn:a})),d(n,Ye({text:p,isChecked:h,userTriggered:c},u));var f=n.name;"radio"===l&&f&&h&&t.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach((function(e){e!==n&&d(e,Ye({text:e.value,isChecked:!h,userTriggered:!1},u))}))}}}function d(t,r){var i=et.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){et.set(t,r);var o=n.getId(t);e(B(B({},r),{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((function(e){return Ce(e,l,t)})),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),f=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return h&&h.set&&p.push.apply(p,X(f.map((function(e){return Te(e[0],e[1],{set:function(){l({target:this})}})})))),function(){p.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.blockSelector,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling,e.userTriggeredOnInput),f=function(e,t,n,r){var i=function(i){return function(o){var s=Je(o);s&&!De(s,t,n)&&e({type:i,id:r.getId(s),currentTime:s.currentTime})}},o=[Ce("play",i(0)),Ce("pause",i(1)),Ce("seeked",i(2))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.blockSelector,e.mirror),m=function(e,t,n){var r=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=function(t,i){var o=n.getId(this.ownerNode);return-1!==o&&e({id:o,adds:[{rule:t,index:i}]}),r.apply(this,arguments)};var i=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=function(t){var r=n.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),i.apply(this,arguments)};var o={};We?o.CSSGroupingRule=t.CSSGroupingRule:(He&&(o.CSSMediaRule=t.CSSMediaRule),Qe&&(o.CSSConditionRule=t.CSSConditionRule),Be&&(o.CSSSupportsRule=t.CSSSupportsRule));var s={};return Object.entries(o).forEach((function(t){var r=J(t,2),i=r[0],o=r[1];s[i]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(t,r){var o=n.getId(this.parentStyleSheet.ownerNode);return-1!==o&&e({id:o,adds:[{rule:t,index:X(tt(this),[r||0])}]}),s[i].insertRule.apply(this,arguments)},o.prototype.deleteRule=function(t){var r=n.getId(this.parentStyleSheet.ownerNode);return-1!==r&&e({id:r,removes:[{index:X(tt(this),[t])}]}),s[i].deleteRule.apply(this,arguments)}})),function(){t.CSSStyleSheet.prototype.insertRule=r,t.CSSStyleSheet.prototype.deleteRule=i,Object.entries(o).forEach((function(e){var t=J(e,2),n=t[0],r=t[1];r.prototype.insertRule=s[n].insertRule,r.prototype.deleteRule=s[n].deleteRule}))}}(e.styleSheetRuleCb,i,e.mirror),v=function(e,t,n){var r=t.CSSStyleDeclaration.prototype.setProperty;t.CSSStyleDeclaration.prototype.setProperty=function(t,i,o){var s,a,c=n.getId(null===(a=null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet)||void 0===a?void 0:a.ownerNode);return-1!==c&&e({id:c,set:{property:t,value:i,priority:o},index:tt(this.parentRule)}),r.apply(this,arguments)};var i=t.CSSStyleDeclaration.prototype.removeProperty;return t.CSSStyleDeclaration.prototype.removeProperty=function(t){var r,o,s=n.getId(null===(o=null===(r=this.parentRule)||void 0===r?void 0:r.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==s&&e({id:s,remove:{property:t},index:tt(this.parentRule)}),i.apply(this,arguments)},function(){t.CSSStyleDeclaration.prototype.setProperty=r,t.CSSStyleDeclaration.prototype.removeProperty=i}}(e.styleDeclarationCb,i,e.mirror),g=e.recordCanvas?function(e,t,n,r){var i,o,s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=[],c=function(i){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var o=Ee(t.CanvasRenderingContext2D.prototype,i,(function(t){return function(){for(var o=this,s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return De(this.canvas,n,null)||setTimeout((function(){var t=X(s);if("drawImage"===i&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],a=n.getContext("2d"),c=null==a?void 0:a.getImageData(0,0,n.width,n.height),u=null==c?void 0:c.data;t[0]=JSON.stringify(u)}e({id:r.getId(o.canvas),property:i,args:t})}),0),t.apply(this,s)}}));a.push(o)}catch(n){var s=Te(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e({id:r.getId(this.canvas),property:i,args:[t],setter:!0})}});a.push(s)}};try{for(var u=Q(s),l=u.next();!l.done;l=u.next()){c(l.value)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return function(){a.forEach((function(e){return e()}))}}(e.canvasMutationCb,i,e.blockClass,e.mirror):function(){},y=e.collectFonts?function(e,t){var n=t.defaultView;if(!n)return function(){};var r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){var r=new o(e,t,n);return i.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=Ee(t.fonts,"add",(function(t){return function(n){return setTimeout((function(){var t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push((function(){n.FontFace=o})),r.push(s),function(){r.forEach((function(e){return e()}))}}(e.fontCb,e.doc):function(){},b=[];try{for(var w=Q(e.plugins),S=w.next();!S.done;S=w.next()){var C=S.value;b.push(C.observer(C.callback,i,C.options))}}catch(e){n={error:e}}finally{try{S&&!S.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}return function(){c.disconnect(),u(),l(),d(),p(),h(),f(),m(),v(),g(),y(),b.forEach((function(e){return e()}))}}var rt,it,ot=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}(),st=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){Xe(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.maskInputFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,e),Ke(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.sampling)},e}();function at(e){return B(B({},e),{timestamp:Date.now()})}var ct={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 ut(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,s=e.blockSelector,a=void 0===s?null:s,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,l=e.maskTextClass,d=void 0===l?"rr-mask":l,p=e.maskTextSelector,h=void 0===p?null:p,f=e.inlineStylesheet,m=void 0===f||f,v=e.maskAllInputs,g=e.maskInputOptions,y=e.slimDOMOptions,b=e.maskInputFn,w=e.maskTextFn,S=e.hooks,C=e.packFn,k=e.sampling,I=void 0===k?{}:k,_=e.mousemoveWait,T=e.recordCanvas,E=void 0!==T&&T,x=e.userTriggeredOnInput,M=void 0!==x&&x,D=e.collectFonts,N=void 0!==D&&D,O=e.plugins,R=e.keepIframeSrcFn,L=void 0===R?function(){return!1}:R;if(!t)throw new Error("emit function is required");void 0!==_&&void 0===I.mousemove&&(I.mousemove=_);var P,A,F=!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==g?g:{password:!0},V=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{};void 0===P&&(P=window),"NodeList"in P&&!P.NodeList.prototype.forEach&&(P.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in P&&!P.DOMTokenList.prototype.forEach&&(P.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 $=0;rt=function(e,i){var o;if(!(null===(o=ze[0])||void 0===o?void 0:o.isFrozen())||e.type===ve.FullSnapshot||e.type===ve.IncrementalSnapshot&&e.data.source===ge.Mutation||ze.forEach((function(e){return e.unfreeze()})),t(C?C(e):e,i),e.type===ve.FullSnapshot)A=e,$=0;else if(e.type===ve.IncrementalSnapshot){if(e.data.source===ge.Mutation&&e.data.isAttachIframe)return;$++;var s=r&&$>=r,a=n&&e.timestamp-A.timestamp>n;(s||a)&&it(!0)}};var q=function(e){rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.Mutation},e)}))},j=function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.Scroll},e)}))},U=new ot({mutationCb:q}),z=new st({mutationCb:q,scrollCb:j,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:d,maskTextSelector:h,inlineStylesheet:m,maskInputOptions:F,maskTextFn:w,maskInputFn:b,recordCanvas:E,sampling:I,slimDOMOptions:V,iframeManager:U},mirror:ct});it=function(e){var t,n,r,i;void 0===e&&(e=!1),rt(at({type:ve.Meta,data:{href:window.location.href,width:Me(),height:xe()}}),e),ze.forEach((function(e){return e.lock()}));var s=J(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,s=void 0===o?null:o,a=n.maskTextClass,c=void 0===a?"rr-mask":a,u=n.maskTextSelector,l=void 0===u?null:u,d=n.inlineStylesheet,p=void 0===d||d,h=n.recordCanvas,f=void 0!==h&&h,m=n.maskAllInputs,v=void 0!==m&&m,g=n.maskTextFn,y=n.maskInputFn,b=n.slimDOM,w=void 0!==b&&b,S=n.preserveWhiteSpace,C=n.onSerialize,k=n.onIframeLoad,I=n.iframeLoadTimeout,_=n.keepIframeSrcFn,T={};return[me(e,{doc:e,map:T,blockClass:i,blockSelector:s,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,recordCanvas:f,preserveWhiteSpace:S,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:I,keepIframeSrcFn:void 0===_?function(){return!1}:_}),T]}(document,{blockClass:o,blockSelector:a,maskTextClass:d,maskTextSelector:h,inlineStylesheet:m,maskAllInputs:F,maskTextFn:w,slimDOM:V,recordCanvas:E,onSerialize:function(e){Re(e)&&U.addIframe(e),Le(e)&&z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){U.attachIframe(e,t)},keepIframeSrcFn:L}),2),c=s[0],u=s[1];if(!c)return console.warn("Failed to snapshot the document");ct.map=u,rt(at({type:ve.FullSnapshot,data:{node:c,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===(i=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ze.forEach((function(e){return e.unlock()}))};try{var W=[];W.push(Ce("DOMContentLoaded",(function(){rt(at({type:ve.DomContentLoaded,data:{}}))})));var H=function(e){return nt({mutationCb:q,mousemoveCb:function(e,t){return rt(at({type:ve.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.MouseInteraction},e)}))},scrollCb:j,viewportResizeCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.ViewportResize},e)}))},inputCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.Input},e)}))},mediaInteractionCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.StyleDeclaration},e)}))},canvasMutationCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.CanvasMutation},e)}))},fontCb:function(e){return rt(at({type:ve.IncrementalSnapshot,data:B({source:ge.Font},e)}))},blockClass:o,ignoreClass:u,maskTextClass:d,maskTextSelector:h,maskInputOptions:F,inlineStylesheet:m,sampling:I,recordCanvas:E,userTriggeredOnInput:M,collectFonts:N,doc:e,maskInputFn:b,maskTextFn:w,blockSelector:a,slimDOMOptions:V,mirror:ct,iframeManager:U,shadowDomManager:z,plugins:(null==O?void 0:O.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return rt(at({type:ve.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};U.addLoadListener((function(e){(function(e){var t=null;try{t=e.contentDocument.body.innerHTML}catch(e){}return null!==t})(e)&&W.push(H(e.contentDocument))}));var Q=function(){it(),W.push(H(document))};return"interactive"===document.readyState||"complete"===document.readyState?Q():W.push(Ce("load",(function(){rt(at({type:ve.Load,data:{}})),Q()}),window)),function(){W.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}ut.addCustomEvent=function(e,t){if(!rt)throw new Error("please add custom event after start recording");rt(at({type:ve.Custom,data:{tag:e,payload:t}}))},ut.freezePage=function(){ze.forEach((function(e){return e.freeze()}))},ut.takeFullSnapshot=function(e){if(!it)throw new Error("please take full snapshot after start recording");it(e)},ut.mirror=ct;const lt=ut;var dt=Uint8Array,pt=Uint16Array,ht=Uint32Array,ft=new dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mt=new dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),vt=new dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gt=function(e,t){for(var n=new pt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ht(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},yt=gt(ft,2),bt=yt[0],wt=yt[1];bt[28]=258,wt[258]=28;for(var St=gt(mt,0),Ct=(St[0],St[1]),kt=new pt(32768),It=0;It<32768;++It){var _t=(43690&It)>>>1|(21845&It)<<1;_t=(61680&(_t=(52428&_t)>>>2|(13107&_t)<<2))>>>4|(3855&_t)<<4,kt[It]=((65280&_t)>>>8|(255&_t)<<8)>>>1}var Tt=function(e,t,n){for(var r=e.length,i=0,o=new pt(t);i<r;++i)++o[e[i]-1];var s,a=new pt(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new pt(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)s[kt[d]>>>c]=u}else for(s=new pt(r),i=0;i<r;++i)s[i]=kt[a[e[i]-1]++]>>>15-e[i];return s},Et=new dt(288);for(It=0;It<144;++It)Et[It]=8;for(It=144;It<256;++It)Et[It]=9;for(It=256;It<280;++It)Et[It]=7;for(It=280;It<288;++It)Et[It]=8;var xt=new dt(32);for(It=0;It<32;++It)xt[It]=5;var Mt=Tt(Et,9,0),Dt=Tt(xt,5,0),Nt=function(e){return(e/8>>0)+(7&e&&1)},Ot=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof pt?pt:e instanceof ht?ht:dt)(n-t);return r.set(e.subarray(t,n)),r},Rt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Lt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Pt=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new dt(0),0];if(1==i){var s=new dt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[d].f?u++:d++],c=n[u!=l&&n[u].f<n[d].f?u++:d++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var h=new pt(p+1),f=At(n[l-1],h,0);if(f>t){r=0;var m=0,v=f-t,g=1<<v;for(o.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(h[y]>t))break;m+=g-(1<<f-h[y]),h[y]=t}for(m>>>=v;m>0;){var b=o[r].s;h[b]<t?m-=1<<t-h[b]++-1:++r}for(;r>=0&&m;--r){var w=o[r].s;h[w]==t&&(--h[w],++m)}f=t}return[new dt(h),f]},At=function(e,t,n){return-1==e.s?Math.max(At(e.l,t,n+1),At(e.r,t,n+1)):t[e.s]=n},Ft=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pt(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Vt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},$t=function(e,t,n){var r=n.length,i=Nt(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},qt=function(e,t,n,r,i,o,s,a,c,u,l){Rt(t,l++,n),++i[256];for(var d=Pt(i,15),p=d[0],h=d[1],f=Pt(o,15),m=f[0],v=f[1],g=Ft(p),y=g[0],b=g[1],w=Ft(m),S=w[0],C=w[1],k=new pt(19),I=0;I<y.length;++I)k[31&y[I]]++;for(I=0;I<S.length;++I)k[31&S[I]]++;for(var _=Pt(k,7),T=_[0],E=_[1],x=19;x>4&&!T[vt[x-1]];--x);var M,D,N,O,R=u+5<<3,L=Vt(i,Et)+Vt(o,xt)+s,P=Vt(i,p)+Vt(o,m)+s+14+3*x+Vt(k,T)+(2*k[16]+3*k[17]+7*k[18]);if(R<=L&&R<=P)return $t(t,l,e.subarray(c,c+u));if(Rt(t,l,1+(P<L)),l+=2,P<L){M=Tt(p,h,0),D=p,N=Tt(m,v,0),O=m;var A=Tt(T,E,0);Rt(t,l,b-257),Rt(t,l+5,C-1),Rt(t,l+10,x-4),l+=14;for(I=0;I<x;++I)Rt(t,l+3*I,T[vt[I]]);l+=3*x;for(var F=[y,S],V=0;V<2;++V){var $=F[V];for(I=0;I<$.length;++I){var q=31&$[I];Rt(t,l,A[q]),l+=T[q],q>15&&(Rt(t,l,$[I]>>>5&127),l+=$[I]>>>12)}}}else M=Mt,D=Et,N=Dt,O=xt;for(I=0;I<a;++I)if(r[I]>255){q=r[I]>>>18&31;Lt(t,l,M[q+257]),l+=D[q+257],q>7&&(Rt(t,l,r[I]>>>23&31),l+=ft[q]);var j=31&r[I];Lt(t,l,N[j]),l+=O[j],j>3&&(Lt(t,l,r[I]>>>5&8191),l+=mt[j])}else Lt(t,l,M[r[I]]),l+=D[r[I]];return Lt(t,l,M[256]),l+D[256]},jt=new ht([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ut=new dt(0),zt=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new dt(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?u=$t(c,u,e.subarray(l,d)):(c[l]=o,u=$t(c,u,e.subarray(l,s)))}else{for(var p=jt[t-1],h=p>>>13,f=8191&p,m=(1<<n)-1,v=new pt(32768),g=new pt(m+1),y=Math.ceil(n/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&m},S=new ht(25e3),C=new pt(288),k=new pt(32),I=0,_=0,T=(l=0,0),E=0,x=0;l<s;++l){var M=w(l),D=32767&l,N=g[M];if(v[D]=N,g[M]=D,E<=l){var O=s-l;if((I>7e3||T>24576)&&O>423){u=qt(e,c,0,S,C,k,_,T,x,l-x,u),T=I=_=0,x=l;for(var R=0;R<286;++R)C[R]=0;for(R=0;R<30;++R)k[R]=0}var L=2,P=0,A=f,F=D-N&32767;if(O>2&&M==w(l-F))for(var V=Math.min(h,O)-1,$=Math.min(32767,l),q=Math.min(258,O);F<=$&&--A&&D!=N;){if(e[l+L]==e[l+L-F]){for(var j=0;j<q&&e[l+j]==e[l+j-F];++j);if(j>L){if(L=j,P=F,j>V)break;var U=Math.min(F,j-2),z=0;for(R=0;R<U;++R){var W=l-F+R+32768&32767,H=W-v[W]+32768&32767;H>z&&(z=H,N=W)}}}F+=(D=N)-(N=v[D])+32768&32767}if(P){S[T++]=268435456|wt[L]<<18|Ct[P];var B=31&wt[L],Q=31&Ct[P];_+=ft[B]+mt[Q],++C[257+B],++k[Q],E=l+L,++I}else S[T++]=e[l],++C[e[l]]}}u=qt(e,c,o,S,C,k,_,T,x,l-x,u),o||(u=$t(c,u,Ut))}return Ot(a,0,r+Nt(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)};function Wt(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)i+=r+=n[s];r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r=zt(e,t,2,4);return function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)}(r,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(r,r.length-4,n.d()),r}var Ht=function(e){var t=B(B({},e),{v:"v1"});return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(Wt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new dt(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new dt(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Ot(r,0,i)}(JSON.stringify(t))),!0)},Bt=lt.addCustomEvent;lt.freezePage;class Qt{constructor(){this.eventBuffer=[],this.vfCounter=0,this.didSetupRecorder=!1,this.recordStopper=null,this.firstRecordedTimestamp=null,this.lastRecordedTimestamp=null,this.invalidVideoLength=!1,this.lastFragPostTimestamp=new Date,this.pauseTimeout=!1,this.freezingEvents=!1,this.cssURLs=new Map,this.timestampOffset=0,this.pageStateHistory=[],this.lastRRWebEvent=null,this.lastEvent=null,this.lastEventType=null,this.setupUnloadHandler(),this.setupPostMetricsHandler()}static configureInstance(){this.instance||(this.instance=new Qt,window.addEventListener("click",()=>{this.instance.handleFragPost()}))}static getInstance(){if(!this.instance)throw new Error("SessionRecorder was not configured");return this.instance}addCSSURLs(e){this.cssURLs.get(e)||this.cssURLs.set(e,{seq_sent:W.getInstance().messageSequenceNum,received:!1})}checkForCSSURLs(e){if(3===e.type||2===e.type){const t=JSON.stringify(e).match(d);t&&t.length>0&&t.forEach(e=>{if(e.length>0&&e.startsWith('"href":')){e.substring(7).split(/['"]/).forEach(e=>{e.includes(".css")&&this.addCSSURLs(e)})}})}}getCSSURLsNotReceived(){const{latestReceivedSeqNumber:e}=W.getInstance(),t=[];return this.cssURLs.forEach((n,r)=>{if(!n.received&&n.seq_sent<e){const e=n;e.received=!0,this.cssURLs.set(r,e)}else n.received||t.push(r)}),t}setupUnloadHandler(){["unload","pagehide","visibilitychange"].forEach(e=>window.addEventListener(e,()=>{this.pageStateHistory.push(`${j()?"":(new Date).toISOString()}: ${e}`),"unload"===e&&this.handleFragPost()}))}setupPostMetricsHandler(){window.addEventListener("noibuPostMetrics",e=>{const t=e.detail,n=null===this.lastRecordedTimestamp||null===this.firstRecordedTimestamp?0:this.lastRecordedTimestamp-this.firstRecordedTimestamp;let r=W.getInstance().sessionLength?W.getInstance().sessionLength:0;if(r=this.lastEvent&&this.lastEvent.occurredAt?Math.max(r,new Date(this.lastEvent.occurredAt).valueOf()-W.getInstance().sessionTimestamp.valueOf()):r,W.getInstance().retryMessageQueue.length>100){const e=this.buildDebugMessage(t,n,r),i=V.getInstance().isClientDisabled;V.getInstance().isClientDisabled=!1,V.getInstance().postNoibuErrorAndOptionallyDisableClient(e,i,"warn")}})}recordUserSession(){if(this.didSetupRecorder)return;const e=this,t={emit(t){e.handleNewRRwebEvent(t,2e3)},inlineStylesheet:!1,maskAllInputs:!0,blockSelector:D()};e.recordStopper=lt(t),this.didSetupRecorder=!0}handleNewRRwebEvent(e,t){if(W.getInstance().closeIfInactive())return void(this.recordStopper&&this.recordStopper());if(5===e.type&&"unfreeze"===e.data.tag)return;3===e.type&&0===e.data.source||(this.pauseTimeout&&(clearTimeout(this.pauseTimeout),this.freezingEvents=!1),this.pauseTimeout=setTimeout((function(){Qt.getInstance().freezingEvents=!0,lt.freezePage()}),t)),e.timestamp=U(e.timestamp),e.timestamp+=this.timestampOffset,this.firstRecordedTimestamp||(this.firstRecordedTimestamp=e.timestamp),(!this.lastRecordedTimestamp||e.timestamp>this.lastRecordedTimestamp)&&(this.lastRecordedTimestamp=e.timestamp),this.firstRecordedTimestamp&&e.timestamp<this.firstRecordedTimestamp&&(0!==this.timestampOffset?V.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind more than once. Client has been disabled.",!0,"error",!0):V.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind. Adjusting data to compensate.",!1,"warn",!0),this.timestampOffset+=this.lastRecordedTimestamp-e.timestamp,e.timestamp+=this.timestampOffset,this.lastRecordedTimestamp=e.timestamp),this.eventBuffer.push(Ht(e)),this.lastRRWebEvent=e,this.checkForCSSURLs(e),3!==e.type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||$.getInstance().addVideoClick();const n=new Date;n.setMilliseconds(n.getMilliseconds()-500),(this.eventBuffer.length>=10||this.lastFragPostTimestamp<n)&&this.handleFragPost()}buildDebugMessage(e,t,n){let r="Posting metrics, logging due to large retry message queue";r+=", URL: "+document.location.href,r+=", Session Length: "+n,r+=", Video Length: "+t,r+=", Length Delta: "+(t-n),r+=", Session Start: "+new Date(W.getInstance().sessionTimestamp),null!==this.firstRecordedTimestamp&&(r+=", Video Start: "+new Date(this.firstRecordedTimestamp),r+=", Start Delta: "+(this.firstRecordedTimestamp-W.getInstance().sessionTimestamp)),r+=", Last active time: "+V.getInstance().lastActiveTime,r+=", Visibility: "+document.visibilityState,this.pageStateHistory.length>0&&(r+=", Page States: "+this.pageStateHistory),r+=`, Socket: Connected ${W.getInstance().isConnected()} Count ${W.getInstance().connectionCount} Buffer: ${W.getInstance().socket.bufferedAmount}`,W.getInstance().socketCloseCodes.length>0&&(r+=" Closure Codes: "+W.getInstance().socketCloseCodes),W.getInstance().socketOpens.length>0&&(r+=" Opens: "+W.getInstance().socketOpens),null!==this.lastRRWebEvent&&(r+=`, Last rrweb event: Type ${this.lastRRWebEvent.type} Data Source ${this.lastRRWebEvent.data&&void 0!==this.lastRRWebEvent.data.source?this.lastRRWebEvent.data.source:-1} Data Type ${this.lastRRWebEvent.data&&void 0!==this.lastRRWebEvent.data.type?this.lastRRWebEvent.data.type:-1} Time: ${new Date(this.lastRRWebEvent.timestamp)}`);const{lastEvent:i,lastEventType:o}=Qt.getInstance();return null!==i&&(r+=`, Last pv event: ${o} ${i.occurredAt}`),W.getInstance().retryMessageQueue.length>0&&(r+=", Retry queue length: "+W.getInstance().retryMessageQueue.length),r+=`, Sequence Info: Latest ${this.lastFragPostTimestamp} ${W.getInstance().messageSequenceNum} Ack'd ${W.getInstance().latestReceivedSeqNumStoredTime} ${W.getInstance().latestReceivedSeqNumber}`,e&&(r+=", Event: "+e),this.timestampOffset>0&&(r+=", Time offset: "+this.timestampOffset),r}handleFragPost(){if(!W.getInstance().closeIfInactive()&&this.didSetupRecorder&&0!==this.eventBuffer.length){try{let e=0;this.firstRecordedTimestamp&&this.lastRecordedTimestamp&&!this.invalidVideoLength&&(e=this.lastRecordedTimestamp-this.firstRecordedTimestamp),!this.invalidVideoLength&&(e<0||e>=Number.MAX_SAFE_INTEGER)&&(V.getInstance().postNoibuErrorAndOptionallyDisableClient(`video lengthMS is invalid: ${e}, start time: ${this.firstRecordedTimestamp}, end time: `+this.lastRecordedTimestamp,!1,"error"),this.invalidVideoLength=!0,e=0),this.vfCounter+=1;const t={};t.vid=T(this.eventBuffer),t.seq=this.vfCounter,t.len=e,t.css_urls=this.getCSSURLsNotReceived(),W.getInstance().addEndTimeToPayload(t,!1),$.getInstance().addVideoFragData(this.vfCounter,e);const n={};n.pvvf=t,W.getInstance().sendMessage("v",n),this.lastFragPostTimestamp=new Date}catch(e){V.getInstance().postNoibuErrorAndOptionallyDisableClient("video frag socket closed with err: "+e.message,!1,"error"),this.recordStopper&&this.recordStopper()}this.eventBuffer=[]}}unfreeze(){this.freezingEvents&&Bt("unfreeze",{})}}class Jt{constructor(){this.partCounter=0,this.pvMap={},this.partCounter=0,this.pvEventLength=0,this.visibilityChangedCounter=0,this.totalPvEventLength=0,this.inDebounceHandle=0,this.isInAcceleratedPvPostMode=!1}static configureInstance(){this.instance||(this.instance=new Jt)}static getInstance(){if(!this.instance)throw new Error("Pagevisit was never configured");return this.instance}addPageVisitEvents(e,t){e.forEach(e=>{this._addPageVisitEvent(e,t)}),this._sendPageVisitMessage()}addPageVisitEvent(e,t){const n=this._addPageVisitEvent(e,t);return this._sendPageVisitMessage(),n}_addPageVisitEvent(e,t){if(!("occurredAt"in e)||!("event"in e))throw new Error("missing attributes in the eventObj");Qt.getInstance().lastEvent=e,Qt.getInstance().lastEventType=t;const n={type:t,occ_at:e.occurredAt,[t]:e.event};this.pvEventLength>=200&&this._sendPageVisitMessage();const r=h()();return this.pvMap[r]=n,this.pvEventLength+=1,this.totalPvEventLength+=1,r}static makePageVisitFrag(e,t){const n={};return n.events=e,n.pc=t,W.getInstance().addEndTimeToPayload(n,!0),n}_sendPageVisitMessage(){const e=Object.keys(this.pvMap).map(e=>this.pvMap[e]);if(0===e.length)return;if(this.partCounter>=1e4)return void V.getInstance().lockClientUntilNextPage(`NoibuJS will stop processing parts because we reached max parts: 10000. Variables: \n      total Pv Event Length: ${this.totalPvEventLength}\n      visibility Changed Counter: ${this.visibilityChangedCounter}\n      `);const t=Jt.makePageVisitFrag(e,this.partCounter);$.getInstance().setPvPart(this.partCounter);const n={pvp:t};W.getInstance().sendMessage("p",n),this.pvMap={},this.pvEventLength=0,this.partCounter+=1}}class Xt{constructor(){this.eventsToDebounce={},this.registerInputType("loc",0),this.registerInputType("err",500),this.registerInputType("http",500),this.registerInputType("kbd",500,"userstep"),this._setupUnloadHandler()}static getInstance(){return this.instance||(this.instance=new Xt),this.instance}registerInputType(e,t,n=e){e in this.eventsToDebounce||(this.eventsToDebounce[e]={timeout:null,events:[],debouncePeriod:t,eventName:n})}addEvent(e,t){if(!(t in this.eventsToDebounce))throw new Error(`Type: ${t} is not in eventsToDebounce`);this.eventsToDebounce[t].events.push({event:e,occurredAt:new Date(U(Date.now())+Qt.getInstance().timestampOffset).toISOString()}),this._debouncePvEvents(t)}_debouncePvEvents(e){clearTimeout(this.eventsToDebounce[e].timeout),this.eventsToDebounce[e].timeout=setTimeout(()=>{this.eventsToDebounce[e].timeout=null,Jt.getInstance().addPageVisitEvents(this.eventsToDebounce[e].events,this.eventsToDebounce[e].eventName),this.eventsToDebounce[e].events=[]},this.eventsToDebounce[e].debouncePeriod)}_setupUnloadHandler(){window.addEventListener("unload",()=>{Object.values(this.eventsToDebounce).forEach(e=>{Jt.getInstance().addPageVisitEvents(e.events,e.eventName)})})}}function Gt(e){return{url:R(e.filename),type:"js",j_err:_(e.error)}}function Kt(e,t){let n=t;switch(t.error&&t.error.originalError&&(n=t.error.originalError),e){case"XMLHttpRequest":return function(e){return{url:R(e.responseURL),type:"http",h_code:e.status}}(n);case"ErrorEvent":return Gt(n);case"Event":return function(e){return{url:R(e.target.src),type:"events"}}(n);case"Response":return function(e){return{url:R(e.url),type:"http",h_code:e.status}}(n);case"WrappedException":return Gt(n);case"FetchException":return function(e){return{url:R(e.url),type:"js",j_err:_({message:"Could not use the fetch API: "+O(e.str)})}}(n);case"ErrorLogEvent":return function(e){return{url:R(window.location.href),type:"js",j_err:_(e)}}(n);default:try{return Gt(n)}catch(e){return null}}}function Yt(e,t){const n=Kt(e,t);if(!n||!n.url||"events"===n.type)return;const r=n.url;if(function(e){try{return URL(e),!0}catch(e){return!1}}(r)){const e=new URL(r);if(e.hostname in L||!e.protocol.startsWith("http"))return}(function(e){if("js"===e.type){if(e.j_err){const t=e.j_err.frames;if(t&&t.length>0){const n=t[0].file.toLowerCase(),r=t[0].mname.toLowerCase();if(n.includes("noibu")&&!r.includes("nbuwrapper"))return V.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,"error"),!0}}else if(e.msg){if(e.msg.toLowerCase().includes("noibu"))return V.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,"error"),!0}}else if("http"===e.type&&e.url){const t=e.url;if("string"==typeof t)for(let n=0;n<o.length;n+=1){const r=o[n];if(t.includes(r))return V.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,"error"),!0}}return!1})(n)||($.getInstance().addError(),Xt.getInstance().addEvent(n,"err"))}let Zt=0;function en(e){if("function"!=typeof e)return e;try{if(e.__noibu__)return e;if(e.__noibu_wrapped__)return e.__noibu_wrapped__}catch(t){return e}const nbuWrapper=function(...t){try{const n=Array.prototype.slice.call(t).map(e=>en(e));return e.handleEvent?e.handleEvent.apply(this,n):e.apply(this,n)}catch(e){throw Yt("WrappedException",{error:e}),Zt+=1,setTimeout(()=>{Zt-=1}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(nbuWrapper[t]=e[t])}catch(e){}nbuWrapper.prototype=e.prototype||{},Object.defineProperty(e,"__noibu_wrapped__",{enumerable:!1,value:nbuWrapper}),Object.defineProperties(nbuWrapper,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(nbuWrapper,"name").configurable&&Object.defineProperty(nbuWrapper,"name",{get:()=>e.name})}catch(t){return e}return nbuWrapper}function tn(e){const{message:t,stack:n}=e;n&&t&&Yt("ErrorLogEvent",{message:t,stack:n})}function nn(e){e.forEach(e=>{Array.isArray(e)?e.forEach(e=>{tn(e)}):tn(e)})}function rn(e){e&&e.constructor&&e.constructor.name&&"undefined"!==e.constructor.name&&!(Zt>0)&&Yt(e.constructor.name,e)}function on(){window.addEventListener("error",rn,!0),r.forEach(e=>{const t=window[e],n=t&&t.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(f(n,"addEventListener",(function(e){return function nbuWrapper(t,n,r){if(!n)return e.call(this,t,n,r);let i;if(n.handleEvent){const e=en(n.handleEvent.bind(n));i=n,i.handleEvent=e}else i=en(n);return e.call(this,t,i,r)}})),f(n,"removeEventListener",(function(e){return function nbuWrapper(t,n,r){let i=n;try{i=i&&(i.__noibu_wrapped__||i)}catch(e){}return e.call(this,t,i,r)}})))}),f(window.console,"error",(function(e){return function nbuWrapper(){e.call(window.console,...arguments),nn(Array.from(arguments))}}))}class sn{constructor(e){const t=e;(!t.resp_time||t.resp_time<0)&&(t.resp_time=0),t.mtd=e.mtd.toUpperCase(),t.url=k(O(t.url)),this.httpEvent=t}saveHTTPEvent(){this.httpEvent&&this.httpEvent.url&&""!==this.httpEvent.url.trim()&&($.getInstance().addHttpEvent(),Xt.getInstance().addEvent(this.httpEvent,"http"))}}function an(e){return"number"!=typeof e||(e>=400||e<=0)}function cn(){const e=window.XMLHttpRequest,t=e&&e.prototype;if(!t||!t.hasOwnProperty||!t.hasOwnProperty("open"))return;const n=Object.getOwnPropertyDescriptor(t,"open");if(!n.writable){if(!n.configurable)return void function(e){const t=Object.getOwnPropertyDescriptor(e,"send");if(!t.writable){if(!t.configurable)return;Object.defineProperty(e,"send",{writable:!0})}f(e,"send",(function(e){return function nbuWrapper(t){const n=t?"POST":"GET",r=new Date;return this.addEventListener("loadend",()=>{const e=new Date,t=Math.abs(e-r),i={mtd:n,code:this.status,url:this.responseURL,r_time:t};let o=new sn(i);o.saveHTTPEvent(),o=null,an(this.status)&&Yt("XMLHttpRequest",this)}),e.call(this,t)}}))}(t);Object.defineProperty(t,"open",{writable:!0})}!function(e){f(e,"open",(function(e){return function nbuWrapper(t,n,r=!0,i=null,o=null){const s=new Date;return this.addEventListener("loadend",()=>{const e=new Date,r=Math.abs(e-s),i={mtd:t,code:this.status,url:n,r_time:r};let o=new sn(i);o.saveHTTPEvent(),o=null,an(this.status)&&Yt("XMLHttpRequest",this)}),e.call(this,t,n,r,i,o)}}))}(t)}function un(){cn(),function(){const e=window;e&&e.hasOwnProperty&&e.hasOwnProperty("fetch")&&f(e,"fetch",(function(e){return function nbuWrapper(t,n){const r=e.call(this,t,n),i=n&&n.method?n.method:"GET",o=new Date;return r.then(e=>{const n=new Date,r=Math.abs(n-o),s={mtd:i,code:e.status,url:t,r_time:r};let a=new sn(s);a.saveHTTPEvent(),a=null,an(e.status)&&Yt("Response",e)}).catch(e=>{Yt("FetchException",{url:t.url?t.url:window.location.href,str:e})}),r}}))}()}function ln(e){const t=e;return t.class=O(t.class),t}const dn=["\\b(view|add|my)\\b.*\\b(cart|bag|basket|bucket|box)\\b","\\b(buy now)\\b","^backorder$","\\b(acquista ora)\\b","\\b(buy this)\\b","\\b(ajouter|mon)\\b.*\\b(panier)\\b","\\b(aggiungi)\\b.*\\b(cart|borsa|carrello)\\b","^ajouter à la shopping bag$","^aggiungi$","^aggiungi alla shopping bag$","\\b(warenkorb)\\b","(^kaufen$)","^купить$","\\b(agregar)\\b.*\\b(carrito)\\b","\\b(adicionar)\\b.*\\b(carrinho)\\b","^carrinho$","^añadir al carrito de compras$","(^añadir al carrito$)","(add another)","(in winkelmand)","(sepete ekle)","(Lagg I Varukorgen)","(ΠΡΟΣΘΗΚΗ ΣΤΟ ΚΑΛΑΘΙ)","(Lägg i varukorgen)","(Köp)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"],pn=["(paypal)","(checkout|payment|check out)","(l.?achat|règlement|paiement|la commande)","(passer).*(commande)","valider mon panier","(acheter maintenant)","^caisse$","(gå vidare till kassan)","(cassa|acquisto)","^vai alla cassa$","^procedi all.?acquisto$","^procedi al checkout$","^siguiente$","(kasse)","^zur kasse gehen$","^bezahlen$","^weiter zum checkout$","(comprar ahora)","^comprar$","(prosseguir com a compra)","^pasar por la caja$","^afrekenen$","^compre$","(continue to pay)","(naar de kassa)","Перейти к оформлению заказа","^купить сейчас$","^bestellen$","(Alışverişi Tamamla)","^Till kassan$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"],hn=["(checkout|continue) (with paypal)","^continue to paypal$","^weiter zu paypal$","^continue to afterpay$","^braintree_paypal$","^pay and place order$","^mit paypal bezahlen$","^continue to payment securely$","(continua su paypal)","(apple pay|applepay)","(amazon pay|amazonpay|continue with amazon)","(sezzlepay)","(place order)","(place your order)","(order confirmation)","(complete purchase)","submit.*order","(pay now)","(^pay it now$)","(make payment)","(^make payment$)","(complete order)","^complete your order$","(fazer pedido)","^encomendar$","((realizar) (pedido|pago))","^finalizar compra$","^pagar$","^jetzt kaufen$","^bestellung aufgeben$","^bestellung prüfen$","^auftragsbestätigung$","^bestelling plaatsen$","^passer la commande$","(je confirme et je paye)","(accéder au paiement)","^passer au paiement$","(Valider et continuer)","^valider la commande$","(^passez la commande$)","^invia ordine$","(effettua ordine)","^effettua l.?ordine$","(conferma acquisto)","^conferma l.?acquisto$","^confirmation de commande$","^confirma l.?ordine$","^conferma l.?ordine$","^conferma ordine$","(SİPARİŞİ TAMAMLA)","^Разместить заказ$","(Slutför köp)","(注文する)","(إنشاء الطلب)","(注文を確定)","^お支払いへ進む$","^确认下单$"];class fn{constructor(){this.textCapturedWhiteListRegex=new RegExp(dn.concat(pn).concat(hn).join("|"),"i"),this.htmlIDWhiteListRegex=new RegExp("method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button","i")}static getInstance(){return this.instance||(this.instance=new fn),this.instance}monitorClicks(){window.addEventListener("click",this._onClickHandle.bind(this),!0)}_onClickHandle(e){const t=function(){const e=i(),t=["noibu-blocked"];return x()&&e.sel.forEach(e=>{e.startsWith(".")&&e.length>0&&t.push(e.substring(1))}),t}();if(e.srcElement){const n=e.srcElement;let r="";r="IMG"===n.tagName?n.alt?n.alt:"":this._getTextualContentFromEl(n,!0);let i=this._parseAndTrimText(r);const o=n.className?n.className:"";let s="";n.tagName&&(s=n.tagName.toLowerCase());let a=n.id?n.id:"";if("string"!=typeof a&&(a=""),!this.textCapturedWhiteListRegex.test(i)&&!this.htmlIDWhiteListRegex.test(a)){"input"===s?(!n.type||"button"!==n.type&&"submit"!==n.type)&&(i="*"):"textarea"===s&&(i="*");i=t.filter(e=>e===o).length>0?"*":i}i=function(e){return e.replace(/[0-9]/g,"*")}(i);const c={src:n.src?n.src:"",txt:i,tag:s,hid:a,type:"click",class:o};$.getInstance().addPvClick(),Jt.getInstance().addPageVisitEvents([{event:ln(c),occurredAt:new Date(U(Date.now())+Qt.getInstance().timestampOffset).toISOString()}],"userstep")}}_parseTextFromParentElement(e){let t=e;const n=[];let r=0;for(;t&&!(r>=5)&&t.parentNode;)t=t.parentNode,n.push(t),r+=1;for(let e=0;e<n.length;e+=1){const t=n[e];if(t&&"BUTTON"===t.tagName)return this._getTextualContentFromEl(t,!1,!1)}return""}_getTextualContentFromEl(e,n){let r="";const i=e.tagName?e.tagName.toLowerCase():"";for(let n=0;n<t.length;n+=1){const i=t[n];if(e[i]&&""!==e[i].trim()){r=e[i];break}}if(n)if(""===r)r=this._parseTextFromParentElement(e);else if("select"===i){const t=r;r=this._parseTextFromParentElement(e),r=r.replace(t,"")}return r}_parseAndTrimText(e){let t=e.trim().replace(/\s+/g," ");if(t.length>100){const e=t.lastIndexOf(" ",97);t=e>0?t.substring(0,e)+"...":"..."}return t}}class mn{constructor(){this.inputsTracked={}}monitor(){this._attachListenersToInputTags("input","textarea"),this._listenForNewInputTags("input","textarea")}_listenForNewInputTags(...e){new MutationObserver(t=>{t.forEach(t=>{for(let n=0;n<t.addedNodes.length;n+=1)if("FORM"===t.addedNodes[n].tagName){const e=t.addedNodes[n].getElementsByTagName("input");Array.prototype.slice.call(e).forEach(e=>{this._attachListenerToTextInput(e)})}else e.forEach(e=>{t.addedNodes[n].tagName===e.toUpperCase()&&this._attachListenerToTextInput(t.addedNodes[n])})})}).observe(window.document,{subtree:!0,childList:!0})}_attachListenersToInputTags(...e){e.forEach(e=>{const t=window.document.getElementsByTagName(e);Array.prototype.slice.call(t).forEach(e=>{this._attachListenerToTextInput(e)})})}_attachListenerToTextInput(e){const t=e.placeholder||e.name||e.id||"";this.inputsTracked[t]||""===t||(this.inputsTracked[t]=!0,e.addEventListener("input",()=>{Xt.getInstance().addEvent(ln({src:"",txt:t,tag:e.tagName.toLowerCase(),hid:e.id,type:"kbd",class:e.className}),"kbd")}))}}let vn=window.location.href;class gn{constructor(){this.customIDs={}}static getInstance(){return this.instance||(this.instance=new gn),this.instance}exposeFunctions(){const e=this._getSDKWindowObject();window.NOIBUJS=e}_getSDKWindowObject(){return{addCustomAttribute:this._addCustomAttribute.bind(this),addError:this._addCustomError.bind(this)}}_addCustomError(){}_addCustomAttribute(e,t){this._validateCustomIDInput(e,t)&&(Object.keys(this.customIDs).length>=10||e in this.customIDs||(this.customIDs[e]=t,W.getInstance().sendMessage("m",{pvm:{id_name:e,id_val:t}})))}_validateCustomIDInput(e,t){return"string"==typeof e&&("string"==typeof t&&(!(t.length>50||e.length>50)&&(0!==t.length&&0!==e.length)))}}!function(t){if(N())return;if(function(t){for(let n=0;n<e.length;n+=1){if(!t[e[n]])return!0}return!1}(t))return;if(!window.location.href.startsWith("http"))return;if(function(){const e=void 0!==window.noibuJSLoaded;return window.noibuJSLoaded=!0,e}())return;const n=h()(),r=t.metroplexHTTPBase+"/collect_error";if(V.configureInstance(r),V.getInstance().isClientDisabled)return;V.getInstance().setupBrowserIDCookie(),W.getInstance(n),Qt.configureInstance(),Jt.configureInstance();const i=Qt.getInstance();q.getInstance();const o=new mn,s=fn.getInstance();on(),un(),s.monitorClicks(),setInterval((function(){if(vn!==window.location.href){vn=window.location.href;const e={url:I()};Xt.getInstance().addEvent(e,"loc")}}),1e3),o.monitor(),new Promise(e=>{function t(){"complete"===document.readyState&&(window.removeEventListener("load",t),document.removeEventListener("readystatechange",t),e())}"complete"===document.readyState?e():(window.addEventListener("load",t),document.addEventListener("readystatechange",t))}).then(()=>{i.recordUserSession()}),gn.getInstance().exposeFunctions()}({metroplexSocketBase:a(),metroplexHTTPBase:c()})})()})();