window.NOIBUJS_CONFIG={"scriptID":"1.171.0","domain":"."};(()=>{var e={181:(e,t,n)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype.toString,h=Math.max,p=Math.min,f=function(){return u.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=o.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,s,a,c,l=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,l=t,s=e.apply(o,n)}function b(e){return l=e,a=setTimeout(w,t),u?y(e):s}function I(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=f();if(I(e))return C(e);a=setTimeout(w,function(e){var n=t-(e-c);return d?p(n,o-(e-l)):n}(e))}function C(e){return a=void 0,v&&r?y(e):(r=i=void 0,s)}function S(){var e=f(),n=I(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return b(c);if(d)return a=setTimeout(w,t),y(c)}return void 0===a&&(a=setTimeout(w,t)),s}return t=m(t)||0,g(n)&&(u=!!n.leading,o=(d="maxWait"in n)?h(m(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,r=c=i=a=void 0},S.flush=function(){return void 0===a?s:C(f())},S}},471: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("")}},814: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}}},550:(e,t,n)=>{var r=n(814),i=n(471);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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e,t,r,i,o,s,a,c,l,u,d,h,p,f,g={};n.r(g),n.d(g,{CLSThresholds:()=>Di,FCPThresholds:()=>Li,FIDThresholds:()=>Eo,INPThresholds:()=>Yi,LCPThresholds:()=>po,TTFBThresholds:()=>mo,onCLS:()=>Pi,onFCP:()=>Vi,onFID:()=>_o,onINP:()=>ho,onLCP:()=>go,onTTFB:()=>yo}),function(e){e.TwoG="2g",e.ThreeG="3g",e.FourG="4g",e.Slow2g="slow-2g"}(e||(e={})),function(e){e.JS="js",e.Http="http",e.Gql="gql",e.Csp="csp",e.Resource="res",e.PageCheck="pagecheck_err",e.HttpResponseMatch="http_match"}(t||(t={})),function(e){e.Error="err",e.UserStep="userstep",e.Http="http",e.Loc="loc",e.Page="page",e.WebVital="wv",e.ECommerce="ecommerce",e.NetworkStats="network",e.Sample="sample",e.ApplicationNavigation="app_nav",e.PageCheck="pagecheck",e.VisualError="visual_error",e.Title="title",e.PageType="page_type",e.PageGroups="page_groups"}(r||(r={})),function(e){e.VideoBlock="vid_block",e.PageVisitBlock="pv_block",e.FullBlock="full_block",e.CloseConnection="close_conn",e.OK="ok"}(i||(i={})),function(e){e.StorageFull="sf",e.StorageUnavailable="su",e.StorageUnavailableSecurityError="suse"}(o||(o={})),function(e){e.XMLHttpRequest="XMLHttpRequest",e.ErrorEvent="ErrorEvent",e.UnhandledRejectionError="UnhandledRejectionError",e.Event="Event",e.Response="Response",e.WrappedException="WrappedException",e.FetchException="FetchException",e.ErrorLogEvent="ErrorLogEvent",e.CustomError="CustomError",e.ReactError="ReactError",e.VueError="VueError",e.PageCheckError="PageCheckError"}(s||(s={})),function(e){e.WARN="warn",e.INFO="info",e.DEBUG="debug",e.ERROR="error"}(a||(a={})),function(e){e.Click="click",e.Keyboard="kbd",e.Navigation="navigation"}(c||(c={})),function(e){e.RRWeb="RRWeb",e.AndroidNative="AndroidNative",e.IOSNative="IOSNative"}(l||(l={})),function(e){e.PageVisitPart="pvp",e.PageVisitVideoFile="pvvf",e.PageVisitHttp="pvh",e.PageVisitMeta="pvm",e.WorkRequest="wr"}(u||(u={})),function(e){e.CumulativeLayoutShift="CLS",e.FirstContentfulPaint="FCP",e.FirstInputDelay="FID",e.InteractionToNextPaint="INP",e.LargestContentfulPaint="LCP",e.TimeToFirstByte="TTFB"}(d||(d={})),function(e){e.Good="good",e.NeedsImprovement="needs-improvement",e.Poor="poor",e.Unknown="unknown"}(h||(h={})),function(e){e.HelpCode="hc"}(p||(p={})),function(e){e.PageVisitPart="pv_part",e.CollectError="collect_error",e.Metrics="metrics",e.PageVisit="pv"}(f||(f={}));const m=!1,v=!1,y=!1,b=!1,I=!1,w=!1,C="",S=0;function k(e,t){return"boolean"==typeof e?e:t}function E(e,t){return"string"==typeof e?e:t}function _(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function A(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function T(){const e=A(A(Ce().njs_config).featureFlags);return{allowsBots:k(e.allowsBots,I),excludeXhrMonitoring:k(e.excludeXhrMonitoring,w),replaceLocalhostInStr:E(e.replaceLocalhostInStr,C),restrictsBundleSize:_(e.restrictsBundleSize,S)}}const R=["metroplexSocketBase","metroplexHTTPBase"],M="Response data unavailable due to an improperly wrapped fetch call",x=["authorization","from","proxy-authorization","content-md5","cookie","x-forwarded-for","x-real-ip","x-device-id","x-auth-token","x-user-id","x-forwarded-for","x-uidh","set-cookie","forwarded"],N=/[0-9]+/g,L=/\b[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9-]*[a-z]\w*\b/gi,O=[/\b4\d{12}(?:\d{3})?\b/g,/\b(?:5[1-5]\d{2}|222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}\b/g,/\b3[47]\d{13}\b/g,/\b3(?:0[0-5]|[68]\d)\d{11}\b/g,/\b6(?:011|5\d{2})\d{12}\b/g,/\b(?:2131|1800|35\d{3})\d{11}\b/g,L,/\b(?!000|666)[0-8]\d{2}[-.● ]?(?!00)\d{2}[-.● ]?(?!0000)\d{4}\b/g,/\b(\d{3}[-.● ]?\d{3}[-.● ]?\d{3})\b/g,/\+(?:\d●?){6,14}\d\b/g],D=/^www\d{0,2}$/,P=/(getElementById\(')([^']*)('\)\.value = )('[^']*')/g,V=a.ERROR,F=a.WARN,U=(a.INFO,a.DEBUG,["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"]),B=u.PageVisitPart,H=u.PageVisitVideoFile,q=u.PageVisitMeta,W=u.PageVisitHttp,j="type",G="tag",$="src",z="txt",Z="hid",K="class",Y=p.HelpCode,J=u.WorkRequest,Q=(o.StorageFull,o.StorageUnavailable,o.StorageUnavailableSecurityError,t.Http),X=r.Http,ee=t.JS,te=t.Gql,ne=t.Csp,re=t.Resource,ie=r.UserStep,oe=r.WebVital,se=c.Click,ae=c.Keyboard,ce=(c.Navigation,r.Loc),le=r.Error,ue=r.Page,de=r.NetworkStats,he=r.ECommerce,pe=(r.Sample,t.PageCheck),fe=r.VisualError,ge=r.Title,me=r.PageGroups,ve=u.PageVisitPart,ye=u.PageVisitVideoFile,be=u.PageVisitMeta,Ie=u.PageVisitHttp,we=l.RRWeb;function Ce(){return self.NOIBUJS_CONFIG||{}}const Se=["i.noibu","i.staging.noibu","input.staging.noibu","input.b.noibu","input.noibu","vf.staging.noibu","vf.noibu"],ke=f.PageVisitPart,Ee=f.CollectError,_e=(f.Metrics,f.PageVisit),Ae=i.VideoBlock,Te=i.PageVisitBlock,Re=i.FullBlock,Me=i.CloseConnection,xe=i.OK,Ne=s.XMLHttpRequest,Le=s.ErrorEvent,Oe=s.UnhandledRejectionError,De=s.Event,Pe=s.Response,Ve=s.PageCheckError,Fe=s.WrappedException,Ue=s.FetchException,Be=s.ErrorLogEvent,He=s.CustomError,qe=s.ReactError,We=s.VueError,je=["error","warn","log"],Ge=["pagehide","pageshow","popstate","online","offline","messageerror","languagechange","hashchange","beforeprint","afterprint","load","resize"],$e=["blur","focus"],ze=["visibilitychange","resume","freeze","readystatechange","cut","copy","paste"],Ze=new Set(["background-position-x","background-position-y","background-size","background-attachment","background-origin","background-clip","background-color","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-width","border-right-width","border-bottom-width","border-left-width","flex-wrap","list-style-image","list-style-position","max-width","outline-color","outline-style","outline-width","max-height","height","color","border-collapse","text-indent","width","position","line-height","white-space","display","top","pointer-events","right","overflow-x","overflow-y","text-align","padding-top","padding-bottom","padding-right","padding-left","transform","text-decoration-line","font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","background-image"].map(e=>"--quantum-metric-"+e));function Ke(){return"beta"===Ce().njs_version}function Ye(){return Ke()?"1.171.0-beta":"1.171.0"}function Je(){return Ce().att_sel||{}}function Qe(){return Ke()?"wss://input.b.noibu.com":"wss://input.noibu.com"}function Xe(){return Ke()?"https://input.b.noibu.com":"https://input.noibu.com"}function et(){return`${Xe()}/${_e}`}const tt=[e=>/AppMeasurement Debug/i.test(e)],nt=new Set(["button","radio","checkbox","reset","submit"]),rt=[e=>"button"===e,(e,t)=>"input"===e&&nt.has(t.type),e=>"a"===e,e=>"select"===e,e=>"option"===e];var it,ot=n(550),st=n.n(ot);function at(e){return e.nodeType===e.ELEMENT_NODE}function ct(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function lt(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}!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"}(it||(it={}));var ut={"animation-duration: ;":"animation-duration: 0.6s;","animation-timing-function: ;":"animation-timing-function: cubic-bezier(0, 0, 0.3, 1);","animation-iteration-count: ;":"animation-iteration-count: 1;","animation-direction: ;":"animation-direction: normal;","animation-fill-mode: ;":"animation-fill-mode: forwards;","animation-play-state: ;":"animation-play-state: running;","animation-name: ;":"animation-name: slideIn;","animation-timeline: ;":"animation-timeline: auto;","animation-range-start: ;":"animation-range-start: normal;","animation-range-end: ;":"animation-range-end: normal;","animation-delay: ;":"animation-delay: 0s;"};function dt(e){try{var t=e.rules||e.cssRules;return t?function(e){e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;"));var t=Object.keys(ut);return t.some((function(t){return e.includes(t)}))&&t.forEach((function(t){var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n,"g");e=e.replace(r,ut[t])})),e}(Array.from(t).map(ht).join("")):null}catch(e){return null}}function ht(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=dt(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}(t||e.cssText)}var pt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);if(this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)})),e.nodeType===Node.ELEMENT_NODE){var r=e;r.shadowRoot&&r.shadowRoot.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function ft(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=i&&gt(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function gt(e){return e.toLowerCase()}function mt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gt(t):null}var vt=/var\(\s*(--[A-Za-z0-9_-]+)/g,yt=null,bt="",It=null;function wt(e,t,n){var r;if(-1!==e.indexOf("var("))for(vt.lastIndex=0;null!==(r=vt.exec(e));){var i=r[1],o=n.usedBy.get(i);o||(o=new Set,n.usedBy.set(i,o)),o.add(t)}}function Ct(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=r;if(i.selectorText&&i.style)for(var o=i.style,s=i.selectorText,a=0;a<o.length;a++){var c=o[a];45===c.charCodeAt(0)&&45===c.charCodeAt(1)&&t.declared.add(c),wt(o.getPropertyValue(c),s,t)}var l=r;l.cssRules&&l.cssRules.length&&Ct(l.cssRules,t)}}function St(e){var t=function(e){for(var t=e.styleSheets,n="".concat(t.length),r=0;r<t.length;r++){var i=-1;try{i=t[r].cssRules?t[r].cssRules.length:0}catch(e){}n+=":".concat(i)}return n}(e);if(yt===e&&bt===t&&It)return It;var n=function(e){for(var t={declared:new Set,usedBy:new Map},n=e.styleSheets,r=0;r<n.length;r++){var i=null;try{i=n[r].cssRules}catch(e){continue}i&&Ct(i,t)}return t}(e);return yt=e,bt=t,It=n,n}function kt(e){var t=new Map,n=e.defaultView;if(!n||"function"!=typeof n.getComputedStyle)return t;var r=St(e),i=r.declared,o=r.usedBy,s=[];if(o.forEach((function(e,t){i.has(t)||s.push([t,e])})),0===s.length)return t;for(var a=new Map,c=function(r,i){i.forEach((function(i){for(var o=0,s=function(t){var n=a.get(t);if(n)return n;try{n=Array.from(e.querySelectorAll(t))}catch(e){n=[]}return a.set(t,n),n}(i);o<s.length;o++){var c=s[o],l=n.getComputedStyle(c).getPropertyValue(r).trim();if(l){var u=t.get(c);u||(u={},t.set(c,u)),u[r]=l}}}))},l=0,u=s;l<u.length;l++){var d=u[l];c(d[0],d[1])}return t}var Et,_t,At=1,Tt=new RegExp("[^a-z0-9-_:]");function Rt(){return At++}var Mt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xt=/^(?:[a-z+]+:)?\/\//i,Nt=/^www\..*/i,Lt=/^(data:)([^,]*),(.*)/i;function Ot(e,t){return(e||"").replace(Mt,(function(e,n,r,i,o,s){var a,c=r||o||s,l=n||i||"";if(!c)return e;if(xt.test(c)||Nt.test(c))return"url(".concat(l).concat(c).concat(l,")");if(Lt.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,p=d;h<p.length;h++){var f=p[h];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var Dt=/^[^ \t\n\r\u000c]+/,Pt=/^[, \t\n\r\u000c]+/;function Vt(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function Ft(){var e=document.createElement("a");return e.href="",e.href}function Ut(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?Vt(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?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(Pt),!(n>=t.length);){var o=r(Dt);if(","===o.slice(-1))o=Vt(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=Vt(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?Ot(r,Ft()):"object"===t&&"data"===n?Vt(e,r):r:Vt(e,r):r}function Bt(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Ht(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Ht(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Ht(e.parentNode,t,n)}function qt(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(Ht(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function Wt(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,d=t.maskTextFn,h=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,g=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=t.maskCurrentNode,w=t.cssVariableOverrides,C=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:it.Document,childNodes:[],compatMode:e.compatMode}:{type:it.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:it.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=void 0===s?{}:s,c=t.maskInputFn,l=t.dataURLOptions,u=void 0===l?{}:l,d=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,g=void 0!==f&&f,m=t.rootId,v=t.cssVariableOverrides,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=gt(e.tagName);return Tt.test(t)?"div":t}(e),I={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];Bt(b,S.name,S.value)||(I[S.name]=Ut(n,b,gt(S.name),S.value))}if(v){var k=v.get(e);if(k){var E=function(e,t){var n=[];for(var r in t)e&&-1!==e.indexOf(r)||n.push("".concat(r,":").concat(t[r]));if(0===n.length)return e||"";var i=n.join(";");return e?e.trim().replace(/;\s*$/,"")+";"+i:i}("string"==typeof I.style?I.style:void 0,k);E&&(I.style=E)}}if("link"===b&&o){var _=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),A=null;_&&(A=dt(_)),A&&(delete I.rel,delete I.href,I._cssText=Ot(A,_.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(A=dt(e.sheet))&&(I._cssText=Ot(A,Ft()))}if("input"===b||"textarea"===b||"select"===b){var T=e.value,R=e.checked;if("radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type){var M=T||I.value||"";if(M){var x=mt(e);I.value=ft({element:e,type:x,tagName:b,value:M,maskInputOptions:a,maskInputFn:c})}}else R&&(I.checked=R)}"option"===b&&(e.selected?I.selected=!0:delete I.selected);"dialog"===b&&e.open&&(I.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===b&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var N=e.toDataURL(u.type,u.quality),L=document.createElement("canvas");L.width=e.width,L.height=e.height;var O=L.toDataURL(u.type,u.quality);N!==O&&(I.rr_dataURL=N)}if("img"===b&&d){Et||(Et=n.createElement("canvas"),_t=Et.getContext("2d"));var D=e,P=D.crossOrigin;D.crossOrigin="anonymous";var V=function(){D.removeEventListener("load",V);try{Et.width=D.naturalWidth,Et.height=D.naturalHeight,_t.drawImage(D,0,0),I.rr_dataURL=Et.toDataURL(u.type,u.quality)}catch(e){}P?I.crossOrigin=P:D.removeAttribute("crossorigin")};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}"audio"!==b&&"video"!==b||(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop));if(y){var F=e.getBoundingClientRect(),U=F.width,B=F.height;I={class:I.class,rr_width:"".concat(U,"px"),rr_height:"".concat(B,"px")}}"iframe"!==b||p(I.src)||(e.contentDocument||(I.rr_src=I.src),delete I.src);return{type:it.Element,tagName:b,attributes:I,childNodes:[],isSVG:(H=e,Boolean("svg"===H.tagName||H.ownerSVGElement)||void 0),needBlock:y,rootId:m};var H}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:v,newlyAddedElement:b,rootId:C,cssVariableOverrides:w});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=t.maskCurrentNode,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=dt(e.parentNode.sheet))}catch(e){}l=Ot(l,Ft())}d&&(l="SCRIPT_PLACEHOLDER");if(!u&&!d&&l){(void 0===a?qt(e,r,i):a)&&(l=o?o(l):l.replace(/[\S]/g,"*"))}return{type:it.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:d,rootId:C,maskCurrentNode:I});case e.CDATA_SECTION_NODE:return{type:it.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:it.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function jt(e){return null==e?"":e.toLowerCase()}function Gt(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,p=void 0===h?{}:h,f=t.maskTextFn,g=t.maskInputFn,m=t.slimDOMOptions,v=t.dataURLOptions,y=void 0===v?{}:v,b=t.inlineImages,I=void 0!==b&&b,w=t.recordCanvas,C=void 0!==w&&w,S=t.onSerialize,k=t.onIframeLoad,E=t.iframeLoadTimeout,_=void 0===E?5e3:E,A=t.onStylesheetLoad,T=t.stylesheetLoadTimeout,R=void 0===T?5e3:T,M=t.keepIframeSrcFn,x=void 0===M?function(){return!1}:M,N=t.newlyAddedElement,L=void 0!==N&&N,O=t.maskedElements,D=void 0===O?[]:O,P=t.cssVariableOverrides,V=t.preserveWhiteSpace,F=void 0===V||V,U=t.maskCurrentNode;!1===U&&(U=D.includes(e));var B,H=Wt(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,dataURLOptions:y,inlineImages:I,recordCanvas:C,keepIframeSrcFn:x,newlyAddedElement:L,maskCurrentNode:U,cssVariableOverrides:P});if(!H)return null;B=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===it.Comment)return!0;if(e.type===it.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===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&&(jt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===jt(e.attributes.name)||"icon"===jt(e.attributes.rel)||"apple-touch-icon"===jt(e.attributes.rel)||"shortcut icon"===jt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&jt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(jt(e.attributes.property).match(/^(og|twitter|fb):/)||jt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===jt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===jt(e.attributes.name)||"googlebot"===jt(e.attributes.name)||"bingbot"===jt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===jt(e.attributes.name)||"generator"===jt(e.attributes.name)||"framework"===jt(e.attributes.name)||"publisher"===jt(e.attributes.name)||"progid"===jt(e.attributes.name)||jt(e.attributes.property).match(/^article:/)||jt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===jt(e.attributes.name)||"yandex-verification"===jt(e.attributes.name)||"csrf-token"===jt(e.attributes.name)||"p:domain_verify"===jt(e.attributes.name)||"verify-v1"===jt(e.attributes.name)||"verification"===jt(e.attributes.name)||"shopify-checkout-api-token"===jt(e.attributes.name)))return!0}}return!1}(H,m)&&(F||H.type!==it.Text||H.isStyle||H.textContent.replace(/^\s+|\s+$/gm,"").length)?Rt():-2;var q=Object.assign(H,{id:B});if(r.add(e,q),-2===B)return null;S&&S(e);var W=!l;if(q.type===it.Element){W=W&&!q.needBlock,delete q.needBlock;var j=e.shadowRoot;j&&lt(j)&&(q.isShadowHost=!0)}if((q.type===it.Document||q.type===it.Element)&&W){m.headWhitespace&&q.type===it.Element&&"head"===q.tagName&&(F=!1);for(var G={doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D,cssVariableOverrides:P},$=0,z=Array.from(e.childNodes);$<z.length;$++){(Y=Gt(z[$],G))&&q.childNodes.push(Y)}if(at(e)&&e.shadowRoot)for(var Z=0,K=Array.from(e.shadowRoot.childNodes);Z<K.length;Z++){var Y;(Y=Gt(K[Z],G))&&(lt(e.shadowRoot)&&(Y.isShadow=!0),q.childNodes.push(Y))}}return e.parentNode&&ct(e.parentNode)&&lt(e.parentNode)&&(q.isShadow=!0),q.type===it.Element&&"iframe"===q.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){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}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&&k){var n=Gt(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D});n&&k(e,n)}}),_),q.type===it.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),i=!0,t()}))}}(e,(function(){if(A){var t=Gt(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:f,maskInputFn:g,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:C,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:A,stylesheetLoadTimeout:R,keepIframeSrcFn:x,maskCurrentNode:U,maskedElements:D});t&&A(e,t)}}),R),q}function $t(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>{try{n.removeEventListener(e,t,r)}catch(e){}}}let zt={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function Zt(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}}function Kt(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Kt(e,t,o||{},!0)}function Yt(e,t,n){try{if(!(t in e))return()=>{};const 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,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(zt=new Proxy(zt,{get:(e,t,n)=>Reflect.get(e,t,n)}));let Jt=Date.now;function Qt(e){var t,n,r,i,o,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(o=null===(i=null==a?void 0:a.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function Xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function en(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function tn(e,t){let n=e;for(;n;){const e=n.closest(t);if(e)return e;const r=n.getRootNode();if(!(r instanceof ShadowRoot))return null;n=r.host}return null}function nn(e,t,n,r){if(!e)return!1;let i;if(i=e.nodeType===e.ELEMENT_NODE?e:ct(e)?e.host:e.parentElement,!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==tn(i,"."+t))return!0}else if(Ht(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==tn(i,n))return!0}return!1}function rn(e,t){return-2===t.getId(e)}function on(e){return Boolean(e.changedTouches)}function sn(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function an(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function cn(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Jt=()=>(new Date).getTime());class ln{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function un(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function dn(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=un(n);)n=t;return n}(e);return t.contains(n)}function hn(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||dn(e))}var pn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(pn||{}),fn=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(fn||{}),gn=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(gn||{}),mn=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(mn||{}),vn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(vn||{});function yn(e){return"__ln"in e}class bn{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&yn(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&yn(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const In=(e,t)=>`${e}@${t}`;class wn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{const t=e=>{e.forEach(this.processMutation),this.emit()};if(this.deferProcessMutations){const n=100;for(let r=0;r<Math.ceil(e.length/n);r++){const i=r*n,o=(r+1)*n;setTimeout(()=>t(e.slice(i,o)))}}else t(e)},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new bn,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!hn(i))return;const o=ct(i.parentNode)?this.mirror.getId(un(i)):this.mirror.getId(i.parentNode),s=r(i);if(-1===o||-1===s)return n.addNode(i);const a=Gt(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{sn(e,this.mirror)&&this.iframeManager.addIframe(e),an(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),cn(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t),this.stylesheetManager.handleStylesheetFonts(t)}});a&&(e.push({parentId:o,nextId:s,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Sn(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)kn(this.droppedSet,e)||Sn(this.removes,e,this.mirror)?kn(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{try{if(wn.shouldSkipMutation(e))return}catch(e){}if(rn(e.target,this.mirror))return;let t;try{t=document.implementation.createHTMLDocument()}catch(e){t=this.doc}switch(e.type){case"characterData":{const t=e.target.textContent;nn(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:qt(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const e=mt(n);i=ft({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(nn(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;try{e.attributeName="rr_src"}catch(e){return}}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Bt(n.tagName,r))if(o.attributes[r]=Ut(this.doc,gt(n.tagName),gt(r),i),"style"===r){const r=t.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?t:[t,i]:o._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(nn(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=ct(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);nn(e.target,this.blockClass,this.blockSelector,!1)||rn(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Cn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(ct(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[In(n,r)]?Cn(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!ct(e.target)||!lt(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){try{const t=e.getRootNode();if(t instanceof ShadowRoot&&"closed"===t.mode)return}catch(e){}if(this.mirror.hasNode(e)){if(rn(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[In(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);nn(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),cn(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","deferProcessMutations"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}static shouldSkipMutation(e){var t;const n=e.attributeName||"",r="attributes"===e.type,i=e.oldValue,o=null===(t=e.target.attributes.getNamedItem(n))||void 0===t?void 0:t.value;if(r&&i===o)return!0;const s=window.location.hostname.toLowerCase();if("uat.jtv.com"===s||"www.jtv.com"===s){const e="id"===n&&(0===(i||"").indexOf("sizzle-")||0===(o||"").indexOf("sizzle-"));if(r&&("tabindex"===n||e||"data-slick-index"===n))return!0}return!1}}function Cn(e,t){e.delete(t),t.childNodes.forEach(t=>Cn(e,t))}function Sn(e,t,n){return 0!==e.length&&function e(t,n,r){const{parentNode:i}=n;if(!i)return!1;const o=r.getId(i);if(t.some(e=>e.id===o))return!0;return e(t,i,r)}(e,t,n)}function kn(e,t){return 0!==e.size&&function e(t,n){const{parentNode:r}=n;if(!r)return!1;if(t.has(r))return!0;return e(t,r)}(e,t)}let En;function _n(e){En=e}function An(){En=void 0}const Tn=e=>{if(!En)return e;return(...t)=>{try{return e(...t)}catch(e){if(En&&!0===En(e))return;throw e}}},Rn=[];function Mn(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function xn(e,t){var n,r;const i=new wn;Rn.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");s&&window[s]&&(o=window[s]);const a=new o(Tn(i.processMutations.bind(i)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Nn({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let c=null;return Object.keys(gn).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=gt(o);const l=(t=>o=>{const s=Mn(o);if(nn(s,r,i,!0))return;let a=null,l=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=mn.Mouse;break;case"touch":a=mn.Touch;break;case"pen":a=mn.Pen}a===mn.Touch?gn[t]===gn.MouseDown?l="TouchStart":gn[t]===gn.MouseUp&&(l="TouchEnd"):mn.Pen}else on(o)&&(a=mn.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===mn.Touch||l.startsWith("Mouse")&&a===mn.Mouse)&&(a=null)):gn[t]===gn.Click&&(a=c,c=null);const u=on(o)?o.changedTouches[0]:o;if(!u)return;const d=n.getId(s),{clientX:h,clientY:p}=u;Tn(e)(Object.assign({type:gn[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(gn[o]){case gn.MouseDown:case gn.MouseUp:s=s.replace("mouse","pointer");break;case gn.TouchStart:case gn.TouchEnd:return}a.push($t(s,l,t))}),Tn(()=>{a.forEach(e=>e())})}function Ln({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return $t("scroll",Tn(Zt(Tn(o=>{const s=Mn(o);if(!s||nn(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Qt(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function On(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Dn=["INPUT","TEXTAREA","SELECT"],Pn=new WeakMap;function Vn(e){return function(e,t){if(qn("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qn("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qn("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qn("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Fn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Un({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),Tn(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function Bn({mutationCb:e,mirror:t,recoverCSSVariables:n},{win:r}){var i;const o=null===(i=r.Element)||void 0===i?void 0:i.prototype;if(!n||!o||"function"!=typeof o.animate)return()=>{};const s=o.animate;return o.animate=new Proxy(s,{apply:Tn((n,r,i)=>{const o=n.apply(r,i),s=function(e){if(!e||"object"!=typeof e)return null;const t={};let n=!1;const r=(e,r)=>{if(45!==e.charCodeAt(0)||45!==e.charCodeAt(1))return;const i=Array.isArray(r)?r[r.length-1]:r;null!=i&&""!==i&&(t[e]=String(i),n=!0)};if(Array.isArray(e)){for(const t of e)if(t&&"object"==typeof t)for(const e in t)r(e,t[e])}else for(const t in e)r(t,e[t]);return n?t:null}(i[0]);if(s){const n=t.getId(r);-1!==n&&e({texts:[],attributes:[{id:n,attributes:{style:s}}],removes:[],adds:[]})}return o})}),Tn(()=>{try{o.animate=s}catch(e){}})}function Hn(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=xn(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=Zt(Tn(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),l=Tn(Zt(Tn(e=>{const t=Mn(e),{clientX:n,clientY:i}=on(e)?e.changedTouches[0]:e;s||(s=Jt()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Jt()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?fn.Drag:e instanceof MouseEvent?fn.MouseMove:fn.TouchMove)}),i,{trailing:!1})),u=[$t("mousemove",l,n),$t("touchmove",l,n),$t("drag",l,n)];return Tn(()=>{u.forEach(e=>e())})}(e),o=Nn(e),s=Ln(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return $t("resize",Tn(Zt(Tn(()=>{const t=Xt(),i=en();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Mn(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=n.parentElement),!n||!d||Dn.indexOf(d)<0||nn(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let p=n.value,f=!1;const g=mt(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(a[d.toLowerCase()]||a[g])&&(p=ft({element:n,maskInputOptions:a,tagName:d,type:g,value:p,maskInputFn:c})),h(n,Tn(On)({text:p,isChecked:f,userTriggered:l},u));const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${CSS.escape(m)}"]`).forEach(e=>{e!==n&&h(e,Tn(On)({text:e.value,isChecked:!f,userTriggered:!1},u))})}function h(t,r){const i=Pn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pn.set(t,r);const i=n.getId(t);Tn(e)(Object.assign(Object.assign({},r),{id:i}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>$t(e,Tn(d),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];try{f.document.querySelectorAll('input[type="checkbox"]').forEach(e=>{f.Object.getOwnPropertyDescriptor(e,"checked")&&m.push([e,"checked"])})}catch(e){}return g&&g.set&&p.push(...m.map(e=>Kt(e[0],e[1],{set(){Tn(d)({target:this,isTrusted:!1})}},!1,f))),Tn(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Tn(o=>Zt(Tn(i=>{const s=Mn(i);if(!s||nn(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=s;e({type:o,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u})}),i.media||500)),a=[$t("play",s(0),o),$t("pause",s(1),o),$t("seeked",s(2),o),$t("volumechange",s(3),o),$t("ratechange",s(4),o)];return Tn(()=>{a.forEach(e=>e())})}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Tn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=Fn(i,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(i,o)})});const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Tn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Fn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Tn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Fn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Tn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Fn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(i,o)})}));const c={};Wn("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Wn("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Wn("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Wn("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Tn((r,i,o)=>{const[s,a]=o,{id:c,styleId:l}=Fn(i.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...Vn(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Tn((r,i,o)=>{const[s]=o,{id:a,styleId:c}=Fn(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...Vn(i),s]}]}),r.apply(i,o)})})}),Tn(()=>{try{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}catch(e){}})}(e,{win:n}),d=Un(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Tn((i,s,a)=>{var c;const[l,u,d]=a;if(n.has(l))return o.apply(s,[l,u,d]);const{id:h,styleId:p}=Fn(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:l,value:u,priority:d},index:Vn(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Tn((i,o,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(o,[l]);const{id:u,styleId:d}=Fn(null===(c=o.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:Vn(o.parentRule)}),i.apply(o,a)})}),Tn(()=>{try{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}catch(e){}})}(e,{win:n}),p=Bn(e,{win:n}),f=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const 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};const s=Yt(t.fonts,"add",(function(t){return function(n){return setTimeout(Tn(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push(()=>{try{n.FontFace=o}catch(e){}}),r.push(s),Tn(()=>{r.forEach(e=>e())})}(e):()=>{},g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Tn(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:l,endOffset:u}=o;nn(s,r,i,!0)||nn(l,r,i,!0)||a.push({start:n.getId(s),startOffset:c,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),$t("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return Tn(()=>{Rn.forEach(e=>e.reset()),r.disconnect(),i(),o(),s(),a(),c(),l(),u(),d(),h(),p(),f(),g(),m.forEach(e=>e())})}function qn(e){return void 0!==window[e]}function Wn(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class jn{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Gn{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new jn(Rt),this.crossOriginIframeRootIdMap=new WeakMap,this.ignoreIframes=e.ignoreIframes,this.ignoreIframes||(this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this)))}addIframe(e){this.ignoreIframes||(this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e))}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.ignoreIframes||(this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument)))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case pn.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:pn.IncrementalSnapshot,data:{source:fn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case pn.Meta:case pn.Load:case pn.DomContentLoaded:return!1;case pn.Plugin:return t;case pn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case pn.IncrementalSnapshot:switch(t.data.source){case fn.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case fn.Drag:case fn.TouchMove:case fn.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case fn.ViewportResize:return!1;case fn.MediaInteraction:case fn.MouseInteraction:case fn.Scroll:case fn.CanvasMutation:case fn.Input:return this.replaceIds(t.data,e,["id"]),t;case fn.StyleSheetRule:case fn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case fn.Font:return t;case fn.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case fn.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===it.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class $n{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.active=!0,this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!this.active)return;if(!lt(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=xn(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Ln(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Un({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;Yt(e.prototype,"attachShadow",(function(e){return function(r){const i=e.call(this,r);return this.shadowRoot&&hn(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.active=!1,this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}function zn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;for(var Zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Yn=0;Yn<Zn.length;Yn++)Kn[Zn.charCodeAt(Yn)]=Yn;const Jn=new Map;const Qn=(e,t,n)=>{if(!e||!tr(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Jn.get(e);return n||(n=new Map,Jn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function Xn(e,t,n){if(e instanceof Array)return e.map(e=>Xn(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Zn[n[t]>>2],i+=Zn[(3&n[t])<<4|n[t+1]>>4],i+=Zn[(15&n[t+1])<<2|n[t+2]>>6],i+=Zn[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Xn(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Xn(e.data,t,n),e.width,e.height]}}if(tr(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Qn(e,t,n)}}return e}const er=(e,t,n)=>[...e].map(e=>Xn(e,t,n)),tr=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function nr(e,t,n,r){const i=[];try{const o=Yt(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!nn(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}}));i.push(o)}catch(e){}return()=>{i.forEach(e=>e())}}function rr(e,t,n,r,i,o,s){const a=[],c=Object.getOwnPropertyNames(e);for(const o of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const c=Yt(e,o,(function(e){return function(...a){const c=e.apply(this,a);if(Qn(c,s,this),"tagName"in this.canvas&&!nn(this.canvas,r,i,!0)){const e=er([...a],s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const i=Kt(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(i)}return a}function ir(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),o=i.indexOf("\n",10)+1,s=i.substring(o)+(r?"//# sourceMappingURL="+r:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var or,sr,ar,cr,lr=(or="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLgoKICBQZXJtaXNzaW9uIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBhbmQvb3IgZGlzdHJpYnV0ZSB0aGlzIHNvZnR3YXJlIGZvciBhbnkKICBwdXJwb3NlIHdpdGggb3Igd2l0aG91dCBmZWUgaXMgaGVyZWJ5IGdyYW50ZWQuCgogIFRIRSBTT0ZUV0FSRSBJUyBQUk9WSURFRCAiQVMgSVMiIEFORCBUSEUgQVVUSE9SIERJU0NMQUlNUyBBTEwgV0FSUkFOVElFUyBXSVRICiAgUkVHQVJEIFRPIFRISVMgU09GVFdBUkUgSU5DTFVESU5HIEFMTCBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZCiAgQU5EIEZJVE5FU1MuIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULAogIElORElSRUNULCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVMgT1IgQU5ZIERBTUFHRVMgV0hBVFNPRVZFUiBSRVNVTFRJTkcgRlJPTQogIExPU1MgT0YgVVNFLCBEQVRBIE9SIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBORUdMSUdFTkNFIE9SCiAgT1RIRVIgVE9SVElPVVMgQUNUSU9OLCBBUklTSU5HIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFVTRSBPUgogIFBFUkZPUk1BTkNFIE9GIFRISVMgU09GVFdBUkUuCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KCiAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgewogICAgZnVuY3Rpb24gYWRvcHQodmFsdWUpIHsgcmV0dXJuIHZhbHVlIGluc3RhbmNlb2YgUCA/IHZhbHVlIDogbmV3IFAoZnVuY3Rpb24gKHJlc29sdmUpIHsgcmVzb2x2ZSh2YWx1ZSk7IH0pOyB9CiAgICByZXR1cm4gbmV3IChQIHx8IChQID0gUHJvbWlzZSkpKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHsKICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9CiAgICAgICAgZnVuY3Rpb24gcmVqZWN0ZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3JbInRocm93Il0odmFsdWUpKTsgfSBjYXRjaCAoZSkgeyByZWplY3QoZSk7IH0gfQogICAgICAgIGZ1bmN0aW9uIHN0ZXAocmVzdWx0KSB7IHJlc3VsdC5kb25lID8gcmVzb2x2ZShyZXN1bHQudmFsdWUpIDogYWRvcHQocmVzdWx0LnZhbHVlKS50aGVuKGZ1bGZpbGxlZCwgcmVqZWN0ZWQpOyB9CiAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOwogICAgfSk7CiAgfQoKICB0eXBlb2YgU3VwcHJlc3NlZEVycm9yID09PSAiZnVuY3Rpb24iID8gU3VwcHJlc3NlZEVycm9yIDogZnVuY3Rpb24gKGVycm9yLCBzdXBwcmVzc2VkLCBtZXNzYWdlKSB7CiAgICB2YXIgZSA9IG5ldyBFcnJvcihtZXNzYWdlKTsKICAgIHJldHVybiBlLm5hbWUgPSAiU3VwcHJlc3NlZEVycm9yIiwgZS5lcnJvciA9IGVycm9yLCBlLnN1cHByZXNzZWQgPSBzdXBwcmVzc2VkLCBlOwogIH07CgogIC8qCiAgICogYmFzZTY0LWFycmF5YnVmZmVyIDEuMC4xIDxodHRwczovL2dpdGh1Yi5jb20vbmlrbGFzdmgvYmFzZTY0LWFycmF5YnVmZmVyPgogICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICogUmVsZWFzZWQgdW5kZXIgTUlUIExpY2Vuc2UKICAgKi8KICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgLy8gVXNlIGEgbG9va3VwIHRhYmxlIHRvIGZpbmQgdGhlIGluZGV4LgogIHZhciBsb29rdXAgPSB0eXBlb2YgVWludDhBcnJheSA9PT0gJ3VuZGVmaW5lZCcgPyBbXSA6IG5ldyBVaW50OEFycmF5KDI1Nik7CiAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaSwgbGVuID0gYnl0ZXMubGVuZ3RoLCBiYXNlNjQgPSAnJzsKICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSArPSAzKSB7CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbKChieXRlc1tpXSAmIDMpIDw8IDQpIHwgKGJ5dGVzW2kgKyAxXSA+PiA0KV07CiAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbKChieXRlc1tpICsgMV0gJiAxNSkgPDwgMikgfCAoYnl0ZXNbaSArIDJdID4+IDYpXTsKICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgIH0KICAgICAgaWYgKGxlbiAlIDMgPT09IDIpIHsKICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICB9CiAgICAgIGVsc2UgaWYgKGxlbiAlIDMgPT09IDEpIHsKICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgfQogICAgICByZXR1cm4gYmFzZTY0OwogIH07CgogIGNvbnN0IGxhc3RCbG9iTWFwID0gbmV3IE1hcCgpOw0KICBjb25zdCB0cmFuc3BhcmVudEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICBjb25zdCBpZCA9IGAke3dpZHRofS0ke2hlaWdodH1gOw0KICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgIGlmICh0cmFuc3BhcmVudEJsb2JNYXAuaGFzKGlkKSkNCiAgICAgICAgICAgICAgICAgIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsNCiAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoJzJkJyk7DQogICAgICAgICAgICAgIGNvbnN0IGJsb2IgPSB5aWVsZCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7DQogICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOw0KICAgICAgICAgICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOw0KICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgIH0NCiAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgIH0NCiAgICAgIH0pOw0KICB9DQogIGNvbnN0IHdvcmtlciA9IHNlbGY7DQogIHdvcmtlci5vbm1lc3NhZ2UgPSBmdW5jdGlvbiAoZSkgew0KICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICBpZiAoJ09mZnNjcmVlbkNhbnZhcycgaW4gZ2xvYmFsVGhpcykgew0KICAgICAgICAgICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7DQogICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgY29uc3QgY3R4ID0gb2Zmc2NyZWVuLmdldENvbnRleHQoJzJkJyk7DQogICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgYml0bWFwLmNsb3NlKCk7DQogICAgICAgICAgICAgIGNvbnN0IGJsb2IgPSB5aWVsZCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7DQogICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOw0KICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgaWYgKGxhc3RCbG9iTWFwLmdldChpZCkgPT09IGJhc2U2NCkNCiAgICAgICAgICAgICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsNCiAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgIGlkLA0KICAgICAgICAgICAgICAgICAgdHlwZSwNCiAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgIHdpZHRoLA0KICAgICAgICAgICAgICAgICAgaGVpZ2h0LA0KICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOw0KICAgICAgICAgIH0NCiAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7DQogICAgICAgICAgfQ0KICAgICAgfSk7DQogIH07Cgp9KSgpOwoK",sr=null,ar=!1,function(e){return cr=cr||ir(or,sr,ar),new Worker(cr,e)});class ur{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}initCanvasFPSObserver(e,t,n,r,i){const o=nr(t,n,r,!0),s=new Map,a=new lr;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:vn["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{nn(t,n,r,!0)||e.push(t)}),e})().forEach(e=>zn(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=nr(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Yt(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return nn(this.canvas,n,r,!0)||setTimeout(()=>{const n=er([...o],t,this);e(this.canvas,{type:vn["2D"],property:s,args:n})},0),i.apply(this,o)}}));i.push(o)}catch(n){const r=Kt(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:vn["2D"],property:s,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r,i){const o=[];return o.push(...rr(t.WebGLRenderingContext.prototype,vn.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...rr(t.WebGL2RenderingContext.prototype,vn.WebGL2,e,n,r,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"])),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}function dr(e){return e.replace(/^["']|["']$/g,"")}const hr={"font-style":"style","font-weight":"weight","font-stretch":"stretch","font-display":"display","font-variant":"variant","font-feature-settings":"featureSettings","unicode-range":"unicodeRange"};function pr(e){const t={};for(const n of Object.keys(hr)){const r=e.match(new RegExp(`(?:^|[;{\\s])${n}\\s*:\\s*([^;}]+)`,"i"));if(r){t[hr[n]]=r[1].trim()}}return Object.keys(t).length?t:void 0}function fr(e){if("undefined"==typeof document||!document.fonts)return!0;const t=dr(e);for(const e of document.fonts)if(dr(e.family)===t&&"loaded"===e.status)return!0;return!1}function gr(e){if(e.type!==it.Element)return!1;if("link"!==e.tagName)return!1;const t=e.attributes.rel;return!("string"!=typeof t||!/(^|\s)stylesheet(\s|$)/i.test(t))&&"string"==typeof e.attributes.href}function mr(e,t){return zn(this,void 0,void 0,(function*(){try{const n=/@font-face\s*{([^}]*)}/gi;let r;for(;null!==(r=n.exec(e));){const e=r[1],n=e.match(/font-family\s*:\s*([^;{]+)/i),i=e.match(/src\s*:\s*((?:url\([^)]+\)|[^;{])+)[\s;}]/i);if(!n||!i)continue;const o=n[1].trim();if(!fr(o))continue;const s=i[1].trim(),a=Array.from(s.matchAll(/url\(["']?(.*?)["']?\)/gi)).map(e=>e[1]);if(0===a.length)continue;const c=pr(e);for(const e of a)if(!e.startsWith("data:"))try{const n=yield fetch(e);if(!n.ok)continue;const r=yield n.arrayBuffer(),i=JSON.stringify(Array.from(new Uint8Array(r)));t({family:dr(o),fontSource:i,buffer:!0,descriptors:c});break}catch(e){}}}catch(e){}}))}class vr{constructor(e){this.trackedLinkElements=new WeakSet,this.linkStylesheetFetchCache=new Map,this.styleMirror=new ln,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.fontCb=e.fontCb,this.inlineStylesheetFonts=e.inlineStylesheetFonts}attachLinkElement(e,t){"_cssText"in t.attributes&&this.emitAttributeMutations([{id:t.id,attributes:t.attributes}]),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:ht(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.linkStylesheetFetchCache=new Map}handleStylesheetFonts(e){this.inlineStylesheetFonts&&e.type===it.Element&&e.attributes&&("string"==typeof e.attributes._cssText?mr(e.attributes._cssText,this.fontCb):gr(e)&&this.inlineLinkAndExtractFonts(e.id,e.attributes.href))}emitFontsFromSnapshot(e){return zn(this,void 0,void 0,(function*(){if(!this.inlineStylesheetFonts)return;const t=[],n=new Map;!function e(r){if(r.type===it.Element){if(r.attributes&&"string"==typeof r.attributes._cssText)t.push(r.attributes._cssText);else if(gr(r)){const e=r.attributes.href,t=n.get(e)||[];t.push(r.id),n.set(e,t)}}else r.type===it.Text&&r.isStyle&&t.push(r.textContent);"childNodes"in r&&r.childNodes.forEach(e)}(e);const r=[];for(const e of t)r.push(mr(e,this.fontCb));for(const[e,t]of n)r.push(this.inlineLinkAndExtractFonts(t,e));yield Promise.all(r)}))}inlineLinkAndExtractFonts(e,t){return zn(this,void 0,void 0,(function*(){const n=yield this.inlineByFetch(t);if(!n)return;const r=Array.isArray(e)?e:[e];this.emitAttributeMutations(r.map(e=>({id:e,attributes:{_cssText:n,rel:null,href:null}}))),yield mr(n,this.fontCb)}))}emitAttributeMutations(e){this.mutationCb({adds:[],removes:[],texts:[],attributes:e})}inlineByFetch(e){const t=this.linkStylesheetFetchCache.get(e);if(t)return t;const n=(()=>zn(this,void 0,void 0,(function*(){try{const t=yield fetch(e);if(!t.ok)return null;return Ot(yield t.text(),e)}catch(e){return null}})))();return this.linkStylesheetFetchCache.set(e,n),n}trackStylesheetInLinkElement(e){}}class yr{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function br(e){return Object.assign(Object.assign({},e),{timestamp:Jt()})}let Ir,wr,Cr,Sr=!1;const kr=new pt;function Er(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,deferProcessMutations:i=!1,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,inlineStylesheetFonts:h=!1,maskAllInputs:p,maskInputOptions:f,slimDOMOptions:g,maskInputFn:m,maskTextFn:v,hooks:y,packFn:b,sampling:I={},dataURLOptions:w={},mousemoveWait:C,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:E=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:_=!1,collectFonts:A=!1,inlineImages:T=!1,plugins:R,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:x=new Set([]),errorHandler:N,ignoreIframes:L=!1,recoverCSSVariables:O=!1}=e;_n(N);const D=!k||window.parent===window;let P=!1;if(!D)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(D&&!t)throw new Error("emit function is required");void 0!==C&&void 0===I.mousemove&&(I.mousemove=C),kr.reset();const V=!0===p?{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,hidden:!0}:void 0!==f?f:{password:!0},F=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const H=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return b&&!P&&(e=b(e)),e};Ir=(e,i)=>{var o;if(!(null===(o=Rn[0])||void 0===o?void 0:o.isFrozen())||e.type===pn.FullSnapshot||e.type===pn.IncrementalSnapshot&&e.data.source===fn.Mutation||Rn.forEach(e=>e.unfreeze()),D)null==t||t(H(e),i);else if(P){const t={type:"rrweb",event:H(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===pn.FullSnapshot)U=e,B=0;else if(e.type===pn.IncrementalSnapshot){if(e.data.source===fn.Mutation&&e.data.isAttachIframe)return;B++;const t=r&&B>=r,i=n&&e.timestamp-U.timestamp>n;(t||i)&&wr(!0)}};const q=e=>{Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Mutation},e)}))},W=e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Scroll},e)})),j=e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.CanvasMutation},e)})),G=new vr({mutationCb:q,adoptedStyleSheetCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.AdoptedStyleSheet},e)})),fontCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Font},e)})),inlineStylesheetFonts:h}),$=new Gn({mirror:kr,mutationCb:q,stylesheetManager:G,recordCrossOriginIframes:k,wrappedEmit:Ir,ignoreIframes:L});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:kr,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const z=new yr;Cr=new ur({recordCanvas:S,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:kr,sampling:I.canvas,dataURLOptions:w});const Z=new $n({mutationCb:q,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,deferProcessMutations:i,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:V,dataURLOptions:w,maskTextFn:v,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:I,slimDOMOptions:F,iframeManager:$,stylesheetManager:G,canvasManager:Cr,keepIframeSrcFn:M,processedNodeManager:z},mirror:kr});wr=(e=!1)=>{Ir(br({type:pn.Meta,data:{href:window.location.href,width:en(),height:Xt()}}),e),G.reset(),Z.init(),Rn.forEach(e=>e.lock());const t=function(e,t){var n,r,i=t||{},o=i.mirror,s=void 0===o?new pt:o,a=i.blockClass,c=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,d=i.maskTextClass,h=void 0===d?"rr-mask":d,p=i.maskTextSelector,f=void 0===p?null:p,g=i.inlineStylesheet,m=void 0===g||g,v=i.inlineImages,y=void 0!==v&&v,b=i.recordCanvas,I=void 0!==b&&b,w=i.maskAllInputs,C=void 0!==w&&w,S=i.maskTextFn,k=i.maskInputFn,E=i.slimDOM,_=void 0!==E&&E,A=i.dataURLOptions,T=i.preserveWhiteSpace,R=i.onSerialize,M=i.onIframeLoad,x=i.iframeLoadTimeout,N=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,O=i.keepIframeSrcFn,D=void 0===O?function(){return!1}:O,P=i.recoverCSSVariables,V=void 0!==P&&P,F=!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===C?{password:!0}:C,U=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_;if("string"==typeof h){var B=e.querySelectorAll("."+h);if(n=!1,r=Array.from(B),f){var H=e.querySelectorAll(f);r=r.concat(Array.from(H))}}return Gt(e,{doc:e,mirror:s,blockClass:c,blockSelector:u,maskTextClass:h,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:F,maskTextFn:S,maskInputFn:k,slimDOMOptions:U,dataURLOptions:A,inlineImages:y,recordCanvas:I,preserveWhiteSpace:T,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:L,keepIframeSrcFn:D,newlyAddedElement:!1,maskCurrentNode:n,maskedElements:r,cssVariableOverrides:V?kt(e):void 0})}(document,{mirror:kr,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:V,maskTextFn:v,maskInputFn:m,slimDOM:F,dataURLOptions:w,recordCanvas:S,inlineImages:T,recoverCSSVariables:O,onSerialize:e=>{sn(e,kr)&&$.addIframe(e),an(e,kr)&&G.trackLinkElement(e),cn(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{$.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{G.attachLinkElement(e,t),G.handleStylesheetFonts(t)},keepIframeSrcFn:M});t&&(Ir(br({type:pn.FullSnapshot,data:{node:t,initialOffset:Qt(window)}}),e),setTimeout(()=>{G.emitFontsFromSnapshot(t)},0),Rn.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,kr.getId(document)))};try{const e=[],t=e=>{var t;return Tn(Hn)({mutationCb:q,mousemoveCb:(e,t)=>Ir(br({type:pn.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.MouseInteraction},e)})),scrollCb:W,viewportResizeCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.ViewportResize},e)})),inputCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Input},e)})),mediaInteractionCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.MediaInteraction},e)})),styleSheetRuleCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.StyleSheetRule},e)})),styleDeclarationCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Font},e)})),selectionCb:e=>{Ir(br({type:pn.IncrementalSnapshot,data:Object.assign({source:fn.Selection},e)}))},blockClass:o,deferProcessMutations:i,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:u,maskInputOptions:V,inlineStylesheet:d,sampling:I,recordCanvas:S,inlineImages:T,userTriggeredOnInput:_,collectFonts:A,doc:e,maskInputFn:m,maskTextFn:v,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:F,dataURLOptions:w,mirror:kr,iframeManager:$,stylesheetManager:G,shadowDomManager:Z,processedNodeManager:z,canvasManager:Cr,ignoreCSSAttributes:x,recoverCSSVariables:O,plugins:(null===(t=null==R?void 0:R.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Ir(br({type:pn.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},y)};$.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){}});const n=()=>{wr(),e.push(t(document)),Sr=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push($t("DOMContentLoaded",()=>{Ir(br({type:pn.DomContentLoaded,data:{}})),"DOMContentLoaded"===E&&n()})),e.push($t("load",()=>{Ir(br({type:pn.Load,data:{}})),"load"===E&&n()},window))),()=>{e.forEach(e=>e()),z.destroy(),Sr=!1,An()}}catch(e){}}Er.addCustomEvent=(e,t)=>{if(!Sr)throw new Error("please add custom event after start recording");Ir(br({type:pn.Custom,data:{tag:e,payload:t}}))},Er.freezePage=()=>{Rn.forEach(e=>e.freeze())},Er.takeFullSnapshot=e=>{if(!Sr)throw new Error("please take full snapshot after start recording");wr(e)},Er.mirror=kr;const{addCustomEvent:_r}=Er,{freezePage:Ar}=Er;var Tr=Uint8Array,Rr=Uint16Array,Mr=Uint32Array,xr=new Tr([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]),Nr=new Tr([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]),Lr=new Tr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Or=function(e,t){for(var n=new Rr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Mr(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]},Dr=Or(xr,2),Pr=Dr[0],Vr=Dr[1];Pr[28]=258,Vr[258]=28;for(var Fr=Or(Nr,0),Ur=(Fr[0],Fr[1]),Br=new Rr(32768),Hr=0;Hr<32768;++Hr){var qr=(43690&Hr)>>>1|(21845&Hr)<<1;qr=(61680&(qr=(52428&qr)>>>2|(13107&qr)<<2))>>>4|(3855&qr)<<4,Br[Hr]=((65280&qr)>>>8|(255&qr)<<8)>>>1}var Wr=function(e,t,n){for(var r=e.length,i=0,o=new Rr(t);i<r;++i)++o[e[i]-1];var s,a=new Rr(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Rr(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Br[d]>>>c]=l}else for(s=new Rr(r),i=0;i<r;++i)s[i]=Br[a[e[i]-1]++]>>>15-e[i];return s},jr=new Tr(288);for(Hr=0;Hr<144;++Hr)jr[Hr]=8;for(Hr=144;Hr<256;++Hr)jr[Hr]=9;for(Hr=256;Hr<280;++Hr)jr[Hr]=7;for(Hr=280;Hr<288;++Hr)jr[Hr]=8;var Gr=new Tr(32);for(Hr=0;Hr<32;++Hr)Gr[Hr]=5;var $r=Wr(jr,9,0),zr=Wr(Gr,5,0),Zr=function(e){return(e/8>>0)+(7&e&&1)},Kr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Rr?Rr:e instanceof Mr?Mr:Tr)(n-t);return r.set(e.subarray(t,n)),r},Yr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Jr=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},Qr=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 Tr(0),0];if(1==i){var s=new Tr(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],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new Rr(h+1),f=Xr(n[u-1],p,0);if(f>t){r=0;var g=0,m=f-t,v=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(p[y]>t))break;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var b=o[r].s;p[b]<t?g-=1<<t-p[b]++-1:++r}for(;r>=0&&g;--r){var I=o[r].s;p[I]==t&&(--p[I],++g)}f=t}return[new Tr(p),f]},Xr=function(e,t,n){return-1==e.s?Math.max(Xr(e.l,t,n+1),Xr(e.r,t,n+1)):t[e.s]=n},ei=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Rr(++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]},ti=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ni=function(e,t,n){var r=n.length,i=Zr(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)},ri=function(e,t,n,r,i,o,s,a,c,l,u){Yr(t,u++,n),++i[256];for(var d=Qr(i,15),h=d[0],p=d[1],f=Qr(o,15),g=f[0],m=f[1],v=ei(h),y=v[0],b=v[1],I=ei(g),w=I[0],C=I[1],S=new Rr(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<w.length;++k)S[31&w[k]]++;for(var E=Qr(S,7),_=E[0],A=E[1],T=19;T>4&&!_[Lr[T-1]];--T);var R,M,x,N,L=l+5<<3,O=ti(i,jr)+ti(o,Gr)+s,D=ti(i,h)+ti(o,g)+s+14+3*T+ti(S,_)+(2*S[16]+3*S[17]+7*S[18]);if(L<=O&&L<=D)return ni(t,u,e.subarray(c,c+l));if(Yr(t,u,1+(D<O)),u+=2,D<O){R=Wr(h,p,0),M=h,x=Wr(g,m,0),N=g;var P=Wr(_,A,0);Yr(t,u,b-257),Yr(t,u+5,C-1),Yr(t,u+10,T-4),u+=14;for(k=0;k<T;++k)Yr(t,u+3*k,_[Lr[k]]);u+=3*T;for(var V=[y,w],F=0;F<2;++F){var U=V[F];for(k=0;k<U.length;++k){var B=31&U[k];Yr(t,u,P[B]),u+=_[B],B>15&&(Yr(t,u,U[k]>>>5&127),u+=U[k]>>>12)}}}else R=$r,M=jr,x=zr,N=Gr;for(k=0;k<a;++k)if(r[k]>255){B=r[k]>>>18&31;Jr(t,u,R[B+257]),u+=M[B+257],B>7&&(Yr(t,u,r[k]>>>23&31),u+=xr[B]);var H=31&r[k];Jr(t,u,x[H]),u+=N[H],H>3&&(Jr(t,u,r[k]>>>5&8191),u+=Nr[H])}else Jr(t,u,R[r[k]]),u+=M[r[k]];return Jr(t,u,R[256]),u+M[256]},ii=new Mr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oi=new Tr(0),si=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Tr(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),l=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?l=ni(c,l,e.subarray(u,d)):(c[u]=o,l=ni(c,l,e.subarray(u,s)))}else{for(var h=ii[t-1],p=h>>>13,f=8191&h,g=(1<<n)-1,m=new Rr(32768),v=new Rr(g+1),y=Math.ceil(n/3),b=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},w=new Mr(25e3),C=new Rr(288),S=new Rr(32),k=0,E=0,_=(u=0,0),A=0,T=0;u<s;++u){var R=I(u),M=32767&u,x=v[R];if(m[M]=x,v[R]=M,A<=u){var N=s-u;if((k>7e3||_>24576)&&N>423){l=ri(e,c,0,w,C,S,E,_,T,u-T,l),_=k=E=0,T=u;for(var L=0;L<286;++L)C[L]=0;for(L=0;L<30;++L)S[L]=0}var O=2,D=0,P=f,V=M-x&32767;if(N>2&&R==I(u-V))for(var F=Math.min(p,N)-1,U=Math.min(32767,u),B=Math.min(258,N);V<=U&&--P&&M!=x;){if(e[u+O]==e[u+O-V]){for(var H=0;H<B&&e[u+H]==e[u+H-V];++H);if(H>O){if(O=H,D=V,H>F)break;var q=Math.min(V,H-2),W=0;for(L=0;L<q;++L){var j=u-V+L+32768&32767,G=j-m[j]+32768&32767;G>W&&(W=G,x=j)}}}V+=(M=x)-(x=m[M])+32768&32767}if(D){w[_++]=268435456|Vr[O]<<18|Ur[D];var $=31&Vr[O],z=31&Ur[D];E+=xr[$]+Nr[z],++C[257+$],++S[z],A=u+O,++k}else w[_++]=e[u],++C[e[u]]}}l=ri(e,c,o,w,C,S,E,_,T,u-T,l),o||(l=ni(c,l,oi))}return Kr(a,0,r+Zr(l)+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 ai(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=si(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}const ci=(e,t)=>{const n=Object.assign(Object.assign({},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}(ai(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Tr(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 Tr(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 Kr(r,0,i)}(JSON.stringify(n)),t),!0)};var li,ui,di,hi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},pi=function(e){if("loading"===document.readyState)return"loading";var t=hi();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},fi=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},gi=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:fi(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},mi=-1,vi=function(){return mi},yi=function(e){addEventListener("pageshow",(function(t){t.persisted&&(mi=t.timeStamp,e(t))}),!0)},bi=function(){var e=hi();return e&&e.activationStart||0},Ii=function(e,t){var n=hi(),r="navigate";return vi()>=0?r="back-forward-cache":n&&(document.prerendering||bi()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},wi=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Ci=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Si=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ki=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ei=function(e){var t=!1;return function(){t||(e(),t=!0)}},_i=-1,Ai=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ti=function(e){"hidden"===document.visibilityState&&_i>-1&&(_i="visibilitychange"===e.type?e.timeStamp:0,Mi())},Ri=function(){addEventListener("visibilitychange",Ti,!0),addEventListener("prerenderingchange",Ti,!0)},Mi=function(){removeEventListener("visibilitychange",Ti,!0),removeEventListener("prerenderingchange",Ti,!0)},xi=function(){return _i<0&&(_i=Ai(),Ri(),yi((function(){setTimeout((function(){_i=Ai(),Ri()}),0)}))),{get firstHiddenTime(){return _i}}},Ni=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Li=[1800,3e3],Oi=function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("FCP"),o=wi("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-bi(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Ci(e,i,Li,t.reportAllChanges),yi((function(r){i=Ii("FCP"),n=Ci(e,i,Li,t.reportAllChanges),Si((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Di=[.1,.25],Pi=function(e,t){!function(e,t){t=t||{},Oi(Ei((function(){var n,r=Ii("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},a=wi("layout-shift",s);a&&(n=Ci(e,r,Di,t.reportAllChanges),ki((function(){s(a.takeRecords()),n(!0)})),yi((function(){i=0,r=Ii("CLS",0),n=Ci(e,r,Di,t.reportAllChanges),Si((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:gi(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:pi(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},Vi=function(e,t){Oi((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:pi(vi())};if(e.entries.length){var n=hi(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,o=Math.max(0,n.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:pi(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},Fi=0,Ui=1/0,Bi=0,Hi=function(e){e.forEach((function(e){e.interactionId&&(Ui=Math.min(Ui,e.interactionId),Bi=Math.max(Bi,e.interactionId),Fi=Bi?(Bi-Ui)/7+1:0)}))},qi=function(){"interactionCount"in performance||li||(li=wi("event",Hi,{type:"event",buffered:!0,durationThreshold:0}))},Wi=[],ji=new Map,Gi=0,$i=function(){return(li?Fi:performance.interactionCount||0)-Gi},zi=[],Zi=function(e){if(zi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Wi[Wi.length-1],n=ji.get(e.interactionId);if(n||Wi.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ji.set(r.id,r),Wi.push(r)}Wi.sort((function(e,t){return t.latency-e.latency})),Wi.length>10&&Wi.splice(10).forEach((function(e){return ji.delete(e.id)}))}}},Ki=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ei(e),"hidden"===document.visibilityState?e():(n=t(e),ki(e)),n},Yi=[200,500],Ji=[],Qi=new Map,Xi=[],eo=new WeakMap,to=new Map,no=-1,ro=function(e){Ji=Ji.concat(e),io()},io=function(){no<0&&(no=Ki(oo))},oo=function(){to.size>10&&to.forEach((function(e,t){ji.has(t)||to.delete(t)})),Xi=Xi.slice(-50);var e=new Set(Xi.concat(Wi.map((function(e){return eo.get(e.entries[0])}))));Qi.forEach((function(t,n){e.has(n)||Qi.delete(n)}));var t=new Set;Qi.forEach((function(e){uo(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))}));for(var n=0;n<50;n++){var r=Ji[Ji.length-1-n];if(!r||r.startTime<di)break;t.add(r)}Ji=Array.from(t),no=-1};zi.push((function(e){e.interactionId&&e.target&&!to.has(e.interactionId)&&to.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;di=Math.max(di,e.processingEnd);for(var r=Xi.length-1;r>=0;r--)if(t=Xi[r],Math.abs(n-t)<=8){var i=Qi.get(t);i.startTime=Math.min(e.startTime,i.startTime),i.processingStart=Math.min(e.processingStart,i.processingStart),i.processingEnd=Math.max(e.processingEnd,i.processingEnd),i.entries.push(e),n=t;break}n!==t&&(Xi.push(n),Qi.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&eo.set(e,n),io()}));var so,ao,co,lo,uo=function(e,t){for(var n,r=[],i=0;n=Ji[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},ho=function(e,t){ui||(ui=wi("long-animation-frame",ro)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Ni((function(){var n;qi();var r,i=Ii("INP"),o=function(e){Ki((function(){e.forEach(Zi);var t,n=(t=Math.min(Wi.length-1,Math.floor($i()/50)),Wi[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},s=wi("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ci(e,i,Yi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ki((function(){o(s.takeRecords()),r(!0)})),yi((function(){Gi=0,Wi.length=0,ji.clear(),i=Ii("INP"),r=Ci(e,i,Yi,t.reportAllChanges)})))})))}((function(t){var n=function(e){var t=e.entries[0],n=eo.get(t),r=Qi.get(n),i=t.processingStart,o=r.processingEnd,s=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=uo(t.startTime,o),c=e.entries.find((function(e){return e.target})),l=c&&c.target||to.get(t.interactionId),u=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,u),h={interactionTarget:gi(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:i-t.startTime,processingDuration:o-i,presentationDelay:Math.max(d-o,0),loadState:pi(t.startTime)};return Object.assign(e,{attribution:h})}(t);e(n)}),t)},po=[2500,4e3],fo={},go=function(e,t){!function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-bi(),0),i.entries=[e],n())}))},s=wi("largest-contentful-paint",o);if(s){n=Ci(e,i,po,t.reportAllChanges);var a=Ei((function(){fo[i.id]||(o(s.takeRecords()),s.disconnect(),fo[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Ki(a)}),!0)})),ki(a),yi((function(r){i=Ii("LCP"),n=Ci(e,i,po,t.reportAllChanges),Si((function(){i.value=performance.now()-r.timeStamp,fo[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=hi();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,n.responseStart-r),a=Math.max(s,o?(o.requestStart||o.startTime)-r:0),c=Math.max(a,o?o.responseEnd-r:0),l=Math.max(c,i.startTime-r);t={element:gi(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:c-a,elementRenderDelay:l-c,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},mo=[800,1800],vo=function(e,t){t=t||{};var n=Ii("TTFB"),r=Ci(e,n,mo,t.reportAllChanges);!function e(t){document.prerendering?Ni((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)}((function(){var i=hi();i&&(n.value=Math.max(i.responseStart-bi(),0),n.entries=[i],r(!0),yi((function(){n=Ii("TTFB",0),(r=Ci(e,n,mo,t.reportAllChanges))(!0)})))}))},yo=function(e,t){vo((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),o=Math.max(n.domainLookupStart-r,0),s=Math.max(n.connectStart-r,0),a=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:o-i,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},bo={passive:!0,capture:!0},Io=new Date,wo=function(e,t){so||(so=t,ao=e,co=new Date,ko(removeEventListener),Co())},Co=function(){if(ao>=0&&ao<co-Io){var e={entryType:"first-input",name:so.type,target:so.target,cancelable:so.cancelable,startTime:so.timeStamp,processingStart:so.timeStamp+ao};lo.forEach((function(t){t(e)})),lo=[]}},So=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){wo(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,bo),removeEventListener("pointercancel",r,bo)};addEventListener("pointerup",n,bo),addEventListener("pointercancel",r,bo)}(t,e):wo(t,e)}},ko=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,So,bo)}))},Eo=[100,300],_o=function(e,t){!function(e,t){t=t||{},Ni((function(){var n,r=xi(),i=Ii("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=wi("first-input",s);n=Ci(e,i,Eo,t.reportAllChanges),a&&(ki(Ei((function(){s(a.takeRecords()),a.disconnect()}))),yi((function(){var r;i=Ii("FID"),n=Ci(e,i,Eo,t.reportAllChanges),lo=[],ao=-1,so=null,ko(addEventListener),r=o,lo.push(r),Co()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:gi(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:pi(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)},Ao=n(181),To=n.n(Ao);const Ro=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"<unknown>",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function Mo(e,t,n,r){const i={file:e,mname:t};return void 0!==n&&(i.line=n),void 0!==r&&(i.column=r),i}const xo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,No=/\((\S*)(?::(\d+))(?::(\d+))\)/,Lo=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Oo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Do=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Po=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Vo=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;function Fo(e,t=!1){const n=e.split("\n");return n.length>50?[]:n.reduce((function(e,n,r){if(n.length>1024)return e;const i=(e=>{const t=Po.exec(e);return t?Mo(t[2],t[3]||"<unknown>",+t[1]):void 0})(n)||(e=>{const t=Vo.exec(e);return t?Mo(t[5],t[3]||t[4]||"<unknown>",+t[1],+t[2]):void 0})(n)||(e=>{const t=xo.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=No.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Ro(t[1]||"<unknown>",t[2]);return Mo(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}})(n)||(e=>{const t=Do.exec(e);return t?Mo(t[2],t[1]||"<unknown>",+t[3],t[4]?+t[4]:void 0):void 0})(n)||(e=>{const t=Lo.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Oo.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"<unknown>";return[n,e]=Ro(n,e),Mo(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}})(n);return i&&(t?e.push(Object.assign(Object.assign({},i),{_frameLocationIndexInOrigString:r})):e.push(i)),e}),[])}let Uo,Bo,Ho=null,qo=null,Wo=!1;function jo(){Go(),qo&&(window.clearTimeout(qo),qo=null),Wo&&(Wo=!1,document.removeEventListener("readystatechange",Zo))}function Go(){Ho&&(window.clearTimeout(Ho),Ho=null)}function $o(){jo(),Bo(!1)}function zo(){jo(),Bo(!0)}function Zo(){switch(document.readyState){case"complete":jo(),Bo(!0);break;case"interactive":Go(),qo=window.setTimeout(zo,0);break;case"loading":Ho=window.setTimeout($o,5e3);break;default:jo(),Bo(!1)}}function Ko(){return"undefined"==typeof window?Promise.resolve(!0):(!Uo&&window.NOIBUJS_DOCUMENT_READY_PROMISE instanceof Promise&&(Uo=window.NOIBUJS_DOCUMENT_READY_PROMISE),Uo||(Uo=new Promise(e=>{Bo=e,"complete"!==document.readyState&&(Wo=!0,document.addEventListener("readystatechange",Zo)),Zo()}),window.NOIBUJS_DOCUMENT_READY_PROMISE=Uo,Uo))}const Yo=(e,t,n)=>{if(!("object"==typeof e&&null!==e))return!1;if(!(t in e))return!1;const r=e[t];if(r&&r.__noibu_wrapped__)return!0;const i=Object.getOwnPropertyDescriptor(e,t);if(i&&!1===i.writable)return!1;const o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:r},__noibu_wrapped__:{enumerable:!1,value:o}})}catch(e){}return e[t]=o,!0};const Jo=e=>{if(!function(e){if(!e)return!1;try{return"function"==typeof e[Symbol.iterator]}catch(e){return!1}}(e))return{};const t={};try{for(const[n,r]of e)t[n]=r}catch(e){}return t};function Qo(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{set(e){r.set.call(this,n(e))}})}function Xo(e){return e&&e.__noibu_original__||e}function es(){try{if("true"===sessionStorage.getItem("noibu-agent-mode"))return!0;const{search:e}=location,t=new URLSearchParams(e),n=t.has("noibu-agent")||t.has("noibuagent");if(n)try{sessionStorage.setItem("noibu-agent-mode","true")}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("[Agent] Error setting agent mode to sessionStorage: "+e,!1,a.ERROR)}return n}catch(e){return!1}}function ts(e,t=1024){return"string"!=typeof e?"":e.length<t?e:e.substring(0,t)}function ns(e,t=1){try{return Fo(e).length>t}catch(e){return!1}}function rs(e){if(!e)return"";return function(e){if(ns(e)){const t=Fo(e,!0),n=e.split("\n"),r=Object.fromEntries(t.map(e=>[e._frameLocationIndexInOrigString,!0]));return n.filter((e,t)=>!r[t]).join("\n")}return e}(ts(e)).replace(P,"$1$2$3'*'").replace(L,"******")}function is(e){return bs(e)?new URL(e).host:""}function os(e,t){const n=new URL(e);Object.assign(n,t);let r=n.toString();return t.protocol&&t.protocol!==n.protocol&&(r=`${t.protocol}:${r.slice(n.protocol.length)}`),r}function ss(){var e,t,n,r,i;if("undefined"!=typeof noibuShopifyProxy){const{api:e}=noibuShopifyProxy;return e.init.context.window.location.href}let o=null===(e=self.location)||void 0===e?void 0:e.href;return o?(!o.startsWith("http")&&(null===(i=null===(r=null===(n=null===(t=self.parent)||void 0===t?void 0:t.location)||void 0===n?void 0:n.href)||void 0===r?void 0:r.startsWith)||void 0===i?void 0:i.call(r,"http"))&&(o=self.parent.location.href),ts(o)):""}function as(e){return e.map(e=>{const t={line:"_",mname:"_",file:"_"};return e.line&&Number.isInteger(e.line)&&(t.line=String(e.line)),e.mname&&"<unknown>"!==e.mname&&(t.mname=String(e.mname)),e.file&&"<unknown>"!==e.file&&(t.file=String(e.file)),e.column&&Number.isInteger(e.column)&&(t.column=e.column),t})}function cs(e,t=!0){let n=[{line:"_",mname:"_",file:"_"}];if("object"!=typeof e||!e)return{frames:n,msg:""};const r=e;if(r.stack)n=as(Fo(r.stack));else{const t=e;t.fileName&&"string"==typeof t.fileName&&(n[0].file=t.fileName),t.lineNumber&&(n[0].line=String(t.lineNumber)),t.columnNumber&&Number.isInteger(t.columnNumber)&&(n[0].column=t.columnNumber)}n.length>=50&&(n=n.slice(0,50));const i={frames:(o=n,o?o.filter(e=>!e.mname.toLowerCase().includes("nbuwrapper")):[]),msg:rs(r.message)};var o;return e.cause&&(i.cause=function(e){if(!Array.isArray(e))return[];const t=e.filter(e=>[z,Z,$,G,j,K].every(t=>"string"==typeof e[t]));return t.length?t:[]}(e.cause)),t&&i.cause&&delete i.cause,i}function ls(e){let t="";try{e&&e.stack&&(t=`(stack: ${e.stack})`)}catch(e){}return t}function us(e){const t=[];try{const n=JSON.stringify(e,(function(e,n){try{if("object"!=typeof n||null===n)return n;if("undefined"!=typeof Node&&n instanceof Node)return{};for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?{}:(t.push(n),n)}catch(e){return{}}}));return void 0===n?"null":n}catch(e){return"{}"}}function ds(e){if(Array.prototype.toJSON){const t=Array.prototype.toJSON;delete Array.prototype.toJSON;const n=us(e);return Array.prototype.toJSON=t,n}return us(e)}function hs(e){const t=e;if(t.className){const n=typeof t.className;if("string"===n)return t.className;if("object"===n&&"baseVal"in e.className)return e.className.baseVal}return""}function ps(e){return"string"==typeof e.id?e.id:""}function fs(e){return e?"object"==typeof e?ds(e):String(e):""}function gs(e,t,n,r=!1,i=0){const o=Xo(self.fetch);if(!o)return Promise.resolve();const s={method:"POST",headers:n,body:fs(t),keepalive:r};let a=0;const c="function"==typeof AbortController;if(i&&c){const e=new AbortController;s.signal=e.signal,a=self.setTimeout(()=>e.abort(),i)}const l=o(e,s);return a&&l.finally(()=>self.clearTimeout(a)),l}function ms(){const e=Ce();return function(){const e=Ce();return e.http_re&&Array.isArray(e.http_re)}()?e.http_re:[]}function vs(){const e=Ce(),t=[".noibu-blocked",".creditCard"];return function(){const e=Ce();return e.sel&&Array.isArray(e.sel)}()&&t.push(...e.sel),""+t.join(",")}function ys(){const e=Ce();let t=null;return e.block&&(t=e.block.filter(e=>{return"string"==typeof e&&(t=e,As(()=>(document.querySelectorAll(t),!0),!1));var t}),0===t.length)?null:t?""+t.join(","):null}function bs(e=""){if("function"==typeof URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch(e){return!1}}function Is(){return function(e){var t;let n=e;return n||(n=null===(t=null===self||void 0===self?void 0:self.navigator)||void 0===t?void 0:t.userAgent),"string"==typeof n&&(!T().allowsBots&&(n=n.toLowerCase(),new RegExp("(bot|crawl(er)?|sp(i|y)der|Palo\\.Alto\\.Networks|search|worm|fetch|headless|synthetic|qaautomation|morningscore|wappalyzer|foregenix|SpeedCurve|Outlook-iOS|bitdiscovery|testing|webflow|rigor)","i").test(n)))}(null)}function ws(e){return"string"!=typeof e?"":e.trim()}function Cs(e,t=!1){let n=ss();if(t&&!bs(e))n=os(n,{pathname:e});else{const t=ws(e);t&&"undefined"!==t&&(n=e)}return ts(n)}function Ss(e,t){try{return"function"==typeof t&&e instanceof t}catch(e){return!1}}function ks(e){return"string"==typeof e||e instanceof String}function Es(e,t,n){Ko().then(()=>{try{const r=document.createElement("script");r.setAttribute("src",e),r.setAttribute("async","true"),"function"==typeof n&&(r.onerror=n),"function"==typeof t&&(r.onload=t),setTimeout(()=>{var e;document.body.appendChild(r),(null===(e=r.outerHTML)||void 0===e?void 0:e.includes("blocked"))&&es()&&Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("[Agent] Blocked script found in the agent mode",!1,a.ERROR)})}catch(e){n(e)}})}function _s(){return"object"==typeof window}function As(e,t=null){try{return e()}catch(e){return"function"==typeof t?t(e):t}}class Ts{constructor(e){this._provider=e}static isAvailable(e){let t=!0,n=null;try{const t=e();if(!t||!t.setItem||!t.removeItem)return{result:!1,error:"provider is nullish"};t.setItem("n_key",0),t.removeItem("n_key")}catch(e){t=!1,n=e}return{result:t,error:n}}load(e){return this._provider.getItem(e)}loadWithExpiry(e){const t=this.load(e);if(!t)return null;const n=JSON.parse(t);return Date.now()>n.expiry?(this.remove(e),null):n.value}updateExpiry(e,t){const n=this.load(e);if(!n)return;const r=JSON.parse(n);r.expiry=Date.now()+t,this.save(e,JSON.stringify(r))}save(e,t){this._provider.setItem(e,t)}saveWithExpiry(e,t,n){const r={value:t,expiry:Date.now()+n};this.save(e,ds(r))}remove(e){this._provider.removeItem(e)}calculateUsedSize(){let e=0;for(let t=0;t<this._provider.length;t++){const n=this._provider.key(t);if(n){e+=n.length;const t=this._provider.getItem(n);t&&(e+=t.length)}}return e}}class Rs extends Ts{constructor(){super(window.localStorage)}static isAvailable(){return Ts.isAvailable(()=>window.localStorage)}}class Ms extends Ts{constructor(){super(window.sessionStorage)}static isAvailable(){return Ts.isAvailable(()=>window.sessionStorage)}}class xs{constructor(){const e=Rs.isAvailable(),t=Ms.isAvailable();this._isLocalStorageAvailable=e.result,this._isSessionStorageAvailable=t.result,this._localStorageError=e.error,this._sessionStorageError=t.error,this._provider=null,this._type="unavailable",this._isLocalStorageAvailable?(this._provider=new Rs,this._type="LocalStorage"):this._isSessionStorageAvailable&&(this._provider=new Ms,this._type="SessionStorage")}static getInstance(){return this._instance||(this._instance=new xs),this._instance}isAvailable(){return null!=this._provider}load(e){return this.isAvailable()?this._provider.load(e):null}loadWithExpiry(e){return this.isAvailable()?this._provider.loadWithExpiry(e):null}save(e,t){this.isAvailable()&&this._provider.save(e,t)}saveWithExpiry(e,t,n){this.isAvailable()&&this._provider.saveWithExpiry(e,t,n)}updateExpiry(e,t){this.isAvailable()&&this._provider.updateExpiry(e,t)}remove(e){this.isAvailable()&&this._provider.remove(e)}calculateUsedSize(){return this.isAvailable()?this._provider.calculateUsedSize():0}getDiagnoseInfo(){return{storageProvider:this._type,localStorageAvailable:this._isLocalStorageAvailable,localStorageError:this._localStorageError,sessionStorageAvailable:this._isSessionStorageAvailable,sessionStorageError:this._sessionStorageError,storageUsedSize:this.calculateUsedSize()}}}class Ns{static get scriptInitializeTime(){return this._scriptInitializeTime}static get recordingStartTime(){return this._recordingStartTime}static get recordingStopTime(){return this._recordingStopTime}static setScriptInitializeTime(){null===this._scriptInitializeTime&&(this._scriptInitializeTime=performance.now())}static setRecordingStartTime(){null===this._recordingStartTime&&(this._recordingStartTime=performance.now())}static setRecordingStopTime(){null===this._recordingStopTime&&(this._recordingStopTime=performance.now())}static resetScriptTimeline(){this._scriptInitializeTime=null,this._recordingStartTime=null,this._recordingStopTime=null}}function Ls(e){if(!("number"==typeof e||"now"in Date&&"number"==typeof Date.now()&&"toISOString"in new Date&&"string"==typeof(new Date).toISOString())){if(Date.prototype.hasOwnProperty("valueOf")&&"function"==typeof e.valueOf&&"number"==typeof e.valueOf())return e.valueOf();Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("The date object has been overwritten and can't be processed properly.\nClient has been disabled.",!0,V,!0)}return e}function Os(e){return!(e instanceof Date)||isNaN(e.getTime())}Ns._scriptInitializeTime=null,Ns._recordingStartTime=null,Ns._recordingStopTime=null;class Ds{constructor(){this.eventListeners=[]}trackEventListener(e,t,n){this.eventListeners.push(Vs(e,t,n))}cleanupAllEventListeners(){this.eventListeners.forEach(({element:e,event:t,handler:n})=>{try{e.removeEventListener(t,n)}catch(e){}}),this.eventListeners=[]}}class Ps{static configureInstance(e){this.instance||(Ns.setScriptInitializeTime(),this.instance=new Ps(e))}static reinitializeInstance(){if(this.instance){this.instance.eventListenerManager.cleanupAllEventListeners();const e=this.instance.collectErrorUrl;Ns.resetScriptTimeline(),Ns.setScriptInitializeTime(),this.instance=new Ps(e)}}static getInstance(){if(!this.instance)throw new Error("ClientConfig was not configured.");return this.instance}constructor(e){this.inactiveThresholdTime=174e4,this.pvCountOveruseLockTime=27e5,this.pvCountLimit=300,this.collectErrorLimit=50,this.storage=xs.getInstance(),this.pvId=st()(),this.isBeta=Ke(),this.scriptId=Ye(),this.deviceEnvironment="browser",this.config=null,this.isStorageAvailable=!0,this.collectErrorCount=0,this.initialPageVisitSequence=0,this.eventListenerManager=new Ds,this.collectErrorUrl=e;try{this.initialize()}catch(e){const t="ClientConfig initialization failed. "+e;this.collectError(t,a.ERROR,!1)}_s()&&this.eventListenerManager.trackEventListener(window.document,"visibilitychange",()=>{"visible"===window.document.visibilityState&&this.initialize()})}initialize(){const e=null===this.config;this.restoreConfig(e);const t=this.config;if(this.isStorageAvailable){if(t.DisabledStatus)if(null===t.ClientUnlockTime)t.DisabledStatus=!1;else{new Date>t.ClientUnlockTime&&(t.DisabledStatus=!1,t.ClientUnlockTime=null)}else t.ClientUnlockTime=null;if(!t.DisabledStatus){if(e)this.isInactive&&(t.CurrentPageVisitCount=0),t.CurrentPageVisitCount+=1,this.initialPageVisitSequence=t.CurrentPageVisitCount-1;else if(this.isInactive)return t.LastActive=new Date,t.CurrentPageVisitCount=0,void this.lockClientUntilNextPage("Session reset, locking until next page");t.LastActive=new Date}this.saveConfig(),this.lockClientIfPageVisitCountOverused()}else t.DisabledStatus=!0}restoreConfig(e){let t=null;try{this.storage.load("n_config_reset")&&e?this.storage.remove("n_config_reset"):t=this.storage.load("n_browser_data")}catch(e){this.isStorageAvailable=!1}let n={};if(null!==t)try{n=JSON.parse(t)}catch(e){}"string"!=typeof n.BrowserId&&(n.BrowserId=st()()),"number"!=typeof n.CurrentPageVisitCount&&(n.CurrentPageVisitCount=0),"boolean"!=typeof n.DisabledStatus&&(n.DisabledStatus=!1),"string"==typeof n.LastActive&&(n.LastActive=new Date(n.LastActive)),Os(n.LastActive)&&(n.LastActive=new Date),null!==n.ClientUnlockTime&&("string"==typeof n.ClientUnlockTime&&(n.ClientUnlockTime=new Date(n.ClientUnlockTime)),Os(n.ClientUnlockTime)&&(n.ClientUnlockTime=null)),this.config=n}saveConfig(){if(this.isStorageAvailable)try{const e=ds(this.config);this.storage.save("n_browser_data",e)}catch(e){this.config.DisabledStatus=!0,this.isStorageAvailable=!1}}get browserId(){return this.config.BrowserId}get pageVisitId(){return this.pvId}get pageVisitSequence(){return this.initialPageVisitSequence}get lastActiveTime(){return this.config.LastActive}get isDisabled(){return this.config.DisabledStatus}get isInactive(){return function(e,t){const n=Date.now()-t;return e<new Date(n)}(this.config.LastActive,this.inactiveThresholdTime)}postNoibuErrorAndOptionallyDisableClient(e,t,n,r=!1,i=!1){if(!this.config.DisabledStatus||i){if(t&&(this.config.DisabledStatus=!0,this.saveConfig()),this.collectErrorCount+=1,this.collectErrorCount>this.collectErrorLimit)return e="Shutting collect off (reached the limit of collect errors).",void this.lockClient(10,e);this.collectError(e,n,r)}}updateLastActiveTime(e=new Date){this.config.LastActive=e,this.saveConfig()}scheduleResetClientConfig(){this.isStorageAvailable&&this.storage.save("n_config_reset",!0)}setSessionToken(e,t){try{this.storage.saveWithExpiry("n_session_id",e,t)}catch(e){}}get sessionToken(){return this.storage.loadWithExpiry("n_session_id")}get sessionId(){const e=this.sessionToken;if("string"!=typeof e)return null;const t=e.split(":");return t.length<4?null:t[0]||null}lockClient(e,t){const n=new Date;n.setMinutes(n.getMinutes()+e),this.config.DisabledStatus=!0,this.config.ClientUnlockTime=n,this.saveConfig(),this.collectError(t,V,!1)}lockClientUntilNextPage(e){if(this.config.DisabledStatus)return;this.config.DisabledStatus=!0,this.saveConfig();const t=this.isBeta?V:F;this.collectError(e,t,!1)}lockClientIfPageVisitCountOverused(){if(this.config.CurrentPageVisitCount<this.pvCountLimit)return;this.config.CurrentPageVisitCount=0;const e=this.pvCountOveruseLockTime/1e3/60;this.lockClient(e,"Hit max page visits, disabling client.")}collectError(e,t,n){var r,i;if(t!==V)return;const o={browserId:(null===(r=this.config)||void 0===r?void 0:r.BrowserId)||st()(),pageVisitId:this.pvId,scriptId:this.scriptId,deviceEnv:this.deviceEnvironment,ua:(null===(i=null===self||void 0===self?void 0:self.navigator)||void 0===i?void 0:i.userAgent)||"",error:e},s={url:ss(),err_msg:o,sev:t},{collectErrorUrl:a}=this;gs(a,s,{"content-type":"application/json"},n,2e3).catch(()=>{})}}function Vs(e,t,n,r){if(!e||!t||!n)return null;const i=e=>{try{n(e)}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("addEventListener callback error: "+e.message,!1,V)}},o=n=>{if(n instanceof TypeError){if((()=>{if(!Reflect)return!1;try{Reflect.get(e,"addEventListener")(t,i,r)}catch(e){return!1}return!0})())return;if(!e.addEventListener)return void Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in addSafeEventListener: '${e.addEventListener}' is supposed to be a function. ${n}`,!1,V)}Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in addSafeEventListener: "+n,!1,V)};try{return e.addEventListener(t,i,r),{element:e,event:t,handler:i}}catch(e){return o(e),null}}function Fs(e,t,n,r,i,o,s,a){a(`Wait for element. Timeout: ${i}s. Selector: "${t}".`);const c=Bs(e,t,n,r,a);if(c)return a("Found target element: true."),Promise.resolve(c);if(0===i){a("Found target element: false.");const e=new Error(`Element not found: "${t}".`);return Promise.reject(e)}return new Promise((c,l)=>{let u=0;const d=()=>{a("Process mutation.");const i=Bs(e,t,n,r,a);i&&(a(`Found target element: ${!!i}.`),window.clearTimeout(u),o.unsubscribe(d),c(i))};o.subscribe(d),s.subscribe(()=>{o.unsubscribe(d);const e=new Error(`Waiting for element has been cancelled: "${t}".`);l(e)});if(i>0){const e=1e3*i;u=window.setTimeout(()=>{o.unsubscribe(d);const e=new Error(`Timeout waiting for element: "${t}".`);l(e)},e)}})}function Us(e,t,n,r,i){let o=function(e,t,n,r,i){let o;if(o=t?[...e.querySelectorAll(t)].filter(e=>e.nodeType===Node.ELEMENT_NODE):[e],i(`Filtered ${o.length} elements by selector.`),(n||r)&&(o=o.filter(e=>"string"==typeof e.innerText),0!==o.length&&(n&&(i(`Filtering by text: "${n=n.toLowerCase()}".`),o=o.filter(e=>e.innerText.toLowerCase().includes(n)),i(`Filtered ${o.length} elements by text.`)),r))){const e=new RegExp(r,"im");i(`Filtering by regexp: '${e}'.`),o=o.filter(t=>e.test(t.innerText)),i(`Filtered ${o.length} elements by regexp.`)}return o}(e,t,n,r,i);return o.length&&(o=o.filter(e=>function(e){if(e.checkVisibility)return e.checkVisibility({visibilityProperty:!0,opacityProperty:!0});const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}(e)),i(`Filtered ${o.length} elements by visibility.`)),o}function Bs(e,t,n,r,i){const o=Us(e,t,n,r,i);return 0===o.length?void 0:o[0]}function Hs(e){let t="";if(e.tag&&(t+=e.tag),e.id&&(t+="#"+e.id),e.class&&(t+=ws(e.class).split(/\s+/).map(e=>"."+e).join("")),e.attributes)for(const[n,r]of Object.entries(e.attributes))t+=`[${n}="${r}"]`;if(e.parentSelector){t=`${Hs(e.parentSelector)} ${t}`}if(""===t)throw new Error("Incorrect element selector.");return t}function qs(){return Ce().page_groups||null}function Ws(e=null){let t="";if(e){const n=new URL(e);t=n.hostname+n.pathname}else t=window.location.hostname+window.location.pathname;return t+=t.endsWith("/")?"":"/",t.startsWith("www.")&&(t=t.slice(4)),t}const js=new Map;function Gs(e,t=null){let n=js.get(e);if(void 0===n||0===n.length){n=e.replace(/https?:\\\/\\\/|www\\\./g,""),n.startsWith("^")||(n="^"+n);n.endsWith(")")&&(n.endsWith("/",n.length-1)||n.endsWith("*",n.length-1)||(n+="/")),n.endsWith("$")||(n+="$"),js.set(e,n)}return new RegExp(n).test(Ws(t))}function $s(e=null,t=!0){const n=qs();if(!n)return[];return Object.values(n).filter(e=>!(t&&"PageCheck"===e.group_type)).filter(t=>function(e,t=null){try{if(e.url_regex){if(Gs(e.url_regex,t))return!0}else if(e.urls){const n=Ws(t);if(e.urls.includes(n))return!0}if(e.element_selector){const t=Hs(e.element_selector);if(window.document.querySelector(t))return!0}}catch(e){}return!1}(t,e)).map(e=>e.name).filter(ws)}class zs{constructor(){this.expectedVideoLength=0,this.expectedVfSeq=0,this.expectedPvPart=0,this.httpSequenceNumber=0,this.httpPayloadCount=0,this.httpDroppedPayloadByLengthCount=0,this.httpDroppedPayloadByTypeCount=0,this.httpOverLimitCount=0,this.videoClicks=0,this.pvClicks=0,this.didCutPv=!1,this.didCutVideo=!1,this.didStartVideo=!1,this.httpCount=0,this.errCount=0,this.customAttributeTotalCount=0,this.customAttributeFailCount=0,this.customAttributeKeyCount=0,this.otherMetrics={},this.eventListenerManager=new Ds}static getInstance(){return this.instance||(this.instance=new zs),this.instance}static reinitializeInstance(){this.instance&&(this.instance.eventListenerManager.cleanupAllEventListeners(),this.instance=new zs)}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}addHttpData(){this.httpSequenceNumber+=1}addHttpDataOverLimit(){this.httpOverLimitCount+=1}addHttpDataDropByType(){this.httpDroppedPayloadByTypeCount+=1}addHttpDataDropByLength(){this.httpDroppedPayloadByLengthCount+=1}addHttpDataPayloadCount(){this.httpPayloadCount+=1}addCustomAttributeTotalCount(){this.customAttributeTotalCount+=1}addCustomAttributeFailCount(){this.customAttributeFailCount+=1}setCustomAttributeKeyCount(e){this.customAttributeKeyCount=e}addOtherMetricsCount(e,t=1){this.otherMetrics[e]||(this.otherMetrics[e]=0),this.otherMetrics[e]+=t}setDidCutVideo(){this.didCutVideo=!0}setDidStartVideo(){this.didStartVideo=!0}setDidCutPv(){this.didCutPv=!0}}var Zs=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Ks{constructor(){try{xs.getInstance().isAvailable()&&this.postPreviousPageVisit()}catch(e){}}static getInstance(){return this.instance||(this.instance=new Ks),this.instance}storeRetryQueue(e,t){const n=xs.getInstance();try{n.remove("n_stored_page_visit")}catch(e){return}const r=e.filter(({type:e})=>e===B).map(({payload:e})=>e[ve]);if(0===r.length)return;const i=ds({pageVisitFrags:r,pageVisitInfo:t,timestamp:new Date});let o=!1;try{n.save("n_stored_page_visit",i)}catch(e){o=!0}if(o)try{n.remove("n_stored_page_visit")}catch(e){return}}getPostData(){const e=xs.getInstance(),t=e.load("n_stored_page_visit");if(!t)return null;let n;try{n=JSON.parse(t)}catch(t){return e.remove("n_stored_page_visit"),null}if(n.timestamp){const e=new Date;if(e.setSeconds(e.getSeconds()-1740),e.getTime()>=Date.parse(n.timestamp))return null}const r={pvi:n.pageVisitInfo,[ve]:n.pageVisitFrags,[ye]:[]};return r.pvi.last=!0,r}postPreviousPageVisit(){return Zs(this,void 0,void 0,(function*(){const e=this.getPostData();if(e){const t={"content-type":"text/plain;charset=UTF-8"};try{yield gs(et(),e,t,!1,6e4)}catch(e){}}this.updateStorageFlushed()}))}updateStorageFlushed(){const e=xs.getInstance();try{e.remove("n_stored_page_visit")}catch(e){return}}}var Ys,Js,Qs=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Xs{static getInstance(){return this.instance||(this.instance=new Xs)}static reinitializeInstance(e){this.instance&&this.instance.initialize(e)}constructor(){this.broadcastContext=null;try{let e=sessionStorage.getItem(Ys.TabId);null===e&&(e=st()(),sessionStorage.setItem(Ys.TabId,e)),this.tabId=e}catch(e){return}if(!this.isShopifyCheckout)try{const e=this.receiveBroadcastMessage.bind(this),t=new BroadcastChannel("noibu_referrer");Vs(t,"message",e),this.broadcastChannel=t}catch(e){}}get isDisabled(){return!this.tabId}get isShopifyCheckout(){return"object"==typeof noibuShopifyProxy}get currentUrl(){return this.isShopifyCheckout?noibuShopifyProxy.api.init.context.window.location.href:window.location.href}get referrerUrl(){return this.isDisabled?"":sessionStorage.getItem(Ys.ReferrerUrl)||""}get referrerPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(Ys.ReferrerPageGroups);return e?JSON.parse(e):[]}get storedPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(Ys.PageGroups);return e?JSON.parse(e):[]}storePageGroups(e){if(this.isDisabled)return;const t=JSON.stringify(e);sessionStorage.setItem(Ys.PageGroups,t)}initialize(){return Qs(this,arguments,void 0,(function*(e=null){if(!this.isDisabled)try{yield this.initializeUnsafe(e)}catch(e){}}))}initializeUnsafe(){return Qs(this,arguments,void 0,(function*(e=null){if(null===e){switch(function(){try{const e=performance.getEntriesByType("navigation");return e[0].type}catch(e){return null}}()){case"reload":break;case"back_forward":{const e=sessionStorage.getItem(Ys.Url),t=sessionStorage.getItem(Ys.PageGroups);sessionStorage.setItem(Ys.Url,this.currentUrl),sessionStorage.setItem(Ys.ReferrerUrl,e||""),sessionStorage.setItem(Ys.ReferrerPageGroups,t||"[]");break}default:{let e=sessionStorage.getItem(Ys.Url),t=sessionStorage.getItem(Ys.PageGroups);if(null==e&&(e=document.referrer||null),null!=e&&null==t&&this.broadcastChannel){const n=yield this.sendBroadcastMessage(e);t=JSON.stringify(n)}sessionStorage.setItem(Ys.Url,this.currentUrl),sessionStorage.setItem(Ys.ReferrerUrl,e||""),sessionStorage.setItem(Ys.ReferrerPageGroups,t||"[]")}}}else{const{url:t,referrerUrl:n,referrerPageGroups:r}=e,i=JSON.stringify(r);sessionStorage.setItem(Ys.Url,t),sessionStorage.setItem(Ys.ReferrerUrl,n),sessionStorage.setItem(Ys.ReferrerPageGroups,i)}}))}sendBroadcastMessage(e){const t={timeout:null,promise:null,resolve:null};t.promise=new Promise(e=>t.resolve=e),t.timeout=window.setTimeout(()=>t.resolve([]),5),this.broadcastContext=t;const n={type:"request",tabId:this.tabId,referrer:e};return this.broadcastChannel.postMessage(n),t.promise}receiveBroadcastMessage({data:e}){switch(e.type){case"request":this.handleRequestMessage(e);break;case"response":this.handleResponseMessage(e)}}handleRequestMessage({tabId:e,referrer:t}){if(t!==window.location.href)return;const n=sessionStorage.getItem(Ys.PageGroups);if(null===n)return;const r={type:"response",tabId:e,pageGroups:JSON.parse(n)};this.broadcastChannel.postMessage(r)}handleResponseMessage({tabId:e,pageGroups:t}){if(e!==this.tabId)return;const n=this.broadcastContext;this.broadcastContext=null,window.clearTimeout(n.timeout),n.resolve(t)}}function ea(e,t=[],n=1.5,r=2){return new Proxy(t,{get:(t,i)=>"push"===i?(...i)=>{t.push(...i),t.length>=n*e&&t.splice(0,e/r)}:t[i]})}Xs.instance=null,function(e){e.TabId="noibu_tab_id",e.Url="noibu_url",e.PageGroups="noibu_page_groups",e.ReferrerUrl="noibu_referrer_url",e.ReferrerPageGroups="noibu_referrer_page_groups"}(Ys||(Ys={}));class ta{constructor(e,t){this.retryMessageQueue=ea(500),this.inactivityTimeout=0;const n=Qe();this.forceClosed=!1,this.trafficHeld=!1,this.socket=null,this.socketInstanceId=null,this.currentConnectionAttempts=0,this.connectionCount=0,this.sessionStartTime=performance.now(),this.connectionPromise=null,this.pageVisitInfoSent=!1,this.replyReceived=!1,this.connectionURL=`${n}/${ke}`,this.postURL=et(),this.messageSequenceNum=0,this.latestReceivedSeqNumber=-1,this.isRetryLoopDisabled=!1,this.metroplexTypeLock={};const{referrerUrl:r}=Xs.getInstance();this.initialReferingURL=ts(r),(null==t?void 0:t.url)?this.initialURL=t.url:this.initialURL=ss(),(null==t?void 0:t.pageTitle)?this.initialPageTitle=t.pageTitle:_s()&&window.document.title?this.initialPageTitle=window.document.title:this.initialPageTitle="",this.sessionTimestamp=new Date,this.latestReceivedSeqNumStoredTime=new Date,this.instanceId=st()(),this.scriptInstanceId=e,this.sessionLength=0,this.ackedOnce=!1,this.metroRetryFrequencyMS=3e4,this.debouncedInactivityHandler=To()(()=>{this._socketTimeout()},5e3),this.eventListenerManager=new Ds}static getInstance(e){return this.instance||(this.instance=new ta(e),this.instance.start()),this.instance}static reinitializeInstance(e,t){if(this.instance)return this.instance.eventListenerManager.cleanupAllEventListeners(),clearInterval(this.instance.retryMetroplexInterval),clearTimeout(this.instance.inactivityTimeout),this.instance=new ta(e,t),this.instance.start(),this.instance}start(){this.connectSocket()}_addSeqNumToPayload(e,t){switch(e){case u.PageVisitPart:this._setSeqNumInPayloadAndIncrementSeqNum(ve,t);break;case u.PageVisitVideoFile:this._setSeqNumInPayloadAndIncrementSeqNum(ye,t);break;case u.PageVisitHttp:this._setSeqNumInPayloadAndIncrementSeqNum(Ie,t);break;case u.PageVisitMeta:this._setSeqNumInPayloadAndIncrementSeqNum(be,t)}}_setSeqNumInPayloadAndIncrementSeqNum(e,t){t[e].seq_num=this.messageSequenceNum,this.messageSequenceNum+=1}sendMessage(e,t){if(e in this.metroplexTypeLock||Ps.getInstance().isDisabled)return!1;if(this.trafficHeld)return!1;const n=t;if(e!==J&&(this._addSeqNumToPayload(e,n),this.retryMessageQueue.push({payload:n,type:e}),Ks.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())),this.isConnected()&&this.pageVisitInfoSent&&this.replyReceived&&this._sendSocketMessage(n),e===B&&t[ve]){const e=t[ve].events?t[ve].events:[];this._updateLatestPvTimestamp(e)}return!0}_updateLatestPvTimestamp(e){this._filterUserEvents(e).length>0&&(Ps.getInstance().updateLastActiveTime(),this.debouncedInactivityHandler())}_socketTimeout(){this.inactivityTimeout&&self.clearTimeout(this.inactivityTimeout),this.inactivityTimeout=self.setTimeout(()=>{this.closeIfInactive()},174e4)}_filterUserEvents(e){return e.filter(e=>e[j]===ie)}isConnected(){return null!==this.socket&&1===this.socket.readyState}isConnecting(){return null!==this.socket&&0===this.socket.readyState}holdTraffic(){this.trafficHeld=!0}releaseTraffic(){this.trafficHeld=!1}clearPendingMessages(){this.retryMessageQueue=ea(500,[]),Ks.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())}close(){this.forceClosed=!0,(this.isConnected()||this.isConnecting())&&this.socket.close(1e3)}handleConnect(e,t){if(!t&&(this.isConnected()||this.isConnecting()))return;this.currentConnectionAttempts+=1;const n=new WebSocket(this.connectionURL);this.socket=n,this.socketInstanceId=st()(),n.onerror=()=>{this.socket},n.onclose=()=>{this.socket===n&&(this.socket=null,this.pageVisitInfoSent=!1,clearInterval(this.retryMetroplexInterval),this.forceClosed||this.isConnecting()||(this.currentConnectionAttempts>=20?Ps.getInstance().lockClientUntilNextPage("Too many reconnection attempts, locking until next page"):this.connectionCount>=100?Ps.getInstance().lockClientUntilNextPage("Too many connections, locking until next page"):setTimeout(()=>{this.handleConnect(e,!1)},Math.pow(this.currentConnectionAttempts,2)*("undefined"!=typeof METROPLEX_CONSECUTIVE_CONNECTION_DELAY?METROPLEX_CONSECUTIVE_CONNECTION_DELAY:1e3))))},this.replyReceived=!1;const r=()=>{this.socket===n&&(this.replyReceived||(this.replyReceived=!0,this._sendUnconfirmedMessages(!1),this.setupRetryMechanism()))};n.onmessage=t=>{this.socket===n&&this._onSocketMessage(t,e,r)},n.onopen=()=>{this.socket===n&&this._onSocketOpen()}}connectSocket(){return this.isConnected()||this.isConnecting()||(this.connectionPromise=new Promise(e=>{if(this.connectionPromiseResolver=e,!_s())return void this.handleConnect(e,!1);"visible"===window.document.visibilityState&&!window.document.hidden&&this.handleConnect(e,!1)})),this.connectionPromise}handleShow(){if(Ps.getInstance().isDisabled)return;if(this.trafficHeld)return;this.forceClosed=!1,this._closeForVisibilityChange();const e=this.connectionPromiseResolver||(()=>{});this.handleConnect(e,!0)}_closeForVisibilityChange(){(this.isConnected()||this.isConnecting())&&(this.socket.onclose=()=>{},this.socket.close(1e3))}addEndTimeToPayload(e,t){const n=performance.now(),r=Math.ceil(n-this.sessionStartTime);t&&(this.sessionLength=r);const i=new Date(this.sessionTimestamp.getTime()+r).toISOString();e.end_at=i}_onSocketOpen(){this.isConnected()&&!Ps.getInstance().isDisabled&&(this._sendSocketMessage(this.getPageInformation()),this.pageVisitInfoSent=!0,this.connectionCount+=1)}_onSocketMessage(e,t,n){switch(e.data){case Ae:this.metroplexTypeLock[H]=!0,zs.getInstance().setDidCutVideo();break;case Te:this.metroplexTypeLock[B]=!0,zs.getInstance().setDidCutPv();break;case Re:Ps.getInstance().lockClient(1440,"Metroplex blocked script"),this.close();break;case Me:this.close();break;case xe:break;default:if(e.data.includes("seq_num")){const r=e.data.split("seq_num:");if(r.length<2){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Invalid message received from metroplex while clearing retry queue "+e.data,!1,V);break}"function"==typeof n&&n();const i=parseInt(r[1],10);if(-1===i)break;i<=this.latestReceivedSeqNumber?this.isRetryLoopDisabled=!0:(this.isRetryLoopDisabled=!1,this.latestReceivedSeqNumber=i,this.currentConnectionAttempts=0,this._clearRetryQueue(i)),!this.ackedOnce&&t&&(this.ackedOnce=!0,t())}if(this._tryProcessHelpCodeResponse(e.data))break;if(this._tryProcessSessionIdResponse(e.data))break}}_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;const t=this.retryMessageQueue.filter(t=>this._messagePayloadHasLargerSeqNum(t,ve,e)||this._messagePayloadHasLargerSeqNum(t,ye,e));this.retryMessageQueue=ea(500,t),Ks.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation())}_sendUnconfirmedMessages(e){if(!this.isConnected()||Ps.getInstance().isDisabled)return;if(e){const e=new Date;if(e.setMilliseconds(e.getMilliseconds()-this.metroRetryFrequencyMS),e<this.latestReceivedSeqNumStoredTime)return;if(this.isRetryLoopDisabled)return}const t=this.retryMessageQueue.filter(e=>!(e.type in this.metroplexTypeLock));this.retryMessageQueue=ea(500,t),Ks.getInstance().storeRetryQueue(this.retryMessageQueue,this.getPageInformation());for(let e=0;e<this.retryMessageQueue.length;e+=1){const{payload:t}=this.retryMessageQueue[e];if(!this._sendSocketMessage(t))break}}setupRetryMechanism(){this.retryMetroplexInterval=setInterval(()=>{this._sendUnconfirmedMessages(!0)},3e4)}handleUnload(e=null){this.close(),Ps.getInstance().isDisabled||Ps.getInstance().isInactive||0!=this.messageSequenceNum&&this.postFullPageVisit(e)}postFullPageVisit(e=null){if(this.trafficHeld)return;if(0===this.retryMessageQueue.length)return;const t={pvi:e=e||this.getPageInformation(),[ve]:[],[ye]:[],[Ie]:[],vpnum:this.connectionCount};t.pvi.last=!0;let n=!1;this.retryMessageQueue.forEach(e=>{const{type:r,payload:i}=e;switch(r){case H:n=!0;const e=i[ye];this.latestReceivedSeqNumber=e.seq_num;break;case B:n=!0;const r=i[ve];t[ve].push(r),this.latestReceivedSeqNumber=r.seq_num;break;case W:n=!0;const o=i[Ie];t[Ie].push(o)}}),n&&this.postMessage(t),this.retryMessageQueue=ea(500,[]),Ks.getInstance().updateStorageFlushed()}postMessage(e){const t=e;t.vpnum+=1;gs(this.postURL,t,{"content-type":"text/plain;charset=UTF-8"},!0).catch(()=>{})}_sendSocketMessage(e){return!this.closeIfInactive()&&(this.socket.send(ds(e)),!0)}closeIfInactive(){const e=Ps.getInstance().isInactive;return e&&!Ps.getInstance().isDisabled&&(Ps.getInstance().lockClientUntilNextPage("Session is inactive, locking until next page"),this.close(),this.postFullPageVisit()),e}getPageInformation(){const e=Ps.getInstance(),t=$s(this.initialURL),{referrerPageGroups:n}=Xs.getInstance(),r={br_id:e.browserId,pv_id:e.pageVisitId,v:5,seq:e.pageVisitSequence,on_url:this.initialURL,page_title:this.initialPageTitle,page_groups:t,ref_url:this.initialReferingURL,ref_page_groups:n,start_at:this.sessionTimestamp.toISOString(),conc:this.connectionCount,cv:2,last:!1,script_id:Ye(),script_inst_id:this.scriptInstanceId,mp_sock_inst_id:this.instanceId,sock_inst_id:this.socketInstanceId,video_recorder:we},i=function(){const e=self.navigator.userLanguage||self.navigator.language;return"string"==typeof e?e.toLowerCase():null}();i&&(r.lang=i);const{sessionToken:o}=e;return o&&(r.session_token=o),r}_tryProcessHelpCodeResponse(e){const t=Y+":";if("string"!=typeof e||!e.startsWith(t))return!1;const n=e.substring(t.length),r=/^\d{6}$/.test(n),i=new CustomEvent("noibuHelpCode",{detail:{success:r,data:n}});return self.dispatchEvent(i),!0}_tryProcessSessionIdResponse(e){if("string"!=typeof e||!e.startsWith("session:"))return!1;const t=e.substring("session:".length);if(!t)return!1;const n=t.split(":");if(n.length<4)return!1;const r=parseInt(n[1],10);return!(isNaN(r)||r<=0)&&(Ps.getInstance().setSessionToken(t,1e3*r),!0)}}class na{constructor(){this.partCounter=0,this.pvMap={},this.partCounter=0,this.pvEventLength=0,this.totalPvEventLength=0,this.inDebounceHandle=0,this.isInAcceleratedPvPostMode=!1,this.liveViewEnabled=!1}static configureInstance(){this.instance||(this.instance=new na)}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(),this.postEvents(t,e)}addPageVisitEvent(e,t){const n=this._addPageVisitEvent(e,t);return this._sendPageVisitMessage(),this.postEvents(t,[e]),n}_addPageVisitEvent(e,t){const n={[j]:t,occ_at:e.occurredAt,[t]:e.event};this.pvEventLength>=200&&this._sendPageVisitMessage();const r=st()();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,ta.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 Ps.getInstance().lockClientUntilNextPage(`Stop processing parts because we reached. max parts: 10000.variables: total PV event length: ${this.totalPvEventLength}.`);const t=na.makePageVisitFrag(e,this.partCounter);zs.getInstance().setPvPart(this.partCounter);const n={[ve]:t};ta.getInstance().sendMessage(B,n),this.pvMap={},this.pvEventLength=0,this.partCounter+=1}postEvents(e,t){this.liveViewEnabled&&self.dispatchEvent(new CustomEvent("noibuPageVisitEvent",{detail:{type:e,eventObjects:t}}))}requestLiveView(){this.liveViewEnabled=!0}disableLiveView(){this.liveViewEnabled=!1}}class ra{constructor(e){this.unmaskedInputSelectors=null,this.unmaskedInputCache=new Set,this.maskedInputCache=new Set,this.unmaskedInputSelectors=e}maskInputSafely(e,t){try{return this.maskInput(e,t)}catch(e){return"*"}}maskInput(e,t){if(null==this.unmaskedInputSelectors)return ra.mask(e);if(this.maskedInputCache.has(t))return ra.mask(e);if(this.unmaskedInputCache.has(t))return e;for(const n of this.unmaskedInputSelectors){const r=document.querySelectorAll(n);for(const n of r){if(n===t)return this.unmaskedInputCache.add(t),e}}return this.maskedInputCache.add(t),ra.mask(e)}static mask(e){return"*".repeat(e.length)}}!function(e){e[e.Init=0]="Init",e[e.Fail=1]="Fail",e[e.Ready=2]="Ready"}(Js||(Js={}));var ia=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class oa{constructor(e,t){this.status=Js.Init,this.recordSnapshotId=0,this.scriptUrl=e,this.errorCallback=t,this.stats={start:0,fetch:0,read:0,create:0,ping:0,pong:0,init:0,error:0,send:0,receive:0,queue:0,first:0,max:0,avg:0}}ready(){return this.statusPromise}start(){this.statusPromise=new Promise((e,t)=>{const n=performance.now();this.statusResolver={timestamp:n,resolve:e,reject:t},this.init()})}processRecordSnapshot(e){if(this.status!==Js.Ready){const e=new Error("Worker is not initialized.");return Promise.reject(e)}return new Promise((t,n)=>{const r=this.getNextRecordSnapshotId(),i={timestamp:performance.now(),resolve:t,reject:n};this.recordSnapshotResolvers.set(r,i),this.sendRecordSnapshotMessage(r,e)})}reportError(e,t){const n=!!this.recordSnapshotResolvers;this.stats.queue=n?this.recordSnapshotResolvers.size:0;const r=ds({error:`${e} ${t} ${ls(t)}`,status:this.status,stats:this.stats});this.errorCallback(r)}init(){return ia(this,void 0,void 0,(function*(){try{this.worker=yield oa.createWorker(this.scriptUrl,this.stats),this.worker.addEventListener("error",e=>{this.stats.error+=1,this.handleInitError(e.error)}),this.worker.addEventListener("message",e=>{this.receiveMessage(e.data)}),this.worker.addEventListener("messageerror",e=>{this.reportError("Message error.",e.data)}),this.setupInitTimeout(),this.sendPingMessage()}catch(e){this.handleInitError(e)}}))}static createWorker(e,t){return ia(this,void 0,void 0,(function*(){t.start=performance.now();const n=yield fetch(e);if(t.fetch=performance.now(),!n.ok)throw new Error(`Failed to fetch worker script. Code: ${n.status}. Status: ${n.statusText}.`);const r=yield n.text();t.read=performance.now();const i=new Blob([r],{type:"application/javascript"}),o=URL.createObjectURL(i),s=new Worker(o);return t.create=performance.now(),s}))}handleReady(){this.status===Js.Init&&(this.recordSnapshotResolvers=new Map,this.stats.init=performance.now()-this.statusResolver.timestamp,this.status=Js.Ready,this.statusResolver.resolve(this.status),this.setupRecordSnapshotCleanup())}handleInitError(e){if(this.status===Js.Init){this.status=Js.Fail,this.statusResolver.resolve(this.status);oa.isInitErrorAcknowledged(e)||this.reportError("Init error.",e)}}static isInitErrorAcknowledged(e){if(!e)return!0;const t=(""+e).trim();return 0===t.length||oa.knownInitErrors.some(e=>t.includes(e))}setupInitTimeout(){window.setTimeout(()=>{const e=new Error("Init timeout.");this.handleInitError(e)},5e3)}sendMessage(e){this.status===Js.Ready&&(this.stats.send+=1,this.worker.postMessage(e))}sendPingMessage(){this.stats.ping=performance.now(),this.worker.postMessage({type:"ping"})}sendRecordSnapshotMessage(e,t){const n={type:"record-snapshot-request",payload:{id:e,snapshot:t}};this.sendMessage(n)}receiveMessage(e){switch(e.type){case"pong":this.stats.pong=this.stats.pong||performance.now(),this.handleReady();break;case"record-snapshot-response":this.receiveRecordSnapshotResponse(e.payload);break;case"messageerror":this.reportError("Received message error.",null)}}receiveRecordSnapshotResponse(e){const{id:t}=e,n=this.recordSnapshotResolvers.get(t);n&&(oa.updateReceiveStats(n,this.stats),this.recordSnapshotResolvers.delete(t),e.error?(this.reportError("Service error.",e.error),n.reject(e.error)):n.resolve(e))}static updateReceiveStats(e,t){const n=performance.now()-e.timestamp,r=t.receive+1;let{avg:i}=t;i-=i/r,i+=n/r,t.receive=r,t.avg=i,0===t.first&&(t.first=n),n>t.max&&(t.max=n)}setupRecordSnapshotCleanup(){window.setInterval(()=>this.cleanupRecordSnapshot(),12e4)}cleanupRecordSnapshot(){let e=0;const t=[...this.recordSnapshotResolvers.entries()];for(const[n,r]of t){if(performance.now()-r.timestamp>12e4){this.recordSnapshotResolvers.delete(n);const t=new Error("Resolver expired.");r.reject(t),e+=1}}if(e){const t=new Error(`Collected ${e} expired resolvers.`);this.reportError("Cleanup.",t)}}getNextRecordSnapshotId(){return this.recordSnapshotId+=1,this.recordSnapshotId}}var sa,aa;oa.knownInitErrors=["SecurityError: The operation is insecure","TypeError: Load failed","TypeError: Failed to fetch","SecurityError: Failed to construct","QuotaExceededError: Failed to construct","TypeError: NetworkError when attempting to fetch resource","AbortError: The operation was aborted"];const ca=(null===(aa=null===(sa=null==Promise?void 0:Promise.all)||void 0===sa?void 0:sa.bind)||void 0===aa?void 0:aa.call(sa,Promise))||(e=>new Promise((function(t,n){const r=[];let i=0;e.forEach((o,s)=>{Promise.resolve(o).then(n=>{r[s]=n,i+=1,i===e.length&&t(r)}).catch(n)})})));var la,ua,da,ha;!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"}(la||(la={})),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"}(ua||(ua={})),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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(da||(da={})),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"}(ha||(ha={}));var pa=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class fa{constructor(e,t,n=null){if(this.isRecordingStopped=!1,this.isMetaEventReceived=!1,this.isRecordingAllowedHandled=!1,this.isRecordingLoadedHandled=!1,this.liveViewRecording=!1,this.eventBuffer=[],this.vfCounter=0,this.didSetupRecorder=!1,this.recordStopper=null,this.firstRecordedTimestamp=null,this.lastRecordedTimestamp=null,this.invalidVideoLength=!1,this.lastFragPostTimestamp=Date.now(),this.pauseTimeout=null,this.freezingEvents=!1,this.cssURLs=new Map,this.eventListenerManager=new Ds,t)return void(this.didSetupRecorder=!0);const r=function(){const e=Ce().unmask;return Array.isArray(e)?e:null}();this.inputMaskManager=new ra(r),this.eventListenerManager.trackEventListener(window,"click",()=>{this.handleFragPost()}),e&&(null!==n?this.workerAgent=n:(this.workerAgent=new oa("https://cdn.noibu.com/collect-worker.js",fa.postWorkerError),this.workerAgent.start()))}static reinitializeInstance(e=!0,t=!1){if(this.instance){clearTimeout(this.instance.pauseTimeout),this.instance.eventListenerManager.cleanupAllEventListeners();const n={record:this.instance.rrwebRecord,pack:this.instance.rrwebPack,addCustomEvent:this.instance.rrwebAddCustomEvent};this.instance=new fa(e,!1,this.instance.workerAgent),this.instance.liveViewRecording=t,n.record&&n.pack&&n.addCustomEvent&&this.instance.handleRRWebLoaded(n)}}static configureInstance(e=!0){this.instance||(this.instance=new fa(e,!1)),addEventListener("hashchange",()=>{const e=this.instance;if(!!e.firstRecordedTimestamp&&e.rrwebAddCustomEvent){const{hash:t}=location;e.rrwebAddCustomEvent("hashchange",{hash:t})}})}static getInstance(){if(!this.instance)throw new Error("SessionRecorder was not configured");return this.instance}static setInstance(e){this.instance=e}static postWorkerError(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Worker error: "+e,!1,F)}addCSSURLs(e){this.cssURLs.get(e)||this.cssURLs.set(e,{seq_sent:ta.getInstance().messageSequenceNum,received:!1})}searchObjectForCSSUrls(e){(function(e){const t=[];return function e(n){if(n)for(const[r,i]of Object.entries(n)){const o="href"===r,s="string"==typeof i&&!!i.length;if(o&&s){const e=i.includes(".css"),r="text/css"===n.type,o="stylesheet"===n.rel;if(e||r||o){const e=i.replace(/['"]/g,"");t.push(e)}}else"object"==typeof i&&null!==i&&e(i)}}(e),t})(e).forEach(e=>{this.addCSSURLs(e)})}checkForCSSURLs(e){3!==e.type&&2!==e.type||this.searchObjectForCSSUrls(e)}getCSSURLsNotReceived(){const{latestReceivedSeqNumber:e}=ta.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}recordUserSession(e={}){if(Ps.getInstance().isInactive||zs.getInstance().didCutVideo)return;if(this.didSetupRecorder)return;const{inlineFonts:t,ignoreIframes:n,deferProcessMutations:r,recoverCSSVariables:i}=function(){const e=A(A(Ce().njs_config).rrwebConfig);return{inlineFonts:k(e.inlineFonts,m),ignoreIframes:k(e.ignoreIframes,v),deferProcessMutations:k(e.deferProcessMutations,y),recoverCSSVariables:k(e.recoverCSSVariables,b)}}(),o=Object.assign({emit:e=>{this.handleNewRRwebEvent(e,2e3)},inlineStylesheet:!0,inlineStylesheetFonts:t,maskAllInputs:!0,maskInputFn:this.inputMaskManager.maskInputSafely.bind(this.inputMaskManager),deferProcessMutations:r,maskTextSelector:vs(),ignoreCSSAttributes:Ze,ignoreIframes:n,collectFonts:!0,blockSelector:ys(),recoverCSSVariables:i},e);Ns.setRecordingStartTime(),zs.getInstance().setDidStartVideo(),this.recordStopper=this.rrwebRecord(o),this.didSetupRecorder=!0}handleNewRRwebEvent(e,t){return pa(this,void 0,void 0,(function*(){if(Ps.getInstance().isInactive||zs.getInstance().didCutVideo)return void this.stopRecording();if(this.isRecordingStopped)return;if(e.type===la.Meta&&(this.isMetaEventReceived=!0),!this.isMetaEventReceived)return;if(e.type===la.Custom&&"unfreeze"===e.data.tag)return;if(e.type===la.IncrementalSnapshot&&e.data.source===da.Mutation||(this.pauseTimeout&&(clearTimeout(this.pauseTimeout),this.pauseTimeout=null,this.freezingEvents=!1),this.pauseTimeout=setTimeout(()=>{this.rrwebRecord.freezePage&&(this.freezingEvents=!0,this.rrwebRecord.freezePage())},t)),e.timestamp=Ls(e.timestamp),this.firstRecordedTimestamp||(this.firstRecordedTimestamp=e.timestamp),(!this.lastRecordedTimestamp||e.timestamp>this.lastRecordedTimestamp)&&(this.lastRecordedTimestamp=e.timestamp),this.firstRecordedTimestamp&&e.timestamp<this.firstRecordedTimestamp)return void Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind. Client has been disabled.",!0,V,!0);const n=yield this.packAndParseCss(e);this.handleLiveView(n),this.eventBuffer.push(n),e.type===la.IncrementalSnapshot&&(e.data.source!==da.MouseInteraction||e.data.type!==ha.Click&&e.data.type!==ha.DblClick||zs.getInstance().addVideoClick());let r=!0;if(e.type===la.IncrementalSnapshot){const e=Date.now()-this.lastFragPostTimestamp<500,t=this.eventBuffer.length<10;e&&t&&(r=!1)}r&&this.handleFragPost()}))}packAndParseCss(e){return pa(this,void 0,void 0,(function*(){let t=null;if(this.workerAgent){if((yield this.workerAgent.ready())===Js.Ready){const n=Object.assign(Object.assign({},e),{v:"v1"});try{const e=yield this.workerAgent.processRecordSnapshot(n);t=e.compressedData,e.cssUrls.forEach(e=>this.addCSSURLs(e))}catch(e){t=null}}}return null==t&&(t=this.rrwebPack(e,{level:1}),this.checkForCSSURLs(e)),t}))}handleFragPost(){if(!Ps.getInstance().isInactive&&this.didSetupRecorder&&0!==this.eventBuffer.length){try{let e=0;this.firstRecordedTimestamp&&this.lastRecordedTimestamp&&!this.invalidVideoLength&&(e=this.lastRecordedTimestamp-this.firstRecordedTimestamp);const t=Math.pow(2,32)-1;!this.invalidVideoLength&&(e<0||e>=t)&&(this.invalidVideoLength=!0,e=t),this.vfCounter+=1;const n={};n.vid=ds(this.eventBuffer),n.seq=this.vfCounter,n.len=e,n.css_urls=this.getCSSURLsNotReceived(),ta.getInstance().addEndTimeToPayload(n,!1),zs.getInstance().addVideoFragData(this.vfCounter,e);const r={};r[ye]=n,ta.getInstance().sendMessage(H,r),this.lastFragPostTimestamp=Date.now()}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("video frag socket closed with err: "+e.message,!1,V),this.stopRecording()}this.eventBuffer=[]}}unfreeze(){this.freezingEvents&&this.rrwebAddCustomEvent("unfreeze",{})}downloadIfAllowed(){if(!this.isRecordingAllowed())return this.listenRecordingAllowedEvent(),void this.listenRecordingLoadedEvent();this.download()}download(){this.listenRecordingLoadedEvent(),Es("https://cdn.noibu.com/collect-recording.js",null,e=>{Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading session recording script. "+e,!0,V)})}isRecordingAllowed(){try{const{src:e}=document.currentScript;if(new URL(e).searchParams.has("hold"))return!1}catch(e){}return!0}listenRecordingAllowedEvent(){this.isRecordingAllowedHandled||(this.isRecordingAllowedHandled=!0,this.eventListenerManager.trackEventListener(window,"noibuRecordingAllowed",()=>{this.download()}))}listenRecordingLoadedEvent(){this.isRecordingLoadedHandled||(this.isRecordingLoadedHandled=!0,this.eventListenerManager.trackEventListener(window,"noibuRecordingLoaded",e=>{this.handleRRWebLoaded(e.detail)}))}handleRRWebLoaded(e){if(e){if(this.setRRWeb(e)){const e=ta.getInstance();ca([Ko(),e.connectionPromise]).then(()=>{this.recordUserSession()})}}else Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading rrweb script",!0,V)}setRRWeb(e){return e&&e.record&&e.pack&&e.addCustomEvent?(this.rrwebRecord=e.record,this.rrwebPack=e.pack,this.rrwebAddCustomEvent=e.addCustomEvent,!0):(Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("RRweb functions not all present",!0,V),!1)}requestLiveView(){this.liveViewRecording=!0,this.rrwebRecord.takeFullSnapshot(!0)}disableLiveView(){this.liveViewRecording=!1}handleLiveView(e){this.liveViewRecording&&Ia.getInstance().sendData(e)}stopRecording(){try{this.recordStopper&&(this.isRecordingStopped=!0,this.eventBuffer=[],this.recordStopper(),this.recordStopper=null)}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error while trying to stop recording: "+e,!0,V)}}getFirstRecordedTimestamp(){return this.firstRecordedTimestamp}resetFirstRecordedTimestamp(){this.firstRecordedTimestamp=null}isLiveView(){return this.liveViewRecording}}const ga=0,ma=1,va=2;function ya(){}class ba extends class{_e=new Map;on(e,t){let n=this._e.get(e);n||this._e.set(e,n=[]),n.push(t)}emit(e,...t){const n=this._e.get(e);if(n)for(const e of n)e.apply(null,t)}}{id;connected=!1;_t;_s;_n;_i;_o;_r=[];_c;_a=!0;constructor(e,t){super(),this._t=e,this._s=Object.assign({path:"/socket.io/",reconnectionDelay:2e3},t),this._h()}_h(){this._n=new WebSocket(this._u()),this._n.onmessage=({data:e})=>this._p(e),this._n.onerror=ya,this._n.onclose=()=>this._l("transport close")}_u(){return`${this._t.replace(/^http/,"ws")}${this._s.path}?EIO=4&transport=websocket`}_p(e){if("string"==typeof e)switch(e[0]){case"0":this._d(e);break;case"1":this._l("transport close");break;case"2":this._T(),this._m("3");break;case"4":let t;try{t=function(e){let t=1;const n={type:parseInt(e.charAt(t++),10)},r=e.indexOf(",");e.substring(t,r);if(t=r+1,e.charAt(t)&&(n.data=JSON.parse(e.substring(t))),!function(e){switch(e.type){case ga:return"object"==typeof e.data;case ma:return void 0===e.data;case va:{const t=e.data;return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}default:return!1}}(n))throw new Error("invalid format");return n}(e)}catch(e){return this._l("parse error")}this._f(t);break;default:this._l("parse error")}}_d(e){let t;try{t=JSON.parse(e.substring(1))}catch(e){return this._l("parse error")}this._o=t.pingInterval+t.pingTimeout,this._T(),this._C()}_f(e){switch(e.type){case ga:this._g(e);break;case ma:this._a=!1,this._l("io server disconnect");break;case va:super.emit.apply(this,e.data);break;default:this._l("parse error")}}_g(e){this.id=e.data.sid,this.connected=!0,this._r.forEach(e=>this._y(e)),this._r.slice(0),super.emit("connect")}_l(e){this._n&&(this._n.onclose=ya,this._n.close()),clearTimeout(this._i),clearTimeout(this._c),this.connected?(this.connected=!1,this.id=void 0,super.emit("disconnect",e)):super.emit("connect_error",e),this._a&&(this._c=setTimeout(()=>this._h(),this._s.reconnectionDelay))}_T(){clearTimeout(this._i),this._i=setTimeout(()=>{this._l("ping timeout")},this._o)}_m(e){this._n.readyState===WebSocket.OPEN&&this._n.send(e)}_y(e){const t=this._s.namespace;this._m("4"+function(e){let n=""+e.type;return t&&(n+="/"+t+","),e.data&&(n+=ds(e.data)),n}(e))}_C(){this._y({type:ga})}emit(...e){const t={type:va,data:e};this.connected?this._y(t):this._r.push(t)}disconnect(){this._a=!1,this._l("io client disconnect")}}class Ia{constructor(){this.socket=null,this.throttledUpdate=null,this.idleConnectionTimer=null,this.connectionTimeout=12e4}static getInstance(){return Ia.instance||(Ia.instance=new Ia),Ia.instance}monitor(){const e=xs.getInstance();if(!e.isAvailable())return;const t=e.loadWithExpiry("noibuHC");t?(e.updateExpiry("noibuHC",12e4),this.connectToSocketIoServer(t)):Vs(window,"noibuHCAlert",e=>this.handleHelpCode(e)),Vs(window,"noibuPageVisitEvent",e=>this.sendPVEvents(e.detail.type,e.detail.eventObjects))}handleHelpCode(e){const{data:t}=e.detail;xs.getInstance().saveWithExpiry("noibuHC",t,12e4),this.connectToSocketIoServer(t)}connectToSocketIoServer(e){const{domain:t}=Ce();if(t&&(this.helpcode=e,!this.socket)){try{this.socket=function(e,t){return"string"!=typeof e&&(t=e,e=location.origin),new ba(e,t)}("https://live.noibu.com",{namespace:t,reconnectionDelay:500})}catch(e){return}try{this.throttledUpdate=To()(this.updateTTL.bind(this),6e4,{leading:!0,maxWait:6e4,trailing:!1}),this.socket.on("connect",this.errorHandler(()=>{this.socket.emit("join_as_recorder",e)})),this.socket.on("start_sending_data",this.errorHandler(e=>{this.helpcode===e&&(fa.getInstance().requestLiveView(),na.getInstance().requestLiveView(),xs.getInstance().updateExpiry("noibuHC",12e4),this.cancelConnectionDisconnectTime())})),this.socket.on("stop_sending_data",this.errorHandler(e=>{this.helpcode===e&&(fa.getInstance().disableLiveView(),na.getInstance().disableLiveView(),this.startConnectionDisconnectTimer())})),this.socket.on("user-event",this.errorHandler(()=>{})),this.startConnectionDisconnectTimer()}catch(e){this.disconnectAndCancelThrottledUpdate()}}}startConnectionDisconnectTimer(){this.cancelConnectionDisconnectTime(),this.idleConnectionTimer=setTimeout(()=>{this.disconnectAndCancelThrottledUpdate()},this.connectionTimeout)}cancelConnectionDisconnectTime(){clearTimeout(this.idleConnectionTimer),this.idleConnectionTimer=null}sendData(e){if(this.socket){try{this.socket.emit("send-event-compressed",{event:e,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}sendPVEvents(e,t){if(this.socket){try{this.socket.emit("send-njs-events",{type:e,events:t,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}updateTTL(){xs.getInstance().updateExpiry("noibuHC",12e4)}disconnectAndCancelThrottledUpdate(){try{this.socket.disconnect()}catch(e){}if(this.socket=null,this.throttledUpdate){try{this.throttledUpdate.cancel()}catch(e){}this.throttledUpdate=null}}errorHandler(e){const t=e=>{this.disconnectAndCancelThrottledUpdate()};return(...n)=>{try{const r=e.apply(this,n);r&&"function"==typeof r.catch&&r.catch(t)}catch(e){t()}}}getSocket(){return this.socket}}const wa=["password","address","credit","postal","token","phone","mobile","expir","account","email","cardnumber","lastname"],Ca=["firstname","lastname","street","fullname","creditcard","postcode","zipcode","city","town","county","cc","cardtype","cardnumber","email","nameoncard"];function Sa(e){return Ca.some(t=>e===t)||wa.some(t=>e.indexOf(t)>=0)}function ka(e){return"string"!=typeof e?null:e.length?e=function(e){return O.forEach(t=>{e=e.replace(t,"******")}),e=function(e){return e.replace(/(?<!\d)(?<!:\s*)(\+1\s?)?(\(?\d{3}\)?)[\s.-]?(\d{3})[\s.-]?(\d{4})\b/g,e=>{const t=e.replace(/\D/g,"");return e.includes("+1")&&11===t.length||!e.includes("+1")&&10===t.length?"******":e})}(e)}(e=function(e){const t=e[0];if(!("{"===t||"["===t))return e;let n=!1;try{const t=JSON.parse(e);return((e,t,n={depth:10})=>{const r=(e,i)=>{if(!(i>n.depth))for(const n in e)try{const o=t(e,n,e[n]);void 0!==o&&(e[n]=o),null!==e[n]&&"object"==typeof e[n]&&r(e[n],i+1)}catch(e){}};r(e,1)})(t,(e,t)=>{if("string"!=typeof t)return;return Sa(t.toLowerCase())?(n=!0,"******"):void 0}),n?ds(t):e}catch(t){return e}}(e)):e}class Ea{static getInstance(){return this.instance||(this.instance=new Ea)}constructor(){this.contexts=new Map;this.register(ce,0),this.register(ge,0),this.register(me,0),this.register(ue,500),this.register(le,500),this.register(X,500),this.register(de,500),this.register(ae,500,ie),this.register(he,5)}register(e,t,n=e){const r={eventName:n,period:t,timeout:null,events:[]};this.contexts.set(e,r)}addEvent(e,t,n=Date.now()){const r=new Date(n).toISOString(),i=this.contexts.get(t);i.events.push({event:e,occurredAt:r}),this.debounce(i)}debounce(e){const{timeout:t,period:n}=e;window.clearTimeout(t),e.timeout=window.setTimeout(()=>this.flush(e),n)}flushAll(){for(const e of this.contexts.values())this.flush(e)}flush(e){window.clearTimeout(e.timeout),e.timeout=null;const t=e.events.splice(0);if(t.length){na.getInstance().addPageVisitEvents(t,e.eventName)}}}Ea.instance=null;const _a={product_added_to_cart:"product_added_to_cart",product_removed_from_cart:"product_removed_from_cart",checkout_started:"checkout_started",checkout_address_info_submitted:"checkout_address_info_submitted",checkout_contact_info_submitted:"checkout_contact_info_submitted",checkout_shipping_info_submitted:"checkout_shipping_info_submitted",payment_info_submitted:"payment_info_submitted",checkout_completed:"checkout_completed",search_submitted:"search_submitted",collection_viewed:"collection_viewed",product_viewed:"product_viewed",cart_viewed:"cart_viewed"};function Aa(e,t,n,r,i,o){if(Ta(t)&&(t=Ra(t),null==e))return;if("boolean"===t)return void("boolean"!=typeof e&&r.push(`boolean is expected [${n}]`));if("number"===t)return void("number"!=typeof e&&r.push(`number is expected [${n}]`));if("string"===t)return void("string"!=typeof e&&r.push(`string is expected [${n}]`));if("object"!=typeof e)return void r.push(`${t} is expected [${n}]`);if(null===e)return void r.push(`${t} is expected [${n}]`);if(Ma(t)){const s=function(e){Ta(e)&&(e=Ra(e));return e.replace("[]","")}(t);if(Array.isArray(e))for(let t=0;t<e.length;t++){Aa(e[t],s,[...n,`[${t}]`],r,i,o)}else r.push(`array is expected [${n}]`);return}const s=i.get(t);if(void 0===s)return void r.push(`schema "${t}" not found [${n}]`);const a=s.properties.map(e=>e.key);for(const t of Object.keys(e))a.includes(t)||(o.autoRemoveUnexpectedProperties?delete e[t]:r.push(`property "${t}" is not expected [${n}]`));for(const t of s.properties){if(!(t.key in e)){const i=Ta(t.type),s=Ma(t.type),a=xa(t.type),c=o.ignoreMissedNullableProperties,l=o.autoAddMissedNullableProperties,u=o.autoFixMissedNullableProperties;if(i&&c)continue;if(i&&l){e[t.key]=null;continue}if(!i||!u){r.push(`${t.type} is expected [${[...n,t.key]}]`);continue}if(a||s){e[t.key]=null;continue}e[t.key]={}}Aa(e[t.key],t.type,[...n,t.key],r,i,o)}}function Ta(e){return e.endsWith("?")}function Ra(e){return e.replace("?","")}function Ma(e){return Ta(e)&&(e=Ra(e)),e.endsWith("[]")}function xa(e){return Ta(e)&&(e=Ra(e)),"boolean"===e||"number"===e||"string"===e}const Na=new Map(Object.entries({Money:{properties:[{key:"amount",type:"number?"},{key:"currencyCode",type:"string?"}]},DeliveryOption:{properties:[{key:"cost",type:"Money?"},{key:"costAfterDiscounts",type:"Money?"},{key:"description",type:"string?"},{key:"handle",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"}]},Delivery:{properties:[{key:"selectedDeliveryOptions",type:"DeliveryOption[]?"}]},Product:{properties:[{key:"id",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"},{key:"type",type:"string?"},{key:"url",type:"string?"},{key:"vendor",type:"string?"}]},ProductVariant:{properties:[{key:"id",type:"string?"},{key:"price",type:"Money?"},{key:"product",type:"Product?"},{key:"sku",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"}]},DiscountApplication:{properties:[{key:"allocationMethod",type:"string?"},{key:"targetSelection",type:"string?"},{key:"targetType",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"},{key:"value",type:"Money?"}]},DiscountAllocation:{properties:[{key:"amount",type:"Money?"},{key:"discountApplication",type:"DiscountApplication?"}]},SellingPlan:{properties:[{key:"id",type:"string?"},{key:"name",type:"string?"}]},SellingPlanAllocation:{properties:[{key:"sellingPlan",type:"SellingPlan?"}]},OrderCustomer:{properties:[{key:"id",type:"string?"},{key:"isFirstOrder",type:"boolean?"}]},Order:{properties:[{key:"id",type:"string?"},{key:"customer",type:"OrderCustomer?"}]},ShippingRate:{properties:[{key:"price",type:"Money?"}]},TransactionPaymentMethod:{properties:[{key:"name",type:"string?"},{key:"type",type:"string?"}]},Transaction:{properties:[{key:"amount",type:"Money?"},{key:"gateway",type:"string?"},{key:"paymentMethod",type:"TransactionPaymentMethod?"}]},CartLineCost:{properties:[{key:"totalAmount",type:"Money?"}]},CartLine:{properties:[{key:"cost",type:"CartLineCost?"},{key:"merchandise",type:"ProductVariant?"},{key:"quantity",type:"number?"}]},CheckoutLineItem:{properties:[{key:"discountAllocations",type:"DiscountAllocation[]?"},{key:"finalLinePrice",type:"Money?"},{key:"id",type:"string?"},{key:"quantity",type:"number?"},{key:"sellingPlanAllocation",type:"SellingPlanAllocation?"},{key:"title",type:"string?"},{key:"variant",type:"ProductVariant?"}]},Checkout:{properties:[{key:"buyerAcceptsEmailMarketing",type:"boolean?"},{key:"buyerAcceptsSmsMarketing",type:"boolean?"},{key:"currencyCode",type:"string?"},{key:"delivery",type:"Delivery?"},{key:"discountApplications",type:"DiscountApplication[]?"},{key:"discountsAmount",type:"Money?"},{key:"token",type:"string?"},{key:"lineItems",type:"CheckoutLineItem[]?"},{key:"order",type:"Order?"},{key:"shippingLine",type:"ShippingRate?"},{key:"subtotalPrice",type:"Money?"},{key:"totalPrice",type:"Money?"},{key:"totalTax",type:"Money?"},{key:"transactions",type:"Transaction[]?"}]},ProductAddedToCart:{properties:[{key:"cartLine",type:"CartLine?"}]},ProductRemovedFromCart:{properties:[{key:"cartLine",type:"CartLine?"}]},CheckoutStarted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutAddressInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutContactInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutShippingInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},PaymentInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutCompleted:{properties:[{key:"checkout",type:"Checkout?"}]},Collection:{properties:[{key:"id",type:"string?"},{key:"title",type:"string?"},{key:"productVariants",type:"ProductVariant[]?"}]},Cart:{properties:[{key:"id",type:"string?"},{key:"lines",type:"CartLine[]?"},{key:"cost",type:"CartLineCost?"},{key:"totalQuantity",type:"number?"}]},SearchResult:{properties:[{key:"query",type:"string?"},{key:"productVariants",type:"ProductVariant[]?"}]},SearchSubmitted:{properties:[{key:"searchResult",type:"SearchResult?"}]},CollectionViewed:{properties:[{key:"collection",type:"Collection?"}]},ProductViewed:{properties:[{key:"productVariant",type:"ProductVariant?"}]},CartViewed:{properties:[{key:"cart",type:"Cart?"}]}})),La={"input.noibu.com":!0,"input.staging.noibu.com":!0,"vf.noibu.com":!0,"vf.staging.noibu.com":!0,"cdn.noibu.com":!0};function Oa(e,t=!0){return{url:Cs(e.filename),[j]:ee,j_err:cs(e.error,t)}}function Da(e,t,n){var r;let i=t;(null===(r=null==t?void 0:t.error)||void 0===r?void 0:r.originalError)&&(i=t.error.originalError);let o,s=e;switch(e){case Ne:o=function(e,t){const n={url:Cs(e.responseURL,!0),[j]:Q,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case Le:o=Oa(i);break;case Pe:o=function(e,t){const n={url:Cs(e.url,!0),[j]:Q,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"GQLError":s=Pe,o=function(e,t){const n={url:ss(),[j]:te,gql_err:e};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"CSPError":s=Le,a=i,o={url:ss(),[j]:ne,csp_err:a};break;case"ImageError":s=Le,o=function(e){return{url:ss(),[j]:re,res_err:e}}(i);break;case Ve:o=function(e){return{url:ss(),[j]:pe,pagecheck_err:e}}(i);break;case Fe:o=Oa(i,!1);break;case Ue:o=Oa(i);break;case Be:o=function(e){return{url:ss(),[j]:ee,j_err:cs(e)}}(i);break;case Oe:case He:o=Oa(i);break;default:try{o=Oa(i),i instanceof Event&&(!function(e,t,n){let r=null;if(n.detail)try{r=ds(n.detail)}catch(e){r="non-serializable"}let i=`Fire error event of type ${e}.`;null!=r&&(i+=` Detail: ${r}.`),t.j_err.msg=ts(i)}(s,o,i),s=Le)}catch(e){return null}}var a;return o&&(o.err_src=s),o}const Pa=is(as(Fo((new Error).stack)).pop().file);function Va(e,t,n,r){if(e===De)return;const i=Da(e,t,n);if(!i||!i.url)return;const o=i.url;if(bs(o)){const e=new URL(o);if(e.hostname in La||!e.protocol.startsWith("http"))return}if(function(e){const t=ds(e);return tt.some(e=>e(t))}(i))return;(function(e){if(e[j]===ee){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")&&is(n)===Pa&&!r.includes("nbuwrapper")&&!n.includes("noibu-customer-session-playback"))return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,V),!0}}if(e.msg){const t=e.msg.toLowerCase();if(t.includes("input.noibu")||t.includes("input.b.noibu"))return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,V),!0}}else if(e[j]===Q&&e.url){const t=e.url;if("string"==typeof t)for(let n=0;n<Se.length;n+=1){const r=Se[n];if(t.includes(r))return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,V),!0}}return!1})(i)||(zs.getInstance().addError(),Ea.getInstance().addEvent(i,le,r))}class Fa{static configure(e){return this.allowUntrustedEvents=e,this.initialRequest=!1,this.instance||(this.instance=new Fa),this.instance}static getInstance(){if(!this.instance)throw new Error("HelpCode was not configured");return this.instance}constructor(){this.requestContext=null,_s()&&(Vs(window,"hashchange",e=>this._handleHashChange(e)),Vs(window,"noibuHelpCode",e=>this._receiveHelpCode(e)))}requestHelpCode(e=!0,t=!1){if(null!=this.requestContext)return this.requestContext.promise;const n={alertUser:e,enableLiveView:t,resolve:null,reject:null,promise:null};n.promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),this.requestContext=n;return!1===this._sendRequest()?(this.requestContext=null,Promise.reject(new Error("noibu connection is unavailable"))):this.requestContext.promise}checkInitialRequest(){ss().toLowerCase().includes("#helpcode")&&!1===Fa.initialRequest&&(Fa.initialRequest=!0,this._sendRequest())}_handleHashChange(e){if(!e.isTrusted&&!Fa.allowUntrustedEvents)return;!e.oldURL.toLowerCase().includes("#helpcode")&&e.newURL.toLowerCase().includes("#helpcode")&&(window.history.back(),this._sendRequest())}_receiveHelpCode(e){if(null==this.requestContext)return void this._presentHelpCode(e);const t=this.requestContext;this.requestContext=null;const{success:n,data:r}=e.detail;!0===t.alertUser?this._presentHelpCode(e):n&&!0===t.enableLiveView&&this._dispatchHelpCodeAlerted(r),n?t.resolve(r):t.reject(new Error(r))}_presentHelpCode(e){const{success:t,data:n}=e.detail;if(t)window.prompt("",n),this._dispatchHelpCodeAlerted(n);else{const e="Noibu help code is not available due to "+n;window.alert(e),Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,V)}}_dispatchHelpCodeAlerted(e){const t=new CustomEvent("noibuHCAlert",{detail:{data:e}});window.dispatchEvent(t)}_sendRequest(){return ta.getInstance().sendMessage(J,{[J]:Y})}}class Ua{constructor(){this.customIDs={},this.customErrorsCount=0,this.internalCustomIDs={},this.TOO_MANY_IDS_ADDED_MSG="TOO_MANY_IDS_ADDED",this.ID_NAME_ALREADY_ADDED_MSG="ID_NAME_ALREADY_ADDED",this.NAME_TOO_LONG_MSG="NAME_TOO_LONG",this.VALUE_TOO_LONG_MSG="VALUE_TOO_LONG",this.INVALID_NAME_TYPE_MSG="INVALID_NAME_TYPE",this.INVALID_VALUE_TYPE_MSG="INVALID_VALUE_TYPE",this.NAME_HAS_NO_LENGTH_MSG="NAME_HAS_NO_LENGTH",this.VALUE_HAS_NO_LENGTH_MSG="VALUE_HAS_NO_LENGTH",this.SUCCESS_MSG="SUCCESS",this.ERROR_HAS_NO_MSG_MSG="ERROR_HAS_NO_MSG",this.ERROR_HAS_NO_STACK_MSG="ERROR_HAS_NO_STACK",this.NULL_CUSTOM_ERR_MSG="NULL_CUSTOM_ERROR",this.ERROR_ALREADY_RECEIVED_MSG="ERROR_ALREADY_RECEIVED",this.INVALID_ERROR_SOURCE_MSG="INVALID_ERROR_SOURCE_MSG",this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG="TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT"}static getInstance(){return this.instance||(this.instance=new Ua),this.instance}exposeFunctions(){const e=this._getSDKWindowObject();window.NOIBUJS=e,this._installGlobalTrack(),window.dispatchEvent(new CustomEvent("noibuSDKReady"))}_installGlobalTrack(){try{const e=window.noibuTrack;if("function"!=typeof e)return;const t=e.q,n=Array.isArray(t)?t:[];window.noibuTrack=(...e)=>this._track(...e);for(const e of n)try{this._track(...e)}catch{}}catch{}}_track(...e){const t=qa(...e);return t&&!t.success&&Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Ecommerce track failed: "+t.errors.join(", "),!1,V),t}_getSDKWindowObject(){const e={requestHelpCode:this.requestHelpCode.bind(this),pageVisitId:this.pageVisitId.bind(this),addCustomAttribute:this.addCustomAttribute.bind(this),addError:this.addCustomError.bind(this),addJsSdkError:this._addErrorFromJSSdk.bind(this),noibuBrowserID:this.noibuBrowserID.bind(this),sessionId:this.sessionId.bind(this),resetSession:this.resetSession.bind(this),track:this._track.bind(this)};return document.getElementById("njs-helper-extension-indicator")&&(e.pageGroups=this.getPageGroups.bind(this),e.customAttributes=this.getCustomAttributes.bind(this)),e}_validateCustomError(e){return e?e.message?e.stack?this.SUCCESS_MSG:this.ERROR_HAS_NO_STACK_MSG:this.ERROR_HAS_NO_MSG_MSG:this.NULL_CUSTOM_ERR_MSG}_validateAndSetCustomError(e){if(this.customErrorsCount>=500)return this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG;const t=this._validateCustomError(e);return t!==this.SUCCESS_MSG?t:(this.customErrorsCount+=1,this.SUCCESS_MSG)}_addErrorFromJSSdk(e,t){const n=this._validateAndSetCustomError(e);return n!==this.SUCCESS_MSG?n:t!==qe&&t!==We?this.INVALID_ERROR_SOURCE_MSG:(Va(t,{error:e}),n)}addCustomError(e){const t=this._validateAndSetCustomError(e);return t!==this.SUCCESS_MSG||Va(He,{error:e}),t}addCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!1)}addNoibuInternalCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!0)}addCustomAttributeInternal(e,t,n){let r=this.customIDs;if(n&&(r=this.internalCustomIDs),zs.getInstance().addCustomAttributeTotalCount(),!n&&Object.keys(r).length>=50)return zs.getInstance().addCustomAttributeFailCount(),this.TOO_MANY_IDS_ADDED_MSG;const i=this._validateCustomIDInput(e,t);if(i!==this.SUCCESS_MSG)return zs.getInstance().addCustomAttributeFailCount(),i;if(e in r)return zs.getInstance().addCustomAttributeFailCount(),this.ID_NAME_ALREADY_ADDED_MSG;if(r[e]=t,ta.getInstance().sendMessage(q,{[be]:{id_name:e,id_val:t}}),!n){const e=Object.keys(r).length;zs.getInstance().setCustomAttributeKeyCount(e)}return this.SUCCESS_MSG}_validateCustomIDInput(e,t){return"string"!=typeof e?this.INVALID_NAME_TYPE_MSG:"string"!=typeof t?this.INVALID_VALUE_TYPE_MSG:t.length>500?this.VALUE_TOO_LONG_MSG:e.length>100?this.NAME_TOO_LONG_MSG:0===t.length?this.VALUE_HAS_NO_LENGTH_MSG:0===e.length?this.NAME_HAS_NO_LENGTH_MSG:this.SUCCESS_MSG}requestHelpCode(e=!0,t=!1){return Fa.getInstance().requestHelpCode(e,t)}noibuBrowserID(){return Ps.getInstance().browserId}pageVisitId(){return Ps.getInstance().pageVisitId}sessionId(){return Ps.getInstance().sessionId}resetSession(){Ps.getInstance().scheduleResetClientConfig()}getPageGroups(){return $s()}getCustomAttributes(){return{...this.customIDs,...this.internalCustomIDs}}}function Ba(e,t){try{Ua.getInstance().addNoibuInternalCustomAttribute(e,t)}catch(e){}}function Ha(e,t,n){"string"==typeof n&&n.length>0&&e.push({name:t,value:n})}function qa(e,t){const n={success:!0,errors:[]};if("string"!=typeof e)return n.success=!1,n.errors.push("Event name must be a string."),n;if(null!==t&&"object"!=typeof t)return n.success=!1,n.errors.push("Event payload must be an object or null."),n;const r=e in _a,i=r?"noibu":"custom",o=null!==t;if(o){try{r?function(e,t,n){const r={ignoreMissedNullableProperties:!0,autoFixMissedNullableProperties:!1,autoAddMissedNullableProperties:!1,autoRemoveUnexpectedProperties:!0};switch(e){case _a.product_added_to_cart:!function(e,t,n){Aa(e,"ProductAddedToCart",[],n.errors,Na,t)}(t,r,n);break;case _a.product_removed_from_cart:!function(e,t,n){Aa(e,"ProductRemovedFromCart",[],n.errors,Na,t)}(t,r,n);break;case _a.checkout_started:!function(e,t,n){Aa(e,"CheckoutStarted",[],n.errors,Na,t)}(t,r,n);break;case _a.checkout_address_info_submitted:!function(e,t,n){Aa(e,"CheckoutAddressInfoSubmitted",[],n.errors,Na,t)}(t,r,n);break;case _a.checkout_contact_info_submitted:!function(e,t,n){Aa(e,"CheckoutContactInfoSubmitted",[],n.errors,Na,t)}(t,r,n);break;case _a.checkout_shipping_info_submitted:!function(e,t,n){Aa(e,"CheckoutShippingInfoSubmitted",[],n.errors,Na,t)}(t,r,n);break;case _a.payment_info_submitted:!function(e,t,n){Aa(e,"PaymentInfoSubmitted",[],n.errors,Na,t)}(t,r,n);break;case _a.checkout_completed:!function(e,t,n){Aa(e,"CheckoutCompleted",[],n.errors,Na,t)}(t,r,n);break;case _a.search_submitted:!function(e,t,n){Aa(e,"SearchSubmitted",[],n.errors,Na,t)}(t,r,n);break;case _a.collection_viewed:!function(e,t,n){Aa(e,"CollectionViewed",[],n.errors,Na,t)}(t,r,n);break;case _a.product_viewed:!function(e,t,n){Aa(e,"ProductViewed",[],n.errors,Na,t)}(t,r,n);break;case _a.cart_viewed:!function(e,t,n){Aa(e,"CartViewed",[],n.errors,Na,t)}(t,r,n);break;default:n.errors.push(`Event name "${e}" is not supported.`)}}(e,t,n):function(e,t,n){e.length>500&&n.errors.push("Event name must not exceed 500 characters.");let r=null;try{r=JSON.stringify(t)}catch(e){n.errors.push("Event payload is not JSON-serializable.")}"string"==typeof r&&r.length>1e4&&n.errors.push("Event payload must not exceed 10,000 characters.")}(e,t,n)}catch(e){n.errors.push("Unexpected error: "+e)}if(n.errors.length&&(n.success=!1),!n.success)return n}const s={platform:i,name:e,data:o?ds(t):null};if(Ea.getInstance().addEvent(s,he),r&&o)try{for(const e of function(e){var t,n,r;const i=[];if(!e||"object"!=typeof e)return i;const{checkout:o}=e;o&&(Ha(i,"orderId",null===(t=o.order)||void 0===t?void 0:t.id),Ha(i,"customerId",null===(r=null===(n=o.order)||void 0===n?void 0:n.customer)||void 0===r?void 0:r.id));const{cart:s}=e;return s&&Ha(i,"cartId",s.id),i}(t))Ba(e.name,e.value)}catch(e){}return n}function Wa(e,t,n){const r=n.get(e);if(!r)return{success:!1,errors:["Converter is not implemented."]};let i;try{i=r(t)}catch(e){return{success:!1,errors:["Converter error: "+e]}}const o={success:!0,errors:[]};for(const t of i)try{const n=qa(e,t);n.success||(o.success=!1,o.errors.push(...n.errors))}catch(e){o.success=!1,o.errors.push("Unexpected error: "+e)}return o}const ja=e=>[e],Ga=new Map;Ga.set(_a.product_added_to_cart,ja),Ga.set(_a.product_removed_from_cart,ja),Ga.set(_a.checkout_started,ja),Ga.set(_a.checkout_address_info_submitted,ja),Ga.set(_a.checkout_contact_info_submitted,ja),Ga.set(_a.checkout_shipping_info_submitted,ja),Ga.set(_a.payment_info_submitted,ja),Ga.set(_a.checkout_completed,ja),Ga.set(_a.search_submitted,ja),Ga.set(_a.collection_viewed,ja),Ga.set(_a.product_viewed,ja),Ga.set(_a.cart_viewed,ja);class $a{static getInstance(){return this.instance||(this.instance=new $a)}constructor(){this.known=!1;const e=Ce(),t=null==e?void 0:e.ecomm_workflow;this.strategy=t||za.Default}acknowledgePlatform(){!1===this.known&&this.saveKnownFlag(),this.known=!0}isPlatform(){return!!this.known||(this.known="Shopify"in window||"bodlEvents"in window||"magentoStorefrontEvents"in window,this.known?(this.saveKnownFlag(),!0):(this.known=null!==this.loadKnownFlag(),this.known))}shouldIgnoreFunnelStepConfig(){switch(this.strategy){case za.UsePlatformOnly:case za.UseCustomOnly:return!0;case za.UseFunnelConfigOnly:return!1;case za.Default:default:return this.isPlatform()}}saveKnownFlag(){try{localStorage.setItem("n_platform","1")}catch(e){}}loadKnownFlag(){try{return localStorage.getItem("n_platform")}catch(e){return null}}}var za;$a.instance=null,function(e){e[e.Default=0]="Default",e[e.UsePlatformOnly=1]="UsePlatformOnly",e[e.UseCustomOnly=2]="UseCustomOnly",e[e.UseFunnelConfigOnly=3]="UseFunnelConfigOnly"}(za||(za={}));let Za=!1,Ka=null;class Ya{constructor(){this.eventDebouncer=Ea.getInstance(),this.inputManager=Ua.getInstance()}static getInstance(){return this.instance||(this.instance=new Ya),this.instance}monitor(){!function(){if(!Za){Za=!0;try{const e=localStorage.getItem("NRBA_SESSION");e&&(Ka=JSON.parse(e),Ua.getInstance().addNoibuInternalCustomAttribute("newrelic-session-id",Ka.value))}catch(e){}}}(),window.addEventListener("message",e=>{if(e.data)if("noibuShopifyEvent"===e.data.type){if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}this.handleStandardEvent(e.data.payload,null)}else if("noibuShopifyEventWithName"===e.data.type){if(!e.data.payload)return;if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}"StandardEvent"===e.data.payload.type?this.handleStandardEvent(e.data.payload.data,e.data.payload.extra):"CustomEvent"===e.data.payload.type?this.handleCustomEvent(e.data.payload.data):"DomEvent"===e.data.payload.type&&this.handleDomEvent(e.data.payload.data)}}),this.notifyPixels()}notifyPixels(){document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow.postMessage("ping","*")}catch(e){}})}handleStandardEvent(e,t){$a.getInstance().acknowledgePlatform();let{data:n}=e;"page_viewed"===e.name&&(n={location:e.context.window.location.href,title:e.context.document.title},this.inputManager.addCustomAttributeInternal("clientId",e.clientId,!0),(null==t?void 0:t.cartId)&&this.inputManager.addCustomAttributeInternal("cartId",t.cartId,!0),(null==t?void 0:t.customerId)&&this.inputManager.addCustomAttributeInternal("customerId",t.customerId,!0));const r=function(){var e;return null!==(e=null==Ka?void 0:Ka.value)&&void 0!==e?e:null}();r&&(n.newRelicSessionId=r);const i={platform:"shopify",name:e.name,data:ds(n)};this.eventDebouncer.addEvent(i,he),Wa(e.name,n,Ga)}handleCustomEvent(e){const{customData:t}=e,n={platform:"shopify",name:e.name,data:ka(ds(t))};this.eventDebouncer.addEvent(n,he)}handleDomEvent(e){const{data:t}=e,n={platform:"shopify",name:e.name,data:ds(t)};this.eventDebouncer.addEvent(n,he)}}Ya.instance=null;const Ja=new Map;function Qa(e){const t=[];for(const n of e.line_items){const r={cartLine:{quantity:n.quantity,cost:{totalAmount:{amount:e.product_value,currencyCode:e.currency}},merchandise:ec(n)}};t.push(r)}return t}function Xa(e){const t={currencyCode:e.currency,totalPrice:{amount:e.cart_value,currencyCode:e.currency},lineItems:e.line_items.map(e=>({quantity:e.quantity,title:e.product_name,finalLinePrice:{amount:e.purchase_price,currencyCode:e.currency},variant:ec(e)}))},{coupon_codes:n}=e;return Array.isArray(n)&&(t.discountApplications=n.map(e=>({title:e}))),e.order_id&&(t.order={id:""+e.order_id}),{checkout:t}}function ec(e){var t,n;const r=null!==(n=null!==(t=e.base_price)&&void 0!==t?t:e.purchase_price)&&void 0!==n?n:e.sale_price;return{id:""+e.variant_id,sku:e.sku,price:r?{amount:r,currencyCode:e.currency}:void 0,product:{id:""+e.product_id,title:e.product_name}}}Ja.set(_a.product_added_to_cart,(function(e){return Qa(e)})),Ja.set(_a.product_removed_from_cart,(function(e){return Qa(e)})),Ja.set(_a.checkout_started,(function(e){return[Xa(e)]})),Ja.set(_a.checkout_shipping_info_submitted,(function(e){return[Xa(e)]})),Ja.set(_a.payment_info_submitted,(function(e){return[Xa(e)]})),Ja.set(_a.checkout_completed,(function(e){return[Xa(e)]})),Ja.set(_a.search_submitted,(function(e){if(!e.search_keyword)return[];return[{searchResult:{query:e.search_keyword}}]})),Ja.set(_a.collection_viewed,(function(e){var t;if(!e.category_id&&!e.category_name&&!e.line_items)return[];return[{collection:{id:""+e.category_id,title:e.category_name,productVariants:null===(t=e.line_items)||void 0===t?void 0:t.map(e=>ec(e))}}]})),Ja.set(_a.product_viewed,(function(e){if(!e.line_items||0===e.line_items.length)return[];return e.line_items.map(e=>({productVariant:ec(e)}))})),Ja.set(_a.cart_viewed,(function(e){var t;if(!(e.event_id||e.cart_value||e.line_items&&0!==e.line_items.length))return[];return[{cart:{id:""+e.event_id,cost:e.cart_value?{totalAmount:{amount:e.cart_value,currencyCode:e.currency}}:void 0,lines:null===(t=e.line_items)||void 0===t?void 0:t.map(e=>({quantity:e.quantity,cost:{totalAmount:{amount:e.purchase_price,currencyCode:e.currency}},merchandise:ec(e)}))}}]}));class tc{constructor(){this.eventDebouncer=Ea.getInstance()}static getInstance(){return this.instance||(this.instance=new tc)}monitor(){const e=this.subscribeEvents.bind(this);Vs(window,"load",e,!1)}subscribeEvents(){const e=window.bodlEvents;if(!e)return;$a.getInstance().acknowledgePlatform();const{banner:t,product:n,cart:r,checkout:i}=e,o=(e,t,n)=>{if("object"==typeof e&&"function"==typeof e[t]){const r=e=>this.handleEvent(n,e);e[t](r)}};o(t,"viewed","banner_viewed"),o(n,"searchPerformed","search_submitted"),o(n,"pageViewed","product_viewed"),o(n,"categoryViewed","collection_viewed"),o(r,"viewed","cart_viewed"),o(r,"addItem","product_added_to_cart"),o(r,"removeItem","product_removed_from_cart"),o(i,"checkoutBegin","checkout_started"),o(i,"shippingDetailsProvided","checkout_shipping_info_submitted"),o(i,"paymentDetailsProvided","payment_info_submitted"),o(i,"orderPurchased","checkout_completed")}handleEvent(e,t){const n={name:e,platform:"bigcommerce",data:ds(t)};this.eventDebouncer.addEvent(n,he),function(e,t){Wa(e,t,Ja)}(e,t)}}tc.instance=null;const nc=new Map;function rc(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,changedProductsContext:r}=t,i=r.items,o=n.storeViewCurrencyCode,s=[];for(const e of i){const{product:t}=e,n={cartLine:{quantity:sc(e.quantity),cost:{totalAmount:{amount:e.prices.price.value,currencyCode:o}},merchandise:{id:""+t.productId,title:t.name,sku:t.sku}}};s.push(n)}return s}function ic(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,shoppingCartContext:r}=t,{items:i}=r,o=n.storeViewCurrencyCode,s=[];if(Array.isArray(i))for(const e of i){const t={id:""+e.id,quantity:sc(e.quantity),variant:oc(e,o)};s.push(t)}const a={checkout:{currencyCode:o,lineItems:s}},{orderContext:c}=t;if(c){const e=ac(c.grandTotal);"number"==typeof e&&(a.checkout.totalPrice={amount:e,currencyCode:o}),c.orderId&&(a.checkout.order={id:""+c.orderId})}return a}function oc(e,t){const{product:n}=e,r={id:""+n.productId,sku:n.sku,title:n.name},{pricing:i}=n;if(i){const e=ac(i.regularPrice);"number"==typeof e&&(r.price={amount:e,currencyCode:t})}return r}function sc(e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}function ac(e){const t=parseFloat(e);return Number.isNaN(t)?null:t}nc.set(_a.product_added_to_cart,(function(e){return rc(e)})),nc.set(_a.product_removed_from_cart,(function(e){return rc(e)})),nc.set(_a.checkout_started,(function(e){return[ic(e)]})),nc.set(_a.checkout_completed,(function(e){return[ic(e)]})),nc.set(_a.search_submitted,(function(e){var t,n,r;const{eventInfo:i}=e,o=null===(r=null===(n=null===(t=null==i?void 0:i.searchInputContext)||void 0===t?void 0:t.units)||void 0===n?void 0:n[0])||void 0===r?void 0:r.phrase;if(!o)return[];return[{searchResult:{query:o}}]})),nc.set(_a.product_viewed,(function(e){var t;const{eventInfo:n}=e,{storefrontInstanceContext:r,productContext:i}=n||{};if(!i)return[];const o=null==r?void 0:r.storeViewCurrencyCode;return[{productVariant:{id:""+i.productId,sku:i.sku,price:(null===(t=i.pricing)||void 0===t?void 0:t.regularPrice)?{amount:i.pricing.regularPrice,currencyCode:o}:void 0,product:{id:""+i.productId,title:i.name}}}]})),nc.set(_a.cart_viewed,(function(e){var t,n,r,i,o,s,a;const{eventInfo:c}=e,{storefrontInstanceContext:l,shoppingCartContext:u}=c||{},{items:d}=u||{};if(!(u&&(u.cartId||u.id||u.cartValue||(null===(n=null===(t=u.prices)||void 0===t?void 0:t.subtotalIncludingTax)||void 0===n?void 0:n.value)||d&&0!==d.length)))return[];const h=(null==l?void 0:l.storeViewCurrencyCode)||(null===(o=null===(i=null===(r=null==d?void 0:d[0])||void 0===r?void 0:r.prices)||void 0===i?void 0:i.price)||void 0===o?void 0:o.currency),p=(null==u?void 0:u.cartId)||(null==u?void 0:u.id),f=(null==u?void 0:u.cartValue)||(null===(a=null===(s=null==u?void 0:u.prices)||void 0===s?void 0:s.subtotalIncludingTax)||void 0===a?void 0:a.value);return[{cart:{id:p,lines:null==d?void 0:d.map(e=>{var t,n,r,i,o,s;return{quantity:sc(e.quantity),cost:{totalAmount:{amount:null===(n=null===(t=e.prices)||void 0===t?void 0:t.price)||void 0===n?void 0:n.value,currencyCode:(null===(i=null===(r=e.prices)||void 0===r?void 0:r.price)||void 0===i?void 0:i.currency)||h}},merchandise:oc(e,(null===(s=null===(o=e.prices)||void 0===o?void 0:o.price)||void 0===s?void 0:s.currency)||h)}}),cost:f?{totalAmount:{amount:f,currencyCode:h}}:void 0,totalQuantity:null==u?void 0:u.totalQuantity}}]}));class cc{constructor(){this.clientConfig=Ps.getInstance(),this.eventDebouncer=Ea.getInstance()}static getInstance(){return this.instance||(this.instance=new cc)}monitor(){const e=()=>!!window.magentoStorefrontEvents&&!!window.magentoStorefrontEvents.subscribe;if(e())return void this.subscribeEvents();let t=0;const n=setInterval(()=>{t+=1,t>5&&clearInterval(n),e()&&(clearInterval(n),this.subscribeEvents())},1e3)}subscribeEvents(){$a.getInstance().acknowledgePlatform();try{const{subscribe:e}=window.magentoStorefrontEvents,t=this.handleEvent.bind(this);e.pageView(e=>t("page_viewed",e)),e.addToCart(e=>t("product_added_to_cart",e)),e.removeFromCart(e=>t("product_removed_from_cart",e)),e.initiateCheckout(e=>t("checkout_started",e)),e.placeOrder(e=>t("checkout_completed",e)),e.searchRequestSent(e=>t("search_submitted",e)),e.productPageView(e=>t("product_viewed",e)),e.shoppingCartView(e=>t("cart_viewed",e))}catch(e){const t="MagentoEventMonitor: "+e;this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,V)}}handleEvent(e,t){const n={name:e,platform:"magento",data:ds(t)};this.eventDebouncer.addEvent(n,he),function(e,t){Wa(e,t,nc)}(e,t)}}cc.instance=null;class lc{constructor(e,t){this.step=e,this.pattern=t}}class uc extends lc{constructor(e,t){super(e,t),this.regexp=new RegExp(this.pattern,"i")}match(e){const{url:t}=e;return this.regexp.test(t)}}class dc extends lc{constructor(e,t){super(e,t),this.prefix=null;const n=t[0];(n===gc||n===mc||n===vc)&&(this.prefix=n,t=t.substring(1),n===vc&&(t=t.replace(yc,""))),this.regexp=new RegExp(t,"i")}match(e){const{id:t,className:n,tagName:r,text:i}=e;return"p"!==r&&(this.prefix===gc?this.regexp.test(t):this.prefix===mc?this.regexp.test(n):this.prefix===vc?this.regexp.test(r):!(i.length>=fc)&&this.regexp.test(i))}}class hc extends lc{constructor(e,t,n){super(e,t),this.regexp=new RegExp(this.pattern,"i"),this.method=n}match(e){return e.method===this.method&&this.regexp.test(e.url)}}var pc;!function(e){e[e.AddToCart=1]="AddToCart",e[e.CheckoutStarted=2]="CheckoutStarted",e[e.PlaceOrder=3]="PlaceOrder",e[e.CheckoutSuccess=4]="CheckoutSuccess"}(pc||(pc={}));const fc=40,gc="#",mc=".",vc="<",yc=">";function bc(e,t,n){const r=t.step;if("number"!=typeof r)return;const i=_c.get(e);if("string"!=typeof i)return;const o=t[i]||"";if("string"!=typeof o)return;const s=o.split(",").filter(e=>e.length);if(s.includes(Ac))return;if(!s.includes(Tc)){const e=Ic(r,i);e&&s.push(...e)}else for(let e=s.length-1;e>=0;e--)s[e]===Tc&&s.splice(e,1);for(const t of s)try{const i=e(r,t);n.push(i)}catch(e){continue}}function Ic(e,t){const n=Rc[e];if("object"==typeof n){const e=n[t];if(Array.isArray(e))return e}return null}const wc=(e,t)=>new uc(e,t),Cc=(e,t)=>new dc(e,t),Sc=(e,t)=>new hc(e,t,"GET"),kc=(e,t)=>new hc(e,t,"POST"),Ec=(e,t)=>new hc(e,t,"PATCH"),_c=new Map([[wc,"on_url"],[Cc,"click"],[Sc,"http_get"],[kc,"http_post"],[Ec,"http_patch"]]),Ac="disabled",Tc="no_default",Rc={[pc.AddToCart]:{on_url:["/(cart|basket|bag)(.php|.jsp)?(/)?$",".*[/.](shoppingbag)[./#?].*",".*my_cart_big.*"],click:[".(add-to-cart)",".(tocart)","\\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)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"]},[pc.CheckoutStarted]:{on_url:[".*[/.-](checkout|onepage|checkouts|billing|shipping|check-out|checkoutshow)[#./?-].*",".*/checkout$",".*/billing$",".*onepagecheckout$",".*onestepcheckout/$",".*(avoncartview?).*",".*(paypal/express/review).*",".*/on/demandware.store/.*",".*/firecheckout/$",".*/personaldata/.*"],click:["#^checkout$",".^checkout$",".^standard-checkout$",".(btn-payment ml-4)","(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$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"]},[pc.PlaceOrder]:{click:["#completeOrder","#paypal_express","#^place_order$","#^btnMakeCCPayment$","#^braintree_paypal$",".(paypal-button-text)","(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 Mc{constructor(e){this.counters=new Map,this.clientConfig=e}isTrackAllowed(e){const{pageVisitId:t}=this.clientConfig;t!==this.pageVisitId&&(this.pageVisitId=t,this.counters.clear());const n=this.counters.get(e)||0;return this.counters.set(e,n+1),this.evaluateByStep(e,n)}evaluateByStep(e,t){return t<1}}class xc{static getInstance(){if($a.getInstance().shouldIgnoreFunnelStepConfig())return null;const e=Ps.getInstance();return this.instance||(this.instance=new xc(e))}static reinitializeInstance(){if($a.getInstance().shouldIgnoreFunnelStepConfig())return;const e=Ps.getInstance();this.instance.handleNewPageVisitNavigation(e)}constructor(e){this.matchersByUrl=[],this.matchersByClick=[],this.matchersByHttp=[],this.clientConfig=e,this.trackOverflowGuard=new Mc(e),As(()=>this.createMatchers())}handleNewPageVisitNavigation(e){this.clientConfig=e,this.trackOverflowGuard=new Mc(e),As(()=>this.matchCurrentUrl())}monitor(){As(()=>this.listenEvents())}listenEvents(){this.listenClickEvent(),this.listenHttpEvent(),this.matchCurrentUrl()}createMatchers(){const e=function(e){const t=[];for(const n of e)bc(wc,n,t),bc(Cc,n,t),bc(Sc,n,t),bc(kc,n,t),bc(Ec,n,t);return t}(NOIBUJS_CONFIG.funnel_config_steps||[]);e.sort((e,t)=>t.step-e.step);for(const t of e){let e;switch(!0){case t instanceof uc:e=this.matchersByUrl;break;case t instanceof dc:e=this.matchersByClick;break;case t instanceof hc:e=this.matchersByHttp}e&&e.push(t)}}listenClickEvent(){const e=this.matchClick.bind(this);Vs(window,"noibuClick",e)}listenHttpEvent(){const e=this.matchRequest.bind(this);Vs(window,"noibuRequest",e)}matchCurrentUrl(){const{pageVisitId:e}=this.clientConfig;if(e===this.pageVisitId)return;this.pageVisitId=e;const t={url:location.href};this.match(this.matchersByUrl,t)}matchClick({detail:e}){this.match(this.matchersByClick,e)}matchRequest({detail:e}){this.match(this.matchersByHttp,e)}match(e,t){if(!$a.getInstance().shouldIgnoreFunnelStepConfig())for(const n of e){if(!As(()=>n.match(t),!1))continue;if(this.isNegativeMatch(n))continue;const{step:e}=n;if(this.trackOverflowGuard.isTrackAllowed(e)){const t=Lc.get(e);t&&this.track(t)}return}}track(e){qa(e,null)}isNegativeMatch(e){return!!(e.step===pc.CheckoutStarted&&e instanceof uc&&Nc.test(location.href))}}xc.instance=null;const Nc=new RegExp(".*[\\/\\.-](checkout\\/cart).*","i"),Lc=new Map([[1,"product_added_to_cart"],[2,"checkout_started"],[3,"payment_info_submitted"],[4,"checkout_completed"]]);function Oc(){ta.getInstance().handleShow()}function Dc(){fa.getInstance().handleFragPost(),ta.getInstance().close(),Ea.getInstance().flushAll(),ta.getInstance().handleUnload()}function Pc(){try{Yo(window.history,"pushState",(function(e){return function nbuWrapper(t,n,r){e.call(history,t,n,r),Vc()}})),Vs(window,"popstate",Vc),Vs(window,"hashchange",Vc)}catch(e){}}function Vc(){const e=new CustomEvent("noibuNavigation");window.dispatchEvent(e)}var Fc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class Uc{constructor(){this.contentTypeReadableRegex=new RegExp("text|json|xml|html|graphql|x-www-form-urlencoded|form-data","i");const e=ss();if(this.initialURLPartsReversed=[],this.hostname="",e&&e.length>0)try{this.hostname=new URL(e).hostname,this.initialURLPartsReversed=this.hostname.split("."),D.test(this.initialURLPartsReversed[0])&&this.initialURLPartsReversed.shift(),this.initialURLPartsReversed.reverse()}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for initial URL: "+e,!1,F)}this.httpDataCollectionEnabled=!!Ce().http_data_collection;const t=ms();this.httpDataAllowedAbsoluteRegex=Uc.buildAllowedRegex(t,!0),this.httpDataAllowedRelativeRegex=Uc.buildAllowedRegex(t,!1)}static getInstance(){return this.instance||(this.instance=new Uc),this.instance}static buildAllowedRegex(e,t){if(!e||!Array.isArray(e))return null;const n=e.map(e=>ws(e).toLowerCase()).filter(e=>{const n=Uc.isAbsoluteURL(e);return t?e&&n:e&&!n});return n.length>0?new RegExp(n.join("|")):null}static headersMapFromIterable(e){const t=new Map;for(const n of e)"string"!=typeof n[0]&&(n[0]=String(n[0])),"string"!=typeof n[1]&&(n[1]=String(n[1])),t.set(n[0].toLowerCase(),n[1]);return t}static headersMapFromString(e){const t=new Map;if(!e||"string"!=typeof e)return t;return e.split("\r\n").filter(Boolean).forEach((function(e){const n=e.split(": ");2===n.length&&n[0].length>0&&n[1].length>0&&t.set(n[0].toLowerCase(),n[1])})),t}static getResponseStringFromXHR(e){return Fc(this,void 0,void 0,(function*(){var t;if(!e)return null;if(""===e.responseType||"text"===e.responseType)return e.responseText;if(!e.response)return"null";if(null===(t=e.response.documentElement)||void 0===t?void 0:t.innerHTML)return e.response.documentElement.innerHTML;if("function"==typeof e.response.text)return yield e.response.text();if("json"===e.responseType)try{const t=ds(e.response);return"{}"===t?null:t}catch(e){return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify JSON response: "+e,!1,F),null}return null}))}isURLSameDomain(e,t=!1){if("string"!=typeof e||!this.initialURLPartsReversed||this.initialURLPartsReversed.length<1)return!1;let n=t?e:"";if(!t)try{let t=e;e.startsWith("//")&&(t="https:"+e),n=new URL(t).hostname}catch(e){return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for request URL: "+e,!1,F),!1}const r=n.split(".");if(r.length<1)return!1;if(D.test(r[0])&&r.shift(),r.reverse(),!t&&r.length<this.initialURLPartsReversed.length)return!1;if(t){const e=r.length>=this.initialURLPartsReversed.length&&this.initialURLPartsReversed.every((e,t)=>e===r[t]),t=r.length<=this.initialURLPartsReversed.length&&r.every((e,t)=>e===this.initialURLPartsReversed[t]);return e||t}return this.initialURLPartsReversed.every((e,t)=>e===r[t])}bundleHTTPData(e,t,n,r,i,o,s){if(!this.isValidRequest(e,o))return null;let a="",c="";this.shouldCollectPayloadForURL(e)&&(a=this.getReasonPayloadIsDropped(t,s)||this.stringFromRequestBody(n,t),c=this.getReasonPayloadIsDropped(r,s)||this.stringFromRequestBody(i,r));const l=t||new Map,u=a||"",d=r||new Map,h=c||"";if(0===l.size&&!u&&0===d.size&&!h)return null;const p=this.restrictPayload(u,e,s),f=this.restrictPayload(h,e,s);return{rqh:Jo(this.removePIIHeaders(t)),rqp:p,rsh:Jo(this.removePIIHeaders(r)),rsp:f}}isValidRequest(e,t){return!!this.httpDataCollectionEnabled&&!(!t||"string"!=typeof t)}shouldContinueForURL(e){return!!this.httpDataCollectionEnabled&&(!(!e||"string"!=typeof e||!this.initialURLPartsReversed)&&!(Uc.isAbsoluteURL(e)&&!this.isURLSameDomain(e)&&!this.shouldCollectPayloadForURL(e)))}static isAbsoluteURL(e){return!(!e||"string"!=typeof e)&&(e.indexOf("://")>0||0===e.indexOf("//"))}shouldCollectPayloadForURL(e){if(!e||"string"!=typeof e)return!1;const t=!!this.httpDataAllowedAbsoluteRegex&&this.httpDataAllowedAbsoluteRegex.test(e.toLowerCase()),n=(!Uc.isAbsoluteURL(e)||this.isURLSameDomain(e))&&!!this.httpDataAllowedRelativeRegex&&this.httpDataAllowedRelativeRegex.test(e.toLowerCase());return t||n}restrictPayload(e,t,n){if(!e||!this.shouldCollectPayloadForURL(t))return"null";if("string"!=typeof e)return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"restrictPayload received non string payload",payloadType:typeof e},!1,V),"null";if("null"===e||e.startsWith&&(e.startsWith("Dropped due to length.")||e.startsWith("Dropped due to unsupported type."))||e.indexOf&&(0===e.indexOf("Dropped due to length.")||0===e.indexOf("Dropped due to unsupported type.")))return e;let r=n?262144:65536;const i=T().restrictsBundleSize;return i&&(r=i),e.length>r?(zs.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+e.length):(zs.getInstance().addHttpDataPayloadCount(),ka(e))}contentLengthAcceptable(e,t){let n=t?262144:65536;const r=T().restrictsBundleSize;return r&&(n=r),this.contentLength(e)<=n}contentTypeAcceptable(e){const t=e.get("content-type");return!(t&&!this.contentTypeReadableRegex.test(t.toLowerCase()))}getReasonPayloadIsDropped(e,t){if(!(null==e?void 0:e.get))return"";const n=Uc.getInstance();return n.contentTypeAcceptable(e)?n.contentLengthAcceptable(e,t)?"":(zs.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+n.contentLength(e)):(zs.getInstance().addHttpDataDropByType(),"Dropped due to unsupported type. Payload type: "+e.get("content-type"))}contentLength(e){if(!(null==e?void 0:e.get))return 0;let t=0;const n=e.get("content-length");if(!n)return-1;try{if(t=parseInt(n,10),Number.isNaN(t))return-1}catch(e){return-1}return t}stringFromRequestBody(e,t){if(null==e)return null;try{if(ks(e)&&t instanceof Map){const n=t.get("content-type");n&&n.toLowerCase().includes("application/x-www-form-urlencoded")&&(e=new URLSearchParams(e))}}catch(e){}try{(e instanceof FormData||e instanceof URLSearchParams)&&(e=Array.from(e.entries()).reduce((e,[t,n])=>(e[t]=this.stringFromRequestBody(n,null),e),{}))}catch(e){}try{const t=e.toString();if(!t.includes("[object"))return t}catch(e){}try{return e.documentElement.innerHTML}catch(e){}try{return ds(e)}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify request body: "+e,!1,F)}return null}removePIIHeaders(e){if(!(e instanceof Map))return null;if(!e.size)return e;const t=new Map(e);return t.forEach((e,t,n)=>{x.includes(t.toLowerCase())?n.set(t,"******"):n.set(t,ka(e))}),t}static removePIIFromURL(e){try{if(Uc.isAbsoluteURL(e)){const t=new URL(e);return Array.from(t.searchParams.entries()).forEach(([e,n])=>{Sa(e)?t.searchParams.set(e,"******"):t.searchParams.set(e,ka(n))}),t.toString()}{const[t,n]=e.split("?");if(!n)return e;const r=new URLSearchParams(n);return Array.from(r.entries()).forEach(([e,t])=>{Sa(e)?r.set(e,"******"):r.set(e,ka(t))}),t+"?"+r.toString()}}catch(t){return e}}}function Bc(e){return"number"!=typeof e||(e>=400||e<=0)}class Hc{constructor(e,t,n=null){const r=e=>!e||e<0?0:e;this.httpEvent={code:r(e.code),r_time:r(e.r_time),mtd:(e.mtd||"get").toUpperCase(),url:ts(fs(e.url))},this.httpData=t,this.gqlError=n}saveHTTPEvent(){if(!this.httpEvent||!ws(this.httpEvent.url))return;zs.getInstance().addHttpEvent();const e=this.httpEvent.code,t=!!this.gqlError;if(this.httpData){const n=zs.getInstance().httpSequenceNumber;if(Hc.isSendAllowed(e,n,t)){this.httpData.seq=n,this.httpEvent.seq=n,zs.getInstance().addHttpData();const e={};e[Ie]=this.httpData,ta.getInstance().sendMessage(W,e)}else zs.getInstance().addHttpDataOverLimit()}Bc(e)?na.getInstance().addPageVisitEvent({event:this.httpEvent,occurredAt:new Date(Ls(Date.now())).toISOString()},X):Ea.getInstance().addEvent(this.httpEvent,X)}static isSendAllowed(e,t,n=!1){const r=Bc(e)||n;if(!r){if(t<100)return!0;0}return r&&t<120}}var qc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function Wc(e){try{const{origin:t}=e,n=new CustomEvent("noibuFrameAttach",{detail:e});window.dispatchEvent(n)}catch(e){}}function jc(e){e.forEach(e=>{"childList"===e.type&&e.addedNodes.forEach(e=>{const t=e;if("IFRAME"===t.tagName||"FRAME"===t.tagName){const e=t,{contentWindow:n}=e;n&&Wc(n)}})})}function Gc(){return qc(this,void 0,void 0,(function*(){yield Ko(),function(){try{const e={childList:!0,subtree:!0};new MutationObserver(jc).observe(document.body,e)}catch(e){}}();try{for(let e=0;e<window.frames.length;e++){Wc(window.frames[e])}}catch(e){}}))}const $c=["Click","Change","Input","Submit"];function zc(e){return $c.includes(e)}class Zc{constructor(){this.subscribers=new Set,this.cancelled=!1}subscribe(e){this.cancelled?e():this.subscribers.add(e)}cancel(){this.cancelled=!0;for(const e of this.subscribers)try{e()}catch(e){}this.subscribers.clear()}assert(){if(this.cancelled)throw new Error("Cancelled.")}}class Kc extends Error{constructor(e,t,n,r,i){super(e.message),this.name=this.constructor.name,this.original=e,this.checkId=t||null,this.version=n||null,this.triggerId=r||null,this.assertionId=i||null}}var Yc,Jc=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};!function(e){e[e.Started=1]="Started",e[e.TriggerCompleted=2]="TriggerCompleted",e[e.AssertionCompleted=3]="AssertionCompleted"}(Yc||(Yc={}));class Qc{get cancelled(){return this.cancellation.cancelled}constructor(e,t,n,r,i,o,s){this.tag=`${t.id}-${Date.now()}`,this.pageVisitId=e,this.check=t,this.watcher=n,this.dispatcher=r,this.cancellation=i,this.inputManager=o,this.logger=s}start(){return Jc(this,void 0,void 0,(function*(){const e=this.logger.tag(this.tag,this.logger.log);try{this.submitStatus(Yc.Started),yield this.waitTriggers(e),this.submitStatus(Yc.TriggerCompleted),yield this.waitAssertions(e),this.submitStatus(Yc.AssertionCompleted)}catch(t){throw e(`Check failed. ${t} Stack: ${t.stack}`),t}}))}cancel(){return Jc(this,void 0,void 0,(function*(){this.logger.tag(this.tag,this.logger.log)("Cancel."),this.cancellation.cancel()}))}waitTriggers(e){return Jc(this,void 0,void 0,(function*(){const t=this.check.triggers.map(t=>this.waitTriggerSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitAssertions(e){return Jc(this,void 0,void 0,(function*(){const t=this.check.assertions.map(t=>this.waitAssertionSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitTriggerSafely(e,t){return Jc(this,void 0,void 0,(function*(){try{yield this.waitTrigger(e,t)}catch(t){throw new Kc(t,this.check.id,this.check.version,e.id,null)}}))}waitAssertionSafely(e,t){return Jc(this,void 0,void 0,(function*(){try{yield this.waitAssertion(e,window.document.body,t)}catch(t){throw new Kc(t,this.check.id,this.check.version,null,e.id)}}))}waitTrigger(e,t){return Jc(this,void 0,void 0,(function*(){(t=this.logger.tag(e.id,t))("Wait trigger",e);const n=e.trigger_type,r=e.element_selector;switch(n){case"PageLoad":yield this.waitPageLoadEvent(e.trigger_value,t);break;case"Click":yield this.waitCommonElementEvent("click",r);break;case"Input":yield this.waitCommonElementEvent("input",r);break;case"Submit":yield this.waitCommonElementEvent("submit",r);break;case"Change":{const t=e.trigger_value;yield this.waitChangeEvent(r,t);break}default:throw new Error(`Trigger type "${n}" is not supported.`)}}))}waitAssertion(e,t,n){return Jc(this,void 0,void 0,(function*(){(n=this.logger.tag(e.id,n))("Wait assertion",e);const r=e.assertion_type,i=e.element_selector,o=e.assertion_value,{timeout:s,text:a,group:c}=o;let l=!1;try{switch(r){case"ElementExists":{const e=yield this.waitElement(t,i,a,s,n);c&&(yield this.assertGroup(e,c,n));break}case"TextExists":yield this.waitText(t,a,s,n);break;default:l=!0}}catch(e){if(o.negated)return;throw e}if(l)throw new Error(`Assertion type "${r}" is not supported.`);if(o.negated)throw new Error("Assertion failed (negated).")}))}waitElement(e,t,n,r,i){return Jc(this,void 0,void 0,(function*(){const o=Hs(t);return this.waitElementBySelector(e,o,n,r,i)}))}waitText(e,t,n,r){return Jc(this,void 0,void 0,(function*(){return this.waitElementBySelector(e,null,t,n,r)}))}waitElementBySelector(e,t,n,r,i){return Jc(this,void 0,void 0,(function*(){return Fs(e,t,null==n?void 0:n.content,null==n?void 0:n.regex,r,this.watcher,this.cancellation,i)}))}assertGroup(e,t,n){return Jc(this,void 0,void 0,(function*(){const r=Hs(t.element_selector),i=[...e.querySelectorAll(r)];let{max:o,min:s}=t;if(-1===o&&(o=Number.MAX_SAFE_INTEGER),-1===s&&(s=Number.MAX_SAFE_INTEGER),i.length>o)throw new Error("The maximum number of elements has been exceeded.");if(i.length<s)throw new Error("The minimum number of elements has not been met.");let a=Date.now();const c=[];for(const e of i)for(const r of t.items){r.id=a+=1,r.assertion_value.timeout=0;const t=this.waitAssertion(r,e,n);c.push(t)}yield Promise.all(c)}))}waitPageLoadEvent(e,t){return Jc(this,void 0,void 0,(function*(){return new Promise(n=>{Ko().then(()=>{(null==e?void 0:e.text)&&(e.text.content||e.text.regex)?Fs(window.document.body,null,e.text.content,e.text.regex,0,this.watcher,this.cancellation,t).then(()=>e.negated?null:n()).catch(()=>e.negated?n():null):n()})})}))}waitCommonElementEvent(e,t){return Jc(this,void 0,void 0,(function*(){const n=Hs(t);yield new Promise((t,r)=>{const i=r=>{const o=r.target.closest(n);o&&(this.dispatcher.unsubscribe(e,i),t(o))};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe(e,i);const t=new Error("Waiting click has been cancelled.");r(t)}),this.dispatcher.subscribe(e,i)})}))}waitChangeEvent(e,t){return Jc(this,void 0,void 0,(function*(){const n=Hs(e);yield new Promise((e,r)=>{const i=r=>{var o;const s=r.target;if(!s.matches(n))return;if(void 0!==s.value&&(null===(o=null==t?void 0:t.ignore_value)||void 0===o?void 0:o.length)){const e=t.ignore_value;if(e.includes(s.value))return;if("SELECT"===s.tagName){const t=s,{text:n}=t.options[t.selectedIndex];if(e.includes(n))return}}this.dispatcher.unsubscribe("change",i),e(!0)};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe("change",i);const e=new Error("Waiting change has been cancelled.");r(e)}),this.dispatcher.subscribe("change",i)})}))}submitStatus(e){}}class Xc{constructor(){this.entries=[]}tag(e,t){return(n,r)=>{n=`[${e}] ${n}`,t.call(this,n,r)}}log(e,t){let n=`${Date.now()}: ${e}`;t&&(n+=` ${ds(t)}.`),this.entries.push(n)}}var el=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class tl{static create(e,t,n,r,i=null,o=null){const s=tl.fetchTest(),a=qs();return tl.isConfigValid(s,a)?new tl(e,t,n,r,s,a,i,o):null}constructor(e,t,n,r,i,o,s=null,a=null){this.activeCheckers=new Map,this.test=i,this.pageGroups=o,this.watcher=e,this.dispatcher=t,this.clientConfig=n,this.inputManager=r,this.startCallback=s,this.resultCallback=a}start(){window.setTimeout(()=>{tl.normalizeTest(this.test);const e=this.handleNavigationChange.bind(this);window.addEventListener("noibuNavigation",e),this.startChecks()})}startChecks(){for(const e of this.test.checks)this.startCheckIfApplicable(e)}startCheckIfApplicable(e){const t=new Xc;if(this.startCallback&&this.startCallback(e,t.entries),this.isCheckApplicable(e,t)){const n=this.activeCheckers.get(e);if(n&&!n.cancelled)return;this.startCheck(e,t)}}isCheckApplicable(e,t){const n=t.tag(""+e.id,t.log);n("Start page group validation.");const r=e.page_group_id,i=this.pageGroups[r];if(!i)return n("Page group not found (no matching id)."),!1;if(i.url_regex){if(!Gs(i.url_regex))return n("Page group not found (no matching url regexp)."),!1}else if(i.urls){const e=Ws();if(!i.urls.some(t=>e.includes(t)))return n("Page group not found (no matching urls)."),!1}if(i.element_selector){const e=Hs(i.element_selector);if(!window.document.querySelector(e))return n("Page group not found (no matching element selector)."),!1}return n("Found page group."),!0}startCheck(e,t){return el(this,void 0,void 0,(function*(){let n=null;const r=new Zc,i=new Qc(this.clientConfig.pageVisitId,e,this.watcher,this.dispatcher,r,this.inputManager,t);this.activeCheckers.set(e,i);try{yield i.start()}catch(e){n=e}if(this.activeCheckers.delete(e),!i.cancelled){const r=null===n;this.submitResult(r,e,n,t),r||this.submitError(n,t)}if(tl.isCheckRestartRequired(e)){if(n)return void t.log("Error: "+n);window.setTimeout(()=>this.startCheckIfApplicable(e))}}))}handleNavigationChange(){for(const[e,t]of this.activeCheckers){this.isCheckApplicable(e,t.logger)||t.cancelled||t.cancel()}this.startChecks()}submitResult(e,t,n,r){const i=r.tag(""+t.id,r.log),o=(null==n?void 0:n.triggerId)||"0",s=(null==n?void 0:n.assertionId)||"0",a=e?"Pass":"Fail",c=this.clientConfig.pageVisitId,l=`PageCheckResult-${a}-${t.id}-${t.version}-${c}-${o}-${s}`;i("Page check result success: "+e),this.resultCallback&&this.resultCallback(l,e,r.entries)}submitError(e,t){const n=t.entries,{checkId:r,version:i,triggerId:o,assertionId:s}=e;Va(Ve,{checkId:r,version:i,triggerId:o,assertionId:s,log:n})}static fetchTest(){return Ce().page_checks||null}static isConfigValid(e,t){return null!==e&&null!==t}static isCheckRestartRequired(e){const{triggers:t}=e;return t.find(({trigger_type:e})=>zc(e))}static normalizeTest(e){const t=e=>null!==e&&"object"==typeof e&&0===Object.keys(e).length,n=new Set;for(const r of e.checks){for(const e of r.triggers)t(e.trigger_value)&&(e.trigger_value=null),t(e.element_selector)&&(e.element_selector=null,zc(e.trigger_type)&&n.add(r));for(const e of r.assertions)null===e.assertion_value&&(e.assertion_value={}),"number"!=typeof e.assertion_value.timeout&&(e.assertion_value.timeout=20),t(e.element_selector)&&(e.element_selector=null)}n.size>0&&(e.checks=e.checks.filter(e=>!n.has(e)))}}var nl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class rl{constructor(e,t,n,r,i=null){this.reportedSnippets=new Set,this.reportedErrors=new Set,this.handleMutationCallback=this.handleMutation.bind(this),this.handleIdleCallback=this.handleIdle.bind(this),this.supportIdleRequest="function"==typeof window.requestIdleCallback,this.idleRequestOptions={timeout:3e3},this.watcher=e,this.clientConfig=t,this.pageVisit=n,this.stopWordDictionary=r,this.resultCallback=i}start(){this.watcher.subscribe(this.handleMutationCallback),window.setTimeout(this.handleMutationCallback)}handleMutation(){this.supportIdleRequest?window.requestIdleCallback(this.handleIdleCallback,this.idleRequestOptions):this.search()}handleIdle(){this.search()}search(){let e=null;try{const t=rl.getVisiblePageContent();e=rl.searchMatches(t,this.stopWordDictionary)}catch(e){this.collectError(e)}if(null!==e){let t=null;for(const n of e)this.reportedSnippets.has(n.snippet)||(this.reportedSnippets.add(n.snippet),t=t||[],t.push(n));null!==t&&this.sendEvent(t)}}static searchMatches(e,t){if(!e)return null;let n=null;for(const r of t.values){let t=0,i=0;for(;i<10&&(i+=1,t=e.lower.indexOf(r.value,t),-1!==t);){const i=t;t+=1;if(!rl.isWord(e.lower,i,i+r.value.length-1))continue;n=n||[];const o=rl.searchSnippet(e.original,i,r.value.length);if(rl.validateSnippet(o,r)){const e={stopWord:r.value,snippet:o,start:i,end:i+r.value.length};n.push(e)}}}return n}static searchSnippet(e,t,n){const r=t+n-1,i=rl.searchSnippetIndex(e,t,-1),o=rl.searchSnippetIndex(e,r,1)+1;return e.slice(i,o).trim()}static searchSnippetIndex(e,t,n){let r=0,i=0;for(;i<120;){i+=1;const o=e[t+n];if(void 0===o||rl.snippetSeparators.has(o)){r=0;break}""===o.trim()&&(r=t),t+=n}return 0!==r&&(t=r),t}static validateSnippet(e,t){if(e=e.toLowerCase(),t.exclude)for(const n of t.exclude)if(e.includes(n))return!1;if(!t.include)return!0;for(const n of t.include)if(e.includes(n))return!0;return!1}static isWord(e,t,n){let r,i=!1,o=!1;return t>0&&(r=e[t-1],i=rl.isWordRegExp.test(r)),n<e.length-1&&(r=e[n+1],o=rl.isWordRegExp.test(r)),!i&&!o}sendEvent(e){return nl(this,void 0,void 0,(function*(){const t={text:{dictionaryVersion:this.stopWordDictionary.version,lang:this.stopWordDictionary.lang,matches:e},performance:null},n={event:t,occurredAt:new Date(Ls(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(n,fe),this.resultCallback&&this.resultCallback(t)}))}collectError(e){const t=""+e;this.reportedErrors.has(t)||(this.reportedErrors.add(t),this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,V))}static getVisiblePageContent(){var e,t;let n=null===(t=null===(e=window.document)||void 0===e?void 0:e.body)||void 0===t?void 0:t.innerText;if(!n)return null;n=rl.removeFragmentsToIgnore(n);const r=n.toLowerCase();return{original:n,lower:r}}static removeFragmentsToIgnore(e){const t=rl.getFragmentsToIgnore();if(null===t)return e;for(const n of t)e=e.replace(n,"");return e}static getFragmentsToIgnore(){const e=document.querySelectorAll(rl.fragmentToIgnoreSelector);if(0===e.length)return null;const t=[];return e.forEach(e=>{const n=null==e?void 0:e.innerText;n&&t.push(n)}),t}}rl.snippetSeparators=new Set([".","!","?","\n"]),rl.isWordRegExp=/\w/,rl.fragmentToIgnoreSelector='[class*="review"], [id*="review"], [class*="footer"], [id*="footer"], nav ';class il{constructor(e){this.subscribers=new Map,this.window=e}subscribe(e,t){let n=this.subscribers.get(e);n||(n=this.registerEvent(e)),n.add(t)}unsubscribe(e,t){const n=this.subscribers.get(e);n&&n.delete(t)}registerEvent(e){window.addEventListener(e,t=>this.nofity(e,t),{capture:!0});const t=new Set;return this.subscribers.set(e,t),t}nofity(e,t){const n=this.subscribers.get(e);for(const e of n)try{e(t)}catch(e){}}}class ol{constructor(e){this.subscribers=new Set,this.observer=null,this.mutated=!1,this.window=e}start(){this.observer=new MutationObserver(this.handleMutation.bind(this)),this.observer.observe(this.window.document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}stop(){this.observer.disconnect(),this.observer=null}subscribe(e){null===this.observer&&this.start(),this.subscribers.add(e)}unsubscribe(e){this.subscribers.delete(e)}handleMutation(){this.mutated||(this.mutated=!0,this.window.setTimeout(()=>{this.mutated=!1,this.nofity()},ol.notificationTimeThreshold))}nofity(){for(const e of this.subscribers)try{e()}catch(e){}}}function sl(){const e=new ol(window),t=new il(window),n=Ps.getInstance(),r=Ua.getInstance(),i=na.getInstance(),o=tl.create(e,t,n,r);o&&o.start();const s=al();new rl(e,n,i,s).start(),function(e,t,n,r){window.addEventListener("noibuPageCheckValidationRequest",i=>{const{pageGroups:o,test:s}=i.detail;new tl(e,t,n,r,s,o,(e,t)=>{const n=new CustomEvent("noibuPageCheckValidationResponse",{detail:{check:e,logs:t}});window.dispatchEvent(n)}).start()})}(e,t,n,r)}function al(e){var t,n;const r=(null===(n=null===(t=window.document)||void 0===t?void 0:t.documentElement)||void 0===n?void 0:n.lang)||"en",i=e||function(e){try{return new Intl.Locale(e).language}catch(e){return null}}(r)||"en",o=i in cl.values?i:"en",s=cl.values[o];return{version:cl.version,lang:o,values:s}}ol.notificationTimeThreshold=1e3;const cl={version:5,values:{en:[{value:"error",include:["application","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server","configuration","security","format","fulfillment","json","code","unexpected","referenceerror","typeerror","syntaxerror","rangeerror","typeerror","urierror","securityerror","quotaexceedederror","evalerror"],exclude:["design with no error codes","no need to worry"]},{value:"fail",include:["create","update","delete","remove","send","receive","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server"]},{value:"unable",include:["create","update","delete","remove","send","receive","load","save","process","connect","complete","verify","retrieve"]},{value:"unavailable",include:["system","service","resource","page","product","feature","payment","shipping"]},{value:"invalid",include:["credentials","payment","parameters","request","file","data","information","address","email","login","password","field","form","card number"]},{value:"exception",include:["database","payment","inventory","shipping","checkout","configuration","session","unexpected","overflow","memory"]},{value:"timeout",include:["operation","gateway","server","service","network","connection","session","payment","request","transaction","database"]},{value:"expired",include:["session","coupon","payment","offer","token","subscription","license"]},{value:"refused",include:["payment","transaction","connection","access","service","order"]},{value:"denied",include:["access","permission","login","authentication","service","request","order"]},{value:"declined",include:["payment","transaction","access","card","request","authorization"]},{value:"blocked",include:["access","account","payment","transaction","content","service"]},{value:"miss",include:["information","payment","required","credential","parameters"]},{value:"inaccessible",include:["service","server","page","system","resource","content","feature","account"]},{value:"overload",include:["system","service","server","network","database","checkout"]},{value:"disabled",include:["account","feature","payment","checkout","access","user","service"],exclude:["“disabled access”"]},{value:"not permitted",include:["action","access","transaction","modification","upload","download","registration"]},{value:"already exist",include:["user","email","file","account","record","process","entry"]},{value:"server",include:["overload","not found","address"]},{value:"maintenance",include:["server","system","under","down","scheduled"]},{value:"connection",include:["timed out","timedout","refused","lost","reset","denied"]},{value:"crash",exclude:["course","courses","door crasher"]},{value:"not supported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"unsupported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"undefined"},{value:"[object object]"},{value:"addeventlistener"},{value:"400 bad request"},{value:"401 unauthorized"},{value:"403 forbidden"},{value:"404 not found"},{value:"405 method not allowed"},{value:"500 internal server error"},{value:"502 bad gateway"},{value:"503 service unavailable"},{value:"504 gateway timeout"},{value:"went wrong"},{value:"not found"},{value:"check your internet"},{value:"try later"},{value:"try again"},{value:"terminated"},{value:"exceeded",exclude:["my expectation","my expectations"]},{value:"corrupt",exclude:["jeans"]},{value:"disconnected"},{value:"unresponsive"},{value:"violation",exclude:["copyright"]},{value:"execution rights"},{value:"out of memory"},{value:"transaction rollback"},{value:"disk space exhausted"},{value:"protocol version"},{value:"doesn't exist"},{value:"has already been used"},{value:"choose a different delivery address"},{value:"no longer available"},{value:"can't be shipped"},{value:"no payment methods available"},{value:"enter a valid email"},{value:"more than what's in stock"},{value:"fill in the required"},{value:"is incorrect"},{value:"isn't valid"},{value:"is not valid"},{value:"coupon is not valid"},{value:"does not exist"},{value:"not authorized"},{value:"account is suspended"},{value:"no longer valid"},{value:"deactivated"},{value:"already in use"},{value:"sqlstate"},{value:"foreign key constraint"},{value:"is not defined"},{value:"no such entity"},{value:"more permissions"},{value:"duplicate entry"},{value:"account is locked"},{value:"api call"},{value:"module not enabled"},{value:"token has expired"},{value:"php extension"},{value:"security reasons"},{value:"file exceeds"},{value:"technical difficulties"},{value:"not allowed to access"},{value:"ssl certificate"},{value:"csrf token"},{value:"memory limit"},{value:"theme registry"},{value:"Current customer does not have an active cart"},{value:"link you selected is expired"}]}};var ll=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class ul{static getInstance(){return ul.instance||(ul.instance=new ul),ul.instance}constructor(){this.incomingErrorBuffer=[],this.confirmedErrorBuffer=[],this.processedUrls=new Set,this.incomingErrorBufferTimeoutId=0,this.processing=!1,this.terminated=!1,"function"==typeof window.fetch?this.nativeFetch=window.fetch.bind(window):this.terminated=!0}monitor(){const e=window;Vs(e,"error",t=>this.handleError(t,e),!0)}terminate(){this.terminated=!0,this.incomingErrorBuffer.splice(0,this.incomingErrorBuffer.length),this.confirmedErrorBuffer.splice(0,this.confirmedErrorBuffer.length),this.processedUrls.clear(),window.clearTimeout(this.incomingErrorBufferTimeoutId)}handleError(e,t){if(this.terminated)return;const n=this.createErrorContext(e,t);null!==n&&(this.incomingErrorBuffer.push(n),this.scheduleErrorProcessing())}scheduleErrorProcessing(){window.clearTimeout(this.incomingErrorBufferTimeoutId),this.incomingErrorBufferTimeoutId=window.setTimeout(()=>this.processErrors(),ul.incomingErrorBufferTimeout)}processErrors(){return ll(this,void 0,void 0,(function*(){if(!this.terminated&&!this.processing){this.processing=!0;try{for(;this.incomingErrorBuffer.length;){if(this.checkIncomingErrorBufferOverflow())return;const e=this.incomingErrorBuffer.shift();(yield this.executeConfirmation(e))&&this.confirmedErrorBuffer.push(e)}for(;this.confirmedErrorBuffer.length;){const e=this.confirmedErrorBuffer.shift();this.submitError(e)}}finally{this.processing=!1}}}))}checkIncomingErrorBufferOverflow(){const e=this.incomingErrorBuffer.length>=ul.incomingErrorBufferOverflowLimit;return e&&this.terminate(),e}executeConfirmation(e){return ll(this,void 0,void 0,(function*(){const{url:t}=e.request,n=ul.confirmationRequestTimeout;if(e.originalResponse=yield this.executeRequest(t,null,n),ul.isErrorConfirmed(e.originalResponse))return!0;if(e.originalResponse.cors){const r=encodeURIComponent(t),i=ul.proxyUrl+"/?"+r,o=new Headers({"X-Upstream-URL":t});if(e.proxyResponse=yield this.executeRequest(i,o,n),ul.isErrorConfirmed(e.proxyResponse))return!0}return!1}))}executeRequest(e,t,n){return ll(this,void 0,void 0,(function*(){const r=new AbortController,{signal:i}=r,o={method:"HEAD",headers:t,signal:i},s=window.setTimeout(()=>r.abort(),n),a={ok:!1,status:0,contentType:null,error:null,timeout:!1,cors:!1};try{const t=yield this.nativeFetch(e,o);a.ok=t.ok,a.status=t.status,a.contentType=t.headers.get("content-type")}catch(e){const t="AbortError"===e.name,n=e instanceof TypeError;a.timeout=t,a.cors=n,a.error=""+e}finally{window.clearTimeout(s)}return a}))}submitError(e){const{tagName:t,id:n,alt:r,title:i,width:o,height:s}=e.image,a=e.request.url,{timestamp:c,originalResponse:l,proxyResponse:u}=e;Va("ImageError",{tag_name:t,id:n||null,src:a,detail:ds({alt:r,title:i,width:o,height:s,originalResponse:l,proxyResponse:u})},void 0,c)}createErrorContext(e,t){const{isTrusted:n,target:r}=e;if(!(n&&r instanceof HTMLImageElement))return null;const i=r,{width:o,height:s,src:a,baseURI:c}=i;if(o<=1||s<=1||!a)return null;let l=a.toLowerCase();if(l.startsWith("//")&&(l=t.location.protocol+l),!l.startsWith("http"))return null;if(ul.areUrlsEqual(l,c))return null;if(this.processedUrls.has(l))return null;this.processedUrls.add(l);const u={tagName:i.tagName,alt:i.alt,id:i.id,src:i.src,title:i.title,width:i.width,height:i.height},d={url:i.src};return{timestamp:Date.now(),image:u,request:d,originalResponse:null,proxyResponse:null}}static isErrorConfirmed(e){if(e.status>=400)return!0;if(e.contentType){const t=e.contentType.startsWith("image");if(e.ok&&!t)return!0}return!1}static areUrlsEqual(e,t){try{const n=new URL(e.toLowerCase()),r=new URL(t.toLowerCase());return n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search}catch(e){return!1}}}ul.proxyUrl="https://resource-proxy.noibu.com",ul.confirmationRequestTimeout=5e3,ul.incomingErrorBufferTimeout=3e3,ul.incomingErrorBufferOverflowLimit=5;class dl{static getInstance(){return dl.instance||(dl.instance=new dl),dl.instance}monitor(e){if(e&&e.length>0)return;const t=setInterval(()=>{const e=document.title;e&&e.length>0&&(this.handler(e),clearInterval(t))},100);setTimeout(()=>{this.clear(t)},5e3)}clear(e){clearInterval(e)}handler(e){const t=Xs.getInstance(),n={url:ss(),page_title:e,page_groups:$s(),ref_url:ts(t.referrerUrl)};Ea.getInstance().addEvent(n,ge)}}class hl{static getInstance(...e){return hl.instances.has(this)||hl.instances.set(this,new this(...null!=e?e:[])),hl.instances.get(this)}destroy(){}static resetInstances(){hl.instances.forEach(e=>{e.destroy()}),hl.instances.clear()}}hl.instances=new Map;class pl extends hl{monitor(){this._monitor(window),Vs(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){Vs(e,"input",this._handle.bind(this))}getPayload(e){const{target:t}=e,n=t,r=n.placeholder||n.name||n.id,i=hs(n),o=ps(n);return{[$]:"",[z]:r,[G]:n.tagName?n.tagName.toLowerCase():"",[Z]:o,[j]:ae,[K]:fs(i)}}isValid(e){const{target:t}=e,n=t;return("INPUT"===n.tagName||"TEXTAREA"===n.tagName)&&!!(n.placeholder||n.name||n.id)}_handle(e){this.isValid(e)&&Ea.getInstance().addEvent(this.getPayload(e),ae)}}const fl=["\\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)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"],gl=["(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$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"],ml=["(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)","(注文する)","(إنشاء الطلب)","(注文を確定)","^お支払いへ進む$","^确认下单$"];function vl(e){if(!(e instanceof Element))return{target:null,selector:null};let t=e,n=[],r=!1,i=0;for(;e&&e.nodeType===Node.ELEMENT_NODE&&!(i++>50);){const{id:i,tagName:o,classList:s,parentNode:a}=e;if(!r&&Il(e)&&(r=!0),!r&&wl(e)&&(t=e,n.splice(0,n.length),r=!0),Cl(i)){const t="#"+i;if(Sl(t,e)){n.push(t);break}}let c=o.toLowerCase();if("html"!==c&&"body"!==c){const t=Array.from(s).filter(Cl);t.length>0&&(c+="."+t.join("."));c+=`:nth-of-type(${bl(e)+1})`}n.push(c),e=a}n=function(e,t){const n=[];for(const r of t){n.push(r);const t=yl(n);if(Sl(t,e))break}return n}(t,n);return{target:t,selector:yl(n)}}function yl(e){return(e=[...e]).length?e.reverse().join(" > "):null}function bl(e){let t=0;for(let n=e.previousElementSibling;null!==n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}function Il(e){return e instanceof HTMLHeadingElement||e.querySelector("h1, h2, h3, h4, h5, h6")}function wl(e){const t=e.tagName.toLowerCase();if(El.includes(t))return!0;const n=e.getAttribute("role");if(_l.includes(n))return!0;for(const t of Al)if(e.classList.contains(t))return!0;return!1}function Cl(e){if(!e)return!1;if(!kl.test(e))return!1;const t=e.toLowerCase();if(Rl.some(e=>t.indexOf(e)>=0))return!1;if(Tl.some(e=>t.startsWith(e)))return!1;return!/\d/.test(e)}function Sl(e,t){const n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}const kl=/^[a-zA-Z_-][a-zA-Z0-9_-]*$/,El=["svg","label","product-item"],_l=["button","menuitem"],Al=["builder-image","nav-item","list-group","l2-title","l3-title","fic-img-wrapper","fic-caption"],Tl=["text-"],Rl=["load","active","fixed","visible","draggable","focus","show","collaps","animat","hover","swiped","highlight","shift","initializ","is-in-view","site-menu-item-open"];class Ml extends hl{constructor(){super(),this.textCapturedWhiteListRegex=new RegExp(fl.concat(gl).concat(ml).join("|"),"i"),this.htmlIDWhiteListRegex=new RegExp("method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button","i"),this.collectTrustedEventsOnly=!0,this.blockedSelector=null,this.blockedSelector=Ml.createBlockedSelector()}static createBlockedSelector(){let e;try{e=vs(),window.document.querySelector(e)}catch(t){e=null;Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Failed to parse selector: "+t,!1,V)}return e}monitorClicks(){this._monitor(window),Vs(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){Vs(e,"click",this._onClickHandle.bind(this),!0)}_onClickHandle(e){if(!this.isValid(e))return;const t=this.getPayload(e);zs.getInstance().addPvClick(),na.getInstance().addPageVisitEvents([{event:t,occurredAt:new Date(Ls(Date.now())).toISOString()}],ie);const n=t.hid,r=t.class,i=t.tag,o=t.txt,s=new CustomEvent("noibuClick",{detail:{id:n,className:r,tagName:i,text:o}});window.dispatchEvent(s)}isValid(e){return!(this.collectTrustedEventsOnly&&!e.isTrusted)}getPayload(e){const t=e.target,n=t,r=t.src||"",i=n.tagName?n.tagName.toLowerCase():"",o=hs(n),s=ps(n),a=this.getElementText(i,t,s),c=function(e){try{const{selector:t}=vl(e);return t}catch(e){return null}}(n);let l=0,u=0;try{const{documentElement:e}=window.document;l=e.scrollWidth,u=e.scrollHeight}catch(e){}return{[$]:r,[z]:a,[G]:i,[Z]:s,[j]:se,[K]:fs(o),selector:c,x:Math.trunc(e.pageX||0),y:Math.trunc(e.pageY||0),w:l,h:u}}getElementText(e,t,n){if(null===this.blockedSelector)return"*";let r="";if("img"===e){const e=t;e.alt&&(r=e.alt)}else{const e=t;if(this.isEnclosedByBlockedElement(e))return"*";r=this._getContainedText(e,!0)}if(!this.textCapturedWhiteListRegex.test(r)&&!this.htmlIDWhiteListRegex.test(n))if("input"===e){if(!rt.some(n=>n(e,t)))return"*"}else if("textarea"===e)return"*";return function(e){return e.replace(L,"******").replace(N,"*")}(Ml.cutoffText(Ml.trimSpaces(r)))}_getContainedText(e,t){let n=this._parseInnerContent(e);if(t){const t=e.tagName?e.tagName.toLowerCase():"";if(""===n)n=this._parseTextFromParentElement(e);else if("select"===t){const t=n;n=this._parseTextFromParentElement(e),n=n.replace(t,"")}}return n}_parseInnerContent(e,t="",n={v:0}){const r=e,i=e;if(t.length>=100||n.v>=100)return t;if(n.v+=1,i&&"function"==typeof i.matches&&i.matches(this.blockedSelector))return t?t+" *":"*";e.nodeType===Node.TEXT_NODE&&(t=this._parseAndAppendText(t,[e.textContent]));let o=!0;if(e.nodeType===Node.ELEMENT_NODE){if(ss().includes("hannaandersson")){const t=t=>t(i.tagName.toLowerCase(),e);if(!rt.some(t))return"*"}const n=xl(r.type),s=xl(r.title),a=xl(r.name),c=xl(r.id);if(Sa(n)||Sa(s)||Sa(a)||Sa(c))return this._parseAndAppendText(t,["*"]);0===e.childNodes.length&&(t=this._parseAndAppendText(t,[r.value,r.title])),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE&&(o=!1,t=this._parseAndAppendText(t,[e.textContent,r.value,r.title]))}if(o)for(const r of e.childNodes)t=this._parseInnerContent(r,t,n);return t}_parseAndAppendText(e,t){if(e.length>=100)return e;const n=t.filter(e=>Number.isFinite(e)||"string"==typeof e).map(e=>Ml.trimSpaces(e)).filter(e=>e.length>0).slice(0,1).join("");return e?`${e} ${n}`:n}static trimSpaces(e){return ws(e).replace(/\s+/g," ")}static cutoffText(e){if(e.length>100){const t=e.lastIndexOf(" ",100-"...".length);return t>0?e.substring(0,t)+"...":"..."}return e}_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||"A"===t.tagName&&"button"===t.type))return this._getContainedText(t,!1)}return""}isEnclosedByBlockedElement(e){const t=document.querySelectorAll(this.blockedSelector);for(const n of t)if(n.contains(e))return!0;return!1}}function xl(e){return"string"==typeof e?e.toLowerCase():""}class Nl{constructor(){this.processedResourceKeys=new Set,this.allowedResourceKeys=new Set(["inline","eval","wasm-eval","trusted-types-policy","trusted-types-sink"])}static getInstance(){return this.instance||(this.instance=new Nl),this.instance}monitor(){const e=this.handle.bind(this);Vs(window,"securitypolicyviolation",e,!0)}handle(e){if("report"===e.disposition)return;const t=this.getResourceKey(e.blockedURI);if(!t||this.processedResourceKeys.has(t))return;this.processedResourceKeys.add(t);const{blockedURI:n,violatedDirective:r}=e;Va("CSPError",{blocked_uri:n,violated_directive:r,original_policy:null})}getResourceKey(e){try{const t=new URL(e),{hostname:n}=t;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(n))return n;const r=n.split(".");return r.length>=3?r.slice(-3).join("."):n}catch(e){}return this.allowedResourceKeys.has(e)?e:null}}class Ll{constructor(){this.debouncedCalls=0}static getInstance(){return this.instance||(this.instance=new Ll),this.instance}monitor(){const e=this._onPageEventHandle.bind(this),t=()=>{const t=To()(e,1e3,{leading:!0,trailing:!0});return(...e)=>(this.debouncedCalls+=1,t(...e))};Ge.forEach(t=>Vs(window,t,e,!0)),$e.forEach(e=>Vs(window,e,t(),!0)),ze.forEach(t=>Vs(document,t,e,!0))}_onPageEventHandle(e){if(!e||!e.type)return;const t={type:e.type};switch(e.type){case"visibilitychange":t.data="state: "+this.getDocumentState();break;case"readystatechange":t.data="state: "+document.readyState;break;case"pagehide":case"pageshow":case"load":e.persisted&&(t.data="persisted: "+e.persisted);break;case"storage":e.key&&(t.data="key: "+e.key);break;case"message":case"messageerror":e.data&&e.origin&&(t.data=`origin: ${e.origin} size: ${this.getSizeInBytes(e.data)}`);break;case"hashchange":e.newURL&&(t.data="newURL: "+e.newURL)}this.setDocumentSize(t),Ea.getInstance().addEvent(t,ue)}getDocumentState(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}getSizeInBytes(e){let t=e;return"string"!=typeof e&&(t=ds(e)),2*t.length}setDocumentSize(e){const{type:t}=e;if("pageshow"===t||"resize"===t)try{const{documentElement:t}=window.document;e.width=t.scrollWidth,e.height=t.scrollHeight}catch(e){}}}class Ol{constructor(){this.submittedMetrics=new Set,this.startedMonitoring=!1,this.onLCP=null,this.onFID=null,this.onCLS=null,this.onFCP=null,this.onINP=null,this.onTTFB=null}static getInstance(){return this.instance||(this.instance=new Ol),this.instance}sendMetric(e){var t,n,r;if(!e||!e.name)return;const{name:i,value:o,rating:s}=e;if(this.submittedMetrics.has(i)&&"CLS"!==i)return;this.submittedMetrics.add(i);let{attribution:a}=e;switch(a||(a={}),a.njsSessionStartTime=Ns.scriptInitializeTime,i){case d.CumulativeLayoutShift:{const e=a;Ol.setEventRecorded(e.largestShiftTime,a);break}case d.FirstContentfulPaint:{const e=a;Ol.setEventRecorded(null===(t=e.fcpEntry)||void 0===t?void 0:t.startTime,a);break}case d.FirstInputDelay:{const e=a;Ol.setEventRecorded(e.eventTime,a);break}case d.InteractionToNextPaint:{a.interactionTargetElement=void 0;const e=a;Ol.setEventRecorded(e.interactionTime,a);break}case d.LargestContentfulPaint:{const e=a;Ol.setEventRecorded(null===(n=e.lcpEntry)||void 0===n?void 0:n.startTime,a);break}case d.TimeToFirstByte:{const e=a;Ol.setEventRecorded(null===(r=e.navigationEntry)||void 0===r?void 0:r.startTime,a);break}}const c={name:i,value:o.toString(),rating:s,attribution:ds(a)};na.getInstance().addPageVisitEvent({event:c,occurredAt:new Date(Ls(Date.now())).toISOString()},oe)}static setEventRecorded(e,t){let n=!1;e&&Ns.recordingStartTime&&(n=e>Ns.recordingStartTime,n&&Ns.recordingStopTime&&(n=e<Ns.recordingStopTime)),t.rrwebRecorder=n}monitor(){try{if(!Ol.isAvailable())return;if(this.startedMonitoring)return;this.startedMonitoring=!0;const e=this.sendMetric.bind(this);this.onLCP(e),this.onFID(e),this.onCLS(e),this.onFCP(e),this.onINP(e),this.onTTFB(e)}catch(e){this.startedMonitoring=!1,Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in WebVitalMonitor: "+e,!1,V)}}download(){Ol.isAvailable()&&(Vs(window,"noibuWebVitalsLoaded",e=>{this.setWebVitals(e.detail),this.monitor()}),Es("https://cdn.noibu.com/collect-webvitals.js",null,e=>{Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading webvitals script. "+e,!1,V)}))}setWebVitals(e){this.onLCP=e.onLCP,this.onFID=e.onFID,this.onCLS=e.onCLS,this.onFCP=e.onFCP,this.onINP=e.onINP,this.onTTFB=e.onTTFB}static isAvailable(){return"object"==typeof window.performance}}class Dl{static getInstance(){return this.instance||(this.instance=new Dl),this.instance}_safeQueryAll(e,t){let n;try{n=e.querySelectorAll(t)}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in ElementMonitor: "+e,!1,V)}return n?Array.from(n):[]}_processMatchingElements(e,t){e.forEach(e=>{if(!e)return;const n=e.textContent;n&&Ua.getInstance().addCustomAttribute(t,n)})}_findAndAddMatchingElementsInNodes(e){Object.keys(Je()).forEach(t=>{const n=Je()[t];n&&e.forEach(e=>{if(e.nodeType===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e.nodeType!==Node.ELEMENT_NODE)return;let r=[];e.matches(n)&&r.push(e);const i=this._safeQueryAll(e,n);r=r.concat(i),this._processMatchingElements(r,t)})})}_setupMutationObserver(){const e=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type&&e.addedNodes.length>0&&this._findAndAddMatchingElementsInNodes(e.addedNodes),"attributes"===e.type){const t=e.target;t.nodeType===Node.ELEMENT_NODE&&this._findAndAddMatchingElementsInNodes([t])}})});e.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),this.observer=e}_findAndAddMatchingElements(){Object.keys(Je()).forEach(e=>{const t=Je()[e];if(!t)return;const n=this._safeQueryAll(document,t);this._processMatchingElements(n,e)})}monitor(){var e;0!==Object.keys(Je()).length&&(this._findAndAddMatchingElements(),"undefined"!=typeof MutationObserver&&MutationObserver&&(null===(e=document.documentElement)||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE?this._setupMutationObserver():this.interval=setInterval(()=>{this._findAndAddMatchingElements()},5e3))}_disconnectObserver(){this.observer&&this.observer.disconnect&&"function"==typeof this.observer.disconnect&&this.observer.disconnect(),this.interval&&clearInterval(this.interval)}}class Pl{constructor(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}static getInstance(){return Pl.instance||(Pl.instance=new Pl),Pl.instance}monitor(){const e=this.handle.bind(this),t=To()(e,1e3,{leading:!0,trailing:!0});Vs(window,"scroll",t),Vs(window,"noibuNavigation",()=>{this.enabled=!1,setTimeout(()=>{this.reset(),this.report(!0)},1e3)}),Ko().then(()=>{null!==this.initialHeight||this.report(!0)})}reset(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}handle(e){e.target===document&&this.report(!1)}report(e){if(!this.enabled)return;const t=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),n=window.innerHeight,r=window.innerWidth,i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,o=i+n;let s=!1;null===this.initialHeight&&(this.initialHeight=t,s=!0),i>this.maxOffset&&(this.maxOffset=i,s=!0);const a={initialHeight:this.initialHeight,height:t,viewportHeight:n,viewportWidth:r,scrollTop:i,scrollBottom:o,isMax:e||s,isSynthetic:e},c={type:"scroll",data:JSON.stringify(a)};Ea.getInstance().addEvent(c,ue)}}class Vl{constructor(){this.pageVisit=na.getInstance(),this.eventTimestamps=new Map}static getInstance(){return this.instance||(this.instance=new Vl)}monitor(){try{this.monitorDataLayer()}catch(e){}}monitorDataLayer(){window.dataLayer=window.dataLayer||[];const e=this.handleDataLayerItems.bind(this);Yo(window.dataLayer,"push",(function(t){return function nbuWrapper(...n){return e(n),t.apply(window.dataLayer,n)}})),e(window.dataLayer)}handleDataLayerItems(e){const t=[];try{e.forEach(e=>this.extractFromDataLayer(e,t)),t.filter(Fl).filter(e=>this.debounce(e.name)).forEach(e=>{this.toStandardName(e),this.sendEvent(e)})}catch(e){}}extractFromDataLayer(e,t){const n=Object.prototype.toString.call(e);if("[object Arguments]"===n){for(const n of e)if(Ul.has(n)){const r=e[2];return void t.push({name:n,data:"object"==typeof r?r:null})}return}if("[object Object]"===n)for(const[n,r]of Object.entries(e)){if(("event"===n||"event_name"===n)&&Ul.has(r)){const n=e.ecommerce;return void t.push({name:r,data:"object"==typeof n?n:null})}}else;}debounce(e){const t=this.eventTimestamps.get(e)||0,n=Date.now();return!(n-t<1e3)&&(this.eventTimestamps.set(e,n),!0)}toStandardName(e){const{name:t}=e;e.name=Bl.get(t)||t}sendEvent(e){const t={event:{platform:"ga4",name:e.name,data:ds(e.data)},occurredAt:new Date(Ls(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(t,he)}}function Fl(e,t,n){return n.findIndex(t=>t.name===e.name)===t}Vl.instance=null;const Ul=new Set(["login","sign_up","share","search","add_to_cart","remove_from_cart","view_cart","begin_checkout","purchase","refund"]),Bl=new Map([["add_to_cart","product_added_to_cart"],["remove_from_cart","product_removed_from_cart"],["view_cart","cart_viewed"],["begin_checkout","checkout_started"],["purchase","checkout_completed"]]);let Hl=0;function ql(e,t){if("function"!=typeof e)return e;if(e===Function.prototype)return e;try{if(e.__noibu__)return e;if(e.__noibu_wrapped__)return e.__noibu_wrapped__}catch(t){return e}const nbuWrapper=function(...n){try{const t=Array.prototype.slice.call(n).map(e=>ql(e));return e.handleEvent?e.handleEvent.apply(this,t):e.apply(this,t)}catch(e){throw(null==t?void 0:t.getCause)&&(e.cause=t.getCause(n)),Va(Fe,{error:e}),Hl+=1,setTimeout(()=>{Hl-=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 Wl(e){const t=[];e.forEach(e=>{e&&(Array.isArray(e)?t.push(...e):t.push(e))});const{errorLikeObjs:n,rest:r}=t.reduce((e,t)=>(!function(e){if(!e)return!1;const t=e;try{return"string"==typeof t.stack&&"string"==typeof t.message}catch(e){return!1}}(t)?e.rest.push(t):e.errorLikeObjs.push(t),e),{errorLikeObjs:[],rest:[]});n.concat(function(e){const t=e.filter(e=>"string"==typeof e&&!!e);if(!t.length)return[];if(2===t.length)switch(!0){case ns(t[0]):return[{stack:t[0],message:t[1]}];case ns(t[1]):return[{stack:t[1],message:t[0]}];default:return[]}const n=[],r=[];return t.forEach(e=>{if(ns(e)){n.push(e);const t=e.split("\n");ns(t[0],0)?r.push("_"):r.push(t[0])}}),n.map((e,t)=>({stack:e,message:r[t]}))}(r)).forEach(e=>{try{Va(Be,e)}catch(e){}})}function jl(e){e&&je.forEach(t=>{e[t]&&Yo(e,t,(function(t){return function nbuWrapper(){t.call(e,...arguments),Wl(Array.from(arguments))}}))})}function Gl(e){e&&e.constructor&&e.constructor.name&&"undefined"!==e.constructor.name&&!(Hl>0)&&Va(e.constructor.name,e)}function $l(e){if(!e.reason)return;if(!e.reason.message||!e.reason.stack)return;const t=new Error;t.message=e.reason.message,t.stack=e.reason.stack;Va(Oe,{error:t})}function zl(e){!function(e){Vs(e,"error",Gl,!0),Vs(e,"unhandledrejection",$l,!0),U.forEach(t=>{var n;if("XMLHttpRequest"===t&&T().excludeXhrMonitoring)return;const r=e[t],i=r&&r.prototype;if(!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener"))return;const o=(null===(n=i.removeEventListener)||void 0===n?void 0:n.__noibu_original__)||i.removeEventListener;Yo(i,"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=ql(n.handleEvent.bind(n));i=n,i.handleEvent=e}else i=ql(n);try{o.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}})),Yo(i,"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)}}))})}(e),jl(e.console),function(e){var t;const n=e=>t=>{try{return t.filter(e.isValid.bind(e)).map(t=>e.getPayload(t))}catch(e){return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"Can't get cause for an onclick error in wrapHtmlElementEvents: "+e,args:t},!1,V),[]}};try{const r=null===(t=null==e?void 0:e.HTMLElement)||void 0===t?void 0:t.prototype;if(!r)return;Qo(r,"onclick",e=>ql(e,{getCause:n(Ml.getInstance())})),Qo(r,"oninput",e=>ql(e,{getCause:n(pl.getInstance())})),Qo(r,"onchange",e=>ql(e,{getCause:n(pl.getInstance())}))}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in wrapHtmlElementEvents: "+e,!1,V)}}(e),function(e){const t=e.console;let n=0,r=t;const i=()=>{try{const{console:t}=e}catch(e){return}if(n+=1,e.console!==r){r=e.console;const n={};Object.keys(t).forEach(t=>{e.console[t]||(e.console[t]=()=>{n[t]||(n[t]=!0,Va("GlobalReassignError",{error:new Error(`The console object was overridden and the ${t} method does not exist. Backfilling it with an empty function to avoid errors.`)}))})}),jl(e.console)}n<3&&setTimeout(i,500)};setTimeout(i,500)}(e)}function Zl(){zl(window),Vs(window,"noibuFrameAttach",e=>{zl(e.detail)})}class Kl{static async fromFetch(e,t,n,r){try{if(!(Ss(r,Response)&&r.ok&&!r.bodyUsed))return null;const i=this._getHeaderFromFetchArguments("content-type",t,n),o=this._getHeaderFromFetchArguments("apollographql-client-name",t,n);if(null!=o||this._shouldHandleRequest(e,i)){const t=await r.json();return this._validate(t,e,[])}}catch(e){this._isRequestAborted(t,n)||this._postError(e)}return null}static async fromXhr(e,t){try{if(!(Ss(t,XMLHttpRequest)&&t.status>=200&&t.status<=299))return null;let n=null,r=!1;if(t.noibuRequestHeaders&&(n=t.noibuRequestHeaders.get("content-type"),r=t.noibuRequestHeaders.has("apollographql-client-name")),r||this._shouldHandleRequest(e,n)){let n=null;if("blob"===t.responseType){if(t.response.text){const e=await t.response.text();n=this._parseJsonSafely(e)}}else if("json"===t.responseType)n=t.response;else{const e=t.responseText;n=this._parseJsonSafely(e)}if(n)return this._validate(n,e,[])}}catch(e){this._postError(e)}return null}static _parseJsonSafely(e){try{return JSON.parse(e)}catch(e){return null}}static _getHeaderFromFetchArguments(e,t,n){let r=null;Ss(n,Request)?r=n.headers:t&&t.headers&&(r=new Headers(t.headers));let i=null;return r&&(i=r.get(e)),i}static _isRequestAborted(e,t){return Ss(t,Request)?t.signal&&t.signal.aborted:!(!e||!Ss(e.signal,AbortSignal))&&e.signal.aborted}static _shouldHandleRequest(e,t){ks(t)&&(t=t.toLowerCase());let n=!1;return e&&(Ss(e,URL)&&(e=e.toString()),ks(e)&&(n=e.toLowerCase().includes("graphql"))),"application/json"===t&&n||"application/graphql"===t}static _validate(e,t,n){let r=null;if(e&&Array.isArray(e.errors)){r=e.errors;for(const e of r){const r=Object.keys(e);for(const t of r)switch(t){case"message":this._validateMessage(e);break;case"locations":this._validateLocations(e,n);break;case"path":this._validatePath(e,n);break;case"extensions":this._validateExtensions(e);break;default:delete e[t],n.push("unexpected error."+t)}e.src=t}n.length>0&&this._postValidationIssues(n)}return r}static _validateMessage(e){e.message=ts(e.message,1e3)}static _validateExtensions(e){const t=ka(ds(e.extensions));e.extensions=ts(t,1e3)}static _validateLocations(e,t){const n=e.locations;if(Array.isArray(n))for(const e of n){const n=Object.keys(e);for(const r of n)switch(r){case"line":case"column":if(!Number.isSafeInteger(e[r])){const n=e[r];e[r]=0,t.push(`unexpected ${r} value '${n}'`)}break;default:delete e[r],t.push("unexpected error.location."+r)}}else delete e.locations,t.push("unexpected error.locations")}static _validatePath(e,t){const n=e.path;Array.isArray(n)?e.path=e.path.map(e=>e.toString()):(delete e.path,t.push("unexpected error.path"))}static _postError(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL parse error: "+e,!1,V)}static _postValidationIssues(e){const t=e.join(",");Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL error validation warning: "+t,!1,V)}}var Yl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};al("en");function Jl(e,t,n,r,i){const o={mtd:n,code:e,url:Uc.removePIIFromURL(r),r_time:i},s=Uc.getInstance(),a=s.contentLength(t);return a>0&&s.shouldContinueForURL(r)&&(o.resp_len=a),o}function Ql(e){return Yl(this,void 0,void 0,(function*(){return e instanceof Response?e.bodyUsed?M:Xo(e.text).call(e):""}))}function Xl(e,t,n,r,i,o,s,a){return Yl(this,void 0,void 0,(function*(){return Uc.getInstance().shouldContinueForURL(r)?Uc.getInstance().bundleHTTPData(r,function(e,t){var n;let r=[];return"function"==typeof(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.entries)&&(r=e.headers.entries()),Array.from(r).length<1&&((null==t?void 0:t.headers)instanceof Headers?r=t.headers.entries():"object"==typeof(null==t?void 0:t.headers)&&(r=Object.entries(t.headers))),Uc.headersMapFromIterable(r)}(e,i),function(e,t){return"string"==typeof e?e:null==t?void 0:t.body}(s,i),function(e){return(null==e?void 0:e.headers)?Uc.headersMapFromIterable(e.headers.entries()):new Map}(t),a,n,o):null}))}function eu(e,t,n,r,i){return Yl(this,void 0,void 0,(function*(){var o;const s=Date.now()-t,a=yield Kl.fromXhr(n,e),c=Bc(e.status);let l=[];const u=yield Uc.getResponseStringFromXHR(e);const d=Jl(e.status,Uc.headersMapFromString(e.getAllResponseHeaders()),r,n,s),h=yield function(e,t,n,r){return Yl(this,arguments,void 0,(function*(e,t,n,r,i=null,o){if(!Uc.getInstance().shouldContinueForURL(n))return null;const s=Uc.headersMapFromString(e.getAllResponseHeaders());return Uc.getInstance().bundleHTTPData(n,e.noibuRequestHeaders,i,s,o,t,r)}))}(e,r,n,c||!!a||!!l.length,i,u),p=new Hc(d,h,a);p.saveHTTPEvent();const f=null===(o=p.httpData)||void 0===o?void 0:o.seq;c&&Va(Ne,e,f),a&&a.forEach(e=>Va("GQLError",e,f))}))}function tu(e){return e.bodyUsed?e:e.clone()}function nu(e){const t=e;"function"==typeof t.fetch&&(function(e){var t,n,r;return null===(r=null===(n=null===(t=e.toString)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.includes)||void 0===r?void 0:r.call(n,"native code")}(Response.prototype.text)||(Response.prototype.text.__noibu_original__=function(e){try{const t=document.createElement("iframe");document.body.appendChild(t);let n=t.contentWindow;return e.split(".").forEach(e=>{n=n[e]}),t.remove(),n}catch(e){}}("Response.prototype.text")||Response.prototype.text),Yo(t,"fetch",(function(e){return function nbuWrapper(t,n){let r;const{url:i,method:o}=function(e,t){const n={method:"GET",url:""};try{return e?e instanceof Request&&e.method?{method:e.method,url:e.url||""}:{method:(null==t?void 0:t.method)||"GET",url:"function"==typeof e.toString?e.toString():""}:n}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in fetch() wrapper: "+e,!1,V)}return n}(t,n);ru(i,o,null==n?void 0:n.body),t instanceof Request&&(r=t.clone());const s=Date.now(),a=e.call(this,t,n);return a.then(function(e,t,n,r,i){return o=>Yl(this,void 0,void 0,(function*(){var s,a,c;try{if(!o)return Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in custom fetch() callback: no response received",!1,V);const l=tu(o),u=tu(l),d=tu(l),h=Date.now()-e;let p=[];const f=l.status,g=l.headers,m=yield Kl.fromFetch(t,r,i,u),v=Bc(f),[y,b]=yield ca([Promise.resolve(null===(a=null===(s=Xo(null==i?void 0:i.text))||void 0===s?void 0:s.call)||void 0===a?void 0:a.call(s,i)),Ql(d)]);0;const I=Jl(f,g,n,t,h),w=yield Xl(i,d,n,t,r,v||!!m||!!p.length,y,b),C=new Hc(I,w,m);C.saveHTTPEvent();const S=null===(c=C.httpData)||void 0===c?void 0:c.seq;v&&Va(Pe,{status:l.status,url:l.url||I.url},S),p.length,m&&m.forEach(e=>Va("GQLError",e,S))}catch(e){if("AbortError"===e.name)return;const t=ls(e);Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in custom fetch() callback: ${e}${t}`,!1,V)}}))}(s,i,o,n,r)).catch(e=>{!function(e,t){if(!e||"object"!=typeof e)return;const n=e;if(!(null==n?void 0:n.message)||!(null==n?void 0:n.stack))return;const r=new Error;r.stack=n.stack;const i=ws(t),o=i?" on url "+i:"";r.message=`${n.message}${o}`,Va(Ue,{error:r})}(e,i)}),a}})))}function ru(e,t,n){try{const r=new CustomEvent("noibuRequest",{detail:{url:e,method:t,body:n}});dispatchEvent(r)}catch(e){}}function iu(e){const t=e.XMLHttpRequest,n=t&&t.prototype;!function(e,t){Yo(e,"open",(function(e){return function nbuWrapper(n,r,i=!0,o=null,s=null){try{ru(r,n,null);try{this.noibuHttpMethod=n,this.noibuHttpUrl=r}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to set custom properties on XHR object: "+e,!1,F)}if(t){const e=Date.now();Vs(this,"loadend",()=>eu(this,e,r,n,null))}}catch(e){const t=ls(e);Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.open() wrapper: ${e}${t}`,!1,V)}return e.call(this,n,r,i,o,s)}}))}(n,!function(e){return Yo(e,"send",(function(e){return function nbuWrapper(t){try{const e=function(e,t){return e.noibuHttpMethod?e.noibuHttpMethod:t?"POST":"GET"}(this,t),n=Date.now();Vs(this,"loadend",()=>eu(this,n,this.noibuHttpUrl||this.responseURL,e,t))}catch(e){const t=ls(e);Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.send() wrapper: ${e}${t}`,!1,V)}return e.call(this,t)}}))}(n)),function(e){Yo(e,"setRequestHeader",(function(e){return function nbuWrapper(t,n){try{this.noibuRequestHeaders instanceof Map||(this.noibuRequestHeaders=new Map);const e="string"==typeof n?n:String(n);"string"==typeof t&&this.noibuRequestHeaders.set(t.toLowerCase(),e)}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in XHR.setRequestHeader() wrapper: "+e,!1,V)}return e.call(this,t,n)}}))}(n)}function ou(e){iu(e),nu(e)}var su=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function au(){return su(this,arguments,void 0,(function*(e=null){const t=Xs.getInstance(),n=$s(e);t.storePageGroups(n),yield Ko();const r=$s(e);if(n.length===r.length&&n.every((e,t)=>e===r[t]))return;t.storePageGroups(r);const i={page_groups:r};Ea.getInstance().addEvent(i,me)}))}function cu(){const e={event:{type:"page_visit_start"},occurredAt:(new Date).toISOString()};na.getInstance().addPageVisitEvent(e,ue)}const lu=["carrot-top.com"];function uu(){let e=ss();e&&Vs(window,"noibuNavigation",()=>{const t=ss();if(!t||e===t)return;const n=e;if(e=t,r=t,i=n,As(()=>{const e=new URL(r),t=new URL(i);return e.host===t.host&&e.pathname===t.pathname},!1)&&!lu.some(e=>t.includes(e)))return void function(e,t){const n={url:e,page_title:window.document.title,page_groups:$s(),ref_url:t};Ea.getInstance().addEvent(n,ce)}(t,n);var r,i;const o=Xs.getInstance().storedPageGroups,s=ta.getInstance().getPageInformation();s.page_groups=o;const a=fa.getInstance().isLiveView();fa.getInstance().stopRecording(),Ea.getInstance().flushAll(),ta.getInstance().handleUnload(s),setTimeout(()=>{const t={url:e,pageTitle:window.document.title,referrerUrl:n,referrerPageGroups:o};As(()=>{Ps.reinitializeInstance(),Xs.reinitializeInstance(t),zs.reinitializeInstance(),ta.reinitializeInstance(st()(),t),fa.reinitializeInstance(!0,a),cu(),au(),xc.reinitializeInstance()})},10)})}let du=!1;let hu=!1;function pu(){Ua.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_completed","true")}function fu(){Vs(window,"message",e=>{if("string"==typeof e.data){if(e.data.startsWith("QualtricsEOS"))try{const t=e.data.split("|"),n=t[1],r=t[2];pu(),Ua.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_id",n),Ua.getInstance().addNoibuInternalCustomAttribute("qualtrics_session_id",r)}catch(e){}if("endOfSurvey"===e.data)try{pu()}catch(e){}}})}function gu(){window.QSI&&window.QSI.API&&(fu(),mu())}function mu(){Vs(document,"mousedown",e=>{var t;const n=null===(t=(r=e.target)instanceof Element?r:r instanceof Node?r.parentElement:null)||void 0===t?void 0:t.closest("a");var r;if(!(null==n?void 0:n.href))return;const i=function(e){let t;try{t=new URL(e)}catch(e){return null}return t.hostname.toLowerCase().endsWith(".qualtrics.com")&&t.pathname.startsWith("/jfe/form")?t:null}(n.href);if(!i)return;const o=Ps.getInstance().sessionId;if(o)try{i.searchParams.set("NOIBU_SESSION_ID",o),n.href=i.toString()}catch(e){}},!1)}let vu=!1;function yu(){vu||(vu=!0,Vs(window,"MDigital_Submit_Feedback",e=>{const t=e.detail.Form_ID,n=e.detail.Feedback_UUID;Ua.getInstance().addNoibuInternalCustomAttribute("medallia_form_id",t),Ua.getInstance().addNoibuInternalCustomAttribute("medallia_feedback_uuid",n)}))}var bu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};let Iu=!1;function wu(e){if(e)try{const{id:t,response_id:n}=e;t&&Ua.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_id",""+t),n&&Ua.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_response_id",""+n)}catch(e){}}function Cu(){return bu(this,void 0,void 0,(function*(){Iu||(Iu=!0,yield function(){return bu(this,void 0,void 0,(function*(){yield Ko(),window.hj&&"function"==typeof window.hj&&window.hj.event&&(window.hj.event.listen("feedback.sentiment",e=>{wu(e)}),window.hj.event.listen("poll.send",e=>{wu(e)}))}))}())}))}let Su=!1;let ku=!1;function Eu(e){var t,n;(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.campaignId)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.variationId)&&Ua.getInstance().addNoibuInternalCustomAttribute("abtasty-campaign-"+e.detail.campaignId,"variation-"+e.detail.variationId)}var _u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};function Au(e){try{return!0===e()}catch(e){return!1}}function Tu(){return _u(this,void 0,void 0,(function*(){return yield new Promise(e=>{try{const t=window.Shopify;if(!t||t.customerPrivacy)return void e();if("function"!=typeof t.loadFeatures)return void e();t.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],()=>{e()})}catch(t){e()}}),function(){try{const e="undefined"!=typeof window?window.Shopify:null;return!(!e||!e.customerPrivacy)&&e.customerPrivacy.analyticsProcessingAllowed()}catch(e){return!1}}()?"granted":"blocked"}))}function Ru(e){try{const t=function(){const e={analyticsAllowed:!1,marketingAllowed:!1,preferencesAllowed:!1,saleOfDataAllowed:!1};try{const t="undefined"!=typeof window?window.Shopify:null,n=t&&t.customerPrivacy;return n?{analyticsAllowed:Au(()=>{var e;return null===(e=n.analyticsProcessingAllowed)||void 0===e?void 0:e.call(n)}),marketingAllowed:Au(()=>{var e;return null===(e=n.marketingAllowed)||void 0===e?void 0:e.call(n)}),preferencesAllowed:Au(()=>{var e;return null===(e=n.preferencesProcessingAllowed)||void 0===e?void 0:e.call(n)}),saleOfDataAllowed:Au(()=>{var e;return null===(e=n.saleOfDataAllowed)||void 0===e?void 0:e.call(n)})}:e}catch(t){return e}}(),n={platform:"shopify",name:"consent_state",data:ds(Object.assign({reason:e},t))};na.getInstance().addPageVisitEvent({event:n,occurredAt:(new Date).toISOString()},he)}catch(e){}}function Mu(e){return _u(this,void 0,void 0,(function*(){try{if(!function(){try{return"undefined"!=typeof window&&!!window.Shopify}catch(e){return!1}}())return;const t=yield Tu();if(Ru(t),"granted"===t)return;let n=!1;e.holdTraffic(),e.connectionPromise.then(()=>{n||(e.close(),e.clearPendingMessages())}),function(e){try{const t=n=>{const r=n.detail;r&&!0===r.analyticsAllowed&&(document.removeEventListener("visitorConsentCollected",t),e())};document.addEventListener("visitorConsentCollected",t)}catch(e){}}(()=>{try{n=!0,e.releaseTraffic(),e.clearPendingMessages(),e.handleShow(),Ru("granted")}catch(e){Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error resuming after consent: "+e,!0,V)}})}catch(t){e.releaseTraffic(),Ps.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in applyShopifyConsentGate: "+t,!1,V)}}))}async function xu(t){if(Is())return;if(function(e){for(let t=0;t<R.length;t+=1){if(!e[R[t]])return!0}return!1}(t))return;if(!ss().startsWith("http"))return;if(function(){const e=void 0!==self.noibuJSLoaded;return self.noibuJSLoaded=!0,e}())return;const n=`${t.metroplexHTTPBase}/${Ee}`;Ps.configureInstance(n);try{const t=st()();if(Ps.getInstance().isDisabled)return;await Xs.getInstance().initialize(),Pc(),Fa.configure(!1);const n=ta.getInstance(t);fa.configureInstance(),na.configureInstance(),Ks.getInstance(),cu(),await Mu(n),Vs(document,"visibilitychange",()=>{("visible"===document.visibilityState?Oc:Dc)()}),Vs(window,"noibuSnapshotComplete",Dc);const r=Ll.getInstance(),i=Nl.getInstance(),o=ul.getInstance(),s=dl.getInstance(),a=pl.getInstance(),c=Ml.getInstance(),l=Ol.getInstance(),u=Dl.getInstance(),d=Pl.getInstance(),h=Vl.getInstance(),p=Ya.getInstance(),f=tc.getInstance(),m=cc.getInstance(),v=xc.getInstance(),y=Ia.getInstance();Uc.getInstance(),r.monitor(),i.monitor(),s.monitor(n.initialPageTitle),Zl(),ou(window),Vs(window,"noibuFrameAttach",e=>{ou(e.detail)}),c.monitorClicks(),uu(),au(),d.monitor(),a.monitor(),u.monitor(),p.monitor(),f.monitor(),m.monitor(),v&&v.monitor(),h.monitor(),function(t=!1){if(!du||t){if(du=!0,!window.navigator||!window.navigator.connection||!window.navigator.connection.downlink)return;const{connection:{downlink:t,rtt:n,effectiveType:r,saveData:i}}=window.navigator;Ea.getInstance().addEvent({downlink:Number(t),effective_type:r===e.TwoG||r===e.ThreeG||r===e.FourG||r===e.Slow2g?r:e.FourG,rtt:Number(n),save_data:!!i},de)}}(),hu||(hu=!0,window.QSI&&window.QSI.API?(fu(),mu()):Vs(window,"qsi_js_loaded",gu,!1)),yu(),ku||(ku=!0,Vs(window,"abtasty_executedCampaign",Eu,!1)),Gc(),sl(),o.monitor();const b=fa.getInstance();n.connectionPromise.then(()=>{Ua.getInstance().exposeFunctions(),Fa.getInstance().checkInitialRequest(),function(){if(!Su){Su=!0;try{const e=new URLSearchParams(window.location.search),t=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],n=Ua.getInstance();t.forEach(t=>{const r=e.get(t);r&&n.addNoibuInternalCustomAttribute(t,r)})}catch(e){}}}()}),ca([Ko(),n.connectionPromise]).then(()=>{b.setRRWeb({record:Er,addCustomEvent:_r,pack:ci}),b.recordUserSession(),l.setWebVitals(g),l.monitor(),y.monitor(),Cu()}).catch(e=>{const t=ls(e);Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during recordUserSession: ${e}${t}`,!1,V)}),es()&&function(e){const t=new URL("https://cdn.noibu.com/collect-agent.js");t.searchParams.set("pv",e),Es(t,null,null)}(Ps.getInstance().pageVisitId),function(){const{search:e}=location;return new URLSearchParams(e).has("ada-audit")}()&&Es(new URL("https://cdn.noibu.com/collect-ada.js"),null,null)}catch(e){const t=ls(e);Ps.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during globalInit: ${e}${t}`,!0,V)}}const Nu={metroplexSocketBase:Qe(),metroplexHTTPBase:Xe()};(async()=>{await xu(Nu)})()})()})();