var e;e=()=>(()=>{function e(e,value,n,r){var i,o,a,c,s;void 0===n&&(n=576e3);try{(o=new Date).setTime(o.getTime()+60*n*1e3),a=["".concat(e,"=").concat(encodeURIComponent(value)),"expires=".concat(o.toUTCString()),"path=".concat((null==r?void 0:r.path)||"/"),"SameSite=".concat((null==r?void 0:r.sameSite)||"Lax")],(null==r?void 0:r.domain)&&a.push("domain=".concat(r.domain)),c="undefined"!=typeof window&&"https:"===(null===(i=window.location)||void 0===i?void 0:i.protocol),(!0===(null==r?void 0:r.secure)||!1!==(null==r?void 0:r.secure)&&c)&&a.push("Secure"),s=a.join("; "),document.cookie=s,n<=0||""===String(value)||"__cst_domain_test__"===e||null===t(e)&&yt("Failed to set cookie: ".concat(e))}catch(e){yt("Error setting cookie:",e)}}function t(e){var t,n,r,i,o;try{for(t=e+"=",n=document.cookie.split(";"),r=0,i=n;r<i.length;r++)if((o=(o=i[r]).trim()).startsWith(t))return decodeURIComponent(o.substring(t.length))}catch(t){yt("Error getting cookie: ".concat(e),t)}return null}function n(e){var t={},marketingTrackers={};return e?(e.split(";").forEach((function(e){var n,value,r,i,o,a=e.indexOf("=");if(-1!==a&&(n=e.substring(0,a).trim(),value=e.substring(a+1).trim(),n))try{if(r=decodeURIComponent(n),o=i=decodeURIComponent(value),r===zt)try{o=JSON.parse(i)}catch(e){yt("Error parsing location cookie JSON: ".concat(i),e),o=i}t[r]?t[r].includes(o)||t[r].push(o):t[r]=[o],Vt.includes(r)&&"string"==typeof o&&(marketingTrackers[r]?marketingTrackers[r].includes(o)||marketingTrackers[r].push(o):marketingTrackers[r]=[o])}catch(e){yt("Error decoding cookie: ".concat(n,"=").concat(value),e)}})),{allCookies:t,marketingTrackers}):{allCookies:t,marketingTrackers}}function r(e){return Object.fromEntries(Object.entries(e).map((function(e){var t,n=e[0],value=e[1];try{return Array.isArray(value)&&1===value.length?(t=value[0],n===zt&&"object"==typeof t&&null!==t?[n,JSON.stringify(t)]:[n,String(t)]):[n,Array.isArray(value)?JSON.stringify(value):String(value)]}catch(e){return yt("Error converting value for key: ".concat(n),e),[n,""]}})))}function i(e){return r(e)}function o(){var n,r,i,o,a,c,s,u,l,d,f,h,m;try{if("undefined"==typeof window)return;if(Gt)return Kt;if((n=window).CST_COOKIE_DOMAIN&&"string"==typeof n.CST_COOKIE_DOMAIN)return n.CST_COOKIE_DOMAIN.trim();if(null==(r=document.querySelector('meta[name="cst:cookieDomain"], meta[name="cst-cookie-domain"]'))?void 0:r.content)return r.content.trim();if(!(m=i=window.location.hostname)||"localhost"===m||/^\d{1,3}(?:\.\d{1,3}){3}$/.test(m)||m.includes(":"))return Gt=!0,Kt=void 0;if((o=i.split(".")).length<2)return Gt=!0,Kt=void 0;for(a=[],c=o.length-2;c>=0;c--)s="."+o.slice(c).join("."),a.push(s);for(u="__cst_domain_test__",l=0,d=a;l<d.length;l++){f=d[l];try{if(e(u,"1",1,{domain:f,path:"/",sameSite:"Lax"}),h="1"===t(u),e(u,"",-1,{domain:f,path:"/",sameSite:"Lax"}),h)return gt("Selected cookie domain",f),Gt=!0,Kt=f}catch(e){}}}catch(e){}return Gt=!0,Kt=void 0}function a(){return Xt(this,void 0,void 0,(function(){var n,r,i;return Yt(this,(function(a){switch(a.label){case 0:return(n=t(Ft))?[2,n]:[4,c()];case 1:return r=a.sent(),i=o(),e(Ft,r,576e3,{domain:i,path:"/",sameSite:"Lax"}),[2,r]}}))}))}function c(){return Xt(this,void 0,void 0,(function(){var e;return Yt(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),[4,new Promise((function(e){return requestAnimationFrame(e)}))];case 1:return t.sent(),e=navigator.maxTouchPoints>0||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),[4,Promise.all(Jt([s()],e?[]:[u()],!0))];case 2:return[4,l(t.sent().join("|||"))];case 3:return[2,t.sent()];case 4:return t.sent(),[2,"canvas-error"];case 5:return[2]}}))}))}function s(){return Xt(this,void 0,void 0,(function(){var e,t;return Yt(this,(function(n){try{return e=document.createElement("canvas"),(t=e.getContext("2d"))?(e.width=200,e.height=100,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,50,15),t.fillStyle="#069",t.font="12pt Arial",t.fillText("Canvas test 🔒",2,15),t.fillStyle="rgba(102, 204, 0, 0.8)",t.font="16pt Arial",t.fillText("Font Test",4,40),t.fillStyle="#ff0000",t.font="11pt Times",t.fillText("©®™€",2,65),t.fillStyle="#0000ff",t.font="14pt Arial",t.fillText("😀🌍",2,85),[2,e.toDataURL()]):[2,"text-canvas-unsupported"]}catch(e){return[2,"text-canvas-error"]}return[2]}))}))}function u(){return Xt(this,void 0,void 0,(function(){var e,t,n;return Yt(this,(function(r){try{return e=document.createElement("canvas"),(t=e.getContext("2d"))?(e.width=150,e.height=150,(n=t.createLinearGradient(0,0,150,150)).addColorStop(0,"#ff0000"),n.addColorStop(.5,"#00ff00"),n.addColorStop(1,"#0000ff"),t.fillStyle=n,t.fillRect(10,10,130,50),t.strokeStyle="#ff00ff",t.lineWidth=2,t.beginPath(),t.arc(75,100,30,0,2*Math.PI),t.stroke(),t.strokeStyle="#00ffff",t.lineWidth=1.5,t.beginPath(),t.moveTo(30,80),t.quadraticCurveTo(75,50,120,80),t.stroke(),t.globalAlpha=.6,t.fillStyle="#ffff00",t.fillRect(40,70,70,40),[2,e.toDataURL()]):[2,"geometry-canvas-unsupported"]}catch(e){return[2,"geometry-canvas-error"]}return[2]}))}))}function l(e){return Xt(this,void 0,void 0,(function(){var t,n,r,i,o,a;return Yt(this,(function(c){switch(c.label){case 0:t=new TextEncoder,n=t.encode(e),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,crypto.subtle.digest("SHA-256",n)];case 2:return r=c.sent(),[2,Array.from(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join("").slice(0,12)];case 3:for(c.sent(),i=0,o=0;o<e.length;o++)a=e.charCodeAt(o),i=(i<<5)-i+a,i|=0;return[2,Math.abs(i).toString(36).padStart(12,"0")];case 4:return[2]}}))}))}function d(){return $t(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,s,u,l,d;return Zt(this,(function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),e=(null===(l=null===(u=navigator.userAgentData)||void 0===u?void 0:u.brands)||void 0===l?void 0:l.map((function(e){return"".concat(e.brand,":").concat(e.version)})).join(","))||"",t=(null===(d=navigator.userAgentData)||void 0===d?void 0:d.platform)||"",n=["".concat(screen.width,"x").concat(screen.height),screen.colorDepth,navigator.hardwareConcurrency||"unknown",String(Math.round(2*window.devicePixelRatio)/2),navigator.platform||"unknown",(y=navigator.userAgent,b=y.match(/Chrome\/(\d+)/),b?"chrome_".concat(b[1]):(v=y.match(/Firefox\/(\d+)/))?"firefox_".concat(v[1]):(g=y.match(/Version\/(\d+).*Safari/))?"safari_".concat(g[1]):"unknown_browser"),navigator.userAgent||"unknown",e,t,(Array.isArray(navigator.languages)?navigator.languages.sort().join(","):navigator.language)||""],r=function(){var e,t,n;try{return(t=(e=document.createElement("canvas")).getContext("webgl")||e.getContext("experimental-webgl"))?[(n=t).getParameter(n.RENDERER),n.getParameter(n.VENDOR)].filter(Boolean).join("|||"):"no-webgl"}catch(e){return"webgl-error"}}(),i=function(){var e,t,n,r,i,o,a,c,s,u,l,d,f,h,m,p;try{if(e=["Arial","Verdana","Tahoma","Trebuchet MS","Times New Roman","Georgia","Courier New","Comic Sans MS","Impact","Calibri","Cambria","Consolas","Helvetica Neue","Helvetica","SF Pro Display","SF Pro Text","Menlo","Monaco","Apple Symbols","Lucida Grande","Palatino","Ubuntu","Liberation Sans","DejaVu Sans","Droid Sans","Roboto","Open Sans","Noto Sans","Source Sans Pro","Microsoft YaHei","SimSun","Hiragino Sans","Meiryo","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji"],!(n=(t=document.createElement("canvas")).getContext("2d")))return"canvas-unsupported";for(t.width=50,t.height=20,i="mmmmmmmmmmlli",o={},a=0,c=r=["monospace","sans-serif","serif"];a<c.length;a++)n.font="12px ".concat(s=c[a]),o[s]=n.measureText(i).width;for(u=[],l=0,d=e;l<d.length;l++){for(f=d[l],h=!1,m=0,p=r;m<p.length;m++)if(s=p[m],n.font="12px '".concat(f,"', ").concat(s),n.measureText(i).width!==o[s]){h=!0;break}h&&u.push(f)}return u.sort().join(",")||"none"}catch(e){return"font-detection-error"}}(),[4,c()];case 1:return o=p.sent(),[4,h(Qt(Qt([],n,!0),[r,i,o],!1).join("|||"))];case 2:return a=p.sent(),[2,"fp_".concat(m(a.slice(0,40)))];case 3:return s=p.sent(),yt("Error generating browser fingerprint:",s),[2,f()];case 4:return[2]}var v,g,y,b}))}))}function f(){var e,t=["".concat(screen.width,"x").concat(screen.height),screen.colorDepth,navigator.hardwareConcurrency||"unknown",Math.round(window.devicePixelRatio),navigator.platform||"unknown"].join("|"),n=0;for(e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n>>>=0;return n.toString(36).padStart(24,"0")}function h(e){return $t(this,void 0,void 0,(function(){var t,n,r,i;return Zt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=new TextEncoder,n=t.encode(e),[4,crypto.subtle.digest("SHA-256",n)];case 1:return r=o.sent(),[2,Array.from(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")];case 2:return i=o.sent(),yt("Error generating SHA-256 hash:",i),[2,p(e)];case 3:return[2]}}))}))}function m(e){for(var t=BigInt("0x"+e),n="";t>0;)n="0123456789abcdefghijklmnopqrstuvwxyz"[Number(t%BigInt(36))]+n,t/=BigInt(36);return n.padStart(24,"0")}function p(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n>>>=0;return n.toString(36).padStart(24,"0")}function v(e){return e?encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22"):""}function g(e){var t,n,r,url,i;if(!e)return null;if(0===(t=e.trim()).length)return null;try{return n="undefined"!=typeof document&&document.baseURI||"undefined"!=typeof location&&location.href||void 0,r=t.length>2048?t.slice(0,2048):t,"http:"!==(i=(url=n?new URL(r,n):new URL(r)).protocol.toLowerCase())&&"https:"!==i&&"mailto:"!==i&&"tel:"!==i?null:(url.username="",url.password="",url.toString())}catch(e){return null}}function y(){return crypto.randomUUID().replace(/-/g,"")}function b(){var t,n,r,i,a,c,s,u,l,d,f,h,m,p=function(t){var n;if(t){try{e("_cst_clientId",t,576e3,{domain:o(),path:"/",sameSite:"Lax"})}catch(e){}try{localStorage.setItem("_cst_clientId",t)}catch(e){}try{(n="undefined"!=typeof window?window:{}).CST_CLIENT_ID||(n.CST_CLIENT_ID=t)}catch(e){}}};try{if((n="undefined"!=typeof window?window:{}).CST_CLIENT_ID&&"string"==typeof n.CST_CLIENT_ID&&n.CST_CLIENT_ID.trim())return p(r=n.CST_CLIENT_ID.trim()),r}catch(e){}try{if(i="undefined"!=typeof document&&"string"==typeof document.cookie&&((null===(t=document.cookie.match(/(?:^|; )_cst_clientId=([^;]*)/))||void 0===t?void 0:t[1])?decodeURIComponent(document.cookie.match(/(?:^|; )_cst_clientId=([^;]*)/)[1]):void 0)||void 0,a="undefined"!=typeof localStorage&&(localStorage.getItem("_cst_clientId")||localStorage.getItem("cst_client_id")||void 0)||void 0,c=(i||a||"").trim())return p(s=v(c)),s}catch(e){}u="UNKNOWN";try{for(l=document.getElementsByTagName("script"),gt("Searching for clientId in scripts:",l.length),d=function(e){var t,url,n,r,i;if(!e)return"continue";t=null;try{e.src&&(t=(url=new URL(e.src,document.baseURI)).searchParams.get("cid")||url.searchParams.get("clientId")||url.searchParams.get("client_id"))}catch(e){}return t||(t=e.getAttribute("data-cid")||e.getAttribute("data-client-id")||null),n=e.src||"",r=[_t,"cst.js","cst-local.js"].some((function(e){return n.includes(e)})),i=n.includes(St)||n.includes(Tt)||n.includes(bt)||n.includes(wt)||n.includes("klrr.org"),gt("Checking script for clientId",{src:n,rawClientId:t,matchesKnownScriptName:r,matchesKnownDomain:i}),(r||i)&&t?(u=v(t),gt("Found clientId:",u),"break"):void 0},f=0,h=Array.from(l);f<h.length&&"break"!==d(h[f]);f++);}catch(e){yt("Error during clientId discovery",e)}if("UNKNOWN"===u)try{(m=document.querySelector('meta[name="cst:clientId"], meta[name="cst-client-id"]'))&&m.content&&(u=v(m.content),gt("Found clientId via meta tag:",u))}catch(e){}return gt("Final clientId:",u),u&&"UNKNOWN"!==u&&p(u),u}function w(){return en(this,void 0,void 0,(function(){var n,visitorId,r,i;return tn(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),(n=t(Pt)||localStorage.getItem(Pt))?(gt("Using stored visitor ID from cookies:",n),[2,n]):[4,d()];case 1:return visitorId=a.sent(),gt("Generated new visitor ID:",visitorId),r=o(),e(Pt,visitorId,576e3,{domain:r,path:"/",sameSite:"Lax"}),localStorage.setItem(Pt,visitorId),gt("Visitor ID stored in cookies and localStorage:",visitorId),[2,visitorId];case 2:return i=a.sent(),yt("Error in getVisitorId:",i),[2,"UNKNOWN"];case 3:return[2]}}))}))}function S(e,t,n){var r,i,o,a,c,s,u,l,d;return void 0===n&&(n={}),i=void 0===(r=n.maxRequestsPerSecond)?10:r,a=void 0===(o=n.leading)||o,s=void 0===(c=n.trailing)||c,u=0,l=null,d=t,function(){var n,r,o,c=this,f=[];for(n=0;n<arguments.length;n++)f[n]=arguments[n];r=Date.now(),d=(o=r-u)<1e3/i?Math.min(1.5*d,1e3):Math.max(t,.75*d),(a||0===u)&&o>=d?(l&&(clearTimeout(l),l=null),u=r,e.apply(this,f)):s&&!l&&(l=setTimeout((function(){u=Date.now(),l=null,e.apply(c,f)}),d))}}function T(e,t){var n=null;return function(){var r,i,o=[];for(r=0;r<arguments.length;r++)o[r]=arguments[r];i=function(){n=null,e.apply(void 0,o)},n&&clearTimeout(n),n=setTimeout(i,t)}}function I(){return on(this,void 0,void 0,(function(){var n,r,i,o,a,c,s;return an(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),(n=t(zt))?[2,JSON.parse(n)]:[4,fetch("https://ipapi.co/json/")];case 1:if(!(r=u.sent()).ok)throw new Error("Failed to fetch location");return[4,r.json()];case 2:return i=u.sent(),o={ip:i.ip||null,network:i.network||null,city:i.city||null,region:i.region||null,country:i.country_name||null,postal:i.postal||null,latitude:i.latitude||null,longitude:i.longitude||null,in_eu:i.in_eu||null,ipCompany:i.ip_company||null,isp:i.isp||null,asn:i.asn||null,org:i.org||null,timezone:i.timezone||null},a=JSON.stringify(o),c=encodeURIComponent(a).length,e(zt,c>3500?JSON.stringify({ip:o.ip,network:null,city:o.city,region:o.region,country:o.country,postal:null,latitude:o.latitude,longitude:o.longitude,in_eu:o.in_eu,ipCompany:null,isp:o.isp,asn:null,org:null,timezone:o.timezone}):a,cn),[2,o];case 3:return s=u.sent(),yt("Error fetching location:",s),[2,null];case 4:return[2]}}))}))}function k(){return sn(this,void 0,void 0,(function(){var e,t,n,r,i,o,a;return un(this,(function(c){switch(c.label){case 0:if(fn)return gt("Already retrying events, skipping"),[2];c.label=1;case 1:if(c.trys.push([1,10,11,12]),fn=!0,!(e=localStorage.getItem(dn)))return[2];if(0===(t=JSON.parse(e)).length)return[2];gt("Retrying ".concat(t.length," stored batches")),n=0,r=t,c.label=2;case 2:if(!(n<r.length))return[3,9];i=r[n],c.label=3;case 3:return c.trys.push([3,5,,6]),[4,z(i)];case 4:return c.sent()?function(e){var t,n;try{if(!(t=localStorage.getItem(dn)))return;0===(n=JSON.parse(t).filter((function(t){return t.id!==e}))).length?localStorage.removeItem(dn):localStorage.setItem(dn,JSON.stringify(n)),gt("Removed batch ".concat(e," from storage. Remaining: ").concat(n.length))}catch(e){yt("Error removing batch from storage",e)}}(i.id):gt("Failed to send batch ".concat(i.id,", keeping in storage")),[3,6];case 5:return o=c.sent(),yt("Error processing batch ".concat(i.id),o),[3,6];case 6:return[4,new Promise((function(e){return setTimeout(e,ln)}))];case 7:c.sent(),c.label=8;case 8:return n++,[3,2];case 9:return[3,12];case 10:return a=c.sent(),yt("Error in retryFailedEvents",a),[3,12];case 11:return fn=!1,[7];case 12:return[2]}}))}))}function E(e){if(!vn)return vn={x:e.clientX,y:e.clientY},void wn();Math.hypot(e.clientX-vn.x,e.clientY-vn.y)>gn&&(vn={x:e.clientX,y:e.clientY},wn())}function _(){A(),document.addEventListener("mousemove",E,{passive:!0}),["touchmove","scroll","keypress","click"].forEach((function(e){document.addEventListener(e,wn,{passive:!0})})),wn(),gt("Activity tracking initialized")}function A(){pn&&(clearTimeout(pn),pn=null),document.removeEventListener("mousemove",E),["touchmove","scroll","keypress","click"].forEach((function(e){document.removeEventListener(e,wn)}))}function L(){return(new Date).toISOString()}function P(){return Date.now()}function C(e){var t,n;if("number"==typeof e)return e;if("string"==typeof e){if(t=Number(e),!isNaN(t))return t;if(n=Date.parse(e),!isNaN(n))return n}throw new Error("Invalid time value: ".concat(e))}function x(){return xn(this,void 0,void 0,(function(){var e,t,n,r,i;return Mn(this,(function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),gt("sendInitialData called"),[4,Pn(null,"initial")];case 1:e=o.sent(),o.label=2;case 2:o.trys.push([2,4,,6]),t=void 0;try{t=JSON.stringify(e)}catch(e){throw yt("JSON serialization failed for initial data",e),e}return[4,fetch(Et,{method:"POST",headers:{"Content-Type":"text/plain"},body:t,credentials:"omit",cache:"no-store",signal:AbortSignal.timeout(1e4)})];case 3:if(!(n=o.sent()).ok)throw new Error("HTTP error! status: ".concat(n.status));return gt("sendInitialData sent successfully"),[2,!0];case 4:return r=o.sent(),yt("Error in immediate initial data send",r),[4,z(e,!1)];case 5:return o.sent()?(gt("sendInitialData retry succeeded"),[2,!0]):(gt("sendInitialData saving to storage after failed attempts"),j(e),Fn(),[2,!1]);case 6:return[3,8];case 7:return i=o.sent(),yt("Error sending initial data",i),[2,!1];case 8:return[2]}}))}))}function M(e){return xn(this,void 0,void 0,(function(){return Mn(this,(function(t){try{return j(e),Fn(),[2,!0]}catch(e){return yt("Error queueing data",e),[2,!1]}return[2]}))}))}function O(e){return xn(this,void 0,void 0,(function(){return Mn(this,(function(t){switch(t.label){case 0:return[4,Pn(e)];case 1:return[2,M(t.sent())]}}))}))}function N(e){return xn(this,arguments,void 0,(function(e,t){var n;return void 0===t&&(t=!1),Mn(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,Pn(e)];case 1:return[4,z(r.sent(),t)];case 2:return[2,r.sent()];case 3:return n=r.sent(),yt("Error in buildAndSendDataImmediate",n),[2,!1];case 4:return[2]}}))}))}function R(e,t){void 0===t&&(t={});var id=j(e);return id&&t.triggerSend&&Fn(),id}function D(e){e&&F(e)}function W(){Fn()}function j(e){var t,n;try{t=H(),n=Cn(Cn({},e),{id:"".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9)),queuedAt:Date.now()}),t.push(n),t.length>Nn&&t.splice(0,t.length-Nn);try{localStorage.setItem(Ut,JSON.stringify(t))}catch(e){yt("JSON serialization failed for batch storage",e)}return gt("Saved batch to storage. Total batches: ".concat(t.length)),n.id}catch(e){return yt("Error saving batch to storage",e),null}}function H(){try{var e=localStorage.getItem(Ut);return e?JSON.parse(e):[]}catch(e){return yt("Error loading pending batches",e),[]}}function F(e){var t;try{t=H().filter((function(t){return t.id!==e}));try{localStorage.setItem(Ut,JSON.stringify(t))}catch(e){yt("JSON serialization failed for batch removal",e)}}catch(e){yt("Error removing batch from storage",e)}}function z(e){return xn(this,arguments,void 0,(function(e,t){var n,r,i,o,a,c,s,u,l,d,f;return void 0===t&&(t=!1),Mn(this,(function(h){switch(h.label){case 0:h.trys.push([0,17,,18]),gt("sendDataWithRetry called",e.eventType),delete(n=Cn({},e)).id,delete n.queuedAt,r=void 0;try{r=JSON.stringify(n)}catch(e){throw yt("JSON serialization failed",e),e}if(i=("hidden"===document.visibilityState||t)&&"function"==typeof navigator.sendBeacon,o=!1,i){gt("sendDataWithRetry using beacon");try{a=new Blob([r],{type:"application/json"}),(o=navigator.sendBeacon(Et,a))&&gt("sendDataWithRetry beacon accepted for delivery")}catch(e){yt("Beacon threw error, falling back to fetch",e)}}gt("sendDataWithRetry trying primary endpoint:",Et),h.label=1;case 1:return h.trys.push([1,7,,16]),[4,fetch(Et,{method:"POST",headers:{"Content-Type":"text/plain"},body:r,credentials:"omit",cache:"no-store",keepalive:!0,signal:AbortSignal.timeout(1e4)})];case 2:if(!(c=h.sent()).ok)throw new Error("HTTP error! status: ".concat(c.status));h.label=3;case 3:return h.trys.push([3,5,,6]),[4,c.text()];case 4:return h.sent(),[3,6];case 5:return h.sent(),gt("Could not read success response body, but request succeeded"),[3,6];case 6:return gt("sendDataWithRetry primary endpoint success"),[2,!0];case 7:s=h.sent(),yt("Primary endpoint failed, trying fallback:",s),u=Dn(),gt("sendDataWithRetry trying fallback endpoint:",u),h.label=8;case 8:return h.trys.push([8,14,,15]),[4,fetch(u,{method:"POST",headers:{"Content-Type":"text/plain"},body:r,credentials:"omit",cache:"no-store",keepalive:!0,signal:AbortSignal.timeout(1e4)})];case 9:if(!(l=h.sent()).ok)throw new Error("Fallback HTTP error! status: ".concat(l.status));h.label=10;case 10:return h.trys.push([10,12,,13]),[4,l.text()];case 11:return h.sent(),[3,13];case 12:return h.sent(),gt("Could not read fallback success response body, but request succeeded"),[3,13];case 13:return gt("sendDataWithRetry fallback endpoint success"),[2,!0];case 14:return d=h.sent(),yt("Both primary and fallback endpoints failed:",d),o&&gt("sendDataWithRetry falling back to queued beacon-only delivery"),[2,!1];case 15:return[3,16];case 16:return[3,18];case 17:return f=h.sent(),yt("Error sending data",f),[2,!1];case 18:return[2]}}))}))}function U(element){var e,t,n;return t=(e="target"in element&&"function"==typeof element.target.getIframe?element.target.getIframe():element).tagName.toLowerCase(),e.id&&(t+="#".concat(e.id)),e.className&&(n=e.className.split(/\s+/).join("."),t+=".".concat(n)),t}function V(element){var e,t,n;return e="target"in element&&"function"==typeof element.target.getIframe?element.target.getIframe():element,t=function(e,n){return e?t(e.previousElementSibling,n||e.nodeName)+(e.nodeName===n?1:0):1},(n=function(e){return e&&1===e.nodeType?e.id&&document.getElementById(e.id)===e?['id("'.concat(e.id,'")')]:zn(zn([],n(e.parentNode),!0),["".concat(e.nodeName.toLowerCase(),"[").concat(t(e.previousElementSibling,e.nodeName),"]")],!1):[]})(e).join("/")}function q(url){var e=[],t=url||window.location.href;return Object.entries(Un).forEach((function(n){var r=n[0],i=n[1];!i.active&&i.trigger(t)&&(e.push(r),i.active=!0,gt("Form provider activated: ".concat(i.name)))})),e}function B(){return Object.values(Un).filter((function(e){return e.active}))}function G(url){if(!url)return"";try{var e=new URL(url,location.href);return"".concat(e.hostname).concat(e.pathname)}catch(e){return String(url||"")}}function K(e){if(!e)return"";var t={};try{Object.keys(e).forEach((function(n){var r=n.toLowerCase();r.startsWith("hs_")||r.startsWith("utm")||"hs_context"===r||Gn.has(r)&&(t[r]=e[n])}))}catch(e){}return function(e){if(!e)return"";try{return Object.keys(e).sort().map((function(t){return"".concat(t,":").concat(String(e[t]))})).join("|")}catch(t){try{return JSON.stringify(e)}catch(t){return String(e)}}}(t)}function X(action){var e=G(action||"");return e?"action:".concat(e):""}function Y(action,e){var t,n;return void 0===e&&(e=Vn),!!(t=X(action))&&((n=P())-(Bn.get(t)||0)<e||(Bn.set(t,n),!1))}function J(action,e){var t;return void 0===e&&(e=Vn),!!(t=X(action))&&P()-(Bn.get(t)||0)<e}function $(e,t,n,r){var i,o,a,c,s,u;e?"function"==typeof(s=null!==(i=null==(c=Object.getOwnPropertyDescriptor(e,t))?void 0:c.value)&&void 0!==i?i:e[t])?s[Qn]?gt("".concat(r,": already wrapped, skipping wrap")):(/\[native code\]/.test(s.toString())||gt("".concat(r,": existing non-native implementation detected, chaining wrap"),{originalName:s.name}),c&&!1===c.configurable?gt("".concat(r,": descriptor not configurable, skipping wrap")):((u=n(s))[Qn]=!0,u[er]=s,c?Object.defineProperty(e,t,{configurable:!0,enumerable:null!==(o=c.enumerable)&&void 0!==o&&o,writable:null===(a=c.writable)||void 0===a||a,value:u}):e[t]=u)):gt("".concat(r,": original is not a function, skipping wrap")):gt("".concat(r,": target missing, skipping wrap"))}function Z(e){if(!e)return null;if("string"==typeof e)return e;if("undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams)return e.toString();if("undefined"!=typeof FormData&&e instanceof FormData){var t=[];return e.forEach((function(value,e){"string"==typeof value&&t.push("".concat(e,"=").concat(value))})),t.length?t.join("&"):null}return null}function Q(e,t){var n,r,i,o,a,c,value,s;if(void 0===t&&(t=0),!e||t>3)return[];if(n=[],Array.isArray(e)){for(r=0,i=e;r<i.length;r++)n.push.apply(n,Q(i[r],t+1));return n}if("object"==typeof e)for(o=0,a=Object.entries(e);o<a.length;o++)value=(c=a[o])[1],s=c[0].toLowerCase(),"string"==typeof value&&["event","eventname","event_type","type","status","action","name"].includes(s)&&n.push(value.toLowerCase()),n.push.apply(n,Q(value,t+1));return n}function ee(e,t){var n,r,i,value,o;if(void 0===t&&(t=0),!e||t>3)return!1;if(Array.isArray(e))return e.some((function(e){return ee(e,t+1)}));if("object"==typeof e)for(n=0,r=Object.entries(e);n<r.length;n++){if(value=(i=r[n])[1],o=i[0].toLowerCase(),rr.includes(o))return!0;if(ee(value,t+1))return!0}return!1}function te(e,t,n){var r,i,o,a;return"leadconnector"!==e||(i=function(e){if(!(null==e?void 0:e.text))return null;try{return JSON.parse(e.text)}catch(e){return null}}(n),!(o=Q(i)).some((function(token){return nr.has(token)}))&&(!!o.some((function(token){return tr.has(token)}))||!!ee(i)||!!(a=(null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.toLowerCase())||"")&&!/"event"\s*:\s*"calendar\.view"/i.test(a)&&(!!/email=|phone=|first_name=|last_name=|contact=/i.test(a)||/booking\.scheduled|appointment\.scheduled|meeting\.scheduled|\bbooked\b|\bconfirmed\b/i.test(a))))}function ne(){var e,t=P();try{if("undefined"!=typeof process&&"test"===(null===(e=process.env)||void 0===e?void 0:"production"))return!1}catch(e){}return ur>0&&t-ur<sr}function re(e){var t=P();return t-(dr.get(e)||0)<lr||(dr.set(e,t),!1)}function ie(e){var t=P();return t-(yr.get(e)||0)<gr||(yr.set(e,t),!1)}function oe(e,t){return void 0===t&&(t=gr),P()-(yr.get(e)||0)<t}function ae(value){if(null==value)return"";if("string"==typeof value)return value.toLowerCase();try{var e=value;if("string"==typeof e.value)return e.value.toLowerCase();if("string"==typeof e.baseVal)return e.baseVal.toLowerCase()}catch(e){}return String(value||"").toLowerCase()}function ce(e){var t,n,r,i,o,a,c;try{if(t=window.getComputedStyle(e),null===e.offsetParent&&"none"===t.display)return!1;for(n=Array.from(e.elements||[]),r=0,i=n;r<i.length;r++)if((o=i[r])instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement)if(o instanceof HTMLInputElement){if("hidden"===(a=(o.type||"").toLowerCase()))continue;if("password"===a)continue;if(("checkbox"===a||"radio"===a)&&o.checked)return!0;if(("text"===a||"email"===a||"tel"===a||"url"===a||"search"===a||"number"===a)&&(c=(o.value||"").trim())&&"0"!==c)return!0}else if(o instanceof HTMLTextAreaElement){if(c=(o.value||"").trim())return!0}else if(o instanceof HTMLSelectElement&&(c=(o.value||"").trim())&&"0"!==c&&"select"!==c.toLowerCase())return!0}catch(e){}return!1}function se(element){var e=or.get(element);return!!e&&P()-e.timestamp<ir.DEDUPLICATION_WINDOW}function ue(element,method){var e,t;return se(element)?(vr.duplicatesBlocked++,gt("Duplicate submission blocked",element),""):(e=y(),t={elementId:element.id||U(element),timestamp:P(),submissionId:e,method},or.set(element,t),e)}function le(e){return qt.some((function(t){return"string"==typeof t?e.toLowerCase().includes(t.toLowerCase()):t.test(e)}))}function de(e){var t,n,formData,r,element,value,i={},o=0;if(e.elements.length>ir.MAX_FORM_FIELDS)return yt("Form has too many fields, skipping",e.id),{};if(null===(t=e.action)||void 0===t?void 0:t.includes("facebook.com/tr/"))return{};if(e.classList.contains("hs-form")||(null===(n=e.id)||void 0===n?void 0:n.includes("hsForm_"))||e.closest("[data-reactroot]"))try{return formData=new FormData(e),Array.from(formData.entries()).forEach((function(e){var t=e[0],value=e[1];"hs_context"!==t&&value&&"string"==typeof value&&(i[t]=value.slice(0,ir.MAX_FIELD_LENGTH))})),i}catch(e){yt("Error processing HubSpot form data",e)}for(r=0;r<e.elements.length;r++)if((element=e.elements[r])instanceof HTMLInputElement||element instanceof HTMLSelectElement||element instanceof HTMLTextAreaElement){if(element instanceof HTMLInputElement&&ir.DISALLOWED_FIELD_TYPES.includes(element.type))continue;if(element.name&&"submit"!==element.type){if(++o>ir.MAX_FORM_FIELDS){yt("Too many form fields, truncating",e.id);break}value=element.value.slice(0,ir.MAX_FIELD_LENGTH),i[element.name]=le(element.name)?"[REDACTED]":value}}return i}function fe(e,method){return Xn(this,void 0,void 0,(function(){var t,formData;return Yn(this,(function(n){try{return(t=ue(e,method))?(formData=de(e),[2,{eventId:t,eventType:"formSubmit",time:(new Date).toISOString(),label:e.id||e.className||"unnamed-form",value:g(e.action)||e.action||"",element:{tag:"form",id:e.id,class:e.className,action:g(e.action)||e.action,method:e.method,formData,customSelector:U(e),xpath:V(e)}}]):[2,null]}catch(e){return yt("Error creating form event",e),vr.errors.push("Error creating form event: ".concat(e)),[2,null]}return[2]}))}))}function he(e,method){return Xn(this,void 0,void 0,(function(){var t,n,r,i,o,a,c,s,u,l;return Yn(this,(function(d){switch(d.label){case 0:return d.trys.push([0,6,,7]),t=function(e){var t,n;return[e.eventType||"",G((null===(t=e.element)||void 0===t?void 0:t.action)||""),K(null===(n=e.element)||void 0===n?void 0:n.formData)].join("#")}(e),function(e,t){var n;return void 0===t&&(t=Vn),!function(){var e;try{return"undefined"!=typeof process&&"test"===(null===(e=process.env)||void 0===e?void 0:"production")}catch(e){return!1}}()&&((n=P())-(qn.get(e)||0)<t||(qn.set(e,n),!1))}(t)?(vr.duplicatesBlocked++,gt("Duplicate form event fingerprint blocked",{label:e.label,action:null===(u=e.element)||void 0===u?void 0:u.action,method}),[2]):Y(n=(null===(l=e.element)||void 0===l?void 0:l.action)||"")?(vr.duplicatesBlocked++,gt("Action-level throttle blocked duplicate form",n),[2]):[4,Pn(e)];case 1:r=d.sent(),i="form_submit_".concat(e.eventId),localStorage.setItem(i,JSON.stringify(r)),o=R(r,{triggerSend:!1}),a="submit"===method||"click"===method,d.label=2;case 2:return d.trys.push([2,4,,5]),[4,z(r,a)];case 3:return d.sent()?(o&&D(o),localStorage.removeItem(i),vr.formsSubmitted++,"submit"===method||"xhr"===method?vr.universalSuccess++:"provider"===method&&vr.providerSuccess++,gt("Form data sent successfully",e.eventId),[2]):(gt("Form send failed, scheduling queued retry",e.eventId),o?W():R(r,{triggerSend:!0}),vr.formsMissed++,vr.errors.push("Send error: queued for retry"),[3,5]);case 4:return c=d.sent(),yt("Error sending form data",c),o?W():R(r,{triggerSend:!0}),vr.formsMissed++,vr.errors.push("Send error: ".concat(c)),[3,5];case 5:return[3,7];case 6:return s=d.sent(),yt("Error building form batch",s),vr.formsMissed++,vr.errors.push("Batch error: ".concat(s)),[3,7];case 7:return[2]}}))}))}function me(e){var t,n,r;if(ne())gt("Ignoring form submit during startup debounce window");else if((t=e.target)&&"FORM"===t.tagName){if(n=t.id||t.getAttribute("data-form-id")||U(t),ie(r="native:".concat(n)))return vr.duplicatesBlocked++,void gt("Throttled native form submit",r);try{(t.classList.contains("hs-form")||t.id&&t.id.startsWith("hsForm_")||t.querySelector("input[name='hs_context']"))&&(yr.set("hubspot:".concat(t.id||n),P()),fr.set("hubspot:".concat(t.id||n),P()))}catch(e){}gt("Universal form submit detected",t.id||t.className);try{t.action&&Y(t.action)}catch(e){}pe(t,"submit")}}function pe(e,method){return Xn(this,void 0,void 0,(function(){var t,n;return Yn(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),(e.className||"").toLowerCase().includes("fusion-form")&&!ce(e)?(gt("Skipping Fusion form without user input",e.className),[2]):[4,fe(e,method)];case 1:return(t=r.sent())?[4,he(t,method)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[3,5];case 4:return n=r.sent(),yt("Error handling form submission",n),vr.formsMissed++,[3,5];case 5:return[2]}}))}))}function ve(e){var t,n,r;ne()||(r=e.target.closest("button, input[type=submit], input[type=button]"))&&(r.closest("form")||(r.matches("[type=submit]")||(null===(t=r.textContent)||void 0===t?void 0:t.toLowerCase().includes("submit"))||(null===(n=r.textContent)||void 0===n?void 0:n.toLowerCase().includes("send"))||r.classList.contains("submit")||"submit"===r.getAttribute("data-action"))&&(gt("Button-only form submission detected",r),vr.buttonSubmissions++,function(e){Xn(this,void 0,void 0,(function(){var t,n,r,i,o,a,c,s;return Yn(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),ie(t="button:".concat(e.id||(null===(c=e.textContent)||void 0===c?void 0:c.trim())||U(e)))?(vr.duplicatesBlocked++,gt("Throttled button-only submission",t),[2]):(n=ue(e,"click"))?(r=e.closest("[data-form], .ghl-form-wrap, .form-builder--wrap, #_builder-form, .hl_form-builder--main, .c-form, .form, .contact-form, .newsletter")||document.getElementById("_builder-form")||e.closest(".ghl-form-wrap, .form-builder--wrap")||e.parentElement,i=(null==r?void 0:r.querySelectorAll("input, textarea, select"))||[],o={},i.forEach((function(e){(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&e.name&&!le(e.name)&&(o[e.name]=e.value.slice(0,ir.MAX_FIELD_LENGTH).trim())})),[4,he({eventId:n,eventType:"formSubmit",time:(new Date).toISOString(),label:(null===(s=e.textContent)||void 0===s?void 0:s.slice(0,ir.MAX_FIELD_LENGTH).trim())||e.id||"unnamed-button",value:e.getAttribute("data-action")||"",element:{tag:e.tagName.toLowerCase(),id:e.id,class:e.className,formData:o,customSelector:U(e),xpath:V(e)}},"provider")]):[2];case 1:return u.sent(),[3,3];case 2:return a=u.sent(),yt("Error capturing button submission",a),vr.errors.push("Button capture error: ".concat(a)),[3,3];case 3:return[2]}}))}))}(r)))}function ge(){function e(url){var e,t,n;for(e=0,t=a;e<t.length;e++)if((n=t[e]).re.test(url))return{provider:n.provider,signal:n.signal};return null}function t(e,url,t,n){return Xn(this,void 0,void 0,(function(){var r,i,o,a;return Yn(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),te(e,0,n)?ie(r="calendar:".concat(e,":network:").concat(t))||re(r)?(vr.duplicatesBlocked++,gt("Throttled calendar network event",{provider:e,signal:t}),[2]):(i=y(),o={eventId:i,eventType:"formSubmit",time:(new Date).toISOString(),label:"calendar-".concat(e),value:"network:".concat(t),element:{tag:"network",id:"",class:"calendar-network",action:url,method:"POST",formData:{},customSelector:e,xpath:"",captureSource:"calendar"}},gt("Calendar booking detected via network",{provider:e,url,signal:t}),[4,he(o,"provider")]):(gt("Skipping calendar network event due to non-booking payload",{provider:e,signal:t}),[2]);case 1:return c.sent(),[3,3];case 2:return a=c.sent(),yt("Error emitting calendar network event",a),[3,3];case 3:return[2]}}))}))}function n(url){var e=[/hubspot/i,/hsforms/i,/hs-/i,/\.hs\./i,/meeting/i,/calendar/i,/schedule/i,/book/i].find((function(e){return e.test(url)}));e&&gt("🔍 POTENTIAL HUBSPOT SUBMISSION DETECTED (lenient):",{url,matchedPattern:e.toString(),method:"POST",timestamp:(new Date).toISOString()})}function r(url){if(i.some((function(e){return e.test(url)})))return gt("Excluded analytics endpoint from form detection:",url),!1;var e=o.find((function(e){return e.test(url)}));return!!e&&(gt("Form submission endpoint detected:",{url,matchedPattern:e.toString()}),!0)}var i,o,a,c="__cstNetworkInterceptInstalled";window[c]||(window[c]=!0,i=[new RegExp(Et.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),/google-analytics\.com/i,/googletagmanager\.com/i,/facebook\.com\/tr/i,/hotjar\.com/i,/mixpanel\.com/i,/segment\.com/i,/amplitude\.com/i],o=[/https?:\/\/(?:[^\/]+\.)?hsforms\.com\/submissions\/v\d+\/public\/submit\//i,/https?:\/\/(?:[^\/]+\.)?forms\.hubspot\.com\/submissions\/v\d+\/public\/submit\//i,/https?:\/\/(?:[^\/]+\.)?hscollectedforms\.net\/collected-forms\/submit\/form/i,/https?:\/\/api\.hsforms\.com\/submissions\/v\d+\/integration\/submit\//i,/https?:\/\/forms\.hsforms\.com\/submissions\/v\d+\/public\/submit\/formsnext\//i,/https?:\/\/forms\.hsforms\.com\/submissions\/v\d+\/public\/submit\/legacy\//i,/https?:\/\/(?:[^\/]+\.)?hubspot\.com\/.*\/meetings?\//i,/https?:\/\/meetings\.hubspot\.com\//i,/https?:\/\/api\.hubapi\.com\/.*\/meetings?\//i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=gform_ajax_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=gform_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=gf_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php(?:.*action=gform_ajax_submit|.*gform_ajax=)/i,/https?:\/\/(?:[^\/]+\.)?wp-json\/contact-form-7\/v1\/contact-forms\/\d+\/feedback/i,/https?:\/\/api\.typeform\.com\/forms\/[A-Za-z0-9_-]+\/responses/i,/https?:\/\/list-manage\.com\/subscribe\/post/i,/https?:\/\/(?:[^\/]+\.)?formstack\.com\/forms\//i,/https?:\/\/submit\.jotform\.com\/form\/\d+/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=ninja_forms_ajax_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=wpforms_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=elementor_pro_forms_ajax/i,/\/wp-admin\/admin-ajax\.php.*action=.*form.*submit/i,/\/api\/.*\/forms\/.*\/submit$/i,/\/forms\/.*\/submissions$/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=wpcf7_submit/i,/https?:\/\/(?:[^\/]+\.)?wp-admin\/admin-ajax\.php\?action=wpforms_submit/i,/https?:\/\/docs\.google\.com\/forms\/d\/[A-Za-z0-9_-]+\/formResponse/i,/https?:\/\/(?:[^\/]+\.)?wufoo\.com\/forms\/[A-Za-z0-9_-]+\/def\/field/i,/https?:\/\/(?:[^\/]+\.)?surveymonkey\.com\/r\/[A-Za-z0-9_-]+/i,/https?:\/\/forms\.office\.com\/Pages\/ResponsePage\.aspx/i,/https?:\/\/(?:[^\/]+\.)?constantcontact\.com\/signup\/signup\.do/i,/https?:\/\/(?:[^\/]+\.)?leadconnectorhq\.com\//i,/https?:\/\/(?:[^\/]+\.)?gohighlevel\.com\//i],a=[{re:/https?:\/\/(?:[^\/]+\.)?backend\.leadconnectorhq\.com\/appengine\/appointment\b/i,provider:"leadconnector",signal:"appointment"},{re:/https?:\/\/(?:[^\/]+\.)?backend\.leadconnectorhq\.com\/calendars\/booking-analytics\/event\/submit\b/i,provider:"leadconnector",signal:"booking_analytics_submit"}],"undefined"!=typeof XMLHttpRequest?($(XMLHttpRequest.prototype,"send",(function(e){return function(t){try{this.__cstRequestBodyText=Z(t)}catch(e){gt("Unable to capture XHR request body",e)}return e.call(this,t)}}),"XMLHttpRequest.send"),$(XMLHttpRequest.prototype,"open",(function(i){return function(method,url,o,a,c){var s,u,l;return void 0===o&&(o=!0),q(s="string"==typeof url?url:url.toString()),"POST"===method.toUpperCase()&&n(s),"POST"===method.toUpperCase()&&(u=e(s))&&(l=this,this.addEventListener("load",(function(){var e=l.__cstRequestBodyText,n="string"==typeof e?{text:e}:null;setTimeout((function(){t(u.provider,s,u.signal,n)}),50)}))),"POST"===method.toUpperCase()&&r(s)&&this.addEventListener("load",(function(){gt("Likely form submission XHR detected",s),setTimeout((function(){return ye("xhr")}),100)})),i.call(this,method,url,o,a,c)}}),"XMLHttpRequest.open")):gt("XMLHttpRequest unavailable, skipping interception"),"undefined"!=typeof window&&"function"==typeof window.fetch?$(window,"fetch",(function(i){return function(o,a){return Xn(this,void 0,void 0,(function(){var c,url,method,s,u,l,d;return Yn(this,(function(f){switch(f.label){case 0:return c=function(e,t){var n,r,url="",method="GET",i=null!==(n=null==t?void 0:t.body)&&void 0!==n?n:null;if("string"==typeof e)url=e;else if(e instanceof URL)url=e.toString();else if("undefined"!=typeof Request&&e instanceof Request){if(url=e.url,method=e.method||method,null==i&&"function"==typeof e.clone)try{i="function"==typeof e.clone().text?void 0:null}catch(e){}}else url=String(e);return(null==t?void 0:t.method)&&(method=t.method),r=Z(i),{url,method:(method||"GET").toUpperCase(),bodyInfo:r?{text:r}:null}}(o,a),method=c.method,s=c.bodyInfo,(url=c.url)&&q(url),"POST"===method&&url&&n(url),u="POST"===method&&url?e(url):null,l=!("POST"!==method||!url)&&r(url),[4,i.call(this,o,a)];case 1:return d=f.sent(),u&&url&&Promise.resolve().then((function(){return t(u.provider,url,u.signal,s)})).catch((function(){})),l&&url&&(gt("Likely form submission Fetch detected",url),setTimeout((function(){return ye("xhr")}),100)),[2,d]}}))}))}}),"window.fetch"):gt("window.fetch unavailable, skipping interception"))}function ye(method){var e,t,n;ne()?gt("Startup debounce active; skipping XHR form scan"):(e=P())-ar<cr?gt("XHR scan rate limited, skipping"):(ar=e,t=document.querySelectorAll("form"),n=!1,t.forEach((function(e){var t,r,i,o,a;e instanceof HTMLFormElement&&!se(e)&&(t=de(e),r=Object.keys(t).length>0&&Object.values(t).some((function(value){return value.length>0})),i=ce(e),o=null!==e.offsetParent||"none"!==window.getComputedStyle(e).display,r&&i&&o&&!n&&(gt("Potential XHR form submission detected",e.id||e.className),a=e.id||e.getAttribute("data-form-id")||U(e),oe("native:".concat(a))||oe("hubspot:".concat(a))||J(e.action)?gt("Skipping XHR capture due to recent native/provider send",a):pe(e,method),n=!0))})),n||gt("XHR detected but no valid form submissions found"))}function be(){var e,t,n,r,i;Zn.completed||Zn.inProgress||(e=P(),Zn.lastAttemptAt&&e-Zn.lastAttemptAt<$n||"undefined"!=typeof window&&"undefined"!=typeof document&&((null===(i=null===(r=window.hbspt)||void 0===r?void 0:r.forms)||void 0===i?void 0:i.create)||document.querySelector(".hs-form, form[data-hs-cf-bound], .hbspt-form, script[src*='hsforms'], script[src*='hubspot'], iframe[src*='hsforms']")||B().some((function(e){return"HubSpot"===e.name})))&&(Zn.inProgress=!0,Zn.lastAttemptAt=e,t=0,n=function(){var e,r,i,o,a;if(1!=++t&&t%5!=0||gt("🔧 HubSpot patch attempt ".concat(t,":"),{hasWindow:"undefined"!=typeof window,hasHbspt:!!window.hbspt,hasForms:!!(null===(e=window.hbspt)||void 0===e?void 0:e.forms),hasCreate:"function"==typeof(null===(i=null===(r=window.hbspt)||void 0===r?void 0:r.forms)||void 0===i?void 0:i.create),hbsptKeys:window.hbspt?Object.keys(window.hbspt):[]}),"undefined"!=typeof window&&(null===(o=window.hbspt)||void 0===o?void 0:o.forms)&&"function"==typeof window.hbspt.forms.create)return a=window.hbspt.forms.create,window.hbspt.forms.create=function(e){gt("🎯 HubSpot form created, patching callbacks:",e.formId);var t=e.onFormSubmit;return e.onFormSubmit=function(n){try{var r={};n.serializeArray().forEach((function(e){var t=e.name;"hs_context"!==t&&(r[t]=e.value)})),gt("✅ HubSpot form submit intercepted:",{formId:e.formId,formData:r}),window.postMessage({type:"hsFormCallback",fields:r,id:e.formId,action:"hubspot"},"*")}catch(e){yt("Error in HubSpot form callback patch",e)}return t&&t(n)},a(e)},Zn.completed=!0,Zn.inProgress=!1,void gt("✅ HubSpot forms.create successfully patched!");t<50?setTimeout(n,100):(Zn.inProgress=!1,gt("⚠️ HubSpot patching failed after maximum attempts"))},n()))}function we(){B().forEach((function(e){var t;vr.providerTriggers[e.name]=(vr.providerTriggers[e.name]||0)+1,null===(t=e.events)||void 0===t||t.forEach((function(t){var n,r="".concat(e.name,":").concat(t);Jn.has(r)||(n=function(n){("HubSpot"!==e.name||"message"!==t||function(e){var t,n,r,id;return!!(/hubspot|hsforms/i.test(e.origin||"")||(t=function(e){var t,n;if(null==e)return null;if("string"==typeof e){if(!(t=e.trim()))return null;if((n=t.toLowerCase()).includes("hsformcallback")||n.includes("hubspot"))return{type:"hsFormCallback"};try{return JSON.parse(t)}catch(e){return null}}return"object"==typeof e?e:null}(e.data))&&((n="string"==typeof t.origin?t.origin:"")&&/hubspot|hsforms/i.test(n)||"hsformcallback"===("string"==typeof t.type?t.type.toLowerCase():"")||(r="string"==typeof t.eventName?t.eventName.toLowerCase():"").includes("hubspot")||r.includes("hsform")||(id="string"==typeof t.id?t.id.toLowerCase():"").startsWith("hsform")||id.includes("hubspot")))}(n))&&(gt("Provider event detected: ".concat(t," for ").concat(e.name)),setTimeout((function(){return function(e){e.selectors.forEach((function(t){document.querySelectorAll(t).forEach((function(n){var r,i;if(n instanceof HTMLFormElement){if(!ce(n))return void gt("Skipping provider capture without user input",{provider:e.name,selector:t,id:n.id});if(ie(r="provider:".concat(e.name,":").concat(n.id||U(n))))return vr.duplicatesBlocked++,void gt("Throttled provider form submit",r);if(i=n.id||n.getAttribute("data-form-id")||U(n),oe("native:".concat(i))||oe("hubspot:".concat(i))||J(n.action))return vr.duplicatesBlocked++,void gt("Suppressed provider capture due to recent send",{provider:e.name,idPart:i});gt("Provider form found: ".concat(e.name),n.id),pe(n,"provider")}}))}))}(e)}),50))},window.addEventListener(t,n),document.addEventListener(t,n,!0),Jn.add(r))}))}))}function Se(){var e,t,n,r,i;gt("Initializing enhanced form tracking"),e="__cstEnhancedFormTrackingInit",window[e]?gt("Enhanced form tracking already initialized, skipping"):(window[e]=!0,ur=P(),function(){try{var e=JSON.parse(localStorage.getItem("cst_learned_patterns")||"[]");e.forEach((function(e){hr.add(e),pr.set(e,.8)})),gt("Loaded ".concat(e.length," learned patterns from storage"))}catch(e){yt("Error loading learned patterns",e)}}(),r=new Set,i=document.querySelectorAll("form"),Array.from(i).forEach((function(e){var t,n,i,id;if(e.action)try{(t=new URL(e.action,location.href).hostname)&&t!==location.hostname&&(r.add(t),mr.add(t))}catch(e){}i=ae((n=e).className),id=ae(n.id||n.getAttribute("id")),(i.includes("hubspot")||i.includes("hs-form")||id.includes("hsform"))&&(mr.add("hsforms.com"),r.add("hubspot")),(i.includes("gravity")||i.includes("gform"))&&r.add("gravity-forms"),(i.includes("contact")||i.includes("mailchimp"))&&r.add("contact-form"),i.includes("typeform")&&(mr.add("typeform.com"),r.add("typeform"))})),n=document.querySelectorAll("iframe"),Array.from(n).forEach((function(e){var t,n=e.src;if(n)try{((t=new URL(n).hostname).includes("hubspot")||t.includes("hsforms"))&&(mr.add(t),r.add("hubspot-iframe")),t.includes("typeform")&&(mr.add(t),r.add("typeform-iframe"))}catch(e){}})),gt("Discovered providers:",Array.from(r)),gt("Discovered form providers:",Array.from(r)),we(),document.addEventListener("gform_confirmation_loaded",(function(e){var t,n,r=null===(t=e.detail)||void 0===t?void 0:t[0];gt("Gravity Forms confirmation loaded:",r),(n=document.querySelector("#gform_".concat(r)))&&!se(n)&&(gt("Gravity Forms submission detected via confirmation:",r),pe(n,"provider"))})),document.addEventListener("gform_post_render",(function(e){var t,n=null===(t=e.detail)||void 0===t?void 0:t.formId;gt("Gravity Forms post render:",n)})),"undefined"!=typeof HTMLFormElement&&$(HTMLFormElement.prototype,"submit",(function(e){return function(){var t,n,r=[];for(n=0;n<arguments.length;n++)r[n]=arguments[n];return(null===(t=null==this?void 0:this.id)||void 0===t?void 0:t.startsWith("gform_"))&&!se(this)&&(gt("Gravity Forms iframe submission detected:",this.id),pe(this,"provider")),e.apply(this,r)}}),"HTMLFormElement.submit"),document.addEventListener("click",(function(e){var t,n,r,i=e.target;(null===(t=null==i?void 0:i.id)||void 0===t?void 0:t.startsWith("gform_submit_button_"))&&!se(i)&&(n=i.id.replace("gform_submit_button_",""),(r=document.querySelector("#gform_".concat(n)))&&(gt("Gravity Forms button submission detected:",n),pe(r,"provider")))})),t="__cstHubSpotListener",window[t]||(window[t]=!0,window.addEventListener("message",(function(e){var t,n,r,i,o,a,c,s,u,l,d,f,h,m,p,v,action,g,b,w,S,T,I,k,E,_;try{if("hsFormCallback"===(null===(t=e.data)||void 0===t?void 0:t.type)&&(gt("🔔 HubSpot PostMessage received:",{origin:e.origin,data:e.data,type:typeof e.data,hasType:null===(n=e.data)||void 0===n?void 0:n.type,isHubSpot:(null===(r=e.origin)||void 0===r?void 0:r.includes("hubspot"))||(null===(i=e.origin)||void 0===i?void 0:i.includes("hsforms"))}),f=function(){try{return new URL(e.origin).hostname}catch(e){return""}}(),h=/hubspot|hsforms/i.test(f),m=String((null===(o=e.data)||void 0===o?void 0:o.eventName)||"").toLowerCase(),p=!!(null===(a=e.data)||void 0===a?void 0:a.fields),v=(null===(c=e.data)||void 0===c?void 0:c.id)||(null===(s=e.data)||void 0===s?void 0:s.formId)||"hubspot-form",action=(null===(u=e.data)||void 0===u?void 0:u.action)||(null===(l=e.data)||void 0===l?void 0:l.url)||"hubspot",g=m.includes("onformsubmitted")||m.includes("submitted")||m.includes("onformsubmit")||m.includes("submission"),p||g||h)){if(b="hubspot:".concat(v),w="native:".concat(v),(S=P())-(yr.get(w)||0)<gr||oe(b))return vr.duplicatesBlocked++,void gt("Throttled HubSpot callback via native linkage",{formId:v,eventName:m});if(ie(b))return vr.duplicatesBlocked++,void gt("Throttled HubSpot callback",{formId:v,eventName:m});if(T=fr.get(w)||0,I=fr.get(b)||0,S-T<ir.DEDUPLICATION_WINDOW||S-I<ir.DEDUPLICATION_WINDOW)return vr.duplicatesBlocked++,void gt("Duplicate HubSpot submission blocked (unified)",{formId:v,eventName:m});fr.set(w,S),fr.set(b,S),yr.set(w,S),yr.set(b,S),k=(null===(d=e.data)||void 0===d?void 0:d.fields)||{},E=action;try{(_=document.querySelector("form#".concat(CSS.escape(v),", form[id*='").concat(v,"'], form.hs-form")))&&_.action&&(E=_.action)}catch(e){}gt("✅ HubSpot form callback processed:",{formId:v,eventName:m,hasFields:p,originHost:f});try{E&&Y(E)}catch(e){}(function(e,action,t){return Xn(this,void 0,void 0,(function(){var n,r;return Yn(this,(function(i){try{return n=y(),r={},Array.isArray(t)?t.forEach((function(e){var t=e.name,value=e.value,n="string"==typeof value?value:String(null!=value?value:"");t&&(r[t]=le(t)?"[REDACTED]":n.slice(0,ir.MAX_FIELD_LENGTH))})):Object.entries(t).forEach((function(e){var t=e[0],value=e[1];value&&"string"==typeof value&&(r[t]=le(t)?"[REDACTED]":value.slice(0,ir.MAX_FIELD_LENGTH))})),[2,{eventId:n,eventType:"formSubmit",time:(new Date).toISOString(),label:e||"hubspot-form",value:action,element:{tag:"form",id:e,class:"hs-form",action,method:"post",formData:r,customSelector:"#hsForm_".concat(e),xpath:""}}]}catch(e){return yt("Error creating HubSpot form event",e),vr.errors.push("Error creating HubSpot form event: ".concat(e)),[2,null]}return[2]}))}))})(v,E,k).then((function(e){e&&he(e,"provider")})).catch((function(e){yt("Error processing HubSpot form callback",e)}))}}catch(e){yt("Error processing HubSpot postMessage",e)}}))),Ie(),be(),ge(),document.addEventListener("submit",me,!0),document.addEventListener("click",ve,!0),setTimeout((function(){var e=document.querySelectorAll("form");gt("Found ".concat(e.length," forms on page load")),e.forEach((function(e){e instanceof HTMLFormElement&&!e.getAttribute(Lt)&&(gt("Setting up tracking for form:",e.id||e.className||"unnamed"),e.setAttribute(Lt,"true"))}))}),1e3),gt("Enhanced form tracking initialized"))}function Te(){gt("Rescanning all forms");var e=document.querySelectorAll("form");vr.formsFound=e.length,be(),q(),we(),Ie(),gt("Rescan complete: ".concat(e.length," forms found"))}function Ie(){function e(e){try{return new URL(e).hostname}catch(e){return""}}var t,n="cst_calendar_listener";window[n]||(window[n]=!0,t=["calendly.com","www.calendly.com","cal.com","app.cal.com","tidycal.com","app.tidycal.com","acuityscheduling.com","app.acuityscheduling.com","oncehub.com","scheduleonce.com","savvycal.com","meetings.hubspot.com","leadconnectorhq.com","backend.leadconnectorhq.com","meetings.leadconnectorhq.com","app.leadconnectorhq.com","gohighlevel.com","msgsndr.com"],window.addEventListener("message",(function(n){var r,i,o,a,c,s,u,l,d,f,h,m,p,v;try{if(!(r=e(n.origin)))return;if(!t.some((function(e){return r.endsWith(e)})))return;if(!(i=(v=r.toLowerCase()).includes("calendly")?"calendly":v.endsWith("cal.com")?"cal.com":v.includes("tidycal")?"tidycal":v.includes("acuity")?"acuity":v.includes("oncehub")||v.includes("scheduleonce")?"oncehub":v.includes("savvycal")?"savvycal":v.includes("hubspot")?"hubspot-meetings":v.includes("leadconnectorhq")||v.includes("leadconnector")||v.includes("gohighlevel")||v.includes("msgsndr")?"leadconnector":null))return;if(a="","string"==typeof(o=n.data)?a=o.toLowerCase():o&&"object"==typeof o&&(a=String(o.type||o.event||"").toLowerCase()),!(c=a.includes("scheduled")||a.includes("booking")||a.includes("meeting")||a.includes("booked")||a.includes("event_scheduled"))&&o&&"object"==typeof o)try{s=JSON.stringify(o).toLowerCase(),(u=["event_scheduled","appointment","scheduled","booking","booked","meeting"].find((function(e){return s.includes(e)})))&&(c=!0,a||(a="payload:".concat(u)))}catch(e){}if(!c)return;if(l="calendar:".concat(i,":").concat(a),!function(){var e;try{return"undefined"!=typeof process&&"test"===(null===(e=process.env)||void 0===e?void 0:"production")}catch(e){return!1}}()&&ie(l))return vr.duplicatesBlocked++,void gt("Throttled calendar event",{provider:i,signal:a});if(re(l))return;d=y(),f=null;try{h=Array.from(document.querySelectorAll("iframe")),m=e(n.origin),f=h.find((function(e){try{var t=new URL(e.src).hostname;return t===m||t.endsWith(m)}catch(e){return!1}}))||null}catch(e){}p={eventId:d,eventType:"formSubmit",time:(new Date).toISOString(),label:"calendar-".concat(i),value:"message:".concat(a),element:{tag:"iframe",id:(null==f?void 0:f.id)||"",class:(null==f?void 0:f.className)||"",action:(null==f?void 0:f.src)||n.origin,method:"postMessage",formData:{},customSelector:f?U(f):i,xpath:f?V(f):"",captureSource:"calendar"}},gt("Calendar/iframe scheduled event detected",{provider:i,origin:n.origin,signal:a}),he(p,"provider").catch((function(e){return yt("Error sending calendar event",e)}))}catch(e){yt("Calendar listener error",e)}})))}function ke(){Sr?gt("Heartbeat already running"):"visible"===document.visibilityState?(gt("Starting heartbeat"),Sr=setInterval((function(){(function(){return br(this,arguments,void 0,(function(e){var t,n,r,i;return void 0===e&&(e=!1),wr(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),gt("sendHeartbeat called"),"UNKNOWN - STATE"!==(t=_n.getState()).clientId&&(null===(i=t.session)||void 0===i?void 0:i.id)?"visible"!==document.visibilityState?(gt("heartbeat - tab not visible"),[2]):(n=Kn({},vr),[4,O({eventId:y(),eventType:"heartbeat",time:(new Date).toISOString(),activeTime:t.session.activeTimeInSeconds,timeout:e,formMetrics:n})]):(gt("heartbeat - invalid state. not sending"),[2]);case 1:return o.sent(),[3,3];case 2:return r=o.sent(),yt("Error sending heartbeat",r),Ee(),[3,3];case 3:return[2]}}))}))})().catch((function(e){return yt("Error sending heartbeat",e)}))}),Tr)):gt("Heartbeat not started - page hidden")}function Ee(){Sr&&(clearInterval(Sr),Sr=null,gt("Heartbeat stopped"))}function _e(){return Math.round((window.scrollY||document.documentElement.scrollTop)/(document.documentElement.scrollHeight-window.innerHeight)*100)}function Ae(){gt("Resetting scroll tracking"),Pr=Lr({},Bt),xr=0,Cr&&(window.removeEventListener("scroll",Cr),Cr=null)}function Le(){var e,t,n;try{gt("Initializing scroll tracking"),Ae(),e=0,t=function(){var t=_e();t>e&&(e=t)},n=T((function(){var t,n;e>xr&&(xr=e,t=null,Object.keys(Pr).forEach((function(n){var r=parseInt(n);e>=r&&!Pr[r]&&(Pr[r]=!0,(!t||r>t)&&(t=r))})),null!==t&&(n={eventId:y(),eventType:"scroll",time:(new Date).toISOString(),value:t},gt("Sending scroll event for milestone: ".concat(t,"%")),O(n),gt("Scroll event sent successfully for ".concat(t,"%"))))}),300),Cr=function(){t(),n()},window.addEventListener("scroll",Cr,{passive:!0}),gt("Scroll tracking initialized")}catch(e){yt("Error tracking scroll",e)}}function Pe(){var e,t,n=Or.clickTrackingMode,r=Or.customClickSelector,i=Or.includeDataAnlInStandard,o='button, a, input, select, textarea, [role="button"], [data-track-click]',a=['[class*="btn"]','[class*="button"]','[class*="cta"]'],c=["[data-anl-event]","[data-anl-event_action]"];return"standard"===n?(e=[],Or.alwaysIncludeClasses&&e.push.apply(e,a),i&&e.push.apply(e,c),Ce(o+(e.length?", "+e.join(", "):""),r)):(t=c.concat('[tabindex]:not([tabindex="-1"])',a),Ce("enhanced"===n?o+", "+t.join(", "):o+", "+[].concat(t).concat(["[onclick]","div[role]","span[role]","[data-action]","[data-anl-element_order]","[data-anl-event_action_result]"]).join(", "),r))}function Ce(e,t){return t?e+", "+t:e}function xe(){try{gt("Reinitializing click tracking (manual trigger)"),Re(),document.querySelectorAll("[".concat(Lt,'="true"]')).forEach((function(e){return e.removeAttribute(Lt)})),Ne()}catch(e){yt("Failed to reinitialize click tracking",e)}}function Me(e){var t=Mr({},Or);if(t.customClickSelector)try{if(e.matches(t.customClickSelector))return{mode:"forced",source:"custom"}}catch(e){}return"BUTTON"===e.tagName||"A"===e.tagName||["INPUT","SELECT","TEXTAREA"].includes(e.tagName)||"button"===e.getAttribute("role")||e.hasAttribute("data-track-click")?{mode:"semantic",source:"native"}:e.hasAttribute("data-anl-event")||e.hasAttribute("data-anl-event_action")?{mode:"heuristic",source:"data-anl"}:/btn|button|cta/i.test(e.className||"")?{mode:"heuristic",source:"class"}:e.hasAttribute("onclick")?{mode:"heuristic",source:"onclick"}:{mode:"heuristic",source:"other"}}function Oe(element,e){var t,n,r=this,i=Pe(),o=null==element?void 0:element.closest(i);o&&(Hr.has(o)||(t=S((function(){return Nr(r,void 0,void 0,(function(){var e,value,t,n,r,i,a,c,s,u,l,d,f,h,m,p,v,b,w,S;return Rr(this,(function(T){switch(T.label){case 0:return T.trys.push([0,2,,3]),gt("Click event triggered for element:",o.tagName,o.id||o.className),e="",value="",t=function(e){if(e instanceof HTMLImageElement)return e;var t=e.querySelector("img");return t instanceof HTMLImageElement?t:null},o instanceof HTMLAnchorElement&&(e=o.href),(o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement)&&(value=o.value),n=o.getBoundingClientRect(),r={top:n.top,left:n.left},i=Me(o),a=t(o),c=(null===(p=o.innerText)||void 0===p?void 0:p.slice(0,1e3).trim())||"",s=o.getAttribute("aria-label")||"",u=o.getAttribute("title")||"",l=(null==a?void 0:a.alt)||"",d=(null==a?void 0:a.src)?g(a.src)||a.src:"",f=c||s||u||l||d||null,h={eventId:y(),eventType:"click",time:(new Date).toISOString(),label:o.tagName.toLowerCase(),value:value||o.tagName.toLowerCase(),element:{tag:o.tagName.toLowerCase(),text:f,id:null!==(v=o.id)&&void 0!==v?v:null,class:null!==(b=o.className)&&void 0!==b?b:null,ariaLabel:null!==(w=o.getAttribute("aria-label"))&&void 0!==w?w:null,role:null!==(S=o.getAttribute("role"))&&void 0!==S?S:null,viewportPosition:null!=r?r:null,scrollDepth:_e(),selector:U(o),href:g(e)||e||null,src:d||null,value:null!=value?value:null,checked:o instanceof HTMLInputElement?o.checked:null,customSelector:U(o),xpath:V(o),captureMode:i.mode,captureSource:i.source}},gt("Sending click event:",h),[4,Pn(h)];case 1:return z(T.sent()),gt("Click event sent successfully"),[3,3];case 2:return m=T.sent(),yt("Error in throttled click handler",m),[3,3];case 3:return[2]}}))}))}),500,{maxRequestsPerSecond:2,leading:!0,trailing:!1}),o.addEventListener("click",n=function(e){return Nr(this,void 0,void 0,(function(){var n,r,i,a,c,s,u,l,d,f,h,m,p,v,b,w,S,T,I,k,E,_,A,L,P,C;return Rr(this,(function(x){switch(x.label){case 0:if(x.trys.push([0,8,,9]),e.__cstClickHandled)return[2];if(e.__cstClickHandled=!0,!(n=e.currentTarget instanceof HTMLElement?e.currentTarget:this instanceof HTMLElement?this:null))return[2];if(gt("Click event detected on:",n.tagName,n.id||n.className),!(e instanceof MouseEvent))return[2];try{if((r=e.target)&&r instanceof HTMLElement&&(i=r.closest(Pe()))&&i!==n)return[2]}catch(e){}return a=n instanceof HTMLAnchorElement?n.getAttribute("target"):null,c=!a||""===a||"_self"===a,s=function(){var url;if(!(n instanceof HTMLAnchorElement))return!1;if((n.getAttribute("href")||"").startsWith("#"))return!0;try{return(url=new URL(n.href,document.baseURI)).origin===location.origin&&url.pathname===location.pathname&&url.search===location.search&&url.hash!==location.hash&&""!==url.hash}catch(e){return!1}}(),n instanceof HTMLAnchorElement&&n.href&&!s&&c&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&n instanceof HTMLAnchorElement?(u=n.getAttribute("href")||n.href,l=Me(n),d=function(e){if(e instanceof HTMLImageElement)return e;var t=e.querySelector("img");return t instanceof HTMLImageElement?t:null}(n),f=(null===(E=n.innerText)||void 0===E?void 0:E.slice(0,1e3).trim())||"",h=n.getAttribute("aria-label")||"",m=n.getAttribute("title")||"",p=(null==d?void 0:d.alt)||"",v=(null==d?void 0:d.src)?g(d.src)||d.src:"",b=f||h||m||p||v||null,w={eventId:y(),eventType:"click",time:(new Date).toISOString(),label:n.tagName.toLowerCase(),value:n.tagName.toLowerCase(),element:{tag:n.tagName.toLowerCase(),text:b,id:null!==(_=n.id)&&void 0!==_?_:null,class:null!==(A=n.className)&&void 0!==A?A:null,ariaLabel:null!==(L=n.getAttribute("aria-label"))&&void 0!==L?L:null,role:null!==(P=n.getAttribute("role"))&&void 0!==P?P:null,viewportPosition:null!==(C=n.getBoundingClientRect())&&void 0!==C?C:null,scrollDepth:_e(),selector:U(n),href:g(u)||u||null,src:v||null,value:null,checked:null,customSelector:U(n),xpath:V(n),captureMode:l.mode,captureSource:l.source}},[4,Pn(w)]):[3,6];case 1:S=x.sent(),gt("Navigation click batch",S),T=R(S,{triggerSend:!1}),x.label=2;case 2:return x.trys.push([2,4,,5]),[4,z(S,!0)];case 3:return x.sent()?D(T):(gt("Navigation click send failed, scheduling queued retry",S.eventType),T?W():R(S,{triggerSend:!0})),[3,5];case 4:return I=x.sent(),yt("Navigation click send threw error, scheduling queued retry",I),T?W():R(S,{triggerSend:!0}),[3,5];case 5:return[3,7];case 6:t(),x.label=7;case 7:return[3,9];case 8:return k=x.sent(),yt("Error in click handler",k),o instanceof HTMLAnchorElement&&window.location.assign(o.href),[3,9];case 9:return[2]}}))}))},{capture:!0,passive:!1}),o.setAttribute(Lt,"true"),Hr.add(o),gt("Click listener added to:",o.tagName,o.id||o.className),e instanceof MouseEvent&&n.call(o,e)))}function Ne(){try{if(Dr)return void gt("Click tracking already initialized");Dr=!0,gt("Initializing click tracking system"),function(){var e,t;try{if(function(e){var t,n;if(void 0===e&&(e=document),!Or.autoEnhanceClicks)return!1;try{return t=e.querySelectorAll('button, a, [role="button"], [data-track-click]').length,0!==(n=e.querySelectorAll('[class*="btn"], [class*="button"], [class*="cta"], [data-anl-event], [data-anl-event_action]').length)&&(0===t||n/(t+1)>.5)}catch(e){return!1}}(document)&&"standard"===Or.clickTrackingMode&&(Or=Mr(Mr({},Or),{clickTrackingMode:"enhanced"}),!0)&&gt("Auto-enhanced click tracking mode → enhanced"),e=Pe(),t=document.querySelectorAll(e),gt("Initializing click listeners for ".concat(t.length," elements")),t.forEach((function(element){Oe(element)})),Wr)try{Wr.disconnect()}catch(e){}(Wr=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e instanceof HTMLElement&&(e.matches(Pe())&&Oe(e),e.querySelectorAll(Pe()).forEach((function(element){Oe(element)})))}))}))}))).observe(document.body,{childList:!0,subtree:!0})}catch(e){yt("Error initializing clickable elements",e)}}();var e=S((function(e){var t,n=Pe();e.target instanceof HTMLElement&&(t=e.target.closest(n))&&!Hr.has(t)&&(gt("Adding click listener to dynamically detected element:",t.tagName),Oe(t,e))}),200,{maxRequestsPerSecond:2,leading:!0,trailing:!1});jr=e,document.addEventListener("click",jr),gt("Click tracking system initialized")}catch(e){yt("Error in initial click listener",e)}}function Re(){try{Wr&&(Wr.disconnect(),Wr=null),jr&&(document.removeEventListener("click",jr),jr=null),Hr=new WeakSet}catch(e){yt("cleanupClickTracking error",e)}finally{Dr=!1}}function De(e){var t,element=e.element,eventType=e.eventType,n=e.platform,videoId=e.videoId,r=e.src,label=e.label,value=e.value,watchPercentage=e.watchPercentage,furthestWatchPercentage=e.furthestWatchPercentage,watchTime=e.watchTime,furthestWatchTime=e.furthestWatchTime;try{t={eventId:y(),eventType,time:(new Date).toISOString(),label:label||videoId,value:null!=value?value:String(watchPercentage),element:{tag:element.tagName.toLowerCase(),id:element.id,class:element.className,videoId,watchPercentage,furthestWatchPercentage,watchTime,furthestWatchTime,videoPlatform:n,customSelector:U(element),xpath:V(element),src:null!=r?r:element instanceof HTMLMediaElement?element.currentSrc:element.src||null}},"videoProgress"===eventType?O(t):N(t)}catch(e){yt("Error emitting video event",e)}}function We(){document.querySelectorAll("video").forEach((function(e){zr(e)}))}function je(){var e;return(null===(e=window.Vimeo)||void 0===e?void 0:e.Player)?Promise.resolve():Br||(Br=new Promise((function(e,t){var n=document.createElement("script");n.src=qr,n.async=!0,n.onload=function(){return e()},n.onerror=function(e){return t(e)},document.head.appendChild(n)})).catch((function(e){throw yt("Failed to load Vimeo player API",e),Br=null,e})))}function He(e,t){var n;return void 0===t&&(t=0),{watchPercentage:(n=e.duration||0)?Math.min(100,Math.floor(e.watchTime/n*100)):Math.min(100,Math.floor(100*t)),furthestWatchPercentage:n?Math.min(100,Math.floor(e.furthestWatchTime/n*100)):Math.min(100,Math.floor(100*t))}}function Fe(e){return Ur(this,void 0,void 0,(function(){var t,n,r,i,o;return Vr(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,je()];case 1:return a.sent(),(null===(o=window.Vimeo)||void 0===o?void 0:o.Player)?(t=e.getAttribute("data-cst-video-id")||"vimeo-".concat(y()),e.setAttribute("data-cst-video-id",t),e.setAttribute("data-cst-video-tracked","true"),n=new window.Vimeo.Player(e),r={player:n,element:e,videoKey:t,duration:0,watchTime:0,furthestWatchTime:0,lastSeconds:0,intervalsReported:new Set,handlers:{play:function(){n.getCurrentTime().then((function(e){r.lastSeconds=e||0})).catch((function(){})),n.getDuration().then((function(e){e&&(r.duration=e)})).catch((function(){}));var e=He(r);De({element:r.element,eventType:"videoPlay",platform:"Vimeo",videoId:r.element.src,watchPercentage:e.watchPercentage,furthestWatchPercentage:e.furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime),src:r.element.src})},pause:function(){n.getCurrentTime().then((function(e){if("number"==typeof e){e>r.furthestWatchTime&&(r.furthestWatchTime=e);var t=e-r.lastSeconds;t>0&&(r.watchTime+=t),r.lastSeconds=e}})).catch((function(){}));var e=He(r);De({element:r.element,eventType:"videoPause",platform:"Vimeo",videoId:r.element.src,watchPercentage:e.watchPercentage,furthestWatchPercentage:e.furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime),src:r.element.src})},ended:function(){r.duration>0&&(r.watchTime=r.duration,r.furthestWatchTime=r.duration);var e=He(r,1);De({element:r.element,eventType:"videoEnded",platform:"Vimeo",videoId:r.element.src,watchPercentage:e.watchPercentage,furthestWatchPercentage:e.furthestWatchPercentage,watchTime:Math.floor(r.watchTime||r.duration),furthestWatchTime:Math.floor(r.furthestWatchTime||r.duration),src:r.element.src})},timeupdate:function(e){return function(e,t){var n,r,i,o,watchPercentage,furthestWatchPercentage,a;try{n="number"==typeof(null==t?void 0:t.seconds)?t.seconds:e.lastSeconds,r="number"==typeof(null==t?void 0:t.percent)?t.percent:0,"number"==typeof(null==t?void 0:t.duration)&&t.duration>0&&(e.duration=t.duration),"number"==typeof n&&(e.lastSeconds>=0&&(i=n-e.lastSeconds)>0&&(e.watchTime+=i),e.lastSeconds=n,n>e.furthestWatchTime&&(e.furthestWatchTime=n)),watchPercentage=(o=He(e,r)).watchPercentage,furthestWatchPercentage=o.furthestWatchPercentage,(a=10*Math.floor(furthestWatchPercentage/10))>0&&a<=100&&!e.intervalsReported.has(a)&&(e.intervalsReported.add(a),De({element:e.element,eventType:"videoProgress",platform:"Vimeo",videoId:e.element.src,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime),src:e.element.src}))}catch(e){yt("Error handling Vimeo timeupdate",e)}}(r,e)}}},n.getDuration().then((function(e){e&&(r.duration=e)})).catch((function(){})),n.on("play",r.handlers.play),n.on("pause",r.handlers.pause),n.on("ended",r.handlers.ended),n.on("timeupdate",r.handlers.timeupdate),Gr.set(t,r),gt("Vimeo tracking initialized",{src:e.src,videoKey:t}),[3,3]):(yt("Vimeo Player constructor not available after script load"),[2]);case 2:return i=a.sent(),yt("Error setting up Vimeo tracking",i),[3,3];case 3:return[2]}}))}))}function ze(e){void 0===e&&(e=document);var t=function(e){var t=e instanceof HTMLElement?e:document;return Array.from(t.querySelectorAll('iframe[src*="player.vimeo.com"]')).filter((function(e){return"true"!==e.getAttribute("data-cst-video-tracked")}))}(e);t.forEach((function(e){return Fe(e)}))}function Ue(e){var t=e.duration||0;return{watchPercentage:t?Math.min(100,Math.floor(e.watchTime/t*100)):0,furthestWatchPercentage:t?Math.min(100,Math.floor(e.furthestWatchTime/t*100)):0}}function Ve(element){var e;return element.dataset&&(element.dataset.wistiaId||element.dataset.hashedId||element.dataset.videoId)||((e=element.className.match(/wistia_async_([a-zA-Z0-9]+)/))&&e[1]?e[1]:element.getAttribute("data-wistia-id")||element.getAttribute("data-hashed-id")||null)}function qe(element,e){e&&!Xr.has(e)&&(Xr.add(e),element.setAttribute("data-cst-video-id",e),window._wq||(window._wq=[]),window._wq.push({id:e,onReady:function(t){try{!function(e,element,t){var n,r;try{(r={video:e,element,videoKey:t,duration:(null===(n=e.duration)||void 0===n?void 0:n.call(e))||0,watchTime:0,furthestWatchTime:0,lastSeconds:0,intervalsReported:new Set,handlers:{}}).handlers=function(e){var t={play:function(){e.lastSeconds=e.video.time()||0,e.duration=e.video.duration()||e.duration;var t=Ue(e),watchPercentage=t.watchPercentage,furthestWatchPercentage=t.furthestWatchPercentage;De({element:e.element,eventType:"videoPlay",platform:"Wistia",videoId:e.videoKey,label:e.element.getAttribute("title")||e.videoKey,src:e.element instanceof HTMLIFrameElement?e.element.src:null,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime)})},pause:function(){var t=Ue(e),watchPercentage=t.watchPercentage,furthestWatchPercentage=t.furthestWatchPercentage;De({element:e.element,eventType:"videoPause",platform:"Wistia",videoId:e.videoKey,label:e.element.getAttribute("title")||e.videoKey,src:e.element instanceof HTMLIFrameElement?e.element.src:null,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime)})},end:function(){e.duration=e.video.duration()||e.duration,e.watchTime=e.duration,e.furthestWatchTime=e.duration;var t=Ue(e),watchPercentage=t.watchPercentage,furthestWatchPercentage=t.furthestWatchPercentage;De({element:e.element,eventType:"videoEnded",platform:"Wistia",videoId:e.videoKey,label:e.element.getAttribute("title")||e.videoKey,src:e.element instanceof HTMLIFrameElement?e.element.src:null,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime)})},timechange:function(t){var n,r,watchPercentage,furthestWatchPercentage,i;"number"==typeof t&&((n=t-e.lastSeconds)>0&&(e.watchTime+=n),e.lastSeconds=t,e.duration=e.video.duration()||e.duration,t>e.furthestWatchTime&&(e.furthestWatchTime=t),watchPercentage=(r=Ue(e)).watchPercentage,furthestWatchPercentage=r.furthestWatchPercentage,(i=10*Math.floor(furthestWatchPercentage/10))>0&&i<=100&&!e.intervalsReported.has(i)&&(e.intervalsReported.add(i),De({element:e.element,eventType:"videoProgress",platform:"Wistia",videoId:e.videoKey,label:e.element.getAttribute("title")||e.videoKey,src:e.element instanceof HTMLIFrameElement?e.element.src:null,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime)})))}};return t}(r),e.bind("play",r.handlers.play),e.bind("pause",r.handlers.pause),e.bind("end",r.handlers.end),e.bind("timechange",r.handlers.timechange),element.setAttribute("data-cst-video-tracked","true"),Kr.set(t,r),gt("Wistia tracking initialized",{videoKey:t})}catch(e){yt("Error binding Wistia video",e)}}(t,element,e)}catch(e){yt("Error in Wistia onReady handler",e)}}}))}function Be(e){void 0===e&&(e=document);var t=function(e){var t=e instanceof HTMLElement?e:document;return Array.from(t.querySelectorAll('.wistia_embed, [data-wistia-id], [data-hashed-id], iframe[src*="fast.wistia.net"], iframe[src*="wistia.com"]')).filter((function(element){return"true"!==element.getAttribute("data-cst-video-tracked")}))}(e);t.forEach((function(element){var e=Ve(element);e?qe(element,e):gt("Unable to determine Wistia hashed id",{id:element.id,className:element.className})}))}function Ge(e){var t=e.duration||0;return{watchPercentage:t?Math.min(100,Math.floor(e.watchTime/t*100)):0,furthestWatchPercentage:t?Math.min(100,Math.floor(e.furthestWatchTime/t*100)):0}}function Ke(e,t,n){var r,i,watchPercentage,furthestWatchPercentage,o;"number"==typeof n&&n>0&&(e.duration=n),"number"==typeof t&&((r=t-e.lastSeconds)>0&&(e.watchTime+=r),e.lastSeconds=t,t>e.furthestWatchTime&&(e.furthestWatchTime=t)),watchPercentage=(i=Ge(e)).watchPercentage,furthestWatchPercentage=i.furthestWatchPercentage,(o=10*Math.floor(furthestWatchPercentage/10))>0&&o<=100&&!e.intervalsReported.has(o)&&(e.intervalsReported.add(o),De({element:e.element,eventType:"videoProgress",platform:"Loom",videoId:e.element.src,src:e.element.src,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(e.watchTime),furthestWatchTime:Math.floor(e.furthestWatchTime)}))}function Xe(e){var t,n,r,i,o,a,c,s,u,l,d,f,h;try{if(!e.data||"object"!=typeof e.data)return;if(!function(e){try{var t=new URL(e).hostname;return t.endsWith("loom.com")||t.endsWith("loom.com:443")}catch(e){return!1}}(e.origin))return;if(!(t=function(e){if(!e)return null;var t=null;return Jr.forEach((function(n){t||n.contentWindow!==e||(t=n)})),t}(e.source)))return;if(n=t.getAttribute("data-cst-video-id")||t.src,(r=Yr.get(n))||(r={element:t,videoKey:n,duration:0,watchTime:0,furthestWatchTime:0,lastSeconds:0,intervalsReported:new Set},Yr.set(n,r)),!(i=(f=e.data)&&(h=f.eventName||f.type||f.name||f.event||f.event_type)?{name:String(h).toUpperCase().startsWith("LOOM_")?String(h).toUpperCase():"LOOM_".concat(String(h).toUpperCase()),data:f.data||f.payload||f.details||f.message||f}:null))return;if(!(o=i.name).startsWith("LOOM_"))return;switch(c="number"==typeof(a=i.data||{}).currentTime?a.currentTime:"number"==typeof a.time?a.time:void 0,s="number"==typeof a.duration?a.duration:void 0,o){case"LOOM_PLAY":"number"==typeof c&&(r.lastSeconds=c),"number"==typeof s&&(r.duration=s),u=Ge(r),De({element:r.element,eventType:"videoPlay",platform:"Loom",videoId:r.element.src,src:r.element.src,watchPercentage:u.watchPercentage,furthestWatchPercentage:u.furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime)});break;case"LOOM_PAUSE":"number"==typeof c&&Ke(r,c,s),l=Ge(r),De({element:r.element,eventType:"videoPause",platform:"Loom",videoId:r.element.src,src:r.element.src,watchPercentage:l.watchPercentage,furthestWatchPercentage:l.furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime)});break;case"LOOM_END":case"LOOM_ENDED":"number"==typeof s&&(r.duration=s),r.watchTime=r.duration,r.furthestWatchTime=r.duration,d=Ge(r),De({element:r.element,eventType:"videoEnded",platform:"Loom",videoId:r.element.src,src:r.element.src,watchPercentage:d.watchPercentage,furthestWatchPercentage:d.furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime)});break;case"LOOM_SEEK":case"LOOM_PROGRESS":case"LOOM_TIME":"number"==typeof c&&Ke(r,c,s)}}catch(e){yt("Error handling Loom message",e)}}function Ye(e){var t=e instanceof HTMLElement?e:document;return Array.from(t.querySelectorAll('iframe[src*="loom.com/embed"], iframe[src*="loom.com/share"]')).filter((function(e){return"true"!==e.getAttribute("data-cst-video-tracked")}))}function Je(e){var t,n="true"===e.getAttribute("data-cst-video-tracked");$r||($r=!0,window.addEventListener("message",Xe)),t=e.getAttribute("data-cst-video-id")||"loom-".concat(y()),n?e.getAttribute("data-cst-video-id")?t=e.getAttribute("data-cst-video-id"):e.setAttribute("data-cst-video-id",t):(e.setAttribute("data-cst-video-id",t),e.setAttribute("data-cst-video-tracked","true")),Jr.add(e),Yr.has(t)||Yr.set(t,{element:e,videoKey:t,duration:0,watchTime:0,furthestWatchTime:0,lastSeconds:0,intervalsReported:new Set}),gt("Loom tracking initialized",{src:e.src,videoKey:t,preTracked:n})}function $e(e){void 0===e&&(e=document),Ye(e).forEach(Je);try{Zr&&(Zr.disconnect(),Zr=null),(Zr=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e instanceof HTMLElement&&Ye(e).forEach(Je)}))}))}))).observe(document.body,{childList:!0,subtree:!0})}catch(e){yt("Error setting up Loom MutationObserver",e)}}function Ze(e){e&&ai(this,void 0,void 0,(function(){var e;return ci(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,new Promise((function(e,t){var n=0,r=function(){if(window.YT&&window.YT.Player)return gt("YouTube API loaded successfully"),void e();if(n>=ui){gt("YouTube API not found after retries, attempting to reload"),window.onYouTubeIframeAPIReady=function(){gt("YouTube API reloaded successfully"),e()};var t=document.querySelector('script[src*="youtube.com/iframe_api"]');return t&&t.remove(),void ri()}n++,setTimeout(r,li)};r()}))];case 1:if(t.sent(),n=document.querySelectorAll('iframe[src*="youtube.com/embed/"]'),gt("Found YouTube iframes:",n.length),n.forEach((function(e){var t=fi(e);t.id&&Qe(t,!0)})),di)try{di.disconnect()}catch(e){}return(di=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e instanceof HTMLElement&&e.querySelectorAll('iframe[src*="youtube.com/embed/"]').forEach((function(e){var t=fi(e);t.id&&Qe(t,!0)}))}))}))}))).observe(document.body,{childList:!0,subtree:!0}),[3,3];case 2:return e=t.sent(),yt("Error initializing YouTube iframes:",e),[3,3];case 3:return[2]}var n}))}))}function Qe(e,t){var n,r,i;try{if(gt("Initializing YouTube Iframe",{id:(n=e).id,src:n.src,apiReady:!!window.YT&&!!window.YT.Player,youTubeApiCalled:t}),n.id||(n.id="yt-".concat(y()),gt("Generated new YouTube iframe ID",{id:n.id})),!t)return void gt("YouTube API script not loaded yet, skipping initialization");if(!window.YT||!window.YT.Player)return(r=parseInt(n.getAttribute("data-yt-retry")||"0"))>=10?void yt("Failed to initialize YouTube iframe after 10 retries",{id:n.id,src:n.src}):(i=Math.min(100*Math.pow(2,r),3e3),n.setAttribute("data-yt-retry",(r+1).toString()),gt("YouTube API not ready, retrying in "+i+"ms",{retryCount:r+1,id:n.id}),void setTimeout((function(){return Qe(n,t)}),i));if(n.removeAttribute("data-yt-retry"),si.has(n.id))return void gt("Player already initialized",{id:n.id});gt("Creating YouTube player",{iframeId:n.id,src:n.src}),new window.YT.Player(n.id,{events:{onReady:function(e){gt("YouTube player ready",{id:n.id,playerInfo:e.target.playerInfo}),si.has(n.id)||si.set(n.id,{lastPlayTime:0,furthestWatchTime:0,watchTime:0,intervalsReported:new Set,lastRealTimestamp:e.data===window.YT.PlayerState.PLAYING?Date.now():void 0})},onStateChange:function(e){var t=e;gt("YouTube player state changed",{id:n.id,state:e.data,playerInfo:e.target.playerInfo}),function(e){var t,n,r,i,o,a,c,eventType,furthestWatchPercentage,watchPercentage,s,u,l,d;try{if(!(n=null===(t=e.target.g)||void 0===t?void 0:t.id))return void yt("Missing player ID in YouTube event",e.target);if(r=e.target,si.has(n)||si.set(n,{lastPlayTime:r.playerInfo.currentTime,furthestWatchTime:0,watchTime:0,intervalsReported:new Set,lastRealTimestamp:e.data===window.YT.PlayerState.PLAYING?Date.now():void 0}),!(i=si.get(n)))return void yt("Failed to get player state",{playerID:n});if(o=r.playerInfo.currentTime,a=r.playerInfo.duration,c=Date.now(),eventType=null,e.data===window.YT.PlayerState.PLAYING&&(eventType="videoPlay",i.lastPlayTime=o,i.lastRealTimestamp=c,function(e,t){var n,r;try{n=setInterval((function(){var r,i,o,a,c,furthestWatchPercentage,watchPercentage,s;e.data===window.YT.PlayerState.PLAYING&&(r=si.get(t))&&r.lastRealTimestamp?(o=(i=e.target).playerInfo.currentTime,a=i.playerInfo.duration,c=Date.now(),r.watchTime+=(c-r.lastRealTimestamp)/1e3,r.lastRealTimestamp=c,r.furthestWatchTime=Math.max(r.furthestWatchTime,o),furthestWatchPercentage=Math.floor(o/a*100),watchPercentage=Math.floor(r.watchTime/a*100),s=10*Math.floor(furthestWatchPercentage/10),!r.intervalsReported.has(s)&&s>0&&(r.intervalsReported.add(s),gt("YouTube video ".concat(t,": ").concat(s,"% position reached. Actually watched: ").concat(watchPercentage,"%")),De({element:document.getElementById(t),eventType:"videoProgress",platform:"YouTube",videoId:i.playerInfo.videoUrl,label:i.playerInfo.videoUrl,value:s.toString(),watchPercentage,furthestWatchPercentage,watchTime:Math.floor(r.watchTime),furthestWatchTime:Math.floor(r.furthestWatchTime),src:i.playerInfo.videoUrl}))):clearInterval(n)}),1e3),(r=si.get(t))&&(r.intervalId=n)}catch(e){yt("Error tracking youtube progress",e)}}(e,n)),e.data!==window.YT.PlayerState.PAUSED&&e.data!==window.YT.PlayerState.ENDED||(eventType=e.data===window.YT.PlayerState.PAUSED?"videoPause":"videoEnded",i.lastRealTimestamp&&(i.watchTime+=(c-i.lastRealTimestamp)/1e3,i.lastRealTimestamp=void 0),o>i.lastPlayTime&&(i.furthestWatchTime=Math.max(i.furthestWatchTime,o))),!eventType)return;furthestWatchPercentage=Math.floor(o/a*100),watchPercentage=Math.floor(i.watchTime/a*100),gt("youtube video update",{playerID:n,eventType,watchPercentage,watchTime:Math.floor(i.watchTime),furthestWatchTime:Math.floor(i.furthestWatchTime),furthestWatchPercentage,formattedWatchTime:(s=i.watchTime,u=Math.floor(s/3600),l=Math.floor(s%3600/60),d=Math.floor(s%60),u>0?"".concat(u,":").concat(l.toString().padStart(2,"0"),":").concat(d.toString().padStart(2,"0")):"".concat(l,":").concat(d.toString().padStart(2,"0"))),currentTime:o,duration:a,lastPlayTime:i.lastPlayTime}),De({element:document.getElementById(n),eventType,platform:"YouTube",videoId:r.playerInfo.videoUrl,label:r.playerInfo.videoUrl,value:watchPercentage.toString(),watchPercentage,furthestWatchPercentage,watchTime:Math.floor(i.watchTime),furthestWatchTime:Math.floor(i.furthestWatchTime),src:r.playerInfo.videoUrl})}catch(e){yt("Error in onPlayerStateChange",e)}}(t)},onError:function(e){yt("YouTube player error",{id:n.id,errorCode:e.data,src:n.src})}},playerVars:{origin:window.location.origin,enablejsapi:1,modestbranding:1,rel:0,controls:1,host:window.location.origin}})}catch(t){yt("Error initializing YouTube iframe",{error:t,iframeId:e.id,src:e.src})}}function et(e){var t,n,eventType,r,i,o,a,c=this;"true"!==e.getAttribute("cst-input-tracked")&&(t=function(e){return qt.some((function(t){return"string"==typeof t?e.toLowerCase().includes(t.toLowerCase()):t.test(e)}))},n=e instanceof HTMLSelectElement,r=n?"select_change":"input_blur",i=function(){return hi(c,void 0,void 0,(function(){var n,i;return mi(this,(function(o){switch(o.label){case 0:if(gt("".concat(eventType," event triggered"),e),!e.value.trim()||e instanceof HTMLInputElement&&("password"===e.type||"file"===e.type)||e.name&&t(e.name))return[2];n={eventId:y(),eventType:"input",time:(new Date).toISOString(),label:r,value:e.value,element:{tag:e.tagName.toLowerCase(),id:e.id,class:e.className,type:e.type||null,name:e.name,value:e.value,customSelector:U(e),xpath:V(e)}},gt("Sending input event:",n),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,Pn(n)];case 2:return[4,z(o.sent())];case 3:return o.sent(),gt("input event sent successfully"),[3,5];case 4:return i=o.sent(),yt("Error sending input data",i),O(n),[3,5];case 5:return[2]}}))}))},e.addEventListener(eventType=n?"change":"blur",i),e.setAttribute("cst-input-tracked","true"),o=e.getAttribute("cst-handlers")||"{}",(a=JSON.parse(o))[eventType]=i,e.setAttribute("cst-handlers",JSON.stringify(a)))}function tt(e){e.querySelectorAll("[cst-input-tracked='true']").forEach((function(e){var t,n=e.getAttribute("cst-handlers");if(n)try{(t=JSON.parse(n)).blur&&e.removeEventListener("blur",t.blur),t.change&&e.removeEventListener("change",t.change)}catch(e){yt("Error removing old input handlers",e)}e.removeAttribute("cst-input-tracked"),e.removeAttribute("cst-handlers")})),e.querySelectorAll("input, textarea, select").forEach((function(e){et(e)}));var t=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e instanceof HTMLElement&&((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&et(e),e.querySelectorAll("input, textarea, select").forEach((function(e){et(e)})))}))}))}));return t.observe(e,{childList:!0,subtree:!0}),t}function nt(){gi||(gi=!0,gt("Starting input and select tracking"),pi=tt(document),function(){var e,t=window.location.pathname;if(vi)try{vi.disconnect()}catch(e){}(vi=new MutationObserver((function(){window.location.pathname!==t&&(t=window.location.pathname,gt("SPA navigation detected, reinitializing input tracking"),pi&&pi.disconnect(),pi=tt(document))}))).observe(document.body,{childList:!0,subtree:!0}),yi=e=function(e){gt("Navigation detected, reinitializing input tracking"),pi&&pi.disconnect(),pi=tt(document)},bi=e,wi=e,window.addEventListener("popstate",yi),window.addEventListener("pushState",bi),window.addEventListener("replaceState",wi)}())}function rt(e){return e.closest(ki)||e.closest("[role='listbox']")}function it(e){return Si(this,void 0,void 0,(function(){var t,n,value,label,r,i;return Ti(this,(function(o){switch(o.label){case 0:return t=rt(e),n=function(e){var t,n,r=null!==(n=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==n?n:"",i=e.getAttribute("data-value"),o=e.getAttribute("value"),value=(i||o||r).trim();return{value,label:r||value}}(e),label=n.label,(value=n.value)||label?(r=function(e,t){var n,r=function(e){var t,n,r,i,o;if(!e)return null;if(t=e.id){if((n=document.querySelector("[aria-controls='".concat(CSS.escape(t),"']")))instanceof HTMLInputElement)return n;if((r=null==n?void 0:n.querySelector("input[name]"))instanceof HTMLInputElement)return r}return(o=null==(i=e.closest(ki)||e)?void 0:i.querySelector("input[name], input[type='hidden'][name]"))instanceof HTMLInputElement?o:null}(e.closest("[role='listbox']")||t);return(null==r?void 0:r.name)?r.name:t?(n=t.getAttribute("name")||t.getAttribute("data-name"))&&n.trim()?n.trim():t.id&&t.id.trim()?t.id.trim():U(t):U(document.body)}(e,t),i={eventId:y(),eventType:"input",time:(new Date).toISOString(),label:"dropdown_select",value,element:{tag:e.tagName.toLowerCase(),id:(null==t?void 0:t.id)||e.id||null,class:(null==t?void 0:t.className)||e.className||null,role:(null==t?void 0:t.getAttribute("role"))||null,name:r,text:label,selector:U(e),customSelector:U(e),xpath:V(e)}},gt("Custom dropdown option selected",{name:r,value,label,optionTag:e.tagName}),[4,Pn(i)]):[2];case 1:return[4,z(o.sent())];case 2:return o.sent(),gt("Custom dropdown input event sent successfully"),[2]}}))}))}function ot(method){var e,t,n,r,i,o;try{if(r=Object.getOwnPropertyDescriptor(history,method),"function"!=typeof(i=null!==(e=null==r?void 0:r.value)&&void 0!==e?e:history[method]))return void gt("SPA tracking: history.".concat(method," missing or not a function; skipping patch"));if(i[Ni])return void gt("SPA tracking: history.".concat(method," already wrapped by CST"));if(/\[native code\]/.test(i.toString())||gt("SPA tracking: history.".concat(method," appears pre-wrapped; chaining listener"),{originalName:i.name}),r&&!1===r.configurable)return void gt("SPA tracking: history.".concat(method," not configurable; cannot patch"));o=function(){var e,t,n=[];for(e=0;e<arguments.length;e++)n[e]=arguments[e];t=i.apply(this,n);try{window.dispatchEvent(new Event(method))}catch(e){yt("SPA tracking: failed to dispatch ".concat(method," event"),e)}return t},o[Ni]=!0,r?Object.defineProperty(history,method,{configurable:!0,enumerable:null!==(t=r.enumerable)&&void 0!==t&&t,writable:null===(n=r.writable)||void 0===n||n,value:o}):history[method]=o}catch(e){yt("SPA tracking: error patching history.".concat(method),e)}}function at(element,e){try{if("true"===element.getAttribute(Lt))return;!function(element){var e,t;try{if("true"===element.getAttribute(Lt))return;element instanceof HTMLFormElement&&Ri(),(element instanceof HTMLInputElement||element instanceof HTMLTextAreaElement)&&et(element),element.matches(Pe())&&Oe(element),element instanceof HTMLVideoElement&&Oe(element),element instanceof HTMLIFrameElement&&(null===(e=element.src)||void 0===e?void 0:e.includes("youtube.com/embed/"))&&(t=fi(element),ni()||ri(),Qe(t,ni())),function(element){var e;element instanceof HTMLIFrameElement&&(null===(e=element.src)||void 0===e?void 0:e.includes("player.vimeo.com"))&&"true"!==element.getAttribute("data-cst-video-tracked")&&Fe(element)}(element),function(element){var e=Ve(element);e&&qe(element,e)}(element),function(element){var e,t;element instanceof HTMLIFrameElement&&((null===(e=element.src)||void 0===e?void 0:e.includes("loom.com/embed"))||(null===(t=element.src)||void 0===t?void 0:t.includes("loom.com/share")))&&Je(element)}(element),element.setAttribute(Lt,"true")}catch(e){yt("Error processing element",e)}}(element),e.depth<xi&&Array.from(element.children).forEach((function(t){t instanceof HTMLElement&&!e.processedNodes.has(t)&&(e.processedNodes.add(t),at(t,Li(Li({},e),{depth:e.depth+1})))}))}catch(e){yt("Error handling dynamic element",e)}}function ct(){return Pi(this,void 0,void 0,(function(){var e,t,n,r,i,o,a=this;return Ci(this,(function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),e=Oi,(t=location.href)===e?(gt("Route change ignored because URL has not changed"),[2]):function(e,t){var n,r,i;try{return n=new URL(e,document.baseURI),r=new URL(t,document.baseURI),n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search&&n.hash!==r.hash}catch(n){return(i=function(e){return e.split("#")[0]})(e)===i(t)&&e!==t}}(e,t)?(Oi=t,gt("Hash-only navigation detected; skipping new page view"),[2]):(Oi=t,gt("Route change detected: ".concat(e," -> ").concat(t)),n=P(),r={id:"pv_".concat(window.location.pathname,"_").concat(y()),startTime:n,startTimestamp:L(),lastActivityTime:n,activeTimeInSeconds:0,url:t,pathname:location.pathname,title:document.title,referrer:e||document.referrer,isValid:!0},[4,_n.endCurrentPageViewAndStartNew(r)]);case 1:c.sent(),c.label=2;case 2:return c.trys.push([2,4,,5]),gt("Sending initial data for SPA route change"),[4,x()];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),yt("Error sending initial data during SPA route change",i),[3,5];case 5:return setTimeout((function(){return Pi(a,void 0,void 0,(function(){return Ci(this,(function(e){try{A(),Re(),function(){try{pi&&(pi.disconnect(),pi=null),vi&&(vi.disconnect(),vi=null),yi&&(window.removeEventListener("popstate",yi),yi=null),bi&&(window.removeEventListener("pushState",bi),bi=null),wi&&(window.removeEventListener("replaceState",wi),wi=null)}catch(e){yt("cleanupInputTracking error",e)}finally{gi=!1}}(),function(){try{Fr.forEach((function(e){e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)})),Fr.clear(),document.querySelectorAll("video[data-cst-video-tracked='true']").forEach((function(e){e.removeAttribute("data-cst-video-tracked")}))}catch(e){}}(),Gr.forEach((function(e){try{e.player.off("play",e.handlers.play),e.player.off("pause",e.handlers.pause),e.player.off("ended",e.handlers.ended),e.player.off("timeupdate",e.handlers.timeupdate),e.element.removeAttribute("data-cst-video-tracked"),e.element.removeAttribute("data-cst-video-id")}catch(e){yt("Error cleaning up Vimeo tracking",e)}})),Gr.clear(),Kr.forEach((function(e){try{e.video.unbind("play",e.handlers.play),e.video.unbind("pause",e.handlers.pause),e.video.unbind("end",e.handlers.end),e.video.unbind("timechange",e.handlers.timechange),e.element.removeAttribute("data-cst-video-tracked"),e.element.removeAttribute("data-cst-video-id")}catch(e){yt("Error cleaning up Wistia tracking",e)}})),Kr.clear(),Xr.clear(),function(){window.removeEventListener("message",Xe),$r=!1;try{Zr&&(Zr.disconnect(),Zr=null)}catch(e){}Jr.forEach((function(e){e.removeAttribute("data-cst-video-tracked"),e.removeAttribute("data-cst-video-id")})),Jr.clear(),Yr.clear()}();try{!function(){try{_i&&(document.removeEventListener("click",_i,!0),_i=null),Ai&&(document.removeEventListener("keydown",Ai,!0),Ai=null)}catch(e){yt("cleanupCustomDropdownTracking error",e)}finally{Ei=!1}}()}catch(e){}Ae(),Le(),document.querySelectorAll("input, textarea").forEach((function(e){e.removeAttribute(Lt)})),xe(),Se(),Te(),We(),ze(),Be(),$e(),ke(),document.querySelectorAll("input, textarea").forEach((function(e){return et(e)})),ni()&&Ze(!0)}catch(e){yt("Error reinitializing tracking after route change",e)}return[2]}))}))}),100),[3,7];case 6:return o=c.sent(),yt("Error handling route change",o),[3,7];case 7:return[2]}}))}))}function st(){return Wi(this,void 0,void 0,(function(){var t,n;return ji(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Fi.detect()];case 1:return t=r.sent(),gt("Bot detection result:",{isBot:t.isBot,confidence:t.confidence,signals:t.signals,botType:t.botType,userAgent:navigator.userAgent}),e(Ct,t.isBot.toString()),t.isBot?gt("Bot detected:",{type:t.botType,confidence:t.confidence,signals:t.signals}):gt("No bot detected - proceeding with tracking"),[2,t.isBot];case 2:return n=r.sent(),gt("Error in bot detection:",n),[2,!1];case 3:return[2]}}))}))}function ut(e,t,n){return Ui(this,void 0,void 0,(function(){var r,i,o;return Vi(this,(function(a){switch(a.label){case 0:if(r=_n.getState().cookieConsent,i=ut._lastTag,r===e&&i&&i.consent===e&&i.source===t)return[2];_n.setCookieConsent(e),ut._lastTag={consent:e,source:t},gt("Cookie consent set to ".concat(e," from ").concat(t)),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,O({eventId:y(),eventType:"cookieConsent",time:(new Date).toISOString(),label:"Cookie consent ".concat(e?"granted":"denied"),value:zi({consentGiven:e,consentSource:t},n?{details:n}:{})})];case 2:return a.sent(),[3,4];case 3:return o=a.sent(),yt("Error sending cookie consent event",o),[3,4];case 4:return[2]}}))}))}function lt(e){Bi.push(e)}function dt(){var cookies,e,t,n,value,r,i,o,a,c,s,u,l;try{if(e=(cookies=document.cookie||"").match(/(?:^|; )OptanonConsent=([^;]+)/),t=cookies.match(/(?:^|; )OptanonActiveGroups=([^;]+)/))return{hasConsent:!!(n=decodeURIComponent(t[1]).split(",").filter(Boolean)).some((function(e){return e&&"C0001"!==e})),details:{oneTrust:{activeGroups:n}}};if(!e)return null;for(value=decodeURIComponent(e[1]),r=(Object.fromEntries(value.split("&").map((function(e){var t=e.indexOf("=");return-1===t?[e,""]:[e.slice(0,t),e.slice(t+1)]}))).groups||"").split(",").map((function(e){return e.trim()})).filter(Boolean),i=!1,o={},a=0,c=r;a<c.length;a++)u=(s=c[a].split(":"))[0],l=Number(s[1]),u&&(o[u]=l),u&&"C0001"!==u&&1===l&&(i=!0);return{hasConsent:i,details:{oneTrust:{groups:o}}}}catch(e){return yt("Error parsing OneTrust consent",e),null}}function ft(e){var t,n,r;if(void 0===e&&(e=5),"function"==typeof(t=window.__tcfapi))return t("addEventListener",2,n=function(e,t){var n,r,i,o,a,c,s,u;t&&("useractioncomplete"!==e.eventStatus&&"tcloaded"!==e.eventStatus||(a=(null===(n=null==e?void 0:e.purpose)||void 0===n?void 0:n.consents)||{},c=(null===(r=null==e?void 0:e.vendor)||void 0===r?void 0:r.consents)||{},s=Object.entries(a).some((function(e){return"1"!==e[0]&&!0===e[1]})),u=Object.values(c).some((function(e){return e})),ut(!(!s&&!u),"tcfapi",{tcf:{purposeConsents:null===(i=e.purpose)||void 0===i?void 0:i.consents,vendorConsents:null===(o=e.vendor)||void 0===o?void 0:o.consents}})))}),lt((function(){try{t("removeEventListener",2,n)}catch(e){}})),void t("getTCData",2,(function(e,t){var n,r,i,o,a,c,s,u;t&&(a=(null===(n=null==e?void 0:e.purpose)||void 0===n?void 0:n.consents)||{},c=(null===(r=null==e?void 0:e.vendor)||void 0===r?void 0:r.consents)||{},s=Object.entries(a).some((function(e){return"1"!==e[0]&&!0===e[1]})),u=Object.values(c).some((function(e){return e})),ut(!(!s&&!u),"tcfapi",{tcf:{purposeConsents:null===(i=e.purpose)||void 0===i?void 0:i.consents,vendorConsents:null===(o=e.vendor)||void 0===o?void 0:o.consents}}))}));e>0&&(r=setTimeout((function(){return ft(e-1)}),1e3),Gi.push(r))}function ht(){var e,t,n,r,i,o,a,c,s,u,l,d,f;if(!qi&&"undefined"!=typeof window){qi=!0;try{ft(),function(){var e,t,n,r,i,o,a,c,s,u,l,d,f;try{e=window,t=null,n=null,r=!1,i=function(e){var t,n,r,i,o,a,c;if(!e||"object"!=typeof e)return null;for(t=e.consentParameters||e,n={},r=!1,i=0,o=["analytics_storage","ad_storage","ad_user_data","ad_personalization","personalization_storage","functionality_storage","security_storage"];i<o.length;i++)a=o[i],"string"==typeof(c=null==t?void 0:t[a])&&(n[a]=c,r=!0);return r?n:null},o=function(e,t){var o,a,c,s,u;try{if(!(o=i(e)))return;if(c=(a=Object.values(o)).some((function(e){return"granted"===e})),s=a.length&&a.every((function(e){return"denied"===e})),!c&&!s)return;if(!r)return;if((u=JSON.stringify(o,Object.keys(o).sort()))===n)return;n=u,ut(c,t,{gcm:e,gcmState:o})}catch(e){yt("Error emitting GCM consent",e)}},a=function(e){var t,n;try{if(!e)return;if(t="object"==typeof e&&!Array.isArray(e)&&"number"==typeof e.length&&"consent"===e[0],(Array.isArray(e)||t)&&"consent"===e[0])return"update"===e[1]&&(r=!0),void o(e[2]||{},"gcm");"object"==typeof e&&((n=String(e.event||"")).includes("consent")||"gtm.init_consent"===n||"gtm.default_consent"===n||"gtm.default_consent_update"===n||"gtm.consentUpdate"===n)&&("gtm.consentUpdate"===n&&(r=!0),o(e,"gcm"))}catch(e){yt("Error processing GCM dataLayer item",e)}},c=function(e){var t,n;if(Array.isArray(e)&&!e.__cstPatched){try{e.forEach(a)}catch(e){}t=e.push.bind(e),n=function(){var e,n,r=[];for(e=0;e<arguments.length;e++)r[e]=arguments[e];n=t.apply(void 0,r);try{r.forEach(a)}catch(e){}return n},n.__cstPatched=!0,e.push=n,e.__cstPatched=!0,lt((function(){try{Array.isArray(e)&&e.push===n&&(e.push=t)}catch(e){}}))}},s=40,u=setInterval((function(){try{Array.isArray(e.dataLayer)&&c(e.dataLayer)}catch(e){}--s<=0&&clearInterval(u)}),250),lt((function(){return clearInterval(u)}));try{Array.isArray(e.dataLayer)&&c(e.dataLayer)}catch(e){}l=function(){var n,i=e.gtag||function(){e.dataLayer=e.dataLayer||[],e.dataLayer.push(arguments)};i.__cstPatched||(t||(t=i),n=function(){var e,t=[];for(e=0;e<arguments.length;e++)t[e]=arguments[e];try{"consent"!==t[0]||"update"!==t[1]&&"default"!==t[1]||("update"===t[1]&&(r=!0),o(t[2]||{},"gcm"))}catch(e){yt("Error intercepting gtag consent",e)}return i.apply(this,t)},n.__cstPatched=!0,e.gtag=n)},l(),d=40,f=setInterval((function(){try{"function"!=typeof e.gtag||e.gtag.__cstPatched||l()}catch(e){}--d<=0&&clearInterval(f)}),250),lt((function(){return clearInterval(f)})),lt((function(){var n;try{t&&(null===(n=e.gtag)||void 0===n?void 0:n.__cstPatched)&&(e.gtag=t)}catch(e){}}))}catch(e){yt("Error setting up Google Consent Mode listener",e)}}();try{t=null,n=function(){var e,t,n,r,cookies=document.cookie,i=cookies.match(/__hs_cookie_cat_pref=([^;]+)/),o=cookies.match(/hs-privacy-settings=([^;]+)/),a={},c=null;if(i)try{e=decodeURIComponent(i[1]),t={},e.split(/[_,]/).map((function(e){return e.trim()})).filter(Boolean).forEach((function(e){var n=e.indexOf(":");n>-1&&(t[e.slice(0,n)]=e.slice(n+1))})),c=n="true"===t[2]||"true"===t[3]||"true"===t[4],a.cookie_cat_pref=t}catch(e){}if(o)try{n=!!((r=JSON.parse(decodeURIComponent(o[1]))).consentAllowed||r.consentAnalytics||r.consentAdvertisement||r.consentFunctionality),null===c&&(c=n),a.legacy=r}catch(e){}return null===c?null:{consent:c,details:{hubspot:a}}},(r=function(){var e,r;try{if(!(e=n()))return;if((r=JSON.stringify(e))===t)return;t=r,ut(e.consent,"hubspot",e.details)}catch(e){}})(),i=setInterval(r,1e3),lt((function(){return clearInterval(i)}))}catch(e){yt("Error initializing HubSpot cookie monitor",e)}o=setInterval((function(){var e,t;try{if((e=window.hsConsentApi)&&"function"==typeof e.onConsentChange){clearInterval(o),t=function(e){try{var t={hasConsent:!!((null==e?void 0:e.consentAllowed)||(null==e?void 0:e.consentAnalytics)||(null==e?void 0:e.consentAdvertisement)||(null==e?void 0:e.consentFunctionality)),details:{hubspot:e}};ut(t.hasConsent,"hubspot",t.details)}catch(e){yt("Error handling HubSpot onConsentChange",e)}};try{e.onConsentChange(t),lt((function(){var n;try{null===(n=e.offConsentChange)||void 0===n||n.call(e,t)}catch(e){}}))}catch(e){yt("Failed to register HubSpot onConsentChange",e)}}}catch(e){yt("Error probing HubSpot consent API",e)}}),1e3),lt((function(){return clearInterval(o)})),a=function(){return ut(!0,"cookiebot")},c=function(){return ut(!1,"cookiebot")},s=function(){var e,t,n,r=window.Cookiebot;ut(!!((null===(e=null==r?void 0:r.consent)||void 0===e?void 0:e.marketing)||(null===(t=null==r?void 0:r.consent)||void 0===t?void 0:t.preferences)||(null===(n=null==r?void 0:r.consent)||void 0===n?void 0:n.statistics)),"cookiebot")},window.addEventListener("CookiebotOnAccept",a,{passive:!0}),window.addEventListener("CookiebotOnDecline",c,{passive:!0}),window.addEventListener("CookiebotOnLoad",s,{passive:!0}),lt((function(){window.removeEventListener("CookiebotOnAccept",a),window.removeEventListener("CookiebotOnDecline",c),window.removeEventListener("CookiebotOnLoad",s)})),(null===(e=window.Cookiebot)||void 0===e?void 0:e.consent)&&s(),u=function(){var e=setTimeout((function(){var e=dt();e&&ut(e.hasConsent,"oneTrust",e.details)}),100);Gi.push(e)},window.addEventListener("OneTrustConsentChanged",u,{passive:!0}),lt((function(){window.removeEventListener("OneTrustConsentChanged",u)})),(l=dt())&&ut(l.hasConsent,"oneTrust",l.details),d=function(){return ut(!0,"generic")},f=function(){return ut(!1,"generic")},window.addEventListener("consentGiven",d,{passive:!0}),window.addEventListener("consentDenied",f,{passive:!0}),lt((function(){window.removeEventListener("consentGiven",d),window.removeEventListener("consentDenied",f)})),gt("Cookie consent tracking initialized")}catch(e){yt("Error initializing cookie consent tracking",e)}}}function mt(){return Ki(this,arguments,void 0,(function(e){var t,n,r,i,o,a,c,s,u,l,d,f,h,m,p,v,g,tag,b,w,S,T,I,k,E,token,_,A,P,C,x;return void 0===e&&(e={}),Xi(this,(function(M){switch(M.label){case 0:if(Yi)return[2];if(n=void 0!==(t=e.force)&&t,r=Date.now(),!n&&r-Ji<$i)return gt("Skipping cart attribute update (cooldown active)"),[2];M.label=1;case 1:M.trys.push([1,19,20,21]),Yi=!0,i=_n.getState(),o={_cst_sessionId:i.session.id,_cst_clientId:i.clientId,_cst_pageviewId:i.page.id,_cst_userId:i.userId,_cst_visitorId:i.visitorId},c={cid:(a=function(e){return"string"==typeof e?e.slice(0,64):void 0})(i.clientId),sid:a(i.session.id),vid:a(i.visitorId),pvid:a(i.page.id),uid:a(i.userId)},s=!1,u="",l=!1,d=0,f=void 0,h=void 0,M.label=2;case 2:return M.trys.push([2,6,,7]),[4,fetch("/cart.js",{credentials:"same-origin"})];case 3:return(T=M.sent()).ok?[4,T.json().catch((function(){return null}))]:[3,5];case 4:(I=M.sent())&&"object"==typeof I&&(s=!0,"string"==typeof I.note&&(u=I.note),Array.isArray(I.items)&&(d=I.items.length),I.attributes&&"object"==typeof I.attributes&&(h=I.attributes),"string"==typeof I.token&&(f=I.token)),M.label=5;case 5:return[3,7];case 6:return M.sent(),[3,7];case 7:if(s&&0===d)return gt("Cart is empty; skipping cart attribute update"),[2];if(s&&!f)return gt("Cart token missing; skipping attribute update until cart exists"),[2];m=!1,h&&(m=(p=h)._cst_sessionId===o._cst_sessionId&&p._cst_clientId===o._cst_clientId&&p._cst_pageviewId===o._cst_pageviewId&&p._cst_userId===o._cst_userId&&p._cst_visitorId===o._cst_visitorId);try{(v=u.match(/\[cst:([^\]]+)\]/))&&v[1]&&(g=JSON.parse(v[1]))&&g.cid===c.cid&&g.sid===c.sid&&g.vid===c.vid&&g.pvid===c.pvid&&g.uid===c.uid&&(l=!0)}catch(e){}return l&&m?(gt("Cart attributes already current; skipping write"),[2]):(tag="[cst:".concat(JSON.stringify(c),"]"),b=u?u.replace(/\[cst:[^\]]*\]/g,"").trim():"",w=b?"".concat(b," ").concat(tag):tag,gt("Updating cart attributes (enrichment)",o),[4,fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json","X-CST-Attrs":"1"},body:JSON.stringify({attributes:o,note:w}),credentials:"same-origin"})]);case 8:return(S=M.sent()).ok?[4,S.json().catch((function(){return null}))]:[3,17];case 9:M.sent(),gt("Cart attributes updated successfully",{status:S.status,attributeCount:Object.keys(o).length}),M.label=10;case 10:return M.trys.push([10,15,,16]),[4,fetch("/cart.js",{credentials:"same-origin"})];case 11:return(T=M.sent()).ok?[4,T.json().catch((function(){return null}))]:[3,14];case 12:return I=M.sent(),E=(null==I?void 0:I.attributes)||{},token=(null==I?void 0:I.token)||void 0,_="string"==typeof(k=(null==I?void 0:I.note)||"")&&/\[cst:[^\]]+\]/.test(k),A=Object.keys(E||{}),gt("Cart after update",{token,hasCstTag:_,attrKeys:A}),token?(P=L(),[4,N({eventId:y(),eventType:"cartIdsSync",time:P,source:"shopify",cartToken:String(token),clientId:i.clientId,sessionId:i.session.id,visitorId:i.visitorId,pageViewId:i.page.id,noteHasTag:_,attributesPresent:A.length>0,timestamp:P})]):[3,14];case 13:M.sent(),M.label=14;case 14:return[3,16];case 15:return C=M.sent(),yt("Post-update cart verification failed",C),[3,16];case 16:return[3,18];case 17:yt("Cart attributes update failed",{status:S.status,statusText:S.statusText}),M.label=18;case 18:return[3,21];case 19:return x=M.sent(),yt("Failed to update cart attributes",x),[3,21];case 20:return Ji=Date.now(),Yi=!1,[7];case 21:return[2]}}))}))}function initialize(e){if(void 0===e&&(e={}),gt("KLRR_CST_FX] initialize() called; isInitialized:",eo),!eo){try{t=e,Or=Mr(Mr({},Or),t)}catch(e){yt("Failed applying runtime config",e)}return gt("KLRR_CST_FX] invoking cst() now"),function(){return Zi(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,c,s,u,l,d,f,h=this;return Qi(this,(function(m){switch(m.label){case 0:if(eo)return gt("KLRR_CST_FX] Already initialized, skipping"),[2];m.label=1;case 1:return m.trys.push([1,10,,11]),gt("KLRR_CST_FX] Starting initialization"),gt("KLRR_CST_FX] calling stateManager.initialize()"),[4,_n.initialize()];case 2:m.sent(),gt("KLRR_CST_FX] state initialized; session:",_n.getSessionId(),"page:",_n.getState().page.id),e=!1,m.label=3;case 3:return m.trys.push([3,5,,6]),gt("KLRR_CST_FX] running bot detection"),[4,st()];case 4:return e=m.sent(),[3,6];case 5:return t=m.sent(),yt("Bot detection failed, proceeding with tracking:",t),e=!1,[3,6];case 6:if("undefined"!=typeof window&&"true"===window.localStorage.getItem("bypassBotDetection")&&(gt("Manual bot detection bypass enabled"),e=!1),e)return gt("Bot detected, stopping tracking"),_n.stopTracking(),[2];gt("Installing early form network interceptors"),function(){try{ge()}catch(e){yt("Failed installing early network interceptors",e)}}(),gt("Initializing cookie consent tracking"),ht(),gt("Initializing visibility handling"),_r(),gt("Initializing SPA tracking"),function(){var e,t=this;try{return Mi&&(Mi.disconnect(),Mi=null),Oi=location.href,Mi=new MutationObserver(Di),e=T((function(){return Pi(t,void 0,void 0,(function(){return Ci(this,(function(e){switch(e.label){case 0:return location.href===Oi?[2]:(gt("Route change detected: ".concat(Oi," -> ").concat(location.href)),[4,ct()]);case 1:return e.sent(),[2]}}))}))}),100),window.addEventListener("popstate",e),window.addEventListener("pushState",e),window.addEventListener("replaceState",e),ot("pushState"),ot("replaceState"),Mi.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),gt("SPA tracking initialized"),Mi}catch(e){throw yt("Error setting up SPA tracking",e),e}}(),gt("Initializing scroll tracking"),Le(),gt("Initializing click tracking"),Ne(),gt("Initializing enhanced form tracking"),Se(),gt("Initializing input tracking"),nt(),gt("Initializing custom dropdown tracking"),function(){var e=this;Ei||(Ei=!0,_i=function(t){return Si(e,void 0,void 0,(function(){var e,n;return Ti(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t.target instanceof HTMLElement&&(e=t.target.closest(Ii))&&rt(e)?[4,it(e)]:[2];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),yt("Error handling custom dropdown selection",n),[3,3];case 3:return[2]}}))}))},document.addEventListener("click",_i,{capture:!0,passive:!0}),Ai=function(t){return Si(e,void 0,void 0,(function(){var e,n,r;return Ti(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),"Enter"!==(e=t.key)&&" "!==e?[2]:t.target instanceof HTMLElement&&(n=t.target.closest(Ii))&&rt(n)?[4,it(n)]:[2];case 1:return i.sent(),[3,3];case 2:return r=i.sent(),yt("Error handling keyboard dropdown selection",r),[3,3];case 3:return[2]}}))}))},document.addEventListener("keydown",Ai,{capture:!0}),gt("Initialized custom dropdown tracking"))}(),gt("Initializing video tracking (HTML5, Vimeo, Wistia, Loom)"),We(),ze(),Be(),$e(),gt("Loading YouTube API and watcher"),ri(),oi(),gt("Initializing activity tracking"),_(),gt("KLRR_CST_FX] Initialization complete"),n=function(){try{gt("Ensuring click tracking after DOM ready"),xe()}catch(e){yt("Error reinitializing click tracking",e)}try{gt("Ensuring scroll tracking after DOM ready"),Ae(),Le()}catch(e){yt("Error reinitializing scroll tracking",e)}try{window.__cstEnhancedFormTrackingInit&&(gt("Rescanning forms after DOM ready"),Te())}catch(e){yt("Error rescanning forms",e)}try{gt("Ensuring input tracking after DOM ready"),nt()}catch(e){yt("Error ensuring input tracking",e)}},r=function(){gt("KLRR_CST_FX] scheduleInteractionEnsure()"),n(),setTimeout(n,500),setTimeout(n,2e3)},v=!1,i=function(){v||(v=!0,setTimeout((function(){v=!1,r()}),50))},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){gt("KLRR_CST_FX] DOMContentLoaded"),r()}),{once:!0}):(gt("KLRR_CST_FX] DOM already ready -> ensuring interactions immediately"),r()),document.addEventListener("readystatechange",(function(){gt("KLRR_CST_FX] readystatechange:",document.readyState),"complete"===document.readyState&&i()}));try{"undefined"!=typeof MutationObserver&&(o=document.documentElement||document,new MutationObserver((function(e){var t,n,r,o=!1;for(t=0,n=e;t<n.length;t++)(r=n[t]).addedNodes.forEach((function(e){(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)&&(o=!0)})),r.removedNodes.forEach((function(e){(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)&&(o=!0)}));o&&(gt("DOM root changed, reapplying interaction hooks"),i())})).observe(o,{childList:!0}))}catch(e){yt("Error setting up DOM replacement monitor",e)}return window.addEventListener("online",(function(){gt("Network online, retrying failed events"),gt("KLRR_CST_FX] online -> retryFailedEvents()"),k()}),{passive:!0}),window.addEventListener("load",(function(){gt("Page load complete, retrying failed events"),gt("KLRR_CST_FX] window load -> retryFailedEvents()"),k()}),{passive:!0}),p=Date.now(),Object.keys(localStorage).forEach((function(e){if(e.startsWith("cst_"))try{var t=JSON.parse(localStorage.getItem(e)||"");p-t.timestamp>2592e6&&localStorage.removeItem(e)}catch(t){localStorage.removeItem(e)}})),[4,k()];case 7:return m.sent(),"undefined"!=typeof window&&window.Shopify&&window.Shopify.shop?(a=_n.getState(),gt("Shopify storefront detected, updating cart attributes",a.clientId),[4,mt()]):[3,9];case 8:m.sent(),c=function(){return Zi(h,void 0,void 0,(function(){return Qi(this,(function(e){switch(e.label){case 0:return gt("Cart change detected, updating attributes"),[4,mt({force:!0})];case 1:return e.sent(),[2]}}))}))},document.addEventListener("cart:updated",c,{passive:!0}),void 0!==window.fetch&&(s=window.fetch,l=function(){u||(u=setTimeout((function(){u=void 0,mt({force:!0})}),250))},window.fetch=function(e,t){var n,r,i,o=this,a=s.call(this,e,t),url="",c=!1,u=function(e){if(!e)return!1;try{if(e instanceof Headers)return"1"===e.get("X-CST-Attrs");if(Array.isArray(e))return e.some((function(e){var t=e[1];return"x-cst-attrs"===e[0].toLowerCase()&&"1"===String(t)}));if("object"==typeof e)return Object.entries(e).some((function(e){var t=e[1];return"x-cst-attrs"===e[0].toLowerCase()&&"1"===String(t)}))}catch(e){}return!1};try{"string"==typeof e?(url=e,!c&&t&&u(t.headers)&&(c=!0)):e instanceof Request?(url=e.url,c="1"===(null===(r=null===(n=e.headers)||void 0===n?void 0:n.get)||void 0===r?void 0:r.call(n,"X-CST-Attrs"))||!c&&u(null==t?void 0:t.headers)):e instanceof URL&&(url=e.toString(),!c&&t&&u(t.headers)&&(c=!0))}catch(e){}return i=url.includes("/cart/add")||url.includes("/cart/change")||url.includes("/cart/update"),url.includes("/cart/update.js")||url.includes("/cart/update"),i&&!c&&a.then((function(e){return Zi(o,void 0,void 0,(function(){return Qi(this,(function(t){return e.ok&&(gt("Cart API call detected, scheduling attributes update"),l()),[2,e]}))}))})).catch((function(){})),a}),setInterval((function(){"visible"===document.visibilityState&&mt({force:!0})}),12e4),m.label=9;case 9:return gt("CST initialization complete - all handlers initialized"),d=_n.getState(),gt("Final initialization state:",{sessionValid:d.session.isValid,isTracking:d.session.isValid,sessionId:d.session.id,pageId:d.page.id}),eo=!0,[3,11];case 10:throw f=m.sent(),yt("CST initialization error:",f),console.error("KLRR_CST_FX] Initialization error",f),eo=!1,f;case 11:return[2]}var p,v}))}))}()}var t;return Promise.resolve()}var pt,vt,gt,yt,bt,wt,St,Tt,It,kt,Et,_t,At,Lt,Pt,Ct,xt,Mt,Ot,Nt,Rt,Dt,Wt,jt,Ht,Ft,zt,Ut,Vt,qt,Bt,Gt,Kt,Xt,Yt,Jt,$t,Zt,Qt,en,tn,nn,rn,on,an,cn,sn,un,ln,dn,fn,hn,mn,pn,vn,gn,yn,bn,wn,Sn,Tn,In,kn,En,_n,An,Ln,Pn,Cn,xn,Mn,On,Nn,Rn,Dn,Wn,jn,Hn,Fn,zn,Un,Vn,qn,Bn,Gn,Kn,Xn,Yn,Jn,$n,Zn,Qn,er,tr,nr,rr,ir,or,ar,cr,sr,ur,lr,dr,fr,hr,mr,pr,vr,gr,yr,br,wr,Sr,Tr,Ir,kr,Er,_r,Ar,Lr,Pr,Cr,xr,Mr,Or,Nr,Rr,Dr,Wr,jr,Hr,Fr,zr,Ur,Vr,qr,Br,Gr,Kr,Xr,Yr,Jr,$r,Zr,Qr,ei,ti,ni,ri,ii,oi,ai,ci,si,ui,li,di,fi,hi,mi,pi,vi,gi,yi,bi,wi,Si,Ti,Ii,ki,Ei,_i,Ai,Li,Pi,Ci,xi,Mi,Oi,Ni,Ri,Di,Wi,ji,Hi,Fi,zi,Ui,Vi,qi,Bi,Gi,Ki,Xi,Yi,Ji,$i,Zi,Qi,eo,to,CSTExport,no,ro,io,oo,ao,co,so,uo,lo,fo,ho={d:(e,t)=>{for(var n in t)ho.o(t,n)&&!ho.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};ho.d(pt={},{default:()=>mo}),vt=function(){},"undefined"==typeof localStorage||localStorage.removeItem("debugMode"),gt=vt,yt=vt,bt="https://dev-cdn.klrr.org",wt="https://cdn.klrr.org",St="https://ti-cs.s3.amazonaws.com/dev",Tt="https://ti-cs.s3.amazonaws.com",kt="development"===(It="production".toLowerCase())||"staging"===It,["development","staging","production"].includes(It)||'Invalid environment "'.concat(It,'" specified. Defaulting to development mode.'),Et=kt?"https://dev-api.klrr.org/send":"https://api.klrr.org/send",_t=kt?"cstm-dev.js":"cstm.js",At=kt?"https://dev-api.klrr.org/shop":"https://api.klrr.org/shop",kt&&gt("CST Configuration:",{environment:It,apiEndpoint:Et,buildTime:(new Date).toISOString()}),Lt="cst-event-active",Pt="cst_fp",Ct="cst_bot",xt="cst_tiid",Mt=2102400,Ot="cst_sid",Nt="cst_sid_time",Rt="cst_active_time",Dt="cst_pvid",Wt="cst_pvid_ts",jt=54e5,Ht=18e5,Ft="cst_cfp",zt="cst_loc",Ut="cst_pending_batches",Vt=["hubspotutk","pardot","visitor_id"],qt=[/pass(word)?/i,/^pw$/i,"secret","token","apikey","api_key","auth","authentication","bearer","jwt",/credit[_-]?card/i,/card[_-]?number/i,/^cc[_-]?/i,"cvv","cvc","ccv",/expir(y|ation)/i,/card[_-]?holder/i,"billing","payment",/account[_-]?number/i,"routing","swift","iban","ssn",/social[_-]?security/i,/tax[_-]?id/i,"sin","passport","drivers_license","driving_license","national_id","birth_date","birthdate","dob","health_id","insurance_id","medical_record","patient_id","private","secure","hidden","confidential",/sensitive/i,"_token","csrf","xsrf","nonce",/document[_-]?upload/i,/id[_-]?upload/i,/passport[_-]?upload/i],Bt={5:!1,15:!1,25:!1,35:!1,45:!1,55:!1,65:!1,75:!1,85:!1,95:!1,100:!1},Gt=!1,Xt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Yt=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Jt=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},$t=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Zt=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Qt=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},en=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},tn=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},function(e){e[e.CLOSED=0]="CLOSED",e[e.OPEN=1]="OPEN",e[e.HALF_OPEN=2]="HALF_OPEN"}(nn||(nn={})),rn=function(){function e(e){var t=this;this.failures=0,this.lastFailureTime=0,this.isOpen=!1,this.config=e,setInterval((function(){Date.now()-t.lastFailureTime>t.config.monitorInterval&&(t.failures=0)}),this.config.monitorInterval)}return e.prototype.isAllowed=function(){return!this.isOpen||Date.now()-this.lastFailureTime>this.config.resetTimeout&&(this.isOpen=!1,this.failures=0,!0)},e.prototype.recordSuccess=function(){this.failures=Math.max(0,this.failures-1)},e.prototype.recordFailure=function(){this.failures++,this.lastFailureTime=Date.now(),this.failures>=this.config.failureThreshold&&(this.isOpen=!0)},e}(),on=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},an=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},cn=10080,sn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},un=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},ln=1e3,dn=Ut,fn=!1,hn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},mn=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},pn=null,vn=null,gn=100,yn=function(){pn&&clearTimeout(pn),pn=setTimeout((function(){gt("Inactivity timeout reached, triggering session end"),_n.handleSessionTimeout()}),Ht)},no=function(){return hn(void 0,void 0,void 0,(function(){return mn(this,(function(e){switch(e.label){case 0:return gt("Activity detected, updating state"),[4,_n.updateActivity()];case 1:return e.sent(),[2]}}))}))},void 0===ro&&(ro={}),io=null,oo=0,co=void 0===(ao=ro.leading)||ao,uo=void 0===(so=ro.trailing)||so,lo=!1,(fo=function(){var e,t,n,r=this,i=[];for(e=0;e<arguments.length;e++)i[e]=arguments[e];return t=Date.now(),co&&!lo?(lo=!0,oo=t,no.apply(this,i)):(oo||!1!==co||(oo=t),(n=5e3-(t-oo))<=0||n>5e3?(io&&(clearTimeout(io),io=null),oo=t,no.apply(this,i)):void(io||!1===uo||(io=setTimeout((function(){return function(e,t){oo=!1===co?0:Date.now(),io=null,no.apply(e,t)}(r,i)}),n))))}).cancel=function(){io&&(clearTimeout(io),io=null),oo=0,lo=!1},bn=fo,wn=function(){yn(),bn()},Sn=function(){return Sn=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Sn.apply(this,arguments)},Tn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},In=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},kn={ip:null,network:null,city:null,region:null,country:null,postal:null,latitude:null,longitude:null,in_eu:null,ipCompany:null,isp:null,asn:null,org:null,timezone:null},En=function(){function c(){var e=this;this.initialized=!1,this.initialDataSent=!1,this.isInitializing=!1,this.state={parsedCookies:{},parsedMarketingTrackers:{},lastCookieUpdate:0,clientId:"",visitorId:"",userId:"",cookieConsent:null,fingerprint:{userAgent:"",language:"",timezoneOffset:0,doNotTrack:"",cfp:"",cookieEnabled:!1},location:kn,session:{id:"",startTime:0,startTimestamp:"",lastActivityTime:0,activeTimeInSeconds:0,isValid:!1},page:{id:"",startTime:0,startTimestamp:"",lastActivityTime:0,activeTimeInSeconds:0,url:"",pathname:"",title:"",referrer:"",isValid:!1}},this.isTracking=!1,this.unifiedTimer=null,this.lastSaveTimestamp=0,this.stateChanged=!1,this.unifiedTicks=0,this.lastUserActivityTs=0,this.isHandlingSessionOperation=!1,this.cleanupHandler=function(){return e.cleanup()},this.formSubmitHandler=function(t){return e.handleFormSubmit(t)},"undefined"!=typeof window&&(window.addEventListener("beforeunload",this.cleanupHandler),window.addEventListener("unload",this.cleanupHandler),document.addEventListener("submit",this.formSubmitHandler,!0)),"test"!=="production".toLowerCase()&&this.initialize().catch((function(e){return yt("Error in constructor initialization",e)}))}return c.prototype.publishContext=function(){var e;try{e={clientId:this.state.clientId||"",userId:this.state.userId||"",sessionId:this.state.session.id||"",pageViewId:this.state.page.id||"",timestamp:(new Date).toISOString()},globalThis.KLEERR_CST_CONTEXT=e}catch(e){}},c.prototype.clearAllIntervals=function(){this.unifiedTimer&&(clearInterval(this.unifiedTimer),this.unifiedTimer=null)},c.prototype.sanitizeCookieData=function(value){return"string"!=typeof value?String(value||""):value.replace(/[\x00-\x1F\x7F]/g,"").substring(0,1e3)},c.prototype.getStoredActiveSeconds=function(e,t){var n=function(value){if(!value)return 0;var e=Number(value);return Number.isFinite(e)&&e>=0?e:0};return Math.max(n(e),n(t))},c.prototype.retrySaveActiveTime=function(){var e,activeTime,t;try{if(!this.state.session.id)return;e="".concat(Rt,"_").concat(this.state.session.id),activeTime=this.state.session.activeTimeInSeconds.toString(),t=this.state.session.lastActivityTime.toString(),sessionStorage.setItem(e,activeTime),localStorage.setItem(e,activeTime),localStorage.setItem("cst_last_activity_time",t),gt("Active time retry successful: ".concat(activeTime,"s"))}catch(e){yt("Active time retry failed",e)}},c.prototype.handleFormSubmit=function(e){var t=this;setTimeout((function(){gt("Form submitted, refreshing state for new cookies"),t.refreshState().catch((function(e){return yt("Error refreshing state after form submit",e)}))}),500)},c.prototype.isStoredSessionValid=function(e){var t=P();return!(t-e.startTime>jt||t-e.lastActivityTime>Ht)},c.prototype.initializeSession=function(){return Tn(this,void 0,void 0,(function(){var e,t,n,r;return In(this,(function(i){switch(i.label){case 0:return gt("Initializing session"),(e=this.loadStoredSession())?this.isStoredSessionValid(e)?(gt("Loaded existing session",e),this.state.session=e,t="".concat(Rt,"_").concat(this.state.session.id),n=sessionStorage.getItem(t),r=localStorage.getItem(t),this.state.session.activeTimeInSeconds=this.getStoredActiveSeconds(n,r),this.isTracking=!0,this.state.session.isValid=!0,this.startUnifiedTimer(),[4,this.initializePageView()]):[3,2]:[3,4];case 1:return i.sent(),[2];case 2:return gt("Session invalid, creating new session"),[4,this.handleSessionEnd("manual")];case 3:i.sent(),i.label=4;case 4:return gt("No existing session, creating new session"),[4,this.createNewSession()];case 5:return i.sent(),[2]}}))}))},c.prototype.loadStoredSession=function(){var sessionId,e,n,r,i,o,a,c,s,u;try{if(sessionId=t(Ot)||localStorage.getItem(Ot),e=t(Nt)||localStorage.getItem(Nt),n=localStorage.getItem("cst_last_activity_time"),r="".concat(Rt,"_").concat(sessionId),i=sessionStorage.getItem(r),o=localStorage.getItem(r),!sessionId||!e)return gt("No stored session found"),null;if(!n)return gt("No stored last activity time; stored session invalid"),null;a=this.getStoredActiveSeconds(i,o),c=void 0,s=void 0;try{c=C(e)}catch(t){return gt("Invalid stored session start time format",e),null}try{s=C(n)}catch(e){return gt("Invalid stored last activity time",n),null}return!Number.isFinite(s)||s<=0?(gt("Parsed last activity time invalid",s),null):(u=new Date(c).toISOString(),gt("Found stored session",{sessionId,startTimeRaw:e,activeTimeInSeconds:a}),{id:sessionId,startTime:c,startTimestamp:u,lastActivityTime:s,activeTimeInSeconds:a,isValid:!0})}catch(e){return yt("Error loading stored session",e),null}},c.prototype.isSessionValid=function(){var e,t,n;return this.state.session.isValid?(n=(e=P())-this.state.session.lastActivityTime,gt("Session age: ".concat((t=e-this.state.session.startTime)/1e3,"s, Inactivity time: ").concat(n/1e3,"s")),t>jt?(gt("Session invalid: Max duration exceeded"),this.handleSessionEnd("maxDuration"),{isValid:!1,reason:"maxDuration"}):n>Ht?(gt("Session invalid: Inactivity timeout"),this.handleSessionEnd("timeout"),{isValid:!1,reason:"timeout"}):{isValid:!0}):(gt("Session invalid: already marked as invalid"),{isValid:!1})},c.prototype.createNewSession=function(){return Tn(this,void 0,void 0,(function(){var e,timestamp,t,n;return In(this,(function(r){switch(r.label){case 0:if(gt("createnewssession called"),this.isHandlingSessionOperation)return gt("Session operation in progress, skipping new session creation"),[2];this.isHandlingSessionOperation=!0,r.label=1;case 1:return r.trys.push([1,,8,9]),gt("creating new session"),[4,this.handleSessionEnd("manual")];case 2:return r.sent(),this.clearSessionStorage(),e=P(),timestamp=L(),t={id:"s_".concat(y()),startTime:e,startTimestamp:timestamp,lastActivityTime:e,activeTimeInSeconds:0,isValid:!0},gt("Creating new session",t.id),this.state.session=t,this.isTracking=!0,this.state.session.isValid=!0,this.persistSession(t),this.startUnifiedTimer(),_(),Ee(),ke(),[4,this.initializePageView()];case 3:if(r.sent(),this.publishContext(),this.isInitializing)return[3,7];this.initialDataSent=!1,this.initialDataSent=!0,gt("Sending initial data for new session",t.id),r.label=4;case 4:return r.trys.push([4,6,,7]),[4,x()];case 5:return r.sent(),[3,7];case 6:return n=r.sent(),yt("Error sending initial data for new session",n),this.initialDataSent=!1,[3,7];case 7:return[3,9];case 8:return this.isHandlingSessionOperation=!1,[7];case 9:return[2]}}))}))},c.prototype.persistSession=function(t){try{if(!t.id||t.startTime<=0)return void yt("Invalid session data, cannot persist");var n=o();e(Ot,t.id,90,{domain:n,path:"/",sameSite:"Lax"}),e(Nt,t.startTimestamp,90,{domain:n,path:"/",sameSite:"Lax"}),localStorage.setItem(Ot,t.id),localStorage.setItem(Nt,t.startTimestamp)}catch(e){yt("Error persisting session",e)}},c.prototype.handleSessionEnd=function(e){return Tn(this,void 0,void 0,(function(){var t;return In(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),gt("Ending session due to: ".concat(e)),this.state.session.isValid=!1,this.isTracking=!1,this.clearAllIntervals(),Ee(),this.saveActiveTime(),[4,k()];case 1:return n.sent(),this.clearSessionStorage(),this.cleanupOldStorage(),this.publishContext(),[3,3];case 2:return t=n.sent(),yt("Error ending session",t),[3,3];case 3:return[2]}}))}))},c.getInstance=function(){return c.instance||(c.instance=new c),c.instance},c.prototype.getState=function(){return P()-this.state.lastCookieUpdate>3e5&&this.refreshState().catch((function(e){return yt("Error in getState refresh",e)})),this.state},c.prototype.setCookieConsent=function(e){this.state.cookieConsent=e},c.prototype.refreshState=function(){return Tn(this,void 0,void 0,(function(){var c,marketingTrackers,s,u,l,d,f,h,m,p,v,g,S,T,k,E;return In(this,(function(_){switch(_.label){case 0:for(_.trys.push([0,4,,5]),c=n(document.cookie),marketingTrackers=c.marketingTrackers,s={},u={},l=0,d=Object.entries(r(c.allCookies));l<d.length;l++)s[(f=d[l])[0]]=this.sanitizeCookieData(f[1]);for(h=0,m=Object.entries(i(marketingTrackers));h<m.length;h++)u[(p=m[h])[0]]=this.sanitizeCookieData(p[1]);return v=this,g=[Sn({},this.state)],T={parsedCookies:s,parsedMarketingTrackers:u,lastCookieUpdate:P(),clientId:b()||""},[4,w()];case 1:return T.visitorId=_.sent()||"",T.userId=function(){var n,r,i,a,c,s,u,start,l,d,f,userId=t(xt)||localStorage.getItem(xt)||"";if(userId){try{n=o(),e(xt,userId,Mt,{domain:n,path:"/",sameSite:"Lax"}),localStorage.setItem(xt,userId)}catch(e){yt("Error re-persisting existing userId:",e)}return userId}if(r="cst_uid_lock",i=Date.now(),a="".concat(i,":").concat(Math.random().toString(36).slice(2)),s=function(e){var t=Number(e.split(":")[0]||0);return t&&i-t<5e3},(u=(c=function(){return localStorage.getItem(r)||""})())&&s(u)){for(start=Date.now();Date.now()-start<250&&!(userId=t(xt)||localStorage.getItem(xt)||"")&&(u=c())&&s(u);)for(l=Date.now()+25;Date.now()<l;);if(userId){try{n=o(),e(xt,userId,Mt,{domain:n,path:"/",sameSite:"Lax"})}catch(e){}return userId}}try{(d=c())&&s(d)||localStorage.setItem(r,a)}catch(e){}f=c()===a,userId="u_".concat(y()),gt("Generated new userId",userId);try{n=o(),e(xt,userId,Mt,{domain:n,path:"/",sameSite:"Lax"})}catch(e){yt("Error persisting userId cookie:",e)}try{localStorage.setItem(xt,userId)}catch(e){yt("Error persisting userId to localStorage:",e)}try{f&&localStorage.removeItem(r)}catch(e){}return userId}()||"",k={userAgent:navigator.userAgent||"",language:navigator.language||"",timezoneOffset:(new Date).getTimezoneOffset(),doNotTrack:null!==(E=navigator.doNotTrack)&&void 0!==E?E:""},[4,a()];case 2:return T.fingerprint=(k.cfp=_.sent()||"",k.cookieEnabled=navigator.cookieEnabled,k),[4,I()];case 3:return v.state=Sn.apply(void 0,g.concat([(T.location=_.sent()||kn,T)])),gt("State refreshed",this.state),this.publishContext(),[3,5];case 4:return S=_.sent(),yt("Error refreshing state",S),[3,5];case 5:return[2]}}))}))},c.prototype.getSessionId=function(){return this.state.session.id},c.prototype.getActiveTime=function(){return this.state.session.activeTimeInSeconds},c.prototype.updateActivity=function(){return Tn(this,void 0,void 0,(function(){var e,t;return In(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),gt("updateActivity called"),!(e=P())||e<0?(yt("Invalid timestamp in updateActivity"),[2]):this.state.session.isValid?[3,2]:[4,this.createNewSession()];case 1:return n.sent(),[2];case 2:return this.state.session.lastActivityTime=e,this.state.page.lastActivityTime=e,this.lastUserActivityTs=e,this.stateChanged=!0,gt("Updated session last activity time to ".concat(new Date(e).toISOString())),this.unifiedTimer||this.startUnifiedTimer(),[3,4];case 3:return t=n.sent(),yt("Error updating activity",t),[3,4];case 4:return[2]}}))}))},c.prototype.initialize=function(){return Tn(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,c;return In(this,(function(s){switch(s.label){case 0:if(this.initialized)return gt("StateManager already initialized"),[2];if(!this.isInitializing)return[3,4];gt("StateManager is already initializing, waiting..."),e=0,s.label=1;case 1:return this.isInitializing&&e<50?[4,new Promise((function(e){return setTimeout(e,100)}))]:[3,3];case 2:return s.sent(),e++,[3,1];case 3:if(this.initialized)return gt("StateManager initialization completed while waiting"),[2];s.label=4;case 4:gt("Initializing StateManager"),this.isInitializing=!0,s.label=5;case 5:s.trys.push([5,17,18,19]),t=3,n=!1,s.label=6;case 6:return t>0&&!n?[4,this.refreshState()]:[3,11];case 7:return s.sent(),(r=this.getState()).userId&&r.clientId&&(null===(a=r.fingerprint)||void 0===a?void 0:a.userAgent)?(n=!0,gt("State validation successful during initialization"),[3,10]):[3,8];case 8:return t--,gt("State validation failed, retries left: ".concat(t),{hasUserId:!!r.userId,hasClientId:!!r.clientId,hasUserAgent:!!(null===(c=r.fingerprint)||void 0===c?void 0:c.userAgent)}),t>0?[4,new Promise((function(e){return setTimeout(e,200)}))]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,6];case 11:return n||yt("Failed to initialize state with valid data after retries"),[4,this.initializeSession()];case 12:if(s.sent(),this.state.session.isValid&&ke(),this.startUnifiedTimer(),this.initialized=!0,gt("StateManager initialization completed successfully"),this.publishContext(),this.initialDataSent)return[3,16];this.initialDataSent=!0,gt("Sending initial data after initialization"),s.label=13;case 13:return s.trys.push([13,15,,16]),[4,x()];case 14:return s.sent(),[3,16];case 15:return i=s.sent(),yt("Error sending initial data after initialization",i),this.initialDataSent=!1,[3,16];case 16:return W(),[3,19];case 17:throw o=s.sent(),this.initialized=!1,yt("Error initializing StateManager",o),o;case 18:return this.isInitializing=!1,[7];case 19:return[2]}}))}))},c.prototype.cleanupOldStorage=function(){var e=this,t=P();Object.keys(localStorage).forEach((function(e){if(e.startsWith("cst_")||e.startsWith("pageview_"))try{var n=localStorage.getItem(e);n&&!isNaN(Number(n))&&t-Number(n)>2592e6&&(localStorage.removeItem(e),gt("Cleaned up old localStorage item: ".concat(e)))}catch(t){localStorage.removeItem(e)}})),Object.keys(sessionStorage).forEach((function(t){var sessionId,pageViewId;(t.startsWith("cst_active_time_")||t.startsWith("pageview_time_")||t.startsWith("pageview_last_active_"))&&(sessionId=t.split("_")[3],pageViewId=t.split("_")[2],sessionId&&pageViewId&&sessionId===e.state.session.id||(sessionStorage.removeItem(t),gt("Cleaned up old sessionStorage item: ".concat(t))))})),gt("Storage cleanup completed")},c.prototype.stopTracking=function(){gt("Stopping all tracking"),this.isTracking=!1,this.clearAllIntervals(),this.saveActiveTime()},c.prototype.pauseTracking=function(){gt("Pausing tracking"),this.isTracking=!1,this.clearAllIntervals(),this.saveActiveTime()},c.prototype.resumeTracking=function(){return Tn(this,void 0,void 0,(function(){return In(this,(function(e){switch(e.label){case 0:return gt("Resuming tracking"),this.isSessionValid().isValid?[3,2]:[4,this.createNewSession()];case 1:return e.sent(),[2];case 2:return this.isTracking=!0,this.startUnifiedTimer(),[2]}}))}))},c.prototype.saveActiveTime=function(){var e,activeTime,t;try{if(!this.state.session.id)return;e="".concat(Rt,"_").concat(this.state.session.id),activeTime=this.state.session.activeTimeInSeconds.toString(),t=this.state.session.lastActivityTime.toString(),sessionStorage.setItem(e,activeTime),localStorage.setItem(e,activeTime),localStorage.setItem("cst_last_activity_time",t),gt("Active time saved: ".concat(activeTime,"s"))}catch(e){yt("Error saving active time",e),e instanceof Error&&"QuotaExceededError"===e.name&&(this.cleanupOldStorage(),this.retrySaveActiveTime())}},c.prototype.clearSessionStorage=function(){var e,t,n;this.state.session.isValid||(e=new Date(0).toUTCString(),t=o(),document.cookie="".concat(Ot,"=; expires=").concat(e,"; path=/; SameSite=Lax; Secure"),document.cookie="".concat(Nt,"=; expires=").concat(e,"; path=/; SameSite=Lax; Secure"),t&&(document.cookie="".concat(Ot,"=; expires=").concat(e,"; path=/; domain=").concat(t,"; SameSite=Lax; Secure"),document.cookie="".concat(Nt,"=; expires=").concat(e,"; path=/; domain=").concat(t,"; SameSite=Lax; Secure")),n="".concat(Rt,"_").concat(this.state.session.id),sessionStorage.removeItem(n),localStorage.removeItem(n),localStorage.removeItem("cst_last_activity_time"),localStorage.removeItem(Ot),localStorage.removeItem(Nt))},c.prototype.endCurrentPageViewAndStartNew=function(e){return Tn(this,void 0,void 0,(function(){var t;return In(this,(function(n){switch(n.label){case 0:return gt("Starting page view transition",{currentSession:this.state.session,currentPage:this.state.page}),t=Sn({},this.state.session),[4,this.endCurrentPageView()];case 1:return n.sent(),this.state.session=t,this.isSessionValid().isValid?[3,3]:(gt("Session became invalid during page transition, creating new session"),[4,this.createNewSession()]);case 2:return n.sent(),[2];case 3:return[4,this.initializePageView(e)];case 4:return n.sent(),gt("Page view transition complete",{session:this.state.session,newPage:this.state.page}),[2]}}))}))},c.prototype.endCurrentPageView=function(){return Tn(this,void 0,void 0,(function(){var e;return In(this,(function(t){try{gt("Ending current pageview",{currentSession:this.state.session,currentPage:this.state.page}),e=this.state.session.activeTimeInSeconds,this.stopPageTimeTracking(),this.clearPageViewStorage(),this.state.session.activeTimeInSeconds=e,this.saveActiveTime()}catch(e){yt("Error ending page view",e)}return[2]}))}))},c.prototype.initializePageView=function(e){return Tn(this,void 0,void 0,(function(){var t,n,timestamp;return In(this,(function(r){switch(r.label){case 0:return gt("Initializing page view",{currentSession:this.state.session,pageState:e,initialDataSent:this.initialDataSent}),"UNKNOWN - STATE"===this.state.page.id?[3,2]:[4,this.endCurrentPageView()];case 1:r.sent(),r.label=2;case 2:return this.state.session.id?[3,5]:(gt("Session state lost during page initialization, attempting recovery"),(t=this.loadStoredSession())&&this.isStoredSessionValid(t)?(this.state.session=t,[3,5]):[3,3]);case 3:return[4,this.createNewSession()];case 4:return r.sent(),[2];case 5:return n=P(),timestamp=L(),this.state.page=Sn({id:"pv_".concat(y()),startTime:n,startTimestamp:timestamp,lastActivityTime:n,activeTimeInSeconds:0,url:location.href,pathname:location.pathname,title:document.title,referrer:document.referrer,isValid:!0},e),this.persistPageViewState(),this.unifiedTimer||this.startUnifiedTimer(),this.publishContext(),gt("Page view initialized, initial data sending will be handled separately"),[2]}}))}))},c.prototype.persistPageViewState=function(){try{var t=o();e(Dt,this.state.page.id,90,{domain:t,path:"/",sameSite:"Lax"}),e(Wt,encodeURIComponent(this.state.page.startTimestamp),90,{domain:t,path:"/",sameSite:"Lax"}),localStorage.setItem(Dt,this.state.page.id),localStorage.setItem(Wt,this.state.page.startTimestamp),this.savePageViewTime()}catch(e){yt("Error persisting page view state",e)}},c.prototype.stopPageTimeTracking=function(){this.savePageViewTime()},c.prototype.savePageViewTime=function(){var e,t;try{if(!this.state.page.id)return;e="pageview_time_".concat(this.state.page.id),t="pageview_last_active_".concat(this.state.page.id),sessionStorage.setItem(e,this.state.page.activeTimeInSeconds.toString()),sessionStorage.setItem(t,this.state.page.lastActivityTime.toString()),gt("Page view time saved: ".concat(this.state.page.activeTimeInSeconds,"s"))}catch(e){yt("Error saving page view time",e)}},c.prototype.sendPageViewEvent=function(){return Tn(this,void 0,void 0,(function(){return In(this,(function(e){switch(e.label){case 0:return[4,Pn(null,"initial")];case 1:return[4,M(e.sent())];case 2:return e.sent(),[2]}}))}))},c.prototype.clearPageViewStorage=function(){var e=new Date(0).toUTCString(),t=o();document.cookie="".concat(Dt,"=; expires=").concat(e,"; path=/; SameSite=Lax; Secure"),document.cookie="".concat(Wt,"=; expires=").concat(e,"; path=/; SameSite=Lax; Secure"),t&&(document.cookie="".concat(Dt,"=; expires=").concat(e,"; path=/; domain=").concat(t,"; SameSite=Lax; Secure"),document.cookie="".concat(Wt,"=; expires=").concat(e,"; path=/; domain=").concat(t,"; SameSite=Lax; Secure")),localStorage.removeItem(Dt),localStorage.removeItem(Wt),sessionStorage.removeItem("pageview_time_".concat(this.state.page.id)),sessionStorage.removeItem("pageview_last_active_".concat(this.state.page.id))},c.prototype.cleanup=function(){try{gt("Starting StateManager cleanup"),this.clearAllIntervals(),A(),Ar(),"undefined"!=typeof window&&(window.removeEventListener("beforeunload",this.cleanupHandler),window.removeEventListener("unload",this.cleanupHandler),document.removeEventListener("submit",this.formSubmitHandler,!0)),this.clearPageViewStorage(),this.clearSessionStorage(),this.stopTracking(),Ee(),this.isTracking=!1,this.initialized=!1,this.isHandlingSessionOperation=!1,this.initialDataSent=!1,k().catch((function(e){return yt("Error clearing queued events during cleanup",e)})),gt("StateManager cleanup completed")}catch(e){yt("Error during StateManager cleanup",e)}},c.prototype.handleSessionTimeout=function(){return Tn(this,void 0,void 0,(function(){return In(this,(function(e){if(this.isHandlingSessionOperation)return gt("Session operation already in progress, skipping timeout handler"),[2];this.isHandlingSessionOperation=!0;try{gt("Session timeout triggered"),this.saveActiveTime(),Ee(),this.stopTracking(),this.state.session.isValid=!1}finally{this.isHandlingSessionOperation=!1}return[2]}))}))},c.prototype.refreshStateManually=function(){return Tn(this,void 0,void 0,(function(){return In(this,(function(e){switch(e.label){case 0:return gt("Manual state refresh requested"),[4,this.refreshState()];case 1:return e.sent(),[2]}}))}))},c.prototype.ensureInitialized=function(){return Tn(this,void 0,void 0,(function(){var e;return In(this,(function(t){switch(t.label){case 0:if(this.initialized)return[2];if(!this.isInitializing)return[3,3];e=0,t.label=1;case 1:return this.isInitializing&&e<50?[4,new Promise((function(e){return setTimeout(e,100)}))]:[3,3];case 2:return t.sent(),e++,[3,1];case 3:return this.initialized?[3,5]:[4,this.initialize()];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))},c.prototype.startUnifiedTimer=function(){var e,t,r,o=this;if(!this.unifiedTimer){if(e=P(),this.lastSaveTimestamp=this.lastSaveTimestamp||e,this.state.session.id){t="".concat(Rt,"_").concat(this.state.session.id);try{(r=sessionStorage.getItem(t))&&!isNaN(Number(r))&&(this.state.session.activeTimeInSeconds=Number(r))}catch(e){yt("Error loading saved active time",e)}}this.unifiedTimer=setInterval((function(){return Tn(o,void 0,void 0,(function(){var e,t,r,marketingTrackers,o,a,c,s,u;return In(this,(function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),this.isTracking?(e=this.isSessionValid(),t=e.reason,e.isValid?[3,3]:(gt("Session invalid during timer tick: ".concat(t)),t?[3,2]:[4,this.handleSessionEnd("manual")])):[2];case 1:l.sent(),l.label=2;case 2:return[2];case 3:if("visible"!==document.visibilityState)return[2];if(P()-this.lastUserActivityTs>6e4)return[2];if(this.state.session.activeTimeInSeconds=Math.min(this.state.session.activeTimeInSeconds+5,86400),this.state.page.activeTimeInSeconds=Math.min(this.state.page.activeTimeInSeconds+5,86400),r=P(),this.state.session.lastActivityTime=r,this.state.page.lastActivityTime=r,this.stateChanged=!0,this.unifiedTicks++,5e3*this.unifiedTicks>=288e5)return gt("Max timer runtime reached; restarting unified timer"),this.clearAllIntervals(),this.startUnifiedTimer(),[2];if(this.unifiedTicks%60==0)try{for(marketingTrackers=n(document.cookie).marketingTrackers,o=i(marketingTrackers),a=0,c=Object.entries(o);a<c.length;a++)this.state.parsedMarketingTrackers[(s=c[a])[0]]=this.sanitizeCookieData(s[1]);this.state.lastCookieUpdate=r}catch(e){yt("Unified timer marketing refresh error",e)}return this.unifiedTicks%180==0&&this.refreshState().catch((function(e){return yt("Unified timer state refresh error",e)})),this.unifiedTicks%4320==0&&this.cleanupOldStorage(),r-this.lastSaveTimestamp>=3e4&&(this.saveActiveTime(),this.savePageViewTime(),this.lastSaveTimestamp=r,this.stateChanged=!1),[3,5];case 4:return u=l.sent(),yt("Unified timer error",u),this.clearAllIntervals(),this.startUnifiedTimer(),[3,5];case 5:return[2]}}))}))}),5e3)}},c}(),_n=En.getInstance(),An=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Ln=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Pn=function(e,t){return An(void 0,void 0,void 0,(function(){var n,timestamp,r,events,i;return Ln(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,_n.ensureInitialized()];case 1:if(o.sent(),"UNKNOWN - STATE"===(n=_n.getState()).session.id)throw new Error("State not initialized - cannot build batch");return _n.isSessionValid().isValid||gt("buildUserBatch - Session is invalid, batch may be outdated"),timestamp=L(),r={sessionId:n.session.id,pageViewId:n.page.id,timestamp,activeTime:n.session.activeTimeInSeconds,pageActiveTime:n.page.activeTimeInSeconds},events=[],t?events.push({eventId:y(),eventType:t,time:L(),activeTime:n.page.activeTimeInSeconds,timeout:!1}):e&&events.push(e),[2,{clientId:n.clientId,userId:n.userId,visitorId:n.visitorId,fingerprint:n.fingerprint,timestamp:r.timestamp,eventType:t||(null==e?void 0:e.eventType)||"heartbeat",isBot:!1,session:{sessionId:r.sessionId,start:n.session.startTimestamp,referrer:n.page.referrer,cookies:n.parsedCookies,marketingTrackers:n.parsedMarketingTrackers,activeTime:r.activeTime,lastActivityTime:n.session.lastActivityTime,location:n.location,consentGranted:null===n.cookieConsent?void 0:n.cookieConsent,pageView:{pageViewId:r.pageViewId,activeTime:r.pageActiveTime,lastActivityTime:n.page.lastActivityTime,url:n.page.url,pathname:n.page.pathname,title:n.page.title,start:n.page.startTimestamp,events}}}];case 2:throw i=o.sent(),yt("Error in buildUserBatch",i),i;case 3:return[2]}}))}))},Cn=function(){return Cn=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Cn.apply(this,arguments)},xn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Mn=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},On=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Nn=10,Rn=new rn({failureThreshold:5,resetTimeout:3e4,monitorInterval:6e4}),Dn=function(){var e="https://p2r15l59b8.execute-api.us-east-2.amazonaws.com/prod/push";return gt("Using fallback endpoint:",e),e},Wn=null,jn=0,Hn=Math.max(1,3),Fn=T((function(){return xn(void 0,void 0,void 0,(function(){var e,t,n,r,i,o,a,c,s,u,l,d;return Mn(this,(function(f){switch(f.label){case 0:if(!Rn.isAllowed())return gt("Circuit breaker preventing send"),[2];f.label=1;case 1:if(f.trys.push([1,6,,7]),!(e=H()).length)return[2];if(t=Date.now(),n=t-jn>=1e4,!(e.length>=Hn||n))return r=Math.max(100,1e4-(t-jn)),gt("Delaying send: thresholds not met",{remaining:r,queued:e.length}),null==Wn&&(Wn=setTimeout((function(){Wn=null,Fn()}),Math.max(100,r))),[2];i=function(e,t){var n,r,i,o,a,c,s,u,l,sessionId,pageViewId,d,f,h,m=new Map;for(s=0,u=e;s<u.length;s++)sessionId=(null===(n=(l=u[s]).session)||void 0===n?void 0:n.sessionId)||(null===(r=l.session)||void 0===r?void 0:r.id)||"unknown",pageViewId=(null===(o=null===(i=l.session)||void 0===i?void 0:i.pageView)||void 0===o?void 0:o.pageViewId)||(null===(c=null===(a=l.session)||void 0===a?void 0:a.pageView)||void 0===c?void 0:c.id)||"unknown",d="".concat(l.clientId,"|").concat(sessionId,"|").concat(pageViewId),(f=m.get(d))?f.push(l):m.set(d,[l]);return h=[],m.forEach((function(e){var n,r,i,o,a,c,s,u,l,d,f,m,p;for(e.sort((function(e,t){return e.queuedAt-t.queuedAt})),c=0;c<e.length;){for(u=Cn(Cn({},s=e[c]),{id:"".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2)),queuedAt:[s.queuedAt]}),l=Array.isArray(null===(r=null===(n=s.session)||void 0===n?void 0:n.pageView)||void 0===r?void 0:r.events)?On([],s.session.pageView.events,!0):[],(null===(i=u.session)||void 0===i?void 0:i.pageView)||(u.session=u.session||{},u.session.pageView=u.session.pageView||{events:[]}),u.session.pageView.events=l,d=[s.id],f=u.session.pageView.events.length,c++;c<e.length&&f<t;)m=e[c],p=Array.isArray(null===(a=null===(o=m.session)||void 0===o?void 0:o.pageView)||void 0===a?void 0:a.events)?m.session.pageView.events:[],u.session.pageView.events=On(On([],u.session.pageView.events,!0),p,!0).slice(0,t),d.push(m.id),u.queuedAt.push(m.queuedAt),f=u.session.pageView.events.length,c++;h.push({merged:u,sourceIds:d})}})),h}(e,Hn),o=0,a=i,f.label=2;case 2:return o<a.length?(s=(c=a[o]).sourceIds,[4,z(c.merged)]):[3,5];case 3:if(!f.sent())return Rn.recordFailure(),[3,5];for(u=0,l=s;u<l.length;u++)F(l[u]);Rn.recordSuccess(),jn=Date.now(),f.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return d=f.sent(),yt("Error in debouncedSendBatches",d),Rn.recordFailure(),[3,7];case 7:return[2]}}))}))}),200),zn=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Un={hubspot:{name:"HubSpot",trigger:function(url){return url.includes("hsforms.com")||url.includes("forms.hubspot.com")||null!==document.querySelector(".hs-form, form[data-hs-cf-bound], .hbspt-form")},selectors:[".hs-form","form[data-hs-cf-bound]","form[data-form-id]",".hbspt-form"],events:["hsFormCallback","message"],submitPatterns:["/hsforms.com/submissions/","/forms.hubspot.com/"],active:!1},gravity:{name:"Gravity Forms",trigger:function(url){return url.includes("admin-ajax.php")||null!==document.querySelector(".gform_wrapper, #gform_1, [data-formid]")},selectors:[".gform_wrapper form","#gform_1, #gform_2, #gform_3, #gform_4, #gform_5, #gform_6, #gform_7, #gform_8, #gform_9","form[data-formid]",".gform_body"],events:["gform_confirmation_loaded","gform_post_render"],submitPatterns:["/wp-admin/admin-ajax.php"],active:!1},contactform7:{name:"Contact Form 7",trigger:function(url){return null!==document.querySelector(".wpcf7-form")},selectors:[".wpcf7-form","form.wpcf7-form"],events:["wpcf7submit","wpcf7mailsent"],submitPatterns:["/wp-json/contact-form-7/"],active:!1},typeform:{name:"Typeform",trigger:function(url){return url.includes("typeform.com")||null!==document.querySelector("[data-tf-widget]")},selectors:["[data-tf-widget]",".typeform-embed",'iframe[src*="typeform.com"]'],events:["tf-widget-loaded"],submitPatterns:["/forms/","typeform.com"],active:!1},mailchimp:{name:"Mailchimp",trigger:function(url){return url.includes("mailchimp.com")||null!==document.querySelector(".mc-embedded-subscribe-form")},selectors:[".mc-embedded-subscribe-form",'form[action*="mailchimp.com"]'],events:[],submitPatterns:["/subscribe/post"],active:!1},formstack:{name:"Formstack",trigger:function(url){return url.includes("formstack.com")||null!==document.querySelector(".fsForm")},selectors:[".fsForm",'form[action*="formstack.com"]'],events:[],submitPatterns:["/forms/"],active:!1},jotform:{name:"JotForm",trigger:function(url){return url.includes("jotform.com")||null!==document.querySelector(".jotform-form")},selectors:[".jotform-form",'form[action*="jotform.com"]'],events:[],submitPatterns:["/submit/"],active:!1},ninjaforms:{name:"Ninja Forms",trigger:function(url){return null!==document.querySelector(".ninja-forms-form")},selectors:[".ninja-forms-form",".nf-form-cont form"],events:["nfFormReady","nfFormSubmitResponse","nfFormSubmitted"],submitPatterns:["/wp-admin/admin-ajax.php"],active:!1},wpforms:{name:"WPForms",trigger:function(url){return null!==document.querySelector(".wpforms-form")},selectors:[".wpforms-form","form.wpforms-form"],events:["wpformsFormSubmitSuccess","wpformsAjaxSubmit","wpforms_submit_success"],submitPatterns:["/wp-admin/admin-ajax.php"],active:!1},elementor:{name:"Elementor Forms",trigger:function(url){return null!==document.querySelector(".elementor-form")},selectors:[".elementor-form","form.elementor-form"],events:["form_submit_success"],submitPatterns:["/wp-admin/admin-ajax.php"],active:!1},gohighlevel:{name:"Go High Level",trigger:function(e){return null!==document.querySelector(".ghl-form-wrap, .form-builder--wrap, #_builder-form, .hl_form-builder--main, .c-form")},selectors:[".ghl-form-wrap input, .ghl-form-wrap form",".form-builder--wrap input, .form-builder--wrap form","#_builder-form input, #_builder-form form",".hl_form-builder--main input, .hl_form-builder--main form",".c-form input, .c-form form"],events:[],submitPatterns:["leadconnector","gohighlevel","/funnels/","/forms/"],active:!1}},Vn=1e3,qn=new Map,Bn=new Map,Gn=new Set(["email","phone","firstname","first_name","lastname","last_name","name","company","subject","message"]),Kn=function(){return Kn=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kn.apply(this,arguments)},Xn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Yn=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Jn=new Set,$n=3e4,Zn={inProgress:!1,completed:!1,lastAttemptAt:0},Qn="__cstWrapped",er="__cstOriginal",tr=new Set(["booking.scheduled","appointment.scheduled","meeting.scheduled","appointment booked","appointment.confirmed","booking_confirmed","booking.succeeded"]),nr=new Set(["calendar.view","view","load","impression"]),rr=["contact","customer","email","phone","first_name","firstname","last_name","lastname"],ir={MAX_FIELD_LENGTH:1e3,MAX_FORM_FIELDS:50,DEDUPLICATION_WINDOW:1e3,DISALLOWED_FIELD_TYPES:["file","password","image","video"],CONFIDENCE_THRESHOLD:.7,MAX_LEARNED_PATTERNS:100},or=new WeakMap,ar=0,cr=1e3,sr=2e3,ur=0,lr=ir.DEDUPLICATION_WINDOW,dr=new Map,fr=new Map,hr=new Set,mr=new Set,pr=new Map,vr={formsFound:0,formsSubmitted:0,buttonSubmissions:0,formsMissed:0,universalSuccess:0,providerSuccess:0,providerTriggers:{},errors:[],duplicatesBlocked:0},gr=1e3,yr=new Map,"undefined"!=typeof window&&(window.__cstFormMetrics=vr),br=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},wr=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Sr=null,Tr=1e4,Ir=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},kr=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Er=null,_r=function(){Er=function(){(function(){return Ir(this,void 0,void 0,(function(){var e,t;return kr(this,(function(n){switch(n.label){case 0:return n.trys.push([0,8,,9]),e="visible"===document.visibilityState,gt("Visibility changed to: ".concat(e?"visible":"hidden")),e?[3,2]:(gt("Tab hidden, pausing tracking"),_n.pauseTracking(),Ee(),[4,k()]);case 1:return n.sent(),[3,7];case 2:return[4,_n.isSessionValid()];case 3:return n.sent().isValid?(gt("Session valid, resuming tracking"),_n.resumeTracking(),ke(),[3,6]):[3,4];case 4:return gt("Session invalid, creating new session"),[4,_n.handleSessionTimeout()];case 5:n.sent(),n.label=6;case 6:_n.updateActivity(),n.label=7;case 7:return[3,9];case 8:return t=n.sent(),yt("Error handling visibility change",t),[3,9];case 9:return[2]}}))}))})().catch((function(e){return yt("Visibility handler error",e)}))},document.addEventListener("visibilitychange",Er,{passive:!0})},Ar=function(){Er&&(document.removeEventListener("visibilitychange",Er),Er=null)},Pr=(Lr=function(){return Lr=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lr.apply(this,arguments)})({},Bt),Cr=null,xr=0,Or=(Mr=function(){return Mr=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Mr.apply(this,arguments)})({},{clickTrackingMode:"standard",autoEnhanceClicks:!0,alwaysIncludeClasses:!1,includeDataAnlInStandard:!1}),Nr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Rr=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Dr=!1,Wr=null,jr=null,Hr=new WeakSet,Fr=new Map,zr=function(element){try{if("true"===element.getAttribute("data-cst-video-tracked"))return;element.setAttribute("data-cst-video-tracked","true");var e=element.getAttribute("data-video-id")||y();element.setAttribute("data-video-id",e),gt("Initializing HTML video tracking",{videoId:e,src:element.currentSrc||element.src,duration:element.duration}),Fr.has(e)||Fr.set(e,{lastPlayTime:element.currentTime,furthestWatchTime:0,watchTime:0,intervalsReported:new Set,lastRealTimestamp:void 0}),element.addEventListener("play",(function(){var t,watchPercentage,furthestWatchPercentage,n=Fr.get(e);n&&(t=Date.now(),n.lastPlayTime=element.currentTime,n.lastRealTimestamp=t,watchPercentage=Math.floor(n.watchTime/element.duration*100),furthestWatchPercentage=Math.floor(n.furthestWatchTime/element.duration*100),gt("HTML Video play event",{videoId:e,currentTime:element.currentTime,watchTime:n.watchTime,watchPercentage,furthestWatchTime:n.furthestWatchTime,furthestWatchPercentage}),De({element,eventType:"videoPlay",platform:"HTML5",videoId:element.getAttribute("data-video-id")||e,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(n.watchTime),furthestWatchTime:Math.floor(n.furthestWatchTime),src:element.currentSrc||element.src}),n.intervalId&&clearInterval(n.intervalId),n.intervalId=setInterval((function(){var t,r,i,o;element.paused||element.ended?n.intervalId&&(clearInterval(n.intervalId),n.intervalId=void 0):(t=Date.now(),n.lastRealTimestamp&&(n.watchTime+=(t-n.lastRealTimestamp)/1e3),n.lastRealTimestamp=t,element.currentTime>n.furthestWatchTime&&(n.furthestWatchTime=element.currentTime),r=Math.floor(n.watchTime/element.duration*100),i=Math.floor(n.furthestWatchTime/element.duration*100),(o=10*Math.floor(i/10))>0&&!n.intervalsReported.has(o)&&(n.intervalsReported.add(o),gt("HTML Video ".concat(e,": ").concat(o,"% position reached. Actually watched: ").concat(r,"%")),De({element,eventType:"videoProgress",platform:"HTML5",videoId:element.getAttribute("data-video-id")||e,watchPercentage:r,furthestWatchPercentage:i,watchTime:Math.floor(n.watchTime),furthestWatchTime:Math.floor(n.furthestWatchTime),src:element.currentSrc||element.src})))}),1e3))})),element.addEventListener("pause",(function(){var t,watchPercentage,furthestWatchPercentage,n=Fr.get(e);n&&(n.lastRealTimestamp&&(t=Date.now(),n.watchTime+=(t-n.lastRealTimestamp)/1e3,n.lastRealTimestamp=void 0),element.currentTime>n.furthestWatchTime&&(n.furthestWatchTime=element.currentTime),watchPercentage=Math.floor(n.watchTime/element.duration*100),furthestWatchPercentage=Math.floor(n.furthestWatchTime/element.duration*100),gt("HTML Video pause event",{videoId:e,currentTime:element.currentTime,watchTime:n.watchTime,watchPercentage,furthestWatchTime:n.furthestWatchTime,furthestWatchPercentage}),n.intervalId&&(clearInterval(n.intervalId),n.intervalId=void 0),De({element,eventType:"videoPause",platform:"HTML5",videoId:element.getAttribute("data-video-id")||e,watchPercentage,furthestWatchPercentage,watchTime:Math.floor(n.watchTime),furthestWatchTime:Math.floor(n.furthestWatchTime),src:element.currentSrc||element.src}))})),element.addEventListener("ended",(function(){var t,watchPercentage,n=Fr.get(e);n&&(n.lastRealTimestamp&&(t=Date.now(),n.watchTime+=(t-n.lastRealTimestamp)/1e3,n.lastRealTimestamp=void 0),n.furthestWatchTime=element.duration,watchPercentage=Math.floor(n.watchTime/element.duration*100),gt("HTML Video ended event",{videoId:e,duration:element.duration,watchTime:n.watchTime,watchPercentage}),n.intervalId&&(clearInterval(n.intervalId),n.intervalId=void 0),De({element,eventType:"videoEnded",platform:"HTML5",videoId:element.getAttribute("data-video-id")||e,watchPercentage,furthestWatchPercentage:100,watchTime:Math.floor(n.watchTime),furthestWatchTime:Math.floor(element.duration),src:element.currentSrc||element.src}))}))}catch(e){yt("Error tracking HTML video",e)}},Ur=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Vr=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},qr="https://player.vimeo.com/api/player.js",Br=null,Gr=new Map,Kr=new Map,Xr=new Set,Yr=new Map,Jr=new Set,$r=!1,Zr=null,Qr=!1,ei=!1,ti=null,ni=function(){return ei},ri=function(){var tag,e;Qr||((tag=document.createElement("script")).src="https://www.youtube.com/iframe_api",tag.async=!0,tag.onload=function(){gt("YouTube API script loaded")},tag.onerror=function(){yt("Failed to load YouTube API script"),Qr=!1,ei=!1,setTimeout(ri,1e3)},(null==(e=document.getElementsByTagName("script")[0])?void 0:e.parentNode)&&(e.parentNode.insertBefore(tag,e),gt("YouTube API script loading"),Qr=!0))},ii=function(){return!(!window.YT||!window.YT.Player||(ei=!0,gt("YouTube API loaded successfully"),Ze(!0),ti&&(clearInterval(ti),ti=null),0))},oi=function(){ti||(ti=setInterval((function(){document.querySelectorAll('iframe[src*="youtube.com/embed/"]').length>0&&(ei||(Qr||ri(),ii()))}),2e3))},window.onYouTubeIframeAPIReady=function(){ii()},ai=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},ci=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},si=new Map,ui=20,li=100,di=null,fi=function(e){var t,n,r;try{return(t=e).id=t.id||"yt-".concat(y()),n=new URL(t.src),r={enablejsapi:"1",origin:window.location.origin,widget_referrer:window.location.href},Object.entries(r).forEach((function(e){var t=e[0],value=e[1];n.searchParams.get(t)!==value&&n.searchParams.set(t,value)})),t.src=n.toString(),gt("youtube iframe configured:",{id:t.id,src:t.src}),t}catch(t){return yt("Error adding ID and enablejsapi to YouTube iframe",t),e}},hi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},mi=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},pi=null,vi=null,gi=!1,yi=null,bi=null,wi=null,Si=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Ti=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Ii=["[role='option']","li[role='option']","[aria-selected]","[data-value]",".multiselect__option",".select2-results__option",".MuiAutocomplete-option",".rc-select-item-option"].join(", "),ki=["[role='combobox']","[role='listbox']","[aria-haspopup='listbox']",".multiselect",".select2",".MuiAutocomplete-root",".rc-select"].join(", "),Ei=!1,_i=null,Ai=null,Li=function(){return Li=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Li.apply(this,arguments)},Pi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Ci=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},xi=10,Mi=null,Oi=location.href,Ni="__cstSpaHistoryWrapped",Ri=T((function(){try{Te()}catch(e){yt("Error in debounced enhanced form rescan",e)}}),100),Di=T((function(e){try{var t={depth:0,processedNodes:new Set,startTime:performance.now()};if(location.href!==Oi)return void ct();!function(e,t){var n,r,i;if(performance.now()-t.startTime>100)gt("Mutation processing time limit exceeded");else if(t.depth>=xi)gt("Maximum mutation depth reached");else for(n=0,r=e;n<r.length;n++)"childList"===(i=r[n]).type&&Array.from(i.addedNodes).forEach((function(e){t.processedNodes.has(e)||(t.processedNodes.add(e),t.processedNodes.size>100?gt("Maximum nodes per mutation reached"):e instanceof HTMLElement&&at(e,t))}))}(e,t)}catch(e){yt("Error in mutation observer callback",e)}}),100),Wi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},ji=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Hi=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Fi=function(){function e(){}return e.detectUserAgent=function(){var e=[],t=navigator.userAgent;return t?this.UA_PATTERNS.some((function(e){return e.test(t)}))&&e.push("suspicious_user_agent"):e.push("missing_user_agent"),e},e.detectNavigatorProps=function(){var e=[];return navigator.languages&&navigator.platform||e.push("missing_navigator_info"),e},e.detectAutomationGlobals=function(){var e,t,n,r=[],i=window;for(e=0,t=Array.from(this.AUTOMATION_PROPERTIES);e<t.length;e++)((n=t[e])in i||n in document)&&r.push("automation_global:".concat(n));return r},e.detectWebDriver=function(){return navigator.webdriver?["navigator_webdriver"]:[]},e.detectBrowserFeatures=function(){var e,t,n,r,i=[];try{void 0!==window.localStorage&&void 0!==window.sessionStorage||i.push("no_storage"),(t=(e=document.createElement("canvas")).getContext("webgl")||e.getContext("experimental-webgl"))&&(r=(n=t.getExtension("WEBGL_debug_renderer_info"))?t.getParameter(n.UNMASKED_RENDERER_WEBGL):"",/Headless|SwiftShader/i.test(r)&&i.push("headless_renderer")),0===(window.outerWidth||window.outerHeight)&&i.push("zero_window_size")}catch(e){gt("Browser feature check error",e),i.push("feature_check_error")}return i},e.detectPermissions=function(){return Wi(this,void 0,void 0,(function(){var e,t,n;return ji(this,(function(r){switch(r.label){case 0:if(e=[],!navigator.permissions)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,navigator.permissions.query({name:"notifications"})];case 2:return t=r.sent(),"denied"===Notification.permission&&"prompt"===t.state&&e.push("notif_permission_mismatch"),[3,4];case 3:return n=r.sent(),gt("Permissions check error",n),[3,4];case 4:return[2,e]}}))}))},e.detect=function(){return Wi(this,void 0,void 0,(function(){var e,t,n,r,i;return ji(this,(function(o){switch(o.label){case 0:return t=[Hi(Hi(Hi(Hi(Hi([],this.detectUserAgent(),!0),this.detectNavigatorProps(),!0),this.detectAutomationGlobals(),!0),this.detectWebDriver(),!0),this.detectBrowserFeatures(),!0)],[4,this.detectPermissions()];case 1:return e=Hi.apply(void 0,t.concat([o.sent(),!0])),n=Math.min(e.length*this.SIGNAL_WEIGHT,this.MAX_CONFIDENCE),i=(r=e.length>=this.MIN_SIGNALS_FOR_BOT)?this.getBotType(e):void 0,[2,{isBot:r,confidence:n,signals:e,botType:i}]}}))}))},e.getBotType=function(e){return e.some((function(e){return e.startsWith("automation_global")||"navigator_webdriver"===e}))?"AUTOMATION":e.includes("suspicious_user_agent")?"CRAWLER":e.includes("headless_renderer")?"HEADLESS":"UNKNOWN"},e.UA_PATTERNS=[/\b(bot|crawler|spider|crawl)\b/i,/HeadlessChrome/i,/PhantomJS/i,/Selenium/i,/puppeteer/i,/chrome\-lighthouse/i,/Googlebot/i,/Bingbot/i,/YandexBot/i,/Baiduspider/i,/FacebookExternalHit/i,/Twitterbot/i,/Applebot/i,/AhrefsBot/i],e.AUTOMATION_PROPERTIES=new Set(["webdriver","_phantom","__nightmare","__selenium_evaluate","__webdriver_script_fn","__fxdriver_evaluate","__driver_evaluate","callPhantom","ChromeDriver"]),e.MIN_SIGNALS_FOR_BOT=2,e.MAX_CONFIDENCE=1,e.SIGNAL_WEIGHT=.33,e}(),zi=function(){return zi=Object.assign||function(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zi.apply(this,arguments)},Ui=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Vi=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},qi=!1,Bi=[],Gi=[],Ki=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Xi=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},Yi=!1,Ji=0,$i=2e3,Zi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(value){try{s(r.next(value))}catch(e){o(e)}}function c(value){try{s(r.throw(value))}catch(e){o(e)}}function s(e){var value;e.done?i(e.value):(value=e.value,value instanceof n?value:new n((function(e){e(value)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},Qi=function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,n[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=n(0),c.throw=n(1),c.return=n(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},eo=!1,window.CST_VERSION="1.1.10 frm",console.log("CST version: 1.1.10 frm");try{"undefined"!=typeof window&&((to=window).__KLEERR_PIXEL_ENDPOINT||(to.__KLEERR_PIXEL_ENDPOINT=At))}catch(e){yt("Failed to seed pixel endpoint",e)}CSTExport={initialize},"undefined"!=typeof window&&"test"!=="production".toLowerCase()&&((to=window).KLRR_CSTM_FX||(to.KLRR_CSTM_FX=CSTExport,gt("KLRR_CST_FX] Global set: window.KLRR_CSTM_FX")),to.KLRR_CST_FX||(to.KLRR_CST_FX=to.KLRR_CSTM_FX,gt("KLRR_CST_FX] Back-compat: window.KLRR_CST_FX → window.KLRR_CSTM_FX")),to.CST?gt("KLRR_CST_FX] window.CST already defined; keeping existing alias"):(to.CST=to.KLRR_CSTM_FX,gt("KLRR_CST_FX] Back-compat: window.CST → window.KLRR_CSTM_FX")),gt("CST attempting auto-initialization"),initialize().catch((function(e){console.error("CST initialization failed:",e)})));const mo=CSTExport;return pt.default})(),"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CST=e():this.CST=e();