PageSourceSearch

https://cdn.snitcher.com/releases/latest/radar.min.js

js snitcher.com collected 2026-09-24 08:48:53 UTC 88,098 bytes, 1 lines download raw bytes

1!function(){"use strict";function t(t,e){return(...i)=>{try{t(...i)}catch(s){L(s,e)}}}function e(t,e){t.catch(t=>L(t,e))}function i(t){const e=t.indexOf("\n"),i=-1===e?t:t.slice(0,e),s=G.test(i)&&!i.trimStart().startsWith("at "),n=-1!==e&&s?t.slice(e+1):t;if(2e3>=n.length)return n;const r=n.slice(0,2e3),o=r.lastIndexOf("\n");return o>0?r.slice(0,o):r}function s(t,e){return Element.prototype.getAttribute.call(t,e)??""}function n(t){var e,i,s,n;if(t.labels&&t.labels.length)return null==(e=t.labels[0].textContent)?void 0:e.trim();const r=t.closest("label");if(r)return(r.textContent||"").trim();if(t.id){const e="u">typeof CSS&&CSS.escape?CSS.escape(t.id):t.id.replace(/["\\]/g,"\\$&").replace(/[\n\r\f]/g,t=>`\\${t.charCodeAt(0).toString(16)} `),s=t.ownerDocument.querySelector(`label[for="${e}"]`);if(s)return null==(i=s.textContent)?void 0:i.trim()}const o=t.previousElementSibling;if(o&&"LABEL"===o.tagName)return null==(s=o.textContent)?void 0:s.trim();const a=t.parentElement;if(a){const t=["label","form-label","control-label","field-label"];for(const e of t){const t=a.querySelector("."+e);if(t)return null==(n=t.textContent)?void 0:n.trim()}}}function r(t){if("submit"===t.type||"button"===t.type||"reset"===t.type||function(t){var e,i,s,r;if("password"===t.type||"hidden"===t.type)return!0;const o=[null==(e=t.name)?void 0:e.toLowerCase(),null==(i=t.id)?void 0:i.toLowerCase(),null==(s=t.getAttribute("aria-label"))?void 0:s.toLowerCase(),null==(r=n(t))?void 0:r.toLowerCase()].filter(Boolean);for(const n of o)if(n)for(const t of Z)if(n.includes(t))return!0;return!1}(t))return null;let e="";const i=t.tagName;if("INPUT"===i){const i=t;if("checkbox"===i.type||"radio"===i.type){if(!i.checked)return null;e=i.value||"on"}else e=i.value}else if("SELECT"===i){const i=t,s=i.options[i.selectedIndex];e=s?s.text||s.value:""}else"TEXTAREA"===i&&(e=t.value);return e?{id:t.id||"",name:t.name||"",type:t.type||t.tagName.toLowerCase(),tagName:t.tagName.toLowerCase(),value:e,label:n(t)}:null}function o(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function a(t){try{return decodeURIComponent(t)}catch{return t}}function c(){const t=window.location.hostname,e=Date.now();if(ot&&3e5>e-at)return ot;if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||"localhost"===t)return ot=t,at=e,t;const i=t.split(".");if(1>=i.length)return ot=t,at=e,t;for(let s=i.length-2;s>=0;s--){const t=i.slice(s).join(".");if(h(t))return ot=t,at=e,t}return ot=t,at=e,t}function h(t){try{document.cookie=`${ct}=1; domain=.${t}; path=/`;const e=document.cookie.includes(ct+"=1");return document.cookie=`${ct}=; domain=.${t}; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`,e}catch{try{document.cookie=`${ct}=; domain=.${t}; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`}catch{}return!1}}function u(t){try{const e=sessionStorage.getItem(dt+t);if(!e)return null;const i=JSON.parse(e);return Date.now()-i.timestamp>864e5?(sessionStorage.removeItem(dt+t),null):i}catch{return null}}function l(t,e,i){try{const s={hash:e,timestamp:Date.now(),compute_time_ms:i};sessionStorage.setItem(dt+t,JSON.stringify(s))}catch{}}function d(t,e=3e3){"u">typeof window&&"requestIdleCallback"in window?requestIdleCallback(t,{timeout:e}):"u">typeof window?setTimeout(t,Math.min(1e3,e)):t()}async function f(t){const e=ft.encode(t);return(t=>[...new Uint8Array(t)].map(t=>t.toString(16).padStart(2,"0")).join(""))(await crypto.subtle.digest("SHA-256",e))}function m(t){const e=new WeakSet,i=t=>null===t||"object"!=typeof t?JSON.stringify(t):e.has(t)?'"[circular]"':(e.add(t),Array.isArray(t)?"["+t.map(i).join(",")+"]":"{"+Object.keys(t).sort().map(e=>JSON.stringify(e)+":"+i(t[e])).join(",")+"}");return i(t)}function p(t){const e=document.cookie.match(RegExp(`(?:^|;\\s*)${t}=([^;]+)`));if(e)return a(e[1])}function g(t){const e=t.type||t.name;return e===x.PAGEVIEW?1:e===x.SDK_ERROR||e===x.SDK_HEALTH?4:2}function w(t,e){if(!e||0===e.length)return!0;for(const i of e)if(i.startsWith("*.")){const e=i.slice(2);if(t===e||t.endsWith("."+e))return!0}else if(t===i)return!0;return!1}function y(t,e){for(const i of e)if(i.includes("*"))try{const e=i.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");if(RegExp("^"+e+"$").test(t))return!0}catch{if(t.includes(i.replace(/\*/g,"")))return!0}else if(t.includes(i))return!0;return!1}async function v(t,e){const i=await t.json(),s=i&&"object"==typeof i?i.data:void 0;if(null!==(null==s?void 0:s.settings)&&void 0!==(null==s?void 0:s.settings)){if((t=>{if(!t||"object"!=typeof t)return!1;const e=t;return(!e.profileId||"string"==typeof e.profileId)&&(!e.apiEndpoint||"string"==typeof e.apiEndpoint)&&(!e.cdn||"string"==typeof e.cdn)&&(!e.namespace||"string"==typeof e.namespace)&&(!e.allowedDomains||Array.isArray(e.allowedDomains))})(s.settings))return s.settings;throw new Ft(`[Radar] Invalid Runtime config received for ${e}: ${JSON.stringify(s)}`)}}function b(t,e,i){const{timeout:s,retries:n,alwaysResolve:r=!1}=i;return new Promise((i,o)=>{let a=0;const c=()=>{try{if(t())return e(),void i();if(a++,a>=n)return void(r?i():o(Error(`Condition not met after ${n} attempts`)));setTimeout(c,s)}catch(h){r?(L(h,"when.retry"),i()):o(h)}};c()})}function S(t,e){return(...i)=>e(t,...i)}function k(t,e){return((t??"")+"").slice(0,e).replace(RegExp("[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]","g"),"�")}var x,C,T,_,E,D,I=Object.defineProperty,A=(t,e,i)=>((t,e,i)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),F=Object.defineProperty,M=(t,e,i)=>((t,e,i)=>e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const O=t=>({namespace:"Radar",profileId:"",cdn:"",apiEndpoint:"",debug:!1,features:{downloadTracking:!1,formTracking:!1,
1clickTracking:!1,errorCapture:!0,sessionRecording:!1},integrations:{},...t});O();const $=({base:t,override:e})=>({...t,...e,features:{...t.features,...e.features},integrations:{...t.integrations,...e.integrations},recording:e.recording??t.recording});class P{constructor(t){M(this,"debug",!1),M(this,"onError"),this.debug=!!t.debug,this.onError=t.onError}log(...t){this.debug&&console.log("[Radar]",...t)}warn(...t){this.debug&&console.warn("[Radar]",...t)}error(t,...e){if(this.debug&&console.error("[Radar]",t,...e),this.onError){const i="string"==typeof e[0]?e[0]:void 0;try{this.onError(t,i)}catch{}}}}let N;const R=(...t)=>null==N?void 0:N.warn(...t),L=(t,...e)=>null==N?void 0:N.error(t,...e),B=console.warn.bind(console);class z{constructor(){A(this,"events",new Map),A(this,"middleware",[])}on(t,e){this.events.has(t)||this.events.set(t,new Set);const i=this.events.get(t);i&&i.add(e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),0===i.size&&this.events.delete(t))}use(t){this.middleware.push(t)}removeMiddleware(t){this.middleware=this.middleware.filter(e=>e!==t)}emit(t,...e){for(const n of this.middleware)try{if(!n(t,...e))return}catch(s){L(s,"emitter.middleware")}const i=this.events.get(t);i&&i.forEach(t=>{try{t(...e)}catch(s){L(s,"emitter.handler")}})}}const j=/__react(\w+)\$\w+/g,H=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,J=/https?:\/\/\S+/g,U=/\d{4}-\d{2}-\d{2}T[\d:.]+Z?/g,q=/\b0x[0-9a-f]{6,}\b/gi,V=/\b\d{4,}\b/g,G=/^\s*[A-Za-z_$][\w$]*(?:Error|Exception)?(?::|$)/;class W{constructor(t){A(this,"signatures",new Map),A(this,"sentSignatureCount",0),A(this,"overflowOccurrences",0),A(this,"reportedSuppressedOccurrences",0),A(this,"reporting",!1),A(this,"handleError",(t,e)=>{if(!this.reporting){this.reporting=!0;try{const n=(((null==t?void 0:t.message)??"")+"").slice(0,500),r={errorName:((null==t?void 0:t.name)??"Error")+"",message:n,messageNorm:(s=n,s.replace(j,"__react$1$<id>").replace(H,"<uuid>").replace(J,"<url>").replace(U,"<ts>").replace(q,"<n>").replace(V,"<n>")),stack:i(((null==t?void 0:t.stack)??"")+""),context:e??"unknown"},o=`${r.errorName}|${r.messageNorm}|${r.context}`;let a=this.signatures.get(o);if(!a){if(this.signatures.size>=50)return void this.overflowOccurrences++;a={properties:r,count:0,sentCount:0},this.signatures.set(o,a)}a.count++,0===a.sentCount&&5>this.sentSignatureCount&&(this.sentSignatureCount++,a.sentCount=a.count,this.track({...a.properties,count:a.count}))}catch{}finally{this.reporting=!1}}var s}),A(this,"flushFinalCounts",()=>{if(!this.reporting){this.reporting=!0;try{let t=0,e=this.overflowOccurrences;for(const i of this.signatures.values())i.sentCount>0?i.count>i.sentCount&&(i.sentCount=i.count,this.track({...i.properties,count:i.count})):(t++,e+=i.count);if(e>0&&e>this.reportedSuppressedOccurrences){this.reportedSuppressedOccurrences=e;const i=this.overflowOccurrences>0?t+1+"+":""+t;this.track({errorName:"SuppressedErrors",message:i+" signatures suppressed",messageNorm:"signatures suppressed",stack:"",context:"reporter.overflow",count:e})}}catch{}finally{this.reporting=!1}}}),this.track=t}}class K{constructor(t){A(this,"counters",new Map),A(this,"flushed",new Map),A(this,"count",(t,e=1)=>{try{this.counters.set(t,(this.counters.get(t)??0)+e)}catch{}}),A(this,"flush",()=>{try{const t={};let e=!1;for(const[i,s]of this.counters){const n=s-(this.flushed.get(i)??0);n>0&&(t[i]=n,e=!0)}if(!e)return;this.track({counters:t});for(const[i,s]of this.counters)this.flushed.set(i,s)}catch{}}),this.track=t}}const Q=t=>Math.round(t/1e3),Y={},X=(t="")=>{const e=(t=>{try{return btoa(t)}catch{try{return btoa(unescape(encodeURIComponent(t)))}catch{return""}}})(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t.replace(/^[^@]+@/,""):"");return!Y[e]&&(Y[e]=!0,e)};x=(t=>(t.IDENTIFY="identify",t.TRACK="track",t.COMPANY="company",t.PAGEVIEW="pageview",t.FORM_START="form_start",t.FORM_SUBMIT="form_submit",t.FORM_ABANDON="form_abandon",t.FORM_UPDATE="form_update",t.CLICK="click",t.DOWNLOAD="download",t.INITIALIZED="initialized",t.COLLECTING="collecting",t.ERROR="error",t.OBSERVE="observe",t.RECORDING_START="recording_start",t.SDK_ERROR="sdk_error",t.SDK_HEALTH="sdk_health",t))(x||{});const Z=["password","credit","card","ccn","cvv","secret","token","ssn","social","auth","private","security","pin"],tt=["facebook.com/tr","connect.facebook.net","px.ads.linkedin.com","bat.bing.com","googleads.g.doubleclick.net","analytics.google.com/g/collect","ct.pinterest.com","analytics.twitter.com","ads.twitter.com","tr.snapchat.com","tiktok.com/i18n","ad.atdmt.com"];class et extends z{constructor(){super(...arguments),A(this,"activeFormInteractions",new Map),A(this,"submittedForms",new Set),A(this,"recentProgrammaticSubmits",new Set),A(this,"interactionDocuments",new Map),A(this,"eventHandlersInstalled",!1),A(this,"sensitiveFields",[...Z]),A(this,"originalSubmit",null),A(this,"instrumentedIframes",new Set),A(this,"iframeUnloadHandlers",new Map),A(this,"iframeMutationObserver",null),A(this,"documentIds",new WeakMap),A(this,"documentIdCounter",0),A(this,"handleFormField
1Focus",t(t=>{const e=t.target;if(!this.isFormField(e))return;const i=this.getParentForm(e);if(!i)return;const n=this.getFormId(i);if(!this.activeFormInteractions.has(n)){const t=this.getFormName(i),r=this.isFormElement(i),o=r?s(i,"action"):"",a=r?s(i,"method").toLowerCase()||"get":"",c=e.ownerDocument!==document,h={formId:n,formName:t,action:o,method:a,startTime:Date.now(),lastInteraction:Date.now(),fields:{},submitted:!1,...c&&{fromIframe:c}};this.activeFormInteractions.set(n,h),this.interactionDocuments.set(n,i.ownerDocument),this.emit(x.FORM_START,{formId:n,...c&&{fromIframe:c}})}const r=this.activeFormInteractions.get(n);r&&(this.updateFormFieldData(r,i),r.lastInteraction=Date.now())},"form-tracker.focus")),A(this,"handleFormFieldChange",t(t=>{const e=t.target;if(!this.isFormField(e))return;const i=this.getParentForm(e);if(!i)return;const s=this.getFormId(i),n=this.activeFormInteractions.get(s);if(n){this.updateFormFieldData(n,i);const t=r(e);if(t){const i=e.ownerDocument!==document;this.emit(x.FORM_UPDATE,{formId:s,formName:n.formName,fieldName:t.name||t.id||"unknown",fieldValue:t.value,fieldType:t.type,...i&&{fromIframe:i}})}}},"form-tracker.change")),A(this,"handleFormSubmit",t(t=>{const e=t.target;e&&(!t.isTrusted&&!t.t||this.recordSubmission(e,!t.isTrusted))},"form-tracker.submit")),A(this,"handlePageUnload",t(()=>{this.abandonInteractions()},"form-tracker.unload"))}addSensitiveField(t){this.sensitiveFields.includes(t)||this.sensitiveFields.push(t)}startTracking(){typeof window>"u"||this.eventHandlersInstalled||(document.addEventListener("focusin",this.handleFormField
1Focus,!0),document.addEventListener("change",this.handleFormFieldChange,!0),document.addEventListener("submit",this.handleFormSubmit,!0),window.addEventListener("beforeunload",this.handlePageUnload),this.patchFormSubmitMethod(),this.instrumentIframes(),this.observeNewIframes(),this.eventHandlersInstalled=!0)}stopTracking(){var t;typeof window>"u"||!this.eventHandlersInstalled||(document.removeEventListener("focusin",this.handleFormFieldFocus,!0),document.removeEventListener("change",this.handleFormFieldChange,!0),document.removeEventListener("submit",this.handleFormSubmit,!0),window.removeEventListener("beforeunload",this.handlePageUnload),this.unpatchFormSubmitMethod(),null==(t=this.iframeMutationObserver)||t.disconnect(),this.iframeMutationObserver=null,this.cleanupIframeListeners(),this.eventHandlersInstalled=!1)}recordSubmission(t,e){if(this.isTrackerForm(t))return;const i=this.getFormId(t);if(this.submittedForms.has(i)&&e||!e&&this.recentProgrammaticSubmits.has(i))return;e&&!this.recentProgrammaticSubmits.has(i)&&(this.recentProgrammaticSubmits.add(i),setTimeout(()=>this.recentProgrammaticSubmits.delete(i),0));const n=this.activeFormInteractions.get(i);if(n)this.updateFormFieldData(n,t),n.submitted=!0;else{const e=t.ownerDocument!==document,n={formId:i,formName:this.getFormName(t),action:s(t,"action"),method:s(t,"method").toLowerCase()||"get",startTime:Date.now(),lastInteraction:Date.now(),fields:{},submitted:!0,...e&&{fromIframe:!0}};this.updateFormFieldData(n,t),this.activeFormInteractions.set(i,n),this.interactionDocuments.set(i,t.ownerDocument)}this.submittedForms.add(i);const r=this.activeFormInteractions.get(i);if(!r)return;const o=Q(Date.now()-r.startTime),a=function(t){var e,i;const s={};for(const[n,r]of Object.entries(t)){if("***"===r.value)continue;const t=(null==(e=r.name)?void 0:e.toLowerCase())||"",o=(null==(i=r.id)?void 0:i.toLowerCase())||"",a=n.toLowerCase();t.includes("email")||o.includes("email")||a.includes("email")?s.email=r.value:t.includes("firstname")||o.includes("firstname")||"fname"===t||"fname"===o?s.firstName=r.value:t.includes("lastname")||o.includes("lastname")||"lname"===t||"lname"===o?s.lastName=r.value:!t.includes("name")&&!o.includes("name")||s.firstName||s.lastName?t.includes("phone")||o.includes("phone")||t.includes("tel")||o.includes("tel")?s.phone=r.value:t.includes("company")||o.includes("company")||t.includes("organization")||o.includes("organization")?s.company=r.value:t.includes("title")||o.includes("title")||t.includes("position")||o.includes("position")?s.title=r.value:(t.includes("username")||o.includes("username"))&&(s.username=r.value):s.name=r.value}return s}(r.fields),c=t.ownerDocument!==document;this.emit(x.FORM_SUBMIT,{formId:i,formName:r.formName,action:r.action,method:r.method,timeSpent:o,fields:r.fields,traits:a,...c&&{fromIframe:c}})}abandonInteractions(t){for(const[e,i]of this.activeFormInteractions.entries()){const s=this.interactionDocuments.get(e)??document;if(t&&s!==t||(this.activeFormInteractions.delete(e),this.interactionDocuments.delete(e),i.submitted||this.submittedForms.has(e)))continue;const n=Q(Date.now()-i.startTime),r=Q(Date.now()-i.lastInteraction);this.emit(x.FORM_ABANDON,{formId:e,formName:i.formName,timeSpent:n,timeSinceLastInteraction:r,fieldCount:Object.keys(i.fields).length,fields:i.fields,...i.fromIframe&&{fromIframe:!0}})}}isFormField(t){const e=t.tagName;return"INPUT"===e||"SELECT"===e||"TEXTAREA"===e}isFormVisible(t){const e=(t.ownerDocument.defaultView||window).getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||0===t.offsetWidth||0===t.offsetHeight)}isTrackerForm(t){return!(!function(t){if(!t||"string"!=typeof t)return!1;const e=t.toLowerCase();return tt.some(t=>e.includes(t))}(t.getAttribute("action")||"")&&this.isFormVisible(t))}getParentForm(t){const e=t.closest("form");if(e)return e;const i=t.closest("section");if(i)return i;const s=t.closest("article");if(s)return s;let n=t.parentElement;for(;n&&n!==t.ownerDocument.body;){if("DIV"===n.tagName){const t=n.className||"",e=n.id||"";if(t.includes("form")||e.includes("form"))return n}n=n.parentElement}const r=["[data-form]",'[role="form"]',".form-container",".form-wrapper"];for(const o of r){const e=t.closest(o);if(e instanceof HTMLElement)return e}return t.ownerDocument.body}isFormElement(t){return"FORM"===t.tagName}getFormId(t){if(this.isFormElement(t)){const e=s(t,"id");if(e)return e;const i=s(t,"name");if(i)return i}const e=s(t,"data-form-id");if(e)return e;if(!this.isFormElement(t)){const e=this.getStableElementSuffix(t);return t.id?`container_${t.id}_${e}`:t.className?`container_${t.className.split(" ")[0]}_${e}`:t===document.body?"container_body":"container_standalone_"+e}const i=s(t,"class");return i?"form_"+i.split(" ")[0]:"form_"+this.getStableElementSuffix(t)}getStableElementSuffix(t){const e=[];let i=t;for(;i&&"HTML"!==i.tagName;){const t=i.parentElement,s=t?Array.prototype.indexOf.call(t.children,i):0;e.push(`${i.tagName}:${s}`),i=t}const s=t.ownerDocument;s!==document&&(this.documentIds.has(s)||this.documentIds.set(s,++this.documentIdCounter),e.push("doc:"
1+this.documentIds.get(s)));let n=5381;const r=e.join(">");for(let o=0;o<r.length;o++)n=33*n^r.charCodeAt(o);return(n>>>0).toString(36)}getFormName(t){var e,i;return[s(t,"name"),s(t,"data-form-name"),s(t,"aria-label"),null==(i=null==(e=t.querySelector("h1, h2, h3, legend"))?void 0:e.textContent)?void 0:i.trim()].filter(Boolean)[0]||void 0}updateFormFieldData(t,e){const i=e.querySelectorAll("input, select, textarea");for(const s of i){const e=r(s),i=X((null==e?void 0:e.value)||"");if(i&&"string"==typeof i&&this.emit(x.OBSERVE,i),e&&e.value){const i=e.name||e.id||e.label||"field_"+Object.keys(t.fields).length;t.fields[i]=e}}}patchFormSubmitMethod(){if(typeof window>"u"||this.originalSubmit)return;this.originalSubmit=HTMLFormElement.prototype.submit;const t=this;HTMLFormElement.prototype.submit=function(){var e;try{t.recordSubmission(this,!0)}catch(i){L(i,"Error recording programmatic form submission")}null==(e=t.originalSubmit)||e.call(this)}}unpatchFormSubmitMethod(){this.originalSubmit&&"u">typeof window&&(HTMLFormElement.prototype.submit=this.originalSubmit,this.originalSubmit=null)}instrumentIframes(){const t=document.querySelectorAll("iframe");for(const e of t)this.instrumentIframe(e)}instrumentIframe(t){if(this.instrumentedIframes.has(t))return;const e=()=>{try{const e=t.contentDocument,i=t.contentWindow;if(!e||!i)return;
1e.addEventListener("focusin",this.handleFormFieldFocus,!0),e.addEventListener("change",this.handleFormFieldChange,!0),e.addEventListener("submit",this.handleFormSubmit,!0);const s=()=>this.abandonInteractions(e);i.addEventListener("beforeunload",s),this.iframeUnloadHandlers.set(t,s),this.instrumentedIframes.add(t)}catch{}};e(),t.addEventListener("load",()=>{this.instrumentedIframes.delete(t),e()})}observeNewIframes(){document.body&&(this.iframeMutationObserver=new MutationObserver(t(t=>{for(const e of t)for(const t of e.addedNodes)if(t instanceof HTMLElement)if(t instanceof HTMLIFrameElement)this.instrumentIframe(t);else{const e=t.querySelectorAll("iframe");for(const t of e)this.instrumentIframe(t)}},"form-tracker.iframe-observer")),this.iframeMutationObserver.observe(document.body,{childList:!0,subtree:!0}))}cleanupIframeListeners(){for(const t of this.instrumentedIframes)try{const e=t.contentDocument,i=t.contentWindow;e&&(e.removeEventListener("focusin",this.handleFormFieldFocus,!0),e.removeEventListener("change",this.handleFormFieldChange,!0),e.removeEventListener("submit",this.handleFormSubmit,!0));const s=this.iframeUnloadHandlers.get(t);i&&s&&i.removeEventListener("beforeunload",s)}catch{}this.instrumentedIframes.clear(),this.iframeUnloadHandlers.clear()}}class it extends z{constructor(){super(),A(this,"onRateLimited"),A(this,"eventHandlersInstalled",!1),A(this,"clickTimestampsByElement",new Map),A(this,"privacySettings",{trackAllClicks:!1,collectPositionData:!0,collectModifierData:!0}),A(this,"trackDownloadClick",t=>{var e,i;const s=RegExp("[^/]*\\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt|csv|rtf|odt|ods|odp|pages|numbers|zip|rar|7z|tar|gz|dmg|exe|iso|mp4|mov|avi|mkv|wmv|mp3|wav|ogg|m4a|psd|ai|xd|sketch|fig|indd)$"),n=null==(i=null==(e=null==t?void 0:t.properties)?void 0:e.href)?void 0:i.match(s);n&&this.emit(x.DOWNLOAD,{properties:{...t.properties,fileName:n[0],href:t.properties.href||"",elementPath:t.properties.elementPath}})}),A(this,"handleClick",t(t=>{var e;const i=t.target,s=this.findClickableElement(i)||(this.privacySettings.trackAllClicks?i:null);if(!s)return;const n=this.extractElementData(s,i,t);this.withinClickRateLimit(n.elementPath)?this.emit(x.CLICK,{properties:n}):null==(e=this.onRateLimited)||e.call(this)},"click-tracker.click"))}startTracking(){this.eventHandlersInstalled||typeof window>"u"||(document.addEventListener("click",this.handleClick,!0),this.eventHandlersInstalled=!0,this.on(x.CLICK,this.trackDownloadClick))}stopTracking(){!this.eventHandlersInstalled||typeof window>"u"||(document.removeEventListener("click",this.handleClick,!0),this.eventHandlersInstalled=!1)}updatePrivacySettings(t){this.privacySettings={...this.privacySettings,...t}}withinClickRateLimit(t){const e=Date.now(),i=e-1e4,s=(this.clickTimestampsByElement.get(t)??[]).filter(t=>t>i);if(s.length>=10)return this.clickTimestampsByElement.set(t,s),!1;if(s.push(e),this.clickTimestampsByElement.set(t,s),this.clickTimestampsByElement.size>100)for(const[n,r]of this.clickTimestampsByElement.entries())r.some(t=>t>i)||this.clickTimestampsByElement.delete(n);return!0}findClickableElement(t){if(this.isClickableElement(t))return t;let e=t.parentElement;for(;e;){if(this.isClickableElement(e))return e;e=e.parentElement}return null}isClickableElement(t){const e=t.tagName.toLowerCase();if(["a","button"].includes(e))return!0;if("input"===e){const e=t.getAttribute("type");if("button"===e||"submit"===e)return!0}return!("button"!==t.getAttribute("role")&&!t.hasAttribute("onclick")&&!t.hasAttribute("data-track-event"))}extractElementData(t,e,i){var s;const n=t.tagName,r=t.id||"",o=Array.from(t.classList).join(" "),a=t.getAttribute("href")||"",c=(null==(s=t.textContent)?void 0:s.trim())||"";let h=n.toLowerCase();"INPUT"===n&&(h=`${n.toLowerCase()}[${t.getAttribute("type")||""}]`);const u=this.getDataAttributes(t),l=this.getDomPath(t),d=t.parentElement,f=d?{id:d.id||void 0,classes:d.className||void 0,tag:d.tagName.toLowerCase()}:{};let m,p;if(this.privacySettings.collectPositionData){const e=t.getBoundingClientRect();m={x:e.left+window.scrollX,y:e.top+window.scrollY,viewport:{x:e.left,y:e.top}
1,elementSize:{width:e.width,height:e.height}}}return this.privacySettings.collectModifierData&&(p={ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey,meta:i.metaKey}),{elementId:r,elementType:h,elementTag:n,elementText:c,classes:o,href:a,attributes:u,elementPath:l,parentInfo:f,position:m,clickType:i.button,modifiers:p,isVisible:this.isElementVisible(t)}}getDataAttributes(t){const e={};for(const i of Array.from(t.attributes))i.name.startsWith("data-")&&"data-track-event"!==i.name&&(e[i.name.slice(5).replace(/-([a-z])/g,(t,e)=>e.toUpperCase())]=i.value);return e}getDomPath(t){const e=[];let i=t;for(;i&&"HTML"!==i.tagName;){let t=i.tagName.toLowerCase();if(i.id)t+="#"+i.id;else if(i.className&&"string"==typeof i.className){const e=i.className.split(" ");e.length>0&&e[0]&&(t+="."+e[0])}e.unshift(t),i=i.parentElement}return e.join(" > ")}isElementVisible(t){const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||0===t.offsetWidth||0===t.offsetHeight)}}const st=class t{constructor(t={}){A(this,"isActive",!1),A(this,"isPageVisible",!0),A(this,"lastActivityTime",Date.now()),A(this,"activeStartTime",null),A(this,"accumulatedTime",0),A(this,"activityCheckInterval",null),A(this,"inactivityThreshold",6e4),A(this,"segments",[]),A(this,"handleVisibilityChange",()=>{this.isPageVisible="visible"===document.visibilityState,this.updateTracking()}),A(this,"handleActivity",()=>{this.recordActivity()}),t.inactivityThreshold&&(this.inactivityThreshold=t.inactivityThreshold),this.lastActivityTime=Date.now(),this.isActive=!0,"u">typeof window&&(this.setupVisibilityListener(),this.setupActivityListeners(),this.checkActivity(),this.isPageVisible="visible"===document.visibilityState)}setupVisibilityListener(){"u">typeof document&&document.addEventListener("visibilitychange",this.handleVisibilityChange)}setupActivityListeners(){if("u">typeof window)for(const e of t.ACTIVITY_EVENTS)window.addEventListener(e,this.handleActivity,{passive:!0})}recordActivity(){this.lastActivityTime=Date.now(),this.isActive=!0,this.updateTracking()}checkActivity(){this.activityCheckInterval=window.setInterval(()=>{Date.now()-this.lastActivityTime>this.inactivityThreshold&&this.isActive&&(this.isActive=!1,this.updateTracking())},100)}updateTracking(){const e=this.isPageVisible&&this.isActive;if(e&&null===this.activeStartTime)this.activeStartTime=Date.now();else if(!e&&null!==this.activeStartTime){const e=Date.now(),i=e-this.activeStartTime;this.accumulatedTime+=i,this.segments.push({start:this.activeStartTime,end:e,location:window.location.href}),this.segments.length>t.MAX_SEGMENTS&&this.segments.splice(0,this.segments.length-t.MAX_SEGMENTS),this.activeStartTime=null}}getEngagementTime(){let t=this.accumulatedTime;return null!==this.activeStartTime&&(t+=Date.now()-this.activeStartTime),Q(t)}getEngagementSegments(){const t=[...this.segments];return null!==this.activeStartTime&&t.push({start:this.activeStartTime,end:Date.now(),location:window.location.href}),t}reset(){this.accumulatedTime=0,this.activeStartTime=null,this.segments=[],this.lastActivityTime=Date.now(),this.isActive=!0}simulateActivity(){this.lastActivityTime=Date.now(),this.isActive=!0,this.updateTracking()}simulateVisibilityChange(t){this.isPageVisible=t,this.updateTracking()}simulateInactivity(){this.isActive=!1,this.updateTracking()}destroy(){if(this.activityCheckInterval&&(clearInterval(this.activityCheckInterval),this.activityCheckInterval=null),"u">typeof document&&document.removeEventListener("visibilitychange",this.handleVisibilityChange),"u">typeof window)for(const e of t.ACTIVITY_EVENTS)window.removeEventListener(e,this.handleActivity);null!==this.activeStartTime&&(this.isActive=!1,this.updateTracking())}};A(st,"MAX_SEGMENTS",200),A(st,"ACTIVITY_EVENTS",["mousedown","mousemove","keypress","scroll","touchstart"]);let nt=st;class rt{constructor(t="radar_"){A(this,"prefix"),this.prefix=t}getPrefixedKey(t){return this.prefix+t}safeParse(t){try{return JSON.parse(t)}catch{return t}}safeStringify(t){return"string"==typeof t?t:JSON.stringify(t)}}C=(t=>(t.ANALYTICS="analytics",t.MARKETING="marketing",t.FUNCTIONAL="functional",t.NECESSARY="necessary",t))(C||{});let ot,at=0;const ct="__sn_tld_probe";class ht extends rt{set(t,e,i={},s){const n=this.getPrefixedKey(t),r=this.safeStringify(e);try{return"cookie"!==i.storage?(localStorage.setItem(n,r),i.expires&&this.setExpiration(n,i.expires),i.cookie&&this.setCookie(n,r,i),!0):this.setCookie(n,r,i)}catch{if(!1!==i.cookie)return this.setCookie(n,r,i)}return!1}get(t,e={},i){const s=this.getPrefixedKey(t);if("cookie"!==e.storage)try{if(this.hasExpired(s))return this.remove(t),null;const e=localStorage.getItem(s);if(null!==e)return this.safeParse(e)}catch(n){R("Failed to read localStorage for: "+t,n)}if(!1!==e.cookie)try{const t=this.getCookie(s);if(t)return this.safeParse(t)}catch(n){R("Failed to read cookie for: "+t,n)}return null}remove(t,e={},i){const s=this.getPrefixedKey(t);let n=!1;try{"cookie"!==e.storage&&(localStorage.removeItem(s),localStorage.removeItem(s+"_expires"),n=!0),!1!==e.cookie&&(this.removeCookie(s,e),n=!0)}catch(r){return R("Failed to remove item from storage: "+t,r),!1}return n}exists(t,e={},i){return null!==this.get(t,e,i)}clear(){try{for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&t.startsWith(this.prefix)&&localStorage.removeItem(t)}const t=document.cookie.split(";");for(let e=0;e<t.length;e++){const i=t[e].trim().split("=")[0];if(i&&i.startsWith(this.prefix)){const t=i+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";document.cookie=t;const e=c();e&&(document.cookie=`${t} domain=${e};`)}}return!0}catch(t){return R("Failed to clear storage",t),!1}}migrate(t){if(!(t instanceof rt))return;let e;try{e=this.getSessionStorageKeys()}catch(i){return void L(i,"storage.migrate")}for(const s of e){if(!s.startsWith(this.prefix))continue;const t=s.substring(this.prefix.length),e=sessionStorage.getItem(s);if(null!==e){const i=this.safeParse(e);
1if(t.includes("device_id"))this.get(t)||this.set(t,i,{cookie:!0,expires:31536e6},C.NECESSARY);else if(t.includes("session"))this.set(t,i,{},C.FUNCTIONAL);else if(t.includes("user_traits")){const e=this.get(t);if(e){const s={...e,...i};this.set(t,s,{expires:31536e6},C.ANALYTICS)}else this.set(t,i,{expires:31536e6},C.ANALYTICS)}else this.set(t,i);sessionStorage.removeItem(s)}}}getSessionStorageKeys(){const t=[];for(let e=0;e<sessionStorage.length;e++){const i=sessionStorage.key(e);i&&t.push(i)}return t}setExpiration(t,e){const i=e instanceof Date?e.getTime():Date.now()+e;localStorage.setItem(t+"_expires",i.toString())}hasExpired(t){const e=t+"_expires",i=localStorage.getItem(e);return!!i&&Date.now()>+i}setCookie(t,e,i={}){try{const s=i.expires instanceof Date?i.expires:new Date(Date.now()+(i.expires||864e5)),n=i.path||"/",r=i.domain||c(),o=i.sameSite||"Lax",a=i.secure||"https:"===window.location.protocol;let h=`${t}=${encodeURIComponent(e)}; path=${n}; expires=${s.toUTCString()}`;return r&&(h+="; domain="+r),o&&(h+="; SameSite="+o),a&&(h+="; Secure"),document.cookie=h,!0}catch(s){return R("Failed to set cookie: "+t,s),!1}}getCookie(t){var e;const i=null==(e=null==document?void 0:document.cookie)?void 0:e.match(`(^|;)\\s*${t}\\s*=\\s*([^;]+)`);return i?a(i[2]):null}removeCookie(t,e={}){try{const i=e.path||"/",s=e.domain||c();let n=`${t}=; path=${i}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;return s&&(n+="; domain="+s),document.cookie=n,!0}catch(i){return R("Failed to remove cookie: "+t,i),!1}}}class ut extends rt{set(t,e,i={},s){const n=this.getPrefixedKey(t),r=this.safeStringify(e);try{return sessionStorage.setItem(n,r),!0}catch(o){return R("Failed to set item in session storage: "+t,o),!1}}get(t,e={},i){const s=this.getPrefixedKey(t);try{const t=sessionStorage.getItem(s);if(null!==t)return this.safeParse(t)}catch(n){R("Failed to get item from session storage: "+t,n)}return null}remove(t,e={},i){const s=this.getPrefixedKey(t);try{return sessionStorage.removeItem(s),!0}catch(n){return R("Failed to remove item from session storage: "+t,n),!1}}exists(t,e={},i){return null!==this.get(t,e,i)}clear(){try{const t=[];for(let e=0;e<sessionStorage.length;e++){const i=sessionStorage.key(e);i&&i.startsWith(this.prefix)&&t.push(i)}for(const e of t)sessionStorage.removeItem(e);return!0}catch(t){return R("Failed to clear session storage",t),!1}}migrate(t){}}class lt{constructor(t){A(this,"SESSION_KEY","session"),A(this,"SESSION_TIMEOUT",18e5),A(this,"MAX_SEGMENTS",200),A(this,"currentSession",null),A(this,"focusTimer"),A(this,"storage"),A(this,"engagementBaseline",0),A(this,"segmentsBaseline",[]),this.storage=t,this.focusTimer=new nt}getTimeout(){return this.SESSION_TIMEOUT}getSession(){this.currentSession||(this.currentSession=this.loadSession(),this.currentSession&&!this.hasSessionExpired(this.currentSession)&&(this.engagementBaseline=this.currentSession.engagementTime||0,this.segmentsBaseline=this.currentSession.engagementSegments||[])),this.hasSessionExpired(this.currentSession)&&(this.currentSession=this.createSession());const t=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=/_ga_([A-Z0-9]+)=([^;]+)/g;let e;for(;null!==(e=t.exec(document.cookie));){const t=e[1],i=a(e[2]).split(".");if(i.length>=3){const e=i[2];if(/^\d+$/.test(e))return{sessionId:e,containerId:t}}}}();return e&&(t.ga4SessionId=e.sessionId),t}(),e=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/intercom-session-[a-z0-9]+\s*=\s*([^;]+)/i);if(!t)return;const e=a(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.intercomSessionId=e),t}(),i=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)__hssc\s*=\s*([^;]+)/);if(!t)return;const e=a(t[1]).trim();if(!e||"undefined"===e||"null"===e)return;const i=e.split(".");return 2>i.length?void 0:i[1]}();return e&&(t.hubspotSessionId=e),t}();return{...this.currentSession,...t,...e,...i}}extendSession(){this.getSession(),this.currentSession&&(this.currentSession.lastActivity=(new Date).toISOString(),this.focusTimer.simulateActivity(),this.currentSession.engagementTime=this.getEngagementTime(),this.currentSession.engagementSegments=this.getEngagementSegments(),this.saveSession(this.currentSession))}endSession(){this.currentSession&&(this.currentSession.engagementTime=this.getEngagementTime(),this.currentSession.engagementSegments=this.getEngagementSegments(),this.saveSession(this.currentSession)),this.focusTimer.destroy(),this.storage.remove(this.SESSION_KEY),this.currentSession=null,this.focusTimer=new nt,this.engagementBaseline=0,this.segmentsBaseline=[]}getSessionDuration(){const t=this.getSession();return Q(Date.now()-Date.parse(t.startedAt))}getEngagementTime(){return this.engagementBaseline+this.focusTimer.getEngagementTime()}getEngagementSegments(){const t=[...this.segmentsBaseline,...this.focusTimer.getEngagementSegments()];return t.length>this.MAX_SEGMENTS?t.slice(t.length-this.MAX_SEGMENTS):t}createSession(){const t=(new Date).toISOString();this.focusTimer.reset(),this.engagementBaseline=0,this.segmentsBaseline=[];const e={id:o(),startedAt:t,lastActivity:t,engagementTime:0,engagementSegments:[]};return this.saveSession(e),e}loadSession(){return this.storage.get(this.SESSION_KEY,{},C.FUNCTIONAL)}saveSession(t){this.storage.set(this.SESSION_KEY,t,{expires:2*this.SESSION_TIMEOUT},C.FUNCTIONAL)}hasSessionExpired(t){return!t||Date.now()-Date.parse(t.lastActivity)>this.SESSION_TIMEOUT}}const dt="radar_sn_",ft=new TextEncoder;class mt{constructor(t,e){A(this,"DEVICE_KEY","device_id"),A(this,"TRAITS_KEY","user_traits"),A(this,"SNMETA_KEY","snmeta"),A(this,"storage"),A(this,"sessionStorage"),this.storage=t,this.sessionStorage=e}getDeviceId(){let t=this.storage.get(this.DEVICE_KEY,{cookie:!0},C.NECESSARY);return t||(t=o(),this.setDeviceId(t)),t}setDeviceId(t){this.storage.set(this.DEVICE_KEY,t,{cookie:!0,expires:31536e6},C.NECESSARY)}getTraits(){return this.storage.get(this.TRAITS_KEY,{},C.ANALYTICS)||{}}setTraits(t){const e=this.getTraits(),i={};for(const[n,r]of Object.entries(t))null!=r&&"object"!=typeof r&&(i[n]=r);const s={...e,...i};this.storage.set(this.TRAITS_KEY,s,{expires:31536e6},C.ANALYTICS)}getSnMeta(){return function(){try{const t=["sh","sg","de","rs","ped"],e={};let i=!1;for(const s of t){const t=u(s);t&&(e[s+"_id"]=t.hash,e[s+"_compute_time_ms"]=t.compute_time_ms,i=!0)}return i?btoa(JSON.stringify(e)):null}catch{return null}}()}getUser(){const t=this.getTraits(),e=this.getSnMeta(),i=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)_ga=([^;
1]+)/);if(!t)return;const e=a(t[1]).split(".");return 4>e.length?void 0:`${e[e.length-2]}.${e[e.length-1]}`}();return e&&(t.ga4ClientId=e),t}(),s=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/intercom-id-[a-z0-9]+\s*=\s*([^;]+)/i);if(!t)return;const e=a(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.intercomVisitorId=e),t}(),n=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=function(){const t=document.cookie.match(/(?:^|;\s*)hubspotutk\s*=\s*([^;]+)/);if(!t)return;const e=a(t[1]).trim();return e&&"undefined"!==e&&"null"!==e?e:void 0}();return e&&(t.hubspotUtk=e),t}(),r=function(){if(typeof document>"u"||!document.cookie)return{};const t={},e=p("_fbp");e&&(t.fbp=e);const i=p("_fbc");return i&&(t.fbc=i),t}();return{deviceId:this.getDeviceId(),traits:t,email:t.email,...e&&{snmeta:e},...i,...s,...n,...r}}reset(){this.storage.remove(this.DEVICE_KEY,{cookie:!0}),this.storage.remove(this.TRAITS_KEY)}}const pt=t=>t.split("#")[0],gt="u">typeof window&&"navigation"in window&&window.navigation?window.navigation:null;class wt extends z{constructor(){super(),A(this,"lastUrl",""),A(this,"unloaded",!1),A(this,"enterTimestamps",[]),A(this,"onRateLimited"),A(this,"handlePageChange",()=>{var t;const e=pt(window.location.href);if(e!==this.lastUrl){if(!this.withinNavRateLimit())return void(null==(t=this.onRateLimited)||t.call(this));this.emit("page.exit",{url:this.lastUrl}),this.lastUrl=e,this.unloaded=!1,this.emit("page.enter",{url:e})}}),A(this,"handlePageExit",()=>{this.unloaded||(this.unloaded=!0,this.emit("page.exit",{url:this.lastUrl}))}),A(this,"handleVisibilityChange",()=>{"visible"===document.visibilityState&&this.handlePageChange()}),"u">typeof window&&(this.lastUrl=pt(window.location.href))}start(){if(typeof window>"u")return;const t=performance.getEntriesByType("navigation");t.length>0&&"reload"===t[0].type&&this.emit("page.reload",{url:this.lastUrl}),this.emit("page.enter",{url:this.lastUrl}),gt?this.setupNavigationAPI(gt):(this.patchHistoryMethods(),window.addEventListener("popstate",this.handlePageChange)),["beforeunload","pagehide"].forEach(t=>{window.addEventListener(t,this.handlePageExit,{once:!0})}),document.addEventListener("visibilitychange",this.handleVisibilityChange)}patchHistoryMethods(){["pushState","replaceState"].forEach(t=>{var e;const i=history;if(null!=(e=i[t])&&e.i)return;const s=i[t],n=(...t)=>{s.apply(history,t),this.handlePageChange()};n.i=!0,n.o=s,i[t]=n})}setupNavigationAPI(t){t.i||(t.i=!0,t.addEventListener("currententrychange",()=>{this.handlePageChange()}))}withinNavRateLimit(){const t=Date.now()-1e4;return this.enterTimestamps=this.enterTimestamps.filter(e=>e>t),15>this.enterTimestamps.length&&(this.enterTimestamps.push(Date.now()),!0)}}class yt extends z{constructor(){super(),A(this,"focusTimer"),A(this,"pageViewId"),A(this,"timestamp"),A(this,"nav"),A(this,"stored"),A(this,"sessionIdAtEnter",null),A(this,"onRateLimited"),this.focusTimer=new nt,this.pageViewId=o(),this.timestamp=(new Date).toISOString(),this.nav=new wt,this.nav.onRateLimited=()=>{var t;return null==(t=this.onRateLimited)?void 0:t.call(this)},this.stored=this.getInitialPageData(),this.nav.on("page.enter",()=>{this.pageViewId=o(),this.timestamp=(new Date).toISOString(),this.focusTimer.destroy(),this.focusTimer=new nt,this.sessionIdAtEnter=null,this.trackCurrentPage("enter")}),this.nav.on("page.exit",()=>{this.trackCurrentPage("exit")})}getInitialPageData(){return typeof window>"u"?{url:"",title:"",referrer:"",pageViewId:this.pageViewId}:{url:window.location.href,title:document.title,referrer:document.referrer,pageViewId:this.pageViewId}}startTracking(){this.nav.start()}getPage(t=!1){return t&&(this.stored=this.getInitialPageData()),this.stored}setSessionIdAtEnter(t){this.sessionIdAtEnter=t}getSessionIdAtEnter(){return this.sessionIdAtEnter}
1getPageEngagementParams(t){const e="enter"===t?0:Q(Date.now()-Date.parse(this.timestamp)),i="enter"===t?0:this.focusTimer.getEngagementTime(),s="enter"===t?[]:this.focusTimer.getEngagementSegments();return{stage:t,pageViewId:this.pageViewId,timestamp:this.timestamp,totalTimeOnPage:e,totalFocusTimeOnPage:i,pageEngagementSegments:s}}trackCurrentPage(t){const e={...this.getPage("enter"===t),...this.getPageEngagementParams(t)};this.emit(x.PAGEVIEW,e)}}class vt extends Error{constructor(t){super("Service temporarily unavailable"),A(this,"nextAttemptTime"),this.name="CircuitBreakerOpenError",this.nextAttemptTime=t}getWaitTime(){return Math.max(0,this.nextAttemptTime-Date.now())}}class bt{constructor(t={}){A(this,"state","CLOSED"),A(this,"failureCount",0),A(this,"successCount",0),A(this,"lastFailureTime",null),A(this,"nextAttemptTime",null),A(this,"config"),this.config={failureThreshold:5,timeoutMs:6e4,successThreshold:3,monitoringWindowMs:12e4,...t}}async execute(t){if(!this.canExecute())return Promise.reject(new vt(this.nextAttemptTime||Date.now()+this.config.timeoutMs));try{const e=await t();return this.onSuccess(),e}catch(e){return this.onFailure(),Promise.reject(e)}}canExecute(){const t=Date.now();switch(this.lastFailureTime&&t-this.lastFailureTime>this.config.monitoringWindowMs&&this.reset(),this.state){case"CLOSED":case"HALF_OPEN":return!0;case"OPEN":return!(!this.nextAttemptTime||t<this.nextAttemptTime||(this.moveToHalfOpen(),0));default:return!1}}onSuccess(){"HALF_OPEN"===this.state?(this.successCount++,this.successCount>=this.config.successThreshold&&this.moveToClosed()):"CLOSED"===this.state&&(this.failureCount=0)}onFailure(){this.failureCount++,this.lastFailureTime=Date.now(),"CLOSED"===this.state?this.failureCount>=this.config.failureThreshold&&this.moveToOpen():"HALF_OPEN"===this.state&&this.moveToOpen()}moveToOpen(){this.state="OPEN",this.successCount=0,this.nextAttemptTime=Date.now()+this.config.timeoutMs}moveToHalfOpen(){this.state="HALF_OPEN",this.successCount=0,this.nextAttemptTime=null}moveToClosed(){this.state="CLOSED",this.failureCount=0,this.successCount=0,this.lastFailureTime=null,this.nextAttemptTime=null}reset(){this.moveToClosed()}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,lastFailureTime:this.lastFailureTime,nextAttemptTime:this.nextAttemptTime}}forceState(t){this.state=t,"OPEN"===t&&(this.nextAttemptTime=Date.now()+this.config.timeoutMs)}}let St=null;const kt="Rdr7xK9mPqL2vNwYsT4jHcBfG8aE5uZo";class xt{constructor(t,e={},i={}){A(this,"baseUrl"),A(this,"defaultOptions"),A(this,"circuitBreaker"),this.baseUrl=t.endsWith("/")?t:t+"/",this.defaultOptions={headers:{"Content-Type":"application/json",Accept:"application/json"},timeout:3e4,retries:1,compress:!0,baseDelay:1e3,maxDelay:3e4,jitter:!0,circuitBreaker:!0,...e},this.circuitBreaker=new bt(i)}async send(t,e,i={}){const s=this.getFullUrl(t),n=this.mergeOptions(i);return n.circuitBreaker?this.circuitBreaker.execute(()=>this.sendRequest(s,e,n)):this.sendRequest(s,e,n)}async sendRequest(t,e,i){const s={...this.sanitizeForJSON(e),_c:kt},n=JSON.stringify(s),r=new AbortController,o=setTimeout(()=>{r.abort()},i.timeout);try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,signal:r.signal});if(!e.ok)throw Error(`HTTP error ${e.status+""}: ${e.statusText}`);return e}catch(a){if(i.retries&&i.retries>0)return this.retryRequest(t,e,{...i,retries:i.retries-1},i.retries);throw a}finally{clearTimeout(o)}}beacon(t,e){const i=this.getFullUrl(t),s={..."string"==typeof e?JSON.parse(e):this.sanitizeForJSON(e),_c:kt},n=JSON.stringify(s);if(function(){if(null!==St)return St;if(typeof navigator>"u"||"function"!=typeof navigator.sendBeacon)return St=!1,!1;const t=navigator.userAgent||"";return St=!function(t){const e=t.match(/iP.+; CPU .*OS (\d+)[_\d]*.* AppleWebKit\//);return!!e&&13>=parseInt(e[1],10)}(t)&&!function(t){const e=t.match(/Macintosh;.*Mac OS X (\d+)_(\d+)[_\d]*.* AppleWebKit\//);if(!e)return!1;const i=parseInt(e[1],10),s=parseInt(e[2],10);return/Version\/.*Safari\//.test(t)&&!/Chrom(e|ium)/.test(t)&&(10>i||10===i&&15>=s)}(t),St}
1())try{if(navigator.sendBeacon(i,n))return!0}catch{}try{return fetch(i,{method:"POST",body:n,keepalive:!0,mode:"cors",credentials:"omit"}).catch(()=>{}),!0}catch{return!1}}async fetchJson(t,e={}){const i=this.getFullUrl(t),s=this.mergeOptions(e);return s.circuitBreaker?this.circuitBreaker.execute(()=>this.fetchJsonRequest(i,s)):this.fetchJsonRequest(i,s)}async fetchJsonRequest(t,e){const i=new AbortController,s=setTimeout(()=>{i.abort()},e.timeout);try{const e=await fetch(t,{method:"GET",headers:{Accept:"application/json"},signal:i.signal});if(!e.ok)throw Error(`HTTP error ${e.status+""}: ${e.statusText}`);return await e.json()}finally{clearTimeout(s)}}async retryRequest(t,e,i,s){const n=s-(i.retries||0),r=this.calculateBackoffDelay(n,i);return await new Promise(t=>setTimeout(t,r)),this.sendRequest(t,e,i)}calculateBackoffDelay(t,e){const i=e.baseDelay||this.defaultOptions.baseDelay||1e3,s=e.maxDelay||this.defaultOptions.maxDelay||3e4,n=void 0!==e.jitter?e.jitter:this.defaultOptions.jitter,r=Math.min(i*Math.pow(2,t-1),s);if(n){const t=.25*r,e=2*(Math.random()-.5)*t;return Math.max(0,r+e)}return r}getFullUrl(t,e){const i=e||this.baseUrl;return t.startsWith("http")?t:`${i.endsWith("/")?i:i+"/"}${t.startsWith("/")?t.slice(1):t}`}mergeOptions(t){return{...this.defaultOptions,...t,headers:{...this.defaultOptions.headers,...t.headers}}}sanitizeForJSON(t){if("string"==typeof t)return t.replace(RegExp("[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]","g"),"�");if(t&&"object"==typeof t){if(Array.isArray(t))return t.map(t=>this.sanitizeForJSON(t));const e={};for(const[i,s]of Object.entries(t))e[this.sanitizeForJSON(i)]=this.sanitizeForJSON(s);return e}return t}getCircuitBreakerStats(){return this.circuitBreaker.getStats()}forceCircuitBreakerState(t){this.circuitBreaker.forceState(t)}}T=(t=>(t[t.CRITICAL=1]="CRITICAL",t[t.HIGH=2]="HIGH",t[t.MEDIUM=3]="MEDIUM",t[t.LOW=4]="LOW",t))(T||{});class Ct{constructor(t={}){A(this,"items",[]),A(this,"config"),A(this,"onDrop"),this.config={maxSize:100,maxAge:36e5,priorityLimits:{1:30,2:25,3:25,4:20},...t}}enqueue(t){var e;const i={...t,timestamp:Date.now()},s=this.items.length;this.cleanupOldItems(),this.items.push(i),this.items.sort((t,e)=>t.priority-e.priority),this.enforceSizeLimits();const n=s+1-this.items.length;n>0&&(null==(e=this.onDrop)||e.call(this,n))}dequeue(t=1){return this.items.splice(0,t)}peek(t=1){return this.items.slice(0,t)}getByPriority(t){return this.items.filter(e=>e.priority===t)}clear(){this.items=[]}size(){return this.items.length}isEmpty(){return 0===this.items.length}getStats(){const t={1:0,2:0,3:0,4:0};let e=null,i=null;for(const s of this.items)t[s.priority]++,(null===e||s.timestamp<e)&&(e=s.timestamp),(null===i||s.timestamp>i)&&(i=s.timestamp);return{totalItems:this.items.length,priorityBreakdown:t,oldestItem:e,newestItem:i}}cleanupOldItems(){const t=Date.now()-this.config.maxAge;this.items=this.items.filter(e=>e.timestamp>=t)}enforceSizeLimits(){this.enforcePriorityLimits(),this.items.length>this.config.maxSize&&(this.items=this.items.slice(0,this.config.maxSize))}enforcePriorityLimits(){var t;const e=new Map;for(const s of this.items)e.has(s.priority)||e.set(s.priority,[]),null==(t=e.get(s.priority))||t.push(s);const i=[];for(const[s,n]of e){const t=this.config.priorityLimits[s];n.sort((t,e)=>e.timestamp-t.timestamp),i.push(...n.slice(0,t))}this.items=i.sort((t,e)=>t.priority-e.priority)}}const Tt="1.22.18",_t={maxSize:200,maxAge:18e5,priorityLimits:{[T.CRITICAL]:70,[T.HIGH]:50,[T.MEDIUM]:30,[T.LOW]:20}},Et={batchSize:25,flushInterval:5e3,useBeacon:!0},Dt=65536;class It{constructor(t,e){A(this,"queue",[]),A(this,"priorityQueue"),A(this,"flushTimeout",null),A(this,"exiting",!1),A(this,"exitHooks",[]),A(this,"failureMode",!1),A(this,"options"),A(this,"httpClient"),A(this,"config"),A(this,"domainWarned",!1),A(this,"onHealth"),this.config=t,this.httpClient=e,this.options={...Et,apiEndpoint:t.apiEndpoint,usePriorityQueue:!0,priorityQueueConfig:_t},this.priorityQueue=new Ct(this.options.priorityQueueConfig),this.priorityQueue.onDrop=t=>{var e;return null==(e=this.onHealth)?void 0:e.call(this,"pq_dropped",t)},this.setupExitHandler()}checkDomainAllowed(){if(this.domainWarned||typeof window>"u")return;const t=window.location.hostname;w(t,this.config.allowedDomains)||(this.domainWarned=!0,((...t)=>{B(...t)})(`[${this.config.namespace}] Domain "${t}" is not in allowedDomains. Check your domain configuration.`))}enqueue(t){const e={...t,timestamp:t.timestamp??(new Date).toISOString()};try{JSON.stringify(e)}catch(i){return void L(i,"transport.unserializable."+t.type)}if(this.failureMode&&(e.type===x.SDK_ERROR||e.type===x.SDK_HEALTH))try{this.httpClient.beacon("tracker/event",this.toPayload([e],!0))}catch{}if(this.exiting)this.sendImmediate([e]);
1else{if(t.type===x.PAGEVIEW&&t.properties&&"enter"===t.properties.stage)return this.queue.push(e),void this.flush();if(this.failureMode&&this.options.usePriorityQueue){const i=g(t);return void this.priorityQueue.enqueue({id:t.id,data:e,priority:i})}this.queue.push(e),this.queue.length<this.options.batchSize?this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>{this.flush()},this.options.flushInterval)):this.flush()}}flush(){if(this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.failureMode&&this.options.usePriorityQueue)return void this.flushPriorityQueue();if(0===this.queue.length)return;const t=[...this.queue];this.queue=[],this.sendBatch(t).catch(e=>{this.config.debug&&R("Failed to send batch, retrying...",e.message),this.handleSendFailure(t,e)})}flushPriorityQueue(){if(this.priorityQueue.isEmpty())return;const t=this.priorityQueue.dequeue(this.options.batchSize),e=t.map(t=>t.data);this.sendBatch(e).catch(e=>{this.config.debug&&R("Failed to send priority batch, retrying...",e.message),this.handlePriorityQueueFailure(t,e)})}async sendBatch(t){var e;if(0!==t.length){if(this.exiting&&this.options.useBeacon)return void(this.sendBeacon(t)||null==(e=this.onHealth)||e.call(this,"beacon_false"));try{await this.httpClient.send("tracker/event",this.toPayload(t)),this.failureMode&&this.exitFailureMode()}catch(i){throw this.config.debug&&R("Batch send failed:",i),i}}}sendImmediate(t){var e;0!==t.length&&(this.options.useBeacon?this.sendBeacon(t)||null==(e=this.onHealth)||e.call(this,"beacon_false"):this.httpClient.send("tracker/event",this.toPayload(t)).catch(t=>{this.config.debug&&R("Failed to send immediate data:",t.message)}))}sendBeacon(t){const e=this.toPayload(t,!0);return this.getPayloadSize(e)>Dt?this.sendSplitBeacon(t):this.httpClient.beacon("tracker/event",e)}sendSplitBeacon(t){if(1>=t.length)return this.httpClient.send("tracker/event",this.toPayload(t)).catch(t=>{var e;null==(e=this.onHealth)||e.call(this,"beacon_false"),this.config.debug&&R("Failed to send oversized single item:",t.message)}),!0;const e=Math.floor(t.length/2),i=t.slice(0,e),s=t.slice(e),n=this.sendBeacon(i),r=this.sendBeacon(s);return n&&r}onExit(t){this.exitHooks.push(t)}setupExitHandler(){if(typeof window>"u")return;const e=t(()=>{if(!this.exiting){for(const t of this.exitHooks)try{t()}catch{}this.exiting=!0,this.flush()}},"transport.exit-flush");try{window.addEventListener("beforeunload",e,{capture:!0}),window.addEventListener("pagehide",e,{capture:!0}),window.addEventListener("pageshow",()=>{this.exiting=!1}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?e():this.exiting=!1})}catch(i){L(i,"transport.exit-setup")}}handleSendFailure(t,e){e instanceof vt?(this.enterFailureMode(),this.options.usePriorityQueue?this.moveItemsToPriorityQueue(t):this.queue=[...t,...this.queue]):this.queue=[...t,...this.queue],this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>this.flush(),this.options.flushInterval))}handlePriorityQueueFailure(t,e){var i;const s=e instanceof vt;for(const n of t)s||(n.retryCount=(n.retryCount||0)+1),3>(n.retryCount||0)?this.priorityQueue.enqueue(n):null==(i=this.onHealth)||i.call(this,"retry_dropped");this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>this.flush(),2*this.options.flushInterval))}enterFailureMode(){var t;this.failureMode||(this.failureMode=!0,null==(t=this.onHealth)||t.call(this,"circuit_open"),this.config.debug&&R("Entering failure mode - using priority queue"),this.options.usePriorityQueue&&(this.moveItemsToPriorityQueue(this.queue),this.queue=[]))}exitFailureMode(){if(!this.failureMode)return;this.failureMode=!1,this.config.debug&&((...t)=>{null==N||N.log(...t)})("Exiting failure mode - returning to normal queue");const t=this.priorityQueue.dequeue(this.priorityQueue.size());this.queue=t.map(t=>t.data)}moveItemsToPriorityQueue(t){for(const e of t){const t=g(e);this.priorityQueue.enqueue({id:e.id,data:e,priority:t})}}getStats(){return{failureMode:this.failureMode,normalQueueSize:this.queue.length,priorityQueueStats:this.priorityQueue.getStats(),isExiting:this.exiting}}getPriorityQueueStats(){return this.priorityQueue.getStats()}forceFailureMode(t){t?this.enterFailureMode():this.exitFailureMode()}clearQueues(){this.queue=[],this.priorityQueue.clear()}updateConfig(t){this.config=t,this.checkDomainAllowed()}getPayloadSize(t){return new Blob([JSON.stringify(t)]).size}createSafeBeaconPayload(t){const e={batch:t,metadata:{itemCount:t.length,sentAt:(new Date).toISOString(),isBeacon:!0,version:Tt,workspaceId:this.config.profileId,userAgent:"u">typeof navigator?navigator.userAgent:""}};if(this.getPayloadSize(e)<=Dt)return e;const i={...e,metadata:{...e.metadata,userAgent:"u">
1typeof navigator?navigator.userAgent.substring(0,100)+"...":""}};return this.getPayloadSize(i)>Dt?{...e,metadata:{...e.metadata,userAgent:""}}:i}toPayload(t,e=!1){if(e)return this.createSafeBeaconPayload(t);const i="u">typeof navigator?navigator.userAgent:"",s={};return i.includes("Chrome/125.0.0.0 Safari/537.3")&&(s._ua=btoa(unescape(encodeURIComponent(i)))),s.batch=t,s.metadata={itemCount:t.length,sentAt:(new Date).toISOString(),isBeacon:e,version:Tt,workspaceId:this.config.profileId,userAgent:i},s}}class At extends z{constructor(t,e){var i,s;super(),A(this,"anonymousId"),A(this,"spotterUrl"),A(this,"sessionStorageKey","spotter_data"),A(this,"legacyCallback"),A(this,"ga"),this.anonymousId=e,this.spotterUrl=`${t.apiEndpoint}/bp/${t.profileId}/organisation`,this.ga=null,null!=(i=null==window?void 0:window.SpotterSettings)&&i.callback&&(this.legacyCallback=null==(s=null==window?void 0:window.SpotterSettings)?void 0:s.callback)}async init(t){this.ga=t,this.identify()}get hasGaConnections(){return this.ga&&this.ga.connections.length>0}storeIdentificationData(t){try{sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(t))}catch{}}retrieveIdentificationDataFromSession(){try{const t=sessionStorage.getItem(this.sessionStorageKey);if(t)return JSON.parse(t)}catch{}return null}async getSpotterData(){const t=this.retrieveIdentificationDataFromSession();if(t)return t;try{const t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({anonymous_id:this.anonymousId,url:window.location.href})},e=await fetch(this.spotterUrl,t);if(e.ok){const t=await e.json();return this.storeIdentificationData(t),t}R("Spotter request failed with status",e.status)}catch(e){R("Failure to retrieve spotter data",e)}}mapToLegacySuccess(t){const e=t.data,i=Array.isArray(e.profiles)?e.profiles.reduce((t,e)=>(t[e.name]=e,t),{}):e.profiles;return{ip:"",domain:e.website,type:"business",company:{id:e.uuid,name:e.name,domain:e.website,industry:e.industry,founded_year:e.founded,employee_range:e.size,location:`${e.address.city}, ${e.address.country}`,description:"",emails:[e.email],phones:[e.phone],geo:{...e.address,street_name:e.address.street,state_code:e.address.country,country_code:e.address.state,gps:{lat:e.address.latitude,lon:e.address.longitude}},profiles:i}}}mapToLegacyFailure(){return{type:"isp"}}mapToLegacyDataset(t){return t.success?this.mapToLegacySuccess(t):this.mapToLegacyFailure()}invokeLegacyCallback(t){if(!this.legacyCallback)return;const e=this.mapToLegacyDataset(t);this.legacyCallback(e)}syncGa4Properties(t){if(!this.ga||!Array.isArray(this.ga.connections)||!t.success)return;const e={};for(const i of this.ga.connections){if(e[i.measurementId])return;const s=this.getMappedDimensions(i.mappings,t);this.sendGa4UserProperties(i.measurementId,s),e[i.measurementId]=!0}}getMappedDimensions(t,e){const i=this.mapToLegacyDataset(e);return Array.isArray(t)&&i?t.reduce((t,e)=>{const{attribute:s,dimension:n,fallback_value:r}=e,o=s.split(".").reduce((t,e)=>(null==t?void 0:t[e])??null,i);return t[n]=o||r,t},{}):{}}sendGa4UserProperties(t,e){window.dataLayer=window.dataLayer||[];const i=window.gtag||((...t)=>window.dataLayer.push(t));i("set","user_properties",e),i("event","Spotter Enriched",{...e,user_properties:{...e},event_category:"Spotter",non_interaction:!0,send_to:t})}async identify(){if(!this.legacyCallback&&!this.hasGaConnections)return;
1const t=await this.getSpotterData();if(t){try{this.invokeLegacyCallback(t)}catch(e){L(e,"spotter.legacy-callback")}try{this.syncGa4Properties(t)}catch(e){L(e,"spotter.ga4-sync")}return t}}}class Ft extends Error{}class Mt extends Error{constructor(t){super("settings endpoint returned HTTP "+t),this.status=t}}class Ot{constructor(){A(this,"callbacks",[])}onConsentChange(t){return this.callbacks.push(t),()=>{const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}}notifyConsentChange(t){this.callbacks.forEach(e=>{try{e(t)}catch(i){L(i,"consent.callback")}})}createConsentState(t,e,i,s=!0){return{analytics:t,marketing:e,functional:i,necessary:s,timestamp:new Date}}}class $t{static detectAvailableAdapter(){for(const t of this.adapters)if(t.detect())return t;return null}static getAllAdapters(){return[...this.adapters]}static registerAdapter(t){this.adapters.unshift(t)}}A($t,"adapters",[new class extends Ot{constructor(){super(...arguments),A(this,"name","Cookiebot"),A(this,"initialized",!1),A(this,"pollingInterval"),A(this,"lastConsentState",null)}detect(){return"u">typeof window&&!!window.Cookiebot}initialize(){var t;if(this.initialized||!this.detect())return;this.initialized=!0;const e=window.CookiebotOnAccept,i=window.CookiebotOnDecline;if(window.CookiebotOnAccept=()=>{e&&e();const t=this.getConsentState();t&&this.notifyConsentChange(t)},window.CookiebotOnDecline=()=>{i&&i();const t=this.getConsentState();t&&this.notifyConsentChange(t)},null!=(t=window.Cookiebot)&&t.hasResponse){const t=this.getConsentState();t&&this.notifyConsentChange(t)}else this.startConsentPolling()}hasConsent(t){const e=window.Cookiebot;if(!e||!e.hasResponse||!e.consent)return!1;if(!t)return e.consented;switch(t){case C.NECESSARY:return e.consent.necessary||!1;case C.FUNCTIONAL:return e.consent.preferences||!1;case C.ANALYTICS:return e.consent.statistics||!1;case C.MARKETING:return e.consent.marketing||!1;default:return!1}}getConsentState(){const t=window.Cookiebot;return t&&t.hasResponse&&t.consent?this.createConsentState(t.consent.statistics||!1,t.consent.marketing||!1,t.consent.preferences||!1,t.consent.necessary||!1):null}startConsentPolling(){this.pollingInterval=window.setInterval(()=>{const t=window.Cookiebot;if(t&&t.hasResponse){const t=this.getConsentState();if(t){const e=JSON.stringify(t);e!==this.lastConsentState&&(this.lastConsentState=e,this.notifyConsentChange(t))}this.stopConsentPolling()}},500)}stopConsentPolling(){this.pollingInterval&&(window.clearInterval(this.pollingInterval),this.pollingInterval=void 0)}},new class extends Ot{constructor(){super(...arguments),A(this,"name","OneTrust"),A(this,"initialized",!1),A(this,"categoryMappings",{standard:{[C.NECESSARY]:"C0001",[C.FUNCTIONAL]:"C0003",[C.ANALYTICS]:"C0002",[C.MARKETING]:"C0004"},numeric:{[C.NECESSARY]:"1",[C.FUNCTIONAL]:"3",[C.ANALYTICS]:"2",[C.MARKETING]:"4"}})}detect(){return"u">typeof window&&(!!window.OneTrust||"function"==typeof window.OptanonWrapper)}isAlertBoxClosed(){var t;return"function"==typeof(null==(t=window.OneTrust)?void 0:t.IsAlertBoxClosed)&&window.OneTrust.IsAlertBoxClosed()}initialize(){if(this.initialized||!this.detect())return;this.initialized=!0;const e=window.OptanonWrapper;if(window.OptanonWrapper=()=>{e&&e(),setTimeout(t(()=>{const t=this.getConsentState();t&&this.notifyConsentChange(t)},"consent.onetrust"),100)},this.isAlertBoxClosed()){const t=this.getConsentState();t&&this.notifyConsentChange(t)}}hasConsent(t){if(!this.isAlertBoxClosed())return!1;const e=window.OnetrustActiveGroups||"";if(!t)return e.length>0;const i=this.categoryMappings.standard[t],s=this.categoryMappings.numeric[t];return e.includes(i)||e.includes(s)}getConsentState(){if(!this.isAlertBoxClosed())return null;const t=window.OnetrustActiveGroups||"",e=t.includes(this.categoryMappings.standard[C.ANALYTICS])||t.includes(this.categoryMappings.numeric[C.ANALYTICS]),i=t.includes(this.categoryMappings.standard[C.MARKETING])||t.includes(this.categoryMappings.numeric[C.MARKETING]),s=t.includes(this.categoryMappings.standard[C.FUNCTIONAL])||t.includes(this.categoryMappings.numeric[C.FUNCTIONAL]),n=t.includes(this.categoryMappings.standard[C.NECESSARY])||t.includes(this.categoryMappings.numeric[C.NECESSARY]);return this.createConsentState(e,i,s,n)}},new class extends Ot{constructor(){super(...arguments),A(this,"name","Transcend"),A(this,"initialized",!1),A(this,"pollingInterval"),A(this,"lastConsentState",null)}detect(){return"u">typeof window&&(!!window.Transcend||!!window.airgap)}initialize(){var t,e;if(this.initialized||!this.detect())return;this.initialized=!0;const i=window.Transcend;if(i||window.airgap){if(null!=i&&i.onConsentChange&&i.onConsentChange(t=>{const e=this.mapTranscendConsent(t);e&&this.notifyConsentChange(e)}
1),null!=i&&i.hasLoaded&&i.consent){const t=this.getConsentState();t&&this.notifyConsentChange(t)}if(window.airgap)try{const i=null==(e=(t=window.airgap).getConsent)?void 0:e.call(t);if(null!=i&&i.confirmed){const t=this.getConsentState();t&&this.notifyConsentChange(t)}else this.startConsentPolling()}catch{this.startConsentPolling()}}}hasConsent(t){var e,i,s,n,r;if(window.airgap)try{const o=null==(i=(e=window.airgap).getConsent)?void 0:i.call(e);if(null!=o&&o.confirmed){if(!t){const{Analytics:t,Advertising:e,Functional:i}=o.purposes||{};return!!(t||e||i)}switch(t){case C.NECESSARY:return!0;case C.FUNCTIONAL:return(null==(s=o.purposes)?void 0:s.Functional)??!1;case C.ANALYTICS:return(null==(n=o.purposes)?void 0:n.Analytics)??!1;case C.MARKETING:return(null==(r=o.purposes)?void 0:r.Advertising)??!1;default:return!1}}}catch{}const o=window.Transcend;if(null==o||!o.consent)return!1;if(!t){const{analytics:t,advertising:e,functional:i}=o.consent;return!!(t||e||i)}switch(t){case C.NECESSARY:return o.consent.essential??!0;case C.FUNCTIONAL:return o.consent.functional??!1;case C.ANALYTICS:return o.consent.analytics??!1;case C.MARKETING:return o.consent.advertising??!1;default:return!1}}getConsentState(){var t,e,i,s,n;if(window.airgap)try{const r=null==(e=(t=window.airgap).getConsent)?void 0:e.call(t);if(r&&r.confirmed)return this.createConsentState((null==(i=r.purposes)?void 0:i.Analytics)??!1,(null==(s=r.purposes)?void 0:s.Advertising)??!1,(null==(n=r.purposes)?void 0:n.Functional)??!1,!0)}catch{}const r=window.Transcend;return null!=r&&r.consent?this.createConsentState(r.consent.analytics??!1,r.consent.advertising??!1,r.consent.functional??!1,r.consent.essential??!0):null}mapTranscendConsent(t){return t?this.createConsentState(t.analytics??!1,t.advertising??!1,t.functional??!1,t.essential??!0):null}startConsentPolling(){let t=0;this.pollingInterval=window.setInterval(()=>{var e,i;if(window.airgap)try{const s=null==(i=(e=window.airgap).getConsent)?void 0:i.call(e);if(null!=s&&s.confirmed){const t=JSON.stringify(s);if(t!==this.lastConsentState){this.lastConsentState=t;const e=this.getConsentState();e&&this.notifyConsentChange(e)}}t=0}catch(s){t++,10===t&&L(s,"consent.transcend-poll")}},500)}stopConsentPolling(){this.pollingInterval&&(window.clearInterval(this.pollingInterval),this.pollingInterval=void 0)}},new class extends Ot{constructor(){super(...arguments),A(this,"name","CookieYes"),A(this,"initialized",!1)}detect(){return"u">typeof window&&"function"==typeof window.getCkyConsent}initialize(){if(this.initialized||!this.detect())return;this.initialized=!0,document.addEventListener("cookieyes_consent_update",t(()=>{const t=this.getConsentState();t&&this.notifyConsentChange(t)},"consent.cookieyes"));const e=this.getConsentState();e&&this.hasNonNecessaryConsent(e)&&this.notifyConsentChange(e)}hasConsent(t){if("function"!=typeof window.getCkyConsent)return!1;const e=window.getCkyConsent();if(!t)return e.analytics||e.advertisement||e.functional;switch(t){case C.NECESSARY:return e.necessary||!1;case C.FUNCTIONAL:return e.functional||!1;case C.ANALYTICS:return e.analytics||!1;case C.MARKETING:return e.advertisement||!1;default:return!1}}getConsentState(){if("function"!=typeof window.getCkyConsent)return null;const t=window.getCkyConsent();return this.createConsentState(t.analytics||!1,t.advertisement||!1,t.functional||!1,t.necessary||!1)}hasNonNecessaryConsent(t){return t.analytics||t.marketing||t.functional}}]);const Pt="consent_denied";class Nt{constructor(t="Radar"){A(this,"consentGiven",!1),A(this,"storageManager"),A(this,"sessionStorage"),A(this,"persistentStorage"),A(this,"adapter",null),A(this,"unsubscribe"),A(this,"changeListeners",[]),this.sessionStorage=new ut(t.toLowerCase()+"_"),this.persistentStorage=new ht(t.toLowerCase()+"_"),this.storageManager=this.sessionStorage,e(this.initializeAdapter(),"consent.adapter-init")}async initializeAdapter(){if(this.adapter=$t.detectAvailableAdapter(),this.adapter){this.adapter.initialize(),this.unsubscribe=this.adapter.onConsentChange(t=>{this.handleConsentChange(t)});const t=this.adapter.getConsentState();t&&this.handleConsentChange(t)}
1}handleConsentChange(t){t.analytics||t.marketing?this.autoGrantConsent():this.consentGiven&&this.revokeConsent()}onConsentChanged(t){return this.changeListeners.push(t),()=>{this.changeListeners=this.changeListeners.filter(e=>e!==t)}}notifyChange(t){for(const i of this.changeListeners)try{i(t)}catch(e){L(e,"consent.change-listener")}}giveCookieConsent(){this.persistentStorage.remove(Pt),this.grant()}autoGrantConsent(){this.hasUserDeniedConsent()||this.grant()}grant(){this.consentGiven||(this.consentGiven=!0,this.persistentStorage.migrate(this.sessionStorage),this.storageManager=this.persistentStorage,this.notifyChange(!0))}denyCookieConsent(){this.persistentStorage.clear(),this.persistentStorage.set(Pt,"1",{cookie:!0,expires:31536e6},C.NECESSARY),this.consentGiven&&(this.consentGiven=!1,this.storageManager=this.sessionStorage,this.notifyChange(!1))}hasUserDeniedConsent(){try{return this.persistentStorage.exists(Pt)}catch{return!1}}revokeConsent(){this.consentGiven&&(this.consentGiven=!1,this.persistentStorage.clear(),this.storageManager=this.sessionStorage,this.notifyChange(!1))}hasConsentForCategory(t){return this.adapter?this.adapter.hasConsent(t):this.consentGiven}get hasConsent(){return!this.hasUserDeniedConsent()&&(this.adapter&&this.adapter.hasConsent()||this.consentGiven)}getConsentState(){return this.adapter?this.adapter.getConsentState():this.consentGiven?{analytics:!0,marketing:!0,functional:!0,necessary:!0,timestamp:new Date}:null}getStorageManager(){return this.storageManager}getSessionStorageManager(){return this.sessionStorage}dispose(){this.unsubscribe&&this.unsubscribe()}}const Rt="snitcher.sdk",Lt=["segment","rudderstack"],Bt=(t,e)=>{const i=Lt.includes(e)?e:"external",s={};for(const[n,r]of Object.entries(t))"email"!==n&&(s[`sn_ext_${i}_${n}`]=r);return s};class zt extends z{constructor(e){var i;super(),A(this,"version",Tt),A(this,"initialized",!1),A(this,"__queuedCommands",[]),A(this,"userStore"),A(this,"sessionManager"),A(this,"formTracker",new et),A(this,"clickTracker",new it),A(this,"pageTracker"),A(this,"transport"),A(this,"spotter"),A(this,"httpClient"),A(this,"consentManager"),A(this,"remoteSettingsLoaded",!1),A(this,"settings"),A(this,"loaderScriptSettings"),A(this,"currentPageCollectingEmitted",!1),A(this,"recordingController",null),A(this,"errorReporter"),A(this,"healthMonitor"),A(this,"__scriptLoaderForTests"),A(this,"getSpotterIdentification",()=>this.spotter.getSpotterData()),A(this,"giveCookieConsent",t((t=!0)=>{t?this.consentManager.giveCookieConsent():this.consentManager.denyCookieConsent()},"public-api.giveCookieConsent")),A(this,"denyCookieConsent",t(()=>{this.consentManager.denyCookieConsent()},"public-api.denyCookieConsent")),A(this,"track",t((t,e={},i=Rt)=>{const s={...e,$source:i};this.u(t,s,x.TRACK)},"public-api.track")),A(this,"getSession",()=>{try{return this.sessionManager.getSession()}catch(t){L(t,"public-api.getSession");const e=(new Date).toISOString();return{id:"unknown",startedAt:e,lastActivity:e,engagementTime:0,engagementSegments:[]}}}),A(this,"identify",t((t,e,i=Rt)=>{if(!t||"string"!=typeof t||!t.includes("@")||this.userStore.getTraits().$source===Rt&&i!==Rt)return;const s={...i===Rt?{...e}:Bt(e??{},i),email:t,$source:i};this.userStore.setTraits(s);const n=this.userStore.getUser();this.l(x.IDENTIFY,{user:{...n,email:s.email,traits:s}}),this.emit(x.IDENTIFY,s)},"public-api.identify")),A(this,"company",t((t,e)=>{const i=(t=>{if("string"!=typeof t)return null;let e=t.trim().toLowerCase();if(e.includes("://"))try{e=new URL(e).hostname}catch{return null}return e.length>0&&e.includes(".")&&!e.includes("@")&&!/\s/.test(e)?e:null})(t);if(!i)return void R(`company() dropped: "${t+""}" is not a valid domain`);const s={};if(e&&"object"==typeof e&&!Array.isArray(e))for(const[r,o]of Object.entries(e))null===o||"object"!=typeof o&&"function"!=typeof o?s[r]=o:R(`company() dropped trait "${r}": only scalar values are supported`);const n={domain:i,traits:s};this.l(x.COMPANY,{},{organisation:n})},"public-api.company")),A(this,"register",t(t=>{!t||"object"!=typeof t||Array.isArray(t)||this.userStore.setTraits(t)},"public-api.register")),A(this,"flush",t(()=>{this.transport.flush()},"public-api.flush")),A(this,"error",t=>{const e="string"==typeof t?Error(t):t;
1this.emit(x.ERROR,e)}),A(this,"reset",t(()=>{var t;this.userStore.reset(),this.sessionManager.endSession(),null==(t=this.recordingController)||t.stop(!0)},"public-api.reset")),this.loaderScriptSettings=e,this.settings=this.getInitialSettings(),this.consentManager=(i=this.settings.namespace,new Nt(i)),this.settings.apiEndpoint=(t=>t.includes("http")||t.includes("localhost")?t:"https://"+t)(this.settings.apiEndpoint),(!this.settings.waitForConsent||this.hasExistingConsent())&&this.consentManager.autoGrantConsent(),this.errorReporter=new W(t=>{var e;try{this.l(x.SDK_ERROR,t)}catch{null==(e=this.transport)||e.enqueue({id:o(),type:x.SDK_ERROR,properties:{...t,degraded:!0},page:{url:"u">typeof location?location.href:"",title:"",pageViewId:""},user:{deviceId:"unknown",traits:{}},session:{id:"unknown",startedAt:"",lastActivity:"",engagementTime:0,engagementSegments:[]}})}}),(t=>{N=new P(t)})({debug:this.settings.debug,apiEndpoint:this.settings.apiEndpoint,onError:this.errorReporter.handleError}),this.userStore=new mt(this.consentManager.getStorageManager(),this.consentManager.getSessionStorageManager()),this.sessionManager=new lt(this.consentManager.getStorageManager()),this.consentManager.onConsentChanged(()=>this.rebuildStores()),this.httpClient=new xt(this.settings.apiEndpoint),this.transport=new It(this.settings,this.httpClient),this.transport.onExit(this.errorReporter.flushFinalCounts),this.healthMonitor=new K(t=>this.l(x.SDK_HEALTH,t)),this.transport.onHealth=this.healthMonitor.count,this.transport.onExit(this.healthMonitor.flush),this.clickTracker.onRateLimited=()=>this.healthMonitor.count("click_rate_limited"),this.pageTracker=new yt,this.pageTracker.onRateLimited=()=>this.healthMonitor.count("pageview_rate_limited"),this.spotter=new At(this.settings,this.userStore.getDeviceId())}
1async init(){var i,s,n;this.initialized||(this.initialized=!0,"u">typeof window&&(null==(i=this.m)?void 0:i.length)>0&&(function(t,e){for(const[i,...s]of e)if("function"==typeof t[i])try{t[i](...s)}catch(n){L(n,"queue.command")}else R("Unknown method called from queue: "+i)}(this,this.m),this.m=[]),this.startSnMetaComputation(),this.startPageTracking(),await this.applyRemoteSettings(),this.startFormTracking(this.settings.features.formTracking),this.startclickTracking({...this.settings.features}),this.startSessionRecording(),this.emit(x.INITIALIZED,{version:this.version}),e(this.spotter.init(null==(n=null==(s=this.settings)?void 0:s.integrations)?void 0:n.ga),"spotter.init"),typeof window>"u"||(function(e){b(()=>"u">typeof window.analytics&&"function"==typeof window.analytics.ready,()=>{const i=window.analytics;i&&i.ready(t(()=>{if("function"==typeof i.user){const t=i.user().traits(),s=null==t?void 0:t.email;s&&"string"==typeof s&&s.includes("@")&&e.identify(s,t,"segment")}i.on("track",(t,i)=>{e.track(t,i||{},"segment")}),i.on("identify",(t,i)=>{const s=null==i?void 0:i.email;!s||"string"!=typeof s||!s.includes("@")||e.identify(s,i,"segment")}),i.on("reset",()=>{e.reset()})},"integrations.segment"))},{timeout:100,retries:20,alwaysResolve:!0})}(this),function(e){b(()=>"u">typeof window.rudderanalytics&&"function"==typeof window.rudderanalytics.ready,()=>{const i=window.rudderanalytics;i&&i.ready(t(()=>{const t="function"==typeof i.getUserTraits?i.getUserTraits():{};let s={};i.getGroupTraits&&(s=i.getGroupTraits()||{});const n=null==t?void 0:t.email;if(n&&"string"==typeof n&&n.includes("@")){let i=t;Object.keys(s).length>0&&(i={...i,$account:s}),e.identify(n,i,"rudderstack")}i.track=S(i.track,(t,...i)=>{const s=i[0],n=i[1];return"string"==typeof s&&e.track(s,n||{},"rudderstack"),t(...i)}),i.identify=S(i.identify,(t,...i)=>{const s=i[1]||{},n=s.email;return n&&"string"==typeof n&&n.includes("@")&&e.identify(n,s,"rudderstack"),t(...i)})},"integrations.rudderstack"))},{timeout:1e3,retries:10,alwaysResolve:!0})}(this)))}startSnMetaComputation(){d(async()=>{if(u("sh"))return;const t=performance.now();try{const e=()=>{try{return Number.isFinite(navigator.hardwareConcurrency)?navigator.hardwareConcurrency:null}catch{return null}},i=()=>{try{return"number"==typeof navigator.deviceMemory?navigator.deviceMemory:null}catch{return null}},s=()=>{try{const t=navigator.maxTouchPoints??navigator.msMaxTouchPoints??0;return Number.isFinite(t)?t:0}catch{return 0}},n={platform:(()=>{try{return navigator.platform||null}catch{return null}})(),hardwareConcurrency:e(),deviceMemory:i(),maxTouchPoints:s()};l("sh",await f(m(n)),Math.round(performance.now()-t))}catch{}},500),d(async()=>{if(u("sg"))return;const t=performance.now();try{const e=()=>{try{return screen.colorDepth??null}catch{return null}},i=()=>{try{const t="__ls_test__"+Math.random();localStorage.setItem(t,"1");const e="1"===localStorage.getItem(t);return localStorage.removeItem(t),e}catch{return!1}},s=()=>{try{const t="__ss_test__"+Math.random();sessionStorage.setItem(t,"1");const e="1"===sessionStorage.getItem(t);return sessionStorage.removeItem(t),e}catch{return!1}},n=()=>{try{return!!window.indexedDB}catch{return!1}},r={cookiesEnabled:(()=>{try{return navigator.cookieEnabled??null}catch{return null}})(),localStorageSupport:i(),sessionStorageSupport:s(),indexedDBSupport:n(),colorDepth:e()};l("sg",await f(m(r)),Math.round(performance.now()-t))}catch{}},1e3),d(async()=>{if(u("de"))return;const t=performance.now();try{const e=()=>{try{return screen&&Number.isFinite(screen.width)&&Number.isFinite(screen.height)?{width:screen.width,height:screen.height}:null}catch{return null}},i=()=>{try{return(new Date).getTimezoneOffset()}catch{return null}},s={devicePixelRatio:(()=>{try{return Number.isFinite(window.devicePixelRatio)?window.devicePixelRatio:null}catch{return null}})(),screenResolution:e(),timezoneOffset:i()};l("de",await f(m(s)),Math.round(performance.now()-t))}catch{}},1500),d(async()=>{if(u("rs"))return;const t=performance.now();try{const e=async()=>{try{const t=document.createElement("canvas");t.width=240,t.height=60;const e=t.getContext("2d");if(!e)return null;e.fillStyle="#f0f",e.fillRect(0,0,t.width,t.height),e.textBaseline="alphabetic",e.fillStyle="#0f0",e.font="16px 'Arial'",e.fillText("Cañvas FP 😎 12345",2,20),e.strokeStyle="#00f",e.lineWidth=1.5,e.strokeRect(10,10,100,30),e.globalCompositeOperation="multiply",e.fillStyle="#ff0",e.beginPath(),e.arc(120,30,20,0,2*Math.PI),e.fill();const i=t.toDataURL();return await f(i)}catch{return null}},i=()=>{try{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");
1if(!e)return null;const i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:((i?e.getParameter(i.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR))||"")+"",renderer:((i?e.getParameter(i.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER))||"")+""}}catch{return null}},s=()=>{try{const t=["Arial","Verdana","Times New Roman","Courier New","Trebuchet MS","Georgia","Helvetica","Tahoma","Palatino","Garamond","Bookman","Candara","Calisto MT","Segoe UI","San Francisco","SF Pro Text","Roboto","Noto Sans","Ubuntu","Cantarell"],e=["monospace","sans-serif","serif"],i="mmmmmmmmmmlliWWWWWw12345",s="72px",n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.fontSize=s,n.innerHTML=i,document.body.appendChild(n);const r={};for(const a of e)n.style.fontFamily=a,r[a]={w:n.offsetWidth,h:n.offsetHeight};const o=[];for(const a of t){let t=!1;for(const i of e){n.style.fontFamily=`'${a}',${i}`;const e=n.offsetWidth,s=n.offsetHeight;if(e!==r[i].w||s!==r[i].h){t=!0;break}}t&&o.push(a)}return document.body.removeChild(n),o}catch{return null}},n=async()=>{try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),e=t.createOscillator();e.type="triangle",e.frequency.value=1e3;const i=t.createDynamicsCompressor();i.threshold.value=-20,i.knee.value=15,i.ratio.value=12,i.attack.value=.003,i.release.value=.25,e.connect(i),i.connect(t.destination),e.start(0);const s=(await t.startRendering()).getChannelData(0),n=Math.floor(s.length/500);let r="";for(let o=0;o<s.length&&(r+=Math.round(1e6*s[o])+",",2e4>=r.length);o+=n);return await f(r)}catch{return null}},[r,o,a,c]=await Promise.all([e(),i(),s(),n()]);l("rs",await f(m({canvasHash:r,webglRenderer:o,fontsDetected:a,audioHash:c})),Math.round(performance.now()-t))}catch{}},3e3),d(async()=>{if(u("ped"))return;const t=performance.now();try{const e=()=>{try{return navigator.userAgent||null}catch{return null}},i=()=>{try{if(!navigator.plugins)return null;const t=[];for(let e=0;e<navigator.plugins.length;e++){const i=navigator.plugins[e];t.push({name:i.name||"",filename:i.filename||"",description:i.description||""})}return t}catch{return null}},s=()=>{try{const t=document.createElement("div");t.className="adsbox ad-banner ad-unit advertisement",t.style.position="absolute",t.style.height="10px",t.style.width="10px",t.style.left="-9999px",document.body.appendChild(t);const e="none"===getComputedStyle(t).display||null===t.offsetParent||0===t.clientHeight;return document.body.removeChild(t),e}catch{return null}},n=()=>{try{return navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack||"unspecified"}catch{return"unspecified"}},r=()=>{try{return navigator.language||navigator.languages&&navigator.languages[0]||null}catch{return null}},o=async()=>{try{return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?(await navigator.mediaDevices.enumerateDevices()).reduce((t,e)=>(t[e.kind]=(t[e.kind]||0)+1,t),{}):null}catch{return null}},a=()=>{try{const t={webdriver:!!navigator.webdriver,ua_platform_mismatch:!1},e=(navigator.userAgent||"").toLowerCase(),i=(navigator.platform||"").toLowerCase();return i.includes("win")&&!e.includes("win")&&(t.ua_platform_mismatch=!0),(i.includes("mac")||i.includes("iphone")||i.includes("ipad"))&&!(e.includes("mac")||e.includes("os x")||e.includes("iphone")||e.includes("ipad"))&&(t.ua_platform_mismatch=!0),i.includes("linux")&&!e.includes("linux")&&(t.ua_platform_mismatch=!0),t}catch{return{webdriver:null,ua_platform_mismatch:null}}},c=await o(),h={userAgent:e(),plugins:i(),adblockDetected:s(),doNotTrack:n(),language:r(),mediaDevicesSummary:c,hasLiedFlags:a()};l("ped",await f(m(h)),Math.round(performance.now()-t))}catch{}},2e3)}getInitialSettings(){var t;const e=O({waitForConsent:(null==(t=this.loaderScriptSettings.profileId)?void 0:t.startsWith("c"))??!1});return $({base:e,override:this.loaderScriptSettings})}rebuildStores(){this.userStore=new mt(this.consentManager.getStorageManager(),this.consentManager.getSessionStorageManager()),this.sessionManager=new lt(this.consentManager.getStorageManager())}hasExistingConsent(){try{const t=new ht(this.settings.namespace.toLowerCase()+"_");return t.exists("device_id")||t.exists("session")}catch{return!1}}startPageTracking(){this.pageTracker.on(x.PAGEVIEW,t=>{if("enter"===t.stage){this.currentPageCollectingEmitted=!1,this.maybeEmitCollecting(),this.sessionManager.extendSession();const e=this.getSession();this.pageTracker.setSessionIdAtEnter(e.id),this.p(x.PAGEVIEW,t,e,{id:t.pageViewId,timestamp:t.timestamp})}else{const e=this.pageTracker.getSessionIdAtEnter();this.sessionManager.extendSession();const i=this.getSession(),s=e?{...i,id:e}:i;this.p(x.PAGEVIEW,t,s,{id:t.pageViewId,timestamp:t.timestamp})}
1this.emit(x.PAGEVIEW,t)}),this.pageTracker.startTracking()}startFormTracking(t=!1){this.formTracker.on(x.FORM_START,t=>{this.emit(x.FORM_START,t)}),this.formTracker.on(x.FORM_SUBMIT,e=>{t&&this.l(x.FORM_SUBMIT,e),this.emit(x.FORM_SUBMIT,e)}),this.formTracker.on(x.FORM_ABANDON,e=>{t&&this.l(x.FORM_ABANDON,e),this.emit(x.FORM_ABANDON,e)}),this.formTracker.on(x.OBSERVE,t=>{this.l(x.OBSERVE,{snid:t})}),this.formTracker.startTracking()}startclickTracking({clickTracking:t,downloadTracking:e}){!t&&!e||(this.clickTracker.startTracking(),t&&this.clickTracker.on(x.CLICK,t=>{this.l(x.CLICK,t.properties),this.emit(x.CLICK,t)}),e&&this.clickTracker.on(x.DOWNLOAD,t=>{this.l(x.DOWNLOAD,t.properties),this.emit(x.DOWNLOAD,t)}))}startSessionRecording(){}u(t,e={},i,s){if(this.settings.blackListed&&i!==x.OBSERVE)return;this.sessionManager.extendSession();const n=this.getSession(),r={id:(null==s?void 0:s.id)||o(),type:i,properties:e,timestamp:(null==s?void 0:s.timestamp)||(new Date).toISOString(),page:this.pageTracker.getPage(),user:this.userStore.getUser(),session:n,name:t,...(null==s?void 0:s.organisation)&&{organisation:s.organisation}};this.emit(i,r),this.transport.enqueue(r)}l(t,e={},i){this.u("",e,t,i)}p(t,e,i,s){if(this.settings.blackListed&&t!==x.OBSERVE)return;const n={id:(null==s?void 0:s.id)||o(),type:t,properties:e,timestamp:(null==s?void 0:s.timestamp)||(new Date).toISOString(),page:this.pageTracker.getPage(),user:this.userStore.getUser(),session:i,name:""};this.emit(t,n),this.transport.enqueue(n)}async applyRemoteSettings(){const{settings:t,failure:e}=await async function(t,e,i){let s;try{s=await async function(t,e){const i=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","x-tracking-script-version":e}});if(!i.ok)throw new Mt(i.status);return i}(`${t}/bp/${e}/settings`,i)}catch(n){return n instanceof Mt?(n.status>=500&&L(n,"settings.contract"),{failure:"settings_http"}):{failure:"settings_blocked"}}try{return{settings:await v(s,e)}}catch(n){return n instanceof Ft&&L(n,"settings.contract"),{failure:"settings_invalid"}}}(this.settings.apiEndpoint,this.settings.profileId,Tt);if(e&&this.healthMonitor.count(e),t){const e=$({base:this.settings,override:t}),s=$({base:e,override:this.loaderScriptSettings});i=s,typeof window>"u"||!(!1===i.countryAllowed||!w(window.location.hostname,i.allowedDomains)||!function(t,e){if(!e)return!0;const{blacklist:i,whitelist:s}=e,n=function(t){return t.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")}(t);return!(null!=i&&i.length&&y(n,i)||null!=s&&s.length&&!y(n,s))}(window.location.href,i.urlFilters))||(s.blackListed=!0),this.settings=s,this.transport.updateConfig(s)}var i;this.remoteSettingsLoaded=!0,this.maybeEmitCollecting()}maybeEmitCollecting(){this.currentPageCollectingEmitted||this.remoteSettingsLoaded&&(this.settings.blackListed||(this.currentPageCollectingEmitted=!0,this.emit(x.COLLECTING,{page:this.pageTracker.getPage()})))}}_=Object.defineProperty,E=(t,e,i)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,D=(t,e,i)=>E(t,"symbol"!=typeof e?e+"":e,i);const jt=!1;class Ht{constructor(t){D(this,"debug",!1),D(this,"onError"),this.debug=!!t.debug,this.onError=t.onError}log(...t){this.debug&&console.log("[Radar]",...t)}warn(...t){this.debug&&console.warn("[Radar]",...t)}error(t,...e){if(this.debug&&console.error("[Radar]",t,...e),this.onError){const i="string"==typeof e[0]?e[0]:void 0;try{this.onError(t,i)}catch{}}}}let Jt;const Ut=(t,...e)=>null==Jt?void 0:Jt.error(t,...e);console.warn.bind(console);const qt="__RADAR_TRACKERS__";!async function(t){let e,i;try{e=function(t){var e,i;const s=t??("undefined"!=typeof document?document.getElementById("__radar__"):null);if(!s)return{};const n=function(t){const e=t.dataset;return{profileId:e.profileId||"",apiEndpoint:e.apiEndpoint||"",cdn:e.cdn||"",namespace:e.namespace||"",debug:"true"===e.debug}}(s),r=(e=s.dataset.settings,JSON.parse(e||"{}")),o={};for(const[c,h]of Object.entries(n))""!==h&&void 0!==h&&(o[c]=h);Object.assign(o,r);const a=o;return a.apiEndpoint&&(a.apiEndpoint=(i=a.apiEndpoint).includes("http")||i.includes("localhost")?i:"https://"+i),a}(t),function(t){const e=[];
1if(t.apiEndpoint||e.push("apiEndpoint is required"),t.profileId||e.push("profileId is required"),t.namespace||e.push("namespace is required"),t.apiEndpoint&&!function(t){try{return new URL(t),!0}catch{return!1}}(t.apiEndpoint)&&e.push("apiEndpoint must be a valid URL"),e.length>0)throw Error("Radar configuration errors: "+e.join(", "))}(e);const r=e.debug||jt;if(s={apiEndpoint:e.apiEndpoint,debug:r},Jt=new Ht(s),"undefined"==typeof window)throw Error("Not in a browser context");const{compatible:o,missing:a}=function(){const t={fetch:"fetch"in window,localStorage:"localStorage"in window,JSON:"JSON"in window,Promise:"Promise"in window,setTimeout:"setTimeout"in window},e=Object.entries(t).filter(([,t])=>!t).map(([t])=>t);return{compatible:0===e.length,missing:e}}();if(!o)throw Error("Browser compatibility check failed, missing: "+a);const{namespace:c}=e,h=window[c],u=function(){const t=window;return t[qt]=t[qt]||{},t[qt]}(),l=u[c];if(l)return Array.isArray(h)&&function(t,e){var i;for(const s of e){if(!Array.isArray(s)||0===s.length)continue;const[e,...n]=s;try{null==(i=t[e])||i.call(t,...n)}catch{}}}(l,h),void(window[c]=l);try{i=function(t){if(!t.apiEndpoint)throw Error("apiEndpoint URL is required when creating a tracker");const e=new zt(t),i=t.namespace||"Radar";if("u">typeof window&&window[i]&&Array.isArray(window[i])){const t=window[i].slice();window[i]=e,t.length>0&&(e.m=t)}return e}(e)}catch(n){throw function(t,e){t&&Array.isArray(t)&&(window[e]=t)}(h,c),n}u[c]=i,h&&Array.isArray(h)&&(i.m=h.filter(t=>Array.isArray(t))),window[c]=i,await i.init(),i.on&&i.on("error",t=>{Ut(t)})}catch(r){Ut(r),i||function(t,e){try{if(!(null==t?void 0:t.apiEndpoint)||!t.profileId)return;if("undefined"==typeof navigator||"function"!=typeof navigator.sendBeacon)return;const i=(new Date).toISOString();navigator.sendBeacon(t.apiEndpoint+"/tracker/event",JSON.stringify({_c:kt,batch:[{id:`boot-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,type:"sdk_error",properties:{errorName:k((null==e?void 0:e.name)??"Error",100),message:k(null==e?void 0:e.message,500),stack:k(null==e?void 0:e.stack,2e3),context:"bootstrap",count:1,degraded:!0},timestamp:i,page:{url:"undefined"!=typeof location?location.href:"",title:"",pageViewId:""},user:{deviceId:"unknown",traits:{}},session:{id:"unknown",startedAt:i,lastActivity:i,engagementTime:0,engagementSegments:[]}}],metadata:{itemCount:1,sentAt:i,isBeacon:!0,version:"",workspaceId:t.profileId+"",userAgent:navigator.userAgent}}))}catch{}}(e,r)}var s}("undefined"!=typeof document?document.currentScript:null)}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.