@v-tilt/browser 1.10.8 → 1.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t,e=null==i?void 0:i.navigator,n=null==i?void 0:i.document,r=null==i?void 0:i.location,s=null==i?void 0:i.fetch,o=(null==i?void 0:i.XMLHttpRequest)&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0;null==i||i.AbortController;var a=null==e?void 0:e.userAgent,l=null!=t?t:{},h="[ExternalScriptsLoader]";function d(t,i,e,n,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(n,r)}function u(t){return function(){var i=this,e=arguments;return new Promise(function(n,r){var s=t.apply(i,e);function o(t){d(s,n,r,o,a,"next",t)}function a(t){d(s,n,r,o,a,"throw",t)}o(void 0)})}}function v(){return v=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},v.apply(null,arguments)}l.__VTiltExtensions__=l.__VTiltExtensions__||{},l.__VTiltExtensions__.loadExternalDependency=(t,i,e)=>{var r=((t,i)=>{var e=t.getConfig();return e.script_host?e.script_host.replace(/\/+$/gm,"")+"/"+i+".js":e.api_host?e.api_host.replace(/\/+$/gm,"")+"/dist/"+i+".js":(console.error(h+" Cannot load "+i+".js: api_host is required"),"")})(t,i);((t,i,e)=>{if(t.getConfig().disable_external_dependency_loading)return console.warn(h+" "+i+" was requested but loading of external scripts is disabled."),e("Loading of external scripts is disabled");var r=null==n?void 0:n.querySelectorAll("script");if(r)for(var s,o=function(){if(r[a].src===i){var t=r[a];return t.__vtilt_loading_callback_fired?{v:e()}:(t.addEventListener("load",i=>{t.__vtilt_loading_callback_fired=!0,e(void 0,i)}),t.onerror=t=>e(t),{v:void 0})}},a=0;a<r.length;a++)if(s=o())return s.v;var l=()=>{var t;if(!n)return e("document not found");var r=n.createElement("script");r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=t=>{r.__vtilt_loading_callback_fired=!0,e(void 0,t)},r.onerror=t=>e(t);var s=n.querySelectorAll("body > script");s.length>0?null===(t=s[0].parentNode)||void 0===t||t.insertBefore(r,s[0]):n.body.appendChild(r)};(null==n?void 0:n.body)?l():null==n||n.addEventListener("DOMContentLoaded",l)})(t,r,e)};var c="1.10.8",f="__vt_session",p="__vt_window_id",g="__vt_primary_window",m="__vt_user_state",b="__vt_device_id",y="__vt_anonymous_id",_="__vt_remote_config",w="__vt_distinct_id",x="__vt_user_properties",k="localStorage",S="localStorage+cookie",C="sessionStorage",E="memory",T="$initial_person_info";class I{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!document.currentScript)return v({token:t.token||""},t);var i=document.currentScript,e=v({token:""},t);e.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,e.script_host=i.getAttribute("data-script-host")||t.script_host,e.proxy=i.getAttribute("data-proxy")||t.proxy,e.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,e.token=i.getAttribute("data-token")||t.token||"",e.domain=i.getAttribute("data-domain")||t.domain,e.storage=i.getAttribute("data-storage")||t.storage,e.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");if(e.capture_performance=!!n||t.capture_performance,e.proxy&&e.proxyUrl)throw console.error("Error: Both data-proxy and data-proxy-url are specified. Please use only one of them."),new Error("Both data-proxy and data-proxy-url are specified. Please use only one of them.");for(var r of(e.globalAttributes=v({},t.globalAttributes),Array.from(i.attributes)))r.name.startsWith("data-vt-")&&(e.globalAttributes[r.name.slice(8).replace(/-/g,"_")]=r.value);return e}getConfig(){return v({},this.config)}updateConfig(t){this.config=v({},this.config,t)}}function M(t,i){try{return t()}catch(t){return i}}class R{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,n;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in event listener for "'+t+'":',i)}});var r=this.m.get(t);r&&(r.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(n=this.o.get("*"))||void 0===n||n.forEach(e=>{try{e({event:t,payload:i})}catch(t){console.error("[vTilt] Error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,n,r;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(r=null===(n=this.m.get(t))||void 0===n?void 0:n.size)&&void 0!==r?r:0)}hasListeners(t){return this.listenerCount(t)>0}}var A="sdk:initialized",O="sdk:config_updated",P="sdk:remote_config_loaded",L="feature:started",U="feature:stopped",D="event:captured",z="recording:started",j="recording:stopped",B="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function N(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),n="";n.length<t;)for(var r=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&n.length<t;s++){var o=r[s]&i;o<57&&(n+=B[o])}return n}function F(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function q(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,n)=>{i.call(e,t,n)});else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.call(e,t[n],n)}function V(t,i,e,n){var{capture:r=!1,passive:s=!0}=null!=n?n:{};null==t||t.addEventListener(i,e,{capture:r,passive:s})}function W(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function H(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];for(var r of e)for(var s of r)t.push(s);return t}var J=[y,b,w,m],X=31536e3,K=["herokuapp.com","vercel.app","netlify.app"];function G(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var n=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return n?"."+n[0]:""}class Z{constructor(t){var i,e,n;this.memoryStorage=new Map,this.k=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!K.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(n=t.secure)&&void 0!==n?n:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.k)return this.k;if(void 0===t||!t.localStorage)return this.k=!1,!1;try{var i="__vt_ls_test__";t.localStorage.setItem(i,"1");var e="1"===t.localStorage.getItem(i);return t.localStorage.removeItem(i),this.k=e,e||console.warn("[vTilt] localStorage unavailable, using cookies"),e}catch(t){return this.k=!1,console.warn("[vTilt] localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return J.includes(t)}get(t){var i;try{switch(this.method){case E:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case S:return this.getLocalStoragePlusCookie(t);case k:return this.getLocalStorage(t);case C:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return console.warn('[vTilt] Storage get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case E:this.memoryStorage.set(t,i);break;case S:this.setLocalStoragePlusCookie(t,i,e);break;case k:this.setLocalStorage(t,i);break;case C:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:X)}}catch(i){console.warn('[vTilt] Storage set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case E:this.memoryStorage.delete(t);break;case S:this.removeLocalStoragePlusCookie(t);break;case k:this.removeLocalStorage(t);break;case C:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){console.warn('[vTilt] Storage remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(i){if(this.isCriticalProperty(i)){var e=this.getCookie(i),n=this.getLocalStorage(i);if(null!==e){if(n!==e&&this.isLocalStorageSupported())try{null==t||t.localStorage.setItem(i,e)}catch(t){}return e}return n}return this.getLocalStorage(i)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&this.setCookie(t,i,null!=e?e:X)}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&this.removeCookie(t)}getLocalStorage(i){var e;if(!this.isLocalStorageSupported())return null;try{return null!==(e=null==t?void 0:t.localStorage.getItem(i))&&void 0!==e?e:null}catch(t){return null}}setLocalStorage(i,e){if(this.isLocalStorageSupported())try{null==t||t.localStorage.setItem(i,e)}catch(t){console.warn("[vTilt] localStorage write error:",t)}}removeLocalStorage(i){if(this.isLocalStorageSupported())try{null==t||t.localStorage.removeItem(i)}catch(t){}}readFromSessionStorage(i){var e;try{return null!==(e=null==t?void 0:t.sessionStorage.getItem(i))&&void 0!==e?e:null}catch(t){return null}}writeToSessionStorage(i,e){try{null==t||t.sessionStorage.setItem(i,e)}catch(t){console.warn("[vTilt] sessionStorage write error:",t)}}removeFromSessionStorage(i){try{null==t||t.sessionStorage.removeItem(i)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var n=e.trim();if(n.startsWith(i))try{return decodeURIComponent(n.slice(i.length))}catch(t){return n.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var n=G(this.cross_subdomain),r=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(r+="; Secure"),n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=G(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,e){var n=v({value:i},e?{expiry:Date.now()+e}:{});this.set(t,JSON.stringify(n))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===t||!(null==t?void 0:t.sessionStorage))return!1;try{var i="__vt_ss_test__";return t.sessionStorage.setItem(i,"1"),t.sessionStorage.removeItem(i),!0}catch(t){return!1}}getSessionStorage(){var i;return this.canUseSessionStorage()&&null!==(i=null==t?void 0:t.sessionStorage)&&void 0!==i?i:null}setMethod(t){this.method=t}getMethod(){return this.method}}class Q{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.S=void 0,this.C()}getSessionId(){var t=this.T();return t||(t=N(16),this.$(t)),t}setSessionId(){var t=this.T()||N(16);return this.$(t),t}resetSessionId(){this.I(),this.setSessionId(),this.M(N(16))}T(){return this.storage.get(f)}$(t){this.storage.set(f,t,1800)}I(){this.storage.remove(f)}getWindowId(){if(this.S)return this.S;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(p);if(i)return this.S=i,i}var e=N(16);return this.M(e),e}M(t){if(t!==this.S){this.S=t;var i=this.storage.getSessionStorage();i&&i.setItem(p,t)}}C(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(g),e=t.getItem(p);e&&!i?this.S=e:(e&&t.removeItem(p),this.M(N(16))),t.setItem(g,"true"),this.R()}else this.S=N(16)}R(){var i=this.storage.getSessionStorage();t&&i&&V(t,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(g)},{capture:!1})}updateStorageMethod(t,i){this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Y(t){if(!n)return null;var i=n.createElement("a");return i.href=t,i}function tt(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<e.length;n++){var r=e[n].split("=");if(r[0]===i){if(r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function it(t,i,e){if(!t||!i||!i.length)return t;for(var n=t.split("#"),r=n[0]||"",s=n[1],o=r.split("?"),a=o[1],l=o[0],h=(a||"").split("&"),d=[],u=0;u<h.length;u++){var v=h[u].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?d.push(c+"="+e):c&&d.push(c+(f?"="+f:""))}var p=d.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}function et(t){return"function"==typeof t}var nt="Mobile",rt="iOS",st="Android",ot="Tablet",at=st+" "+ot,lt="iPad",ht="Apple",dt=ht+" Watch",ut="Safari",vt="BlackBerry",ct="Samsung",ft=ct+"Browser",pt=ct+" Internet",gt="Chrome",mt=gt+" OS",bt=gt+" "+rt,yt="Internet Explorer",_t=yt+" "+nt,wt="Opera",xt=wt+" Mini",kt="Edge",St="Microsoft "+kt,Ct="Firefox",Et=Ct+" "+rt,Tt="Nintendo",$t="PlayStation",It="Xbox",Mt=st+" "+nt,Rt=nt+" "+ut,At="Windows",Ot=At+" Phone",Pt="Nokia",Lt="Ouya",Ut="Generic",Dt=Ut+" "+nt.toLowerCase(),zt=Ut+" "+ot.toLowerCase(),jt="Konqueror",Bt="(\\d+(\\.\\d+)?)",Nt=new RegExp("Version/"+Bt),Ft=new RegExp(It,"i"),qt=new RegExp($t+" \\w+","i"),Vt=new RegExp(Tt+" \\w+","i"),Wt=new RegExp(vt+"|PlayBook|BB10","i"),Ht={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function Jt(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Xt=(t,i)=>i&&Jt(i,ht)||function(t){return Jt(t,ut)&&!Jt(t,gt)&&!Jt(t,st)}(t),Kt=function(t,i){return i=i||"",Jt(t," OPR/")&&Jt(t,"Mini")?xt:Jt(t," OPR/")?wt:Wt.test(t)?vt:Jt(t,"IE"+nt)||Jt(t,"WPDesktop")?_t:Jt(t,ft)?pt:Jt(t,kt)||Jt(t,"Edg/")?St:Jt(t,"FBIOS")?"Facebook "+nt:Jt(t,"UCWEB")||Jt(t,"UCBrowser")?"UC Browser":Jt(t,"CriOS")?bt:Jt(t,"CrMo")||Jt(t,gt)?gt:Jt(t,st)&&Jt(t,ut)?Mt:Jt(t,"FxiOS")?Et:Jt(t.toLowerCase(),jt.toLowerCase())?jt:Xt(t,i)?Jt(t,nt)?Rt:ut:Jt(t,Ct)?Ct:Jt(t,"MSIE")||Jt(t,"Trident/")?yt:Jt(t,"Gecko")?Ct:""},Gt={[_t]:[new RegExp("rv:"+Bt)],[St]:[new RegExp(kt+"?\\/"+Bt)],[gt]:[new RegExp("("+gt+"|CrMo)\\/"+Bt)],[bt]:[new RegExp("CriOS\\/"+Bt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Bt)],[ut]:[Nt],[Rt]:[Nt],[wt]:[new RegExp("(Opera|OPR)\\/"+Bt)],[Ct]:[new RegExp(Ct+"\\/"+Bt)],[Et]:[new RegExp("FxiOS\\/"+Bt)],[jt]:[new RegExp("Konqueror[:/]?"+Bt,"i")],[vt]:[new RegExp(vt+" "+Bt),Nt],[Mt]:[new RegExp("android\\s"+Bt,"i")],[pt]:[new RegExp(ft+"\\/"+Bt)],[yt]:[new RegExp("(rv:|MSIE )"+Bt)],Mozilla:[new RegExp("rv:"+Bt)]},Zt=function(t,i){var e=Kt(t,i),n=Gt[e];if(void 0===n)return null;for(var r=0;r<n.length;r++){var s=n[r],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Qt=[[new RegExp(It+"; "+It+" (.*?)[);]","i"),t=>[It,t&&t[1]||""]],[new RegExp(Tt,"i"),[Tt,""]],[new RegExp($t,"i"),[$t,""]],[Wt,[vt,""]],[new RegExp(At,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Ot,""];if(new RegExp(nt).test(i)&&!/IEMobile\b/.test(i))return[At+" "+nt,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var n=e[1],r=Ht[n]||"";return/arm/i.test(i)&&(r="RT"),[At,r]}return[At,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[rt,i.join(".")]}return[rt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+st+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+st+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[st,i.join(".")]}return[st,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[mt,""]],[/Linux|debian/i,["Linux",""]]],Yt=function(t){return Vt.test(t)?Tt:qt.test(t)?$t:Ft.test(t)?It:new RegExp(Lt,"i").test(t)?Lt:new RegExp("("+Ot+"|WPDesktop)","i").test(t)?Ot:/iPad/.test(t)?lt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dt:Wt.test(t)?vt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Pt,"i").test(t)?Pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(nt).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?st:at:st:new RegExp("(pda|"+nt+")","i").test(t)?Dt:new RegExp(ot,"i").test(t)&&!new RegExp(ot+" pc","i").test(t)?zt:""},ti="https?://(.*)",ii=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ei=H(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ii),ni="<masked>";function ri(t){var i=function(t){return t?0===t.search(ti+"google.([^/?]*)")?"google":0===t.search(ti+"bing.com")?"bing":0===t.search(ti+"yahoo.com")?"yahoo":0===t.search(ti+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(null!==i){r.$search_engine=i;var s=n?tt(n.referrer,e):"";s.length&&(r.ph_keyword=s)}return r}function si(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function oi(){return(null==n?void 0:n.referrer)||"$direct"}function ai(){var t;return(null==n?void 0:n.referrer)&&(null===(t=Y(n.referrer))||void 0===t?void 0:t.host)||"$direct"}function li(t){var i,{r:e,u:n}=t,r={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Y(e))||void 0===i?void 0:i.host};if(n){r.$current_url=n;var s=Y(n);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=ei.concat([]),e={};return q(i,function(i){var n=tt(t,i);e[i]=n||null}),e}(n);W(r,o)}e&&W(r,ri(e));return r}function hi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function di(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function ui(i,e){if(!a)return{};var n,s,o,[l,h]=function(t){for(var i=0;i<Qt.length;i++){var[e,n]=Qt[i],r=e.exec(t),s=r&&(et(n)?n(r,t):n);if(s)return s}return["",""]}(a);return W(function(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!=n&&""!==n&&(i[e]=n)}return i}({$os:l,$os_version:h,$browser:Kt(a,navigator.vendor),$device:Yt(a),$device_type:(s=a,o=Yt(s),o===lt||o===at||"Kobo"===o||"Kindle Fire"===o||o===zt?ot:o===Tt||o===It||o===$t||o===Lt?"Console":o===dt?"Wearable":o?nt:"Desktop"),$timezone:hi(),$timezone_offset:di()}),{$current_url:it(null==r?void 0:r.href,[],ni),$host:null==r?void 0:r.host,$pathname:null==r?void 0:r.pathname,$raw_user_agent:a.length>1e3?a.substring(0,997)+"...":a,$browser_version:Zt(a,navigator.vendor),$browser_language:si(),$browser_language_prefix:(n=si(),"string"==typeof n?n.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:"web",$lib_version:c,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class vi{constructor(t,i){void 0===t&&(t="localStorage"),this.A=null,this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return v({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(y,this.userIdentity.anonymous_id,X)),this.userIdentity.anonymous_id}getUserProperties(){return v({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(t,i,e){if("number"==typeof t&&(t=t.toString(),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),t)if(this.isDistinctIdStringLike(t))console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==t){var n=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=t,!this.userIdentity.device_id){var r=n||this.userIdentity.anonymous_id;this.userIdentity.device_id=r,this.userIdentity.properties=v({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:r})}t!==n&&(this.userIdentity.distinct_id=t);var s="anonymous"===this.userIdentity.user_state;t!==n&&s?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=v({},this.userIdentity.properties,i)),e&&Object.keys(e).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=e[t])}),this.saveUserIdentity()):i||e?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=v({},this.userIdentity.properties,i)),e&&Object.keys(e).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=e[t])}),this.saveUserIdentity()):t!==n&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(t,i){if(!t&&!i)return!1;var e=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,n=this.getPersonPropertiesHash(e,t,i);return this.A===n?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=v({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.A=n,!0)}reset(t){var i=this.generateAnonymousId(),e=this.userIdentity.device_id,n=t?this.generateDeviceId():e;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:n,properties:{},user_state:"anonymous"},this.A=null,this.saveUserIdentity(),this.userIdentity.properties=v({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(t){this.userIdentity.distinct_id=t,this.saveUserIdentity()}setUserState(t){this.userIdentity.user_state=t,this.saveUserIdentity()}updateUserProperties(t,i){t&&(this.userIdentity.properties=v({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity()}ensureDeviceId(t){this.userIdentity.device_id||(this.userIdentity.device_id=t,this.userIdentity.properties=v({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:t}),this.saveUserIdentity())}createAlias(t,i){return this.isValidDistinctId(t)?(void 0===i&&(i=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(i)?t===i?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:t,original:i}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(t){return this.isDistinctIdStringLike(t)}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[T]){var e=function(t,i){var e=t?H([],ii,i||[]):[],n=null==r?void 0:r.href.substring(0,1e3);return{r:oi().substring(0,1e3),u:n?it(n,e,ni):void 0}}(t,i);this.register_once({[T]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[T];return e?(t=li(e),i={},q(t,function(t,e){var n;i["$initial_"+(n=String(e),n.startsWith("$")?n.substring(1):n)]=t}),i):{}}update_referrer_info(){var t={$referrer:oi(),$referring_domain:ai()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(y),i=this.storage.get(b),e=this.storage.get(w),n=this.storage.get(m),r=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),a=e||null,l=n||"anonymous",h=s||this.generateAnonymousId();return t||this.storage.set(y,h,X),i||this.storage.set(b,o,X),n||this.storage.set(m,l,X),{distinct_id:a,anonymous_id:h,device_id:o,properties:r,user_state:l}}saveUserIdentity(){this.storage.set(y,this.userIdentity.anonymous_id,X),this.storage.set(b,this.userIdentity.device_id,X),this.storage.set(m,this.userIdentity.user_state,X),this.userIdentity.distinct_id?this.storage.set(w,this.userIdentity.distinct_id,X):this.storage.remove(w),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(x)||{}}setStoredUserProperties(t){this.storage.setJSON(x,t,X)}register_once(t,i){var e=this.getStoredUserProperties(),n=!1;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(e[r]=t[r],n=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],n=!0));n&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+N(16)}generateDeviceId(){return"device_"+N(16)}getPersonPropertiesHash(t,i,e){return JSON.stringify({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}isValidDistinctId(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(i)&&0!==t.trim().length}isDistinctIdStringLike(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(i)}updateStorageMethod(t,i){this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var ci=["LCP","CLS","FCP","INP","TTFB"],fi=["LCP","CLS","FCP","INP"],pi=9e5,gi="[WebVitals]";class mi{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t){this.name="WebVitals",this.O=!1,this._instance=t,this.P=this.L(),this.U=mi.extractConfig(t.getConfig())}get isEnabled(){var t=null==r?void 0:r.protocol;return("http:"===t||"https:"===t)&&!0===this.U.web_vitals}get isStarted(){return this.O}startIfEnabled(){if(this.isEnabled&&!this.O&&t){var i=this.D();i?this.j(i):this.B()}}stop(){this.O&&(this.N(),this.F&&(clearTimeout(this.F),this.F=void 0),this.O=!1)}onConfigUpdate(t){var i=mi.extractConfig(t),e=this.isEnabled;this.U=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}get allowedMetrics(){return this.U.web_vitals_allowed_metrics||fi}get flushTimeoutMs(){return this.U.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.U.__web_vitals_max_value;return void 0===t?pi:0===t?0:t<6e4?pi:t}L(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}D(){var t;return null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}B(){var t,i=null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this._instance,"web-vitals",t=>{if(t)console.error(gi+" Failed to load web-vitals:",t);else{var i=this.D();i?this.j(i):console.error(gi+" web-vitals loaded but callbacks not registered")}}):console.warn(gi+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}j(t){if(!this.O){var i=this.allowedMetrics,e=this.q.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e),this.O=!0}}V(){var i;return null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.href}W(){return null==r?void 0:r.pathname}q(i){try{if(!t||!n||!r)return;if(!(null==i?void 0:i.name)||void 0===(null==i?void 0:i.value))return void console.warn(gi+" Invalid metric received",i);if(this.maxAllowedValue>0&&i.value>=this.maxAllowedValue&&"CLS"!==i.name)return void console.warn(gi+" Ignoring "+i.name+" with value >= "+this.maxAllowedValue+"ms");var e=this.V(),s=this.W();if(!e)return void console.warn(gi+" Could not determine current URL");this.P.url&&this.P.url!==e&&this.N(),this.P.url||(this.P.url=e,this.P.pathname=s),this.P.firstMetricTimestamp||(this.P.firstMetricTimestamp=Date.now());var o=this.H(i.attribution),a=this._instance.getSessionId(),l=this.J(),h=v({},i,{attribution:o,timestamp:Date.now(),$current_url:e,$session_id:a,$window_id:l}),d=this.P.metrics.findIndex(t=>t.name===i.name);d>=0?this.P.metrics[d]=h:this.P.metrics.push(h),this.X(),this.P.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(gi+" Error adding metric to buffer:",t)}}H(t){if(t){var i=v({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}J(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}X(){this.F&&clearTimeout(this.F),this.F=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.F&&(clearTimeout(this.F),this.F=void 0),0!==this.P.metrics.length){try{var t={$pathname:this.P.pathname,$current_url:this.P.url};for(var i of this.P.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){console.error(gi+" Error flushing metrics:",t)}this.P=this.L()}}}function bi(t,i,e){try{if(!(i in t))return()=>{};var n=t[i],r=e(n);return et(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=r,()=>{t[i]=n}}catch(t){return()=>{}}}class yi{constructor(i,e){var n;this.name="HistoryAutocapture",this.O=!1,this._instance=i,this.U=e||yi.extractConfig(i.getConfig()),this.K=(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.U.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.G()}stop(){this.O&&(this.Z&&(this.Z(),this.Z=void 0),this.O=!1)}onConfigUpdate(t){this.U=yi.extractConfig(t),this.isEnabled&&!this.O?this.G():!this.isEnabled&&this.O&&this.stop()}G(){t&&r&&(this.K=r.pathname||"",this.Y(),this.tt(),this.O=!0)}Y(){var i,e;if(null==t?void 0:t.history){var n=this;(null===(i=t.history.pushState)||void 0===i?void 0:i.__vtilt_wrapped__)||bi(t.history,"pushState",t=>function(i,e,r){t.call(this,i,e,r),n.it("pushState")}),(null===(e=t.history.replaceState)||void 0===e?void 0:e.__vtilt_wrapped__)||bi(t.history,"replaceState",t=>function(i,e,r){t.call(this,i,e,r),n.it("replaceState")})}}tt(){if(!this.Z&&t){var i=()=>{this.it("popstate")};V(t,"popstate",i),this.Z=()=>{null==t||t.removeEventListener("popstate",i)}}}it(i){this.isEnabled&&this.O&&M(()=>{var e,s=null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.pathname;if(s&&r&&n){if(s!==this.K){var o={navigation_type:i};this._instance.capture("$pageview",o)}this.K=s}})}}var _i=["a","button","form","input","select","textarea","label"],wi="$copy_autocapture",xi=['[id*="cookie" i]','[class*="cookie" i]','[id*="consent" i]','[class*="consent" i]','[id*="gdpr" i]','[class*="gdpr" i]','[id*="privacy-banner" i]','[class*="privacy-banner" i]','[id*="cookie-banner" i]','[class*="cookie-banner" i]','[id*="cookie-notice" i]','[class*="cookie-notice" i]',"#CybotCookiebotDialog",'[class^="CybotCookiebotDialog"]','[id^="onetrust"]','[class^="onetrust"]','[id^="cc-"]',".cc-banner",".cc-window",".cc-revoke",'[id^="cookieconsent"]','[class^="cookieconsent"]','[id^="gdpr-cookie"]','[id^="qc-cmp"]',"#termly-code-snippet-support",'[id^="iubenda"]','[id^="truste"]','[class^="truste"]',"#consent_blackbar",'[id^="didomi"]','[id^="usercentrics"]',"#uc-center-container",".klaro","#klaro","#cookiescript_injected",".cky-consent-container","#cky-consent","#cmplz-cookiebanner-container","#gdpr-cookie-message",'[class*="fs-cc"]','[class*="fc-cc"]',"[fs-cc]","[fs-cc-checkbox]",'[class*="cookie-preferences"]',"#cookie-preferences",'[role="dialog"][aria-label*="cookie" i]','[role="dialog"][aria-label*="consent" i]','[aria-describedby*="cookie" i]','[aria-label*="Cookie Preferences" i]'];function ki(t){return null==t}function Si(t){return"string"==typeof t}function Ci(t){return void 0===t}function Ei(t){return t.replace(/^\s+|\s+$/g,"")}function Ti(t,i){return t.indexOf(i)>-1}function $i(t){return 1===(null==t?void 0:t.nodeType)}function Ii(t){return 3===(null==t?void 0:t.nodeType)}function Mi(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ri(t){return 11===(null==t?void 0:t.nodeType)}function Ai(t){return t?Ei(t).split(/\s+/):[]}function Oi(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ai(i)}function Pi(t){return ki(t)?null:Ei(t).split(/(\s+)/).filter(t=>Ji(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Li(t){var i,e="";if(Ki(t)&&!Gi(t)&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];Ii(r)&&r.textContent&&(e+=null!==(i=Pi(r.textContent))&&void 0!==i?i:"")}return Ei(e)}function Ui(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(r&&"span"===(null===(i=r.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Li(r)).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Ui(r)).trim())}catch(t){}}return e}function Di(t){var i=Li(t);return Ji(i=(i+" "+Ui(t)).trim())?i:""}function zi(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!$i(i));return i}function ji(t){var i=t.parentNode;return!(!i||!$i(i))&&i}function Bi(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}var Ni="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Fi=new RegExp("^(?:"+Ni+")$"),qi=new RegExp(Ni),Vi="\\d{3}-?\\d{2}-?\\d{4}",Wi=new RegExp("^("+Vi+")$"),Hi=new RegExp("("+Vi+")");function Ji(t,i){if(void 0===i&&(i=!0),ki(t))return!1;if(Si(t)){if(t=Ei(t),(i?Fi:qi).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Wi:Hi).test(t))return!1}return!0}function Xi(t){return!!Si(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Ki(t){for(var i=t;i&&i.parentNode&&!Mi(i,"body");i=i.parentNode){var e=Oi(i);if(Ti(e,"vt-sensitive")||Ti(e,"vt-no-capture"))return!1}if(Ti(Oi(t),"vt-include"))return!0;var n=t.type||"";if(Si(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";if(Si(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Gi(t){return!!(Mi(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Mi(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Zi(t){if(!Ki(t))return null;if(Mi(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var n={$el_value:i.checked?"true":"false"},r=function(t){var i=t.closest("label");if(i){var e=Ei(i.textContent||"");if(e&&Ji(e))return Pi(e)||null}if(t.id)try{var n=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(n){var r=Ei(n.textContent||"");if(r&&Ji(r))return Pi(r)||null}}catch(t){}return null}(i);return r?n.$selected_text=r:i.value&&Ji(i.value)&&(n.$selected_text=i.value),n}var s=i.value;if(s&&Ji(s)){var o=Pi(s);if(o)return{$el_value:o}}return null}if(Mi(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var h=a.options[l],d={};h.value&&Ji(h.value)&&(d.$el_value=h.value);var u=h.text;if(u&&Ji(u)){var v=Pi(u);v&&(d.$selected_text=v)}if(d.$el_value||d.$selected_text)return d}return null}return Mi(t,"textarea"),null}function Qi(i,e,n,r,s){if(void 0===n&&(n=void 0),!t||!i||Mi(i,"html")||!$i(i))return!1;if((null==n?void 0:n.url_allowlist)&&!Bi(n.url_allowlist))return!1;if((null==n?void 0:n.url_ignorelist)&&Bi(n.url_ignorelist))return!1;if(null==n?void 0:n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some(t=>e.type===t))return!1}for(var a=!1,l=[i],h=!0,d=i;d.parentNode&&!Mi(d,"body");)if(Ri(d.parentNode))l.push(d.parentNode.host),d=d.parentNode.host;else{if(!(h=ji(d)))break;if(r||_i.indexOf(h.tagName.toLowerCase())>-1)a=!0;else{var u=t.getComputedStyle(h);u&&"pointer"===u.getPropertyValue("cursor")&&(a=!0)}l.push(h),d=h}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(Ci(e))return!0;var n,r=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(l,n))return!1;if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(Ci(e))return!0;var n,r=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(l,n))return!1;if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,n=void 0===e?xi:e;if(0===n.length)return!1;for(var r of t)for(var s of n)try{if(r.matches(s))return!0}catch(t){}return!1}(l,n))return!1;var v=t.getComputedStyle(i);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0;var c=i.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return a?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(_i.indexOf(c)>-1||"true"===i.getAttribute("contenteditable"))}}function Yi(t,i){return i.length>t?i.slice(0,t)+"...":i}function te(t,i,e,n){var r=t.tagName.toLowerCase(),s={tag_name:r};_i.indexOf(r)>-1&&!e&&(s.$el_text=Yi(1024,"a"===r||"button"===r?Di(t):Li(t)));var o=Oi(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!Gi(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==n?void 0:n.includes(l.name))&&!i&&Ji(l.value)&&!Xi(l.name))){var h=l.value;"class"===l.name&&(h=Ai(h).join(" ")),s["attr__"+l.name]=Yi(1024,h)}}for(var d=1,u=1,v=t;v=zi(v);)d++,v.tagName===t.tagName&&u++;return s.nth_child=d,s.nth_of_type=u,s}function ie(t){if(!Ki(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var n=t.attributes[e];if(n.name&&0===n.name.indexOf("data-vt-capture-attribute")){var r=n.name.replace("data-vt-capture-attribute-",""),s=n.value;r&&s&&Ji(s)&&(i[r]=s)}}return i}function ee(t){return t.replace(/"|\\"/g,'\\"')}function ne(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Ai(e)):void 0}function re(t){return function(t){var i=t.map(t=>{var i,e,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var r of(t.attr_class.sort(),t.attr_class))n+="."+r.replace(/"/g,"");var s=v({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(e=t.nth_of_type)&&void 0!==e?e:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Object.entries(s).sort((t,i)=>{var[e]=t,[n]=i;return e.localeCompare(n)}).forEach(t=>{var[i,e]=t;return o[ee(i.toString())]=ee(String(e))}),(n+=":")+Object.entries(o).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,n={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:ne(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return n.attributes[i]=e}),n})}(t))}function se(t,i){return t.indexOf(i)>-1}class oe{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var n=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-n.x,2)+Math.pow(i-n.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function ae(i,e){for(var n,r,s,o,{e:a,maskAllElementAttributes:l,maskAllText:h,elementAttributeIgnoreList:d,elementsChainAsString:u,captureElementValues:v}=e,c=[i],f=i;f.parentNode&&!Mi(f,"body");)Ri(f.parentNode)?(c.push(f.parentNode.host),f=f.parentNode.host):(c.push(f.parentNode),f=f.parentNode);var p,g=[],m={},b=!1,y=!1;for(var _ of c){var w=Ki(_);if("a"===_.tagName.toLowerCase()){var x=_.getAttribute("href");b=!!(w&&x&&Ji(x))&&x}se(Oi(_),"vt-no-capture")&&(y=!0),g.push(te(_,l,h,d));var k=ie(_);Object.assign(m,k)}if(y)return{props:{},explicitNoCapture:y};if(h||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?g[0].$el_text=Di(i):g[0].$el_text=Li(i)),"change"===a.type&&v){var S=Zi(i);S&&(S.$el_value&&(g[0].$el_value=S.$el_value),S.$selected_text&&(g[0].$selected_text=S.$selected_text))}if(b){g[0].attr__href=b;var C=null===(n=Y(b))||void 0===n?void 0:n.host,E=null===(r=null==t?void 0:t.location)||void 0===r?void 0:r.host;C&&E&&C!==E&&(p=b)}var T=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:a.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:re(g)},(null===(s=g[0])||void 0===s?void 0:s.$el_text)?{$el_text:null===(o=g[0])||void 0===o?void 0:o.$el_text}:{},p&&"click"===a.type?{$external_click_url:p}:{},m);return{props:T}}class le{constructor(t){this.name="Autocapture",this.et=!1,this.nt=null,this.rt=null,this.st=new oe,this.ot=!1,this._instance=t}get U(){var t,i=this._instance.getConfig(),e="object"!=typeof(t=i.autocapture)||null===t||Array.isArray(t)?{}:i.autocapture;return e.url_allowlist&&(e.url_allowlist=e.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),e.url_ignorelist&&(e.url_ignorelist=e.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),e}get isEnabled(){var t,i=null!==(t=this.nt)&&void 0!==t&&t;return!!this._instance.getConfig().autocapture&&!i}get isStarted(){return this.et}startIfEnabled(){this.isEnabled&&!this.et&&(this.lt(),this.et=!0)}stop(){this.et=!1}onConfigUpdate(t){this.isEnabled&&!this.et&&this.startIfEnabled()}onRemoteConfig(t){t.elementsChainAsString&&(this.ot=t.elementsChainAsString),this.nt=!!t.autocapture_opt_out,this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&t.enabled&&(this.nt=!1)}setElementSelectors(t){this.rt=t}getElementSelectors(t){var i,e=[];return null===(i=this.rt)||void 0===i||i.forEach(i=>{var r=null==n?void 0:n.querySelectorAll(i);null==r||r.forEach(n=>{t===n&&e.push(i)})}),e}lt(){if(this.ht()&&t&&n){var i=i=>{i=i||(null==t?void 0:t.event);try{this.dt(i)}catch(t){}};if(V(n,"submit",i,{capture:!0}),V(n,"change",i,{capture:!0}),V(n,"click",i,{capture:!0}),this.U.capture_copied_text){var e=i=>{i=i||(null==t?void 0:t.event),this.dt(i,wi)};V(n,"copy",e,{capture:!0}),V(n,"cut",e,{capture:!0})}}}dt(i,e){var n,r,s,o,a;if(void 0===e&&(e="$autocapture"),this.isEnabled&&i.isTrusted){var l=function(t){var i;return Ci(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(i);if(Ii(l)&&(l=l.parentNode||null),"$autocapture"===e&&"click"===i.type&&i instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(n=this.st)||void 0===n?void 0:n.isRageClick(i.clientX,i.clientY,(new Date).getTime()))&&this.dt(i,"$rageclick");var h=e===wi;if(l&&Qi(l,i,this.U,h,h?["copy","cut"]:void 0)){var d=this._instance.getConfig(),{props:u,explicitNoCapture:v}=ae(l,{e:i,maskAllElementAttributes:null!==(r=d.mask_all_element_attributes)&&void 0!==r&&r,maskAllText:null!==(s=d.mask_all_text)&&void 0!==s&&s,elementAttributeIgnoreList:this.U.element_attribute_ignorelist,elementsChainAsString:this.ot,captureElementValues:null!==(o=this.U.capture_element_values)&&void 0!==o&&o});if(v)return!1;var c=this.getElementSelectors(l);if(c&&c.length>0&&(u.$element_selectors=c),e===wi){var f=Pi(null===(a=null==t?void 0:t.getSelection())||void 0===a?void 0:a.toString()),p=i.type||"clipboard";if(!f)return!1;u.$selected_content=f,u.$copy_type=p}return this._instance.capture(e,u),!0}}}ht(){return"function"==typeof(null==n?void 0:n.querySelectorAll)}}var he="[SessionRecording]";class de{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||de.extractConfig(t.getConfig())}static extractConfig(t){var i,e,n,r=t.session_recording||{};return{enabled:null!==(i=r.enabled)&&void 0!==i&&i,sampleRate:r.sampleRate,minimumDurationMs:r.minimumDurationMs,sessionIdleThresholdMs:r.sessionIdleThresholdMs,fullSnapshotIntervalMs:r.fullSnapshotIntervalMs,captureConsole:null!==(e=r.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(n=r.captureNetwork)&&void 0!==n&&n,captureCanvas:r.captureCanvas,blockClass:r.blockClass,blockSelector:r.blockSelector,ignoreClass:r.ignoreClass,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,maskAllInputs:r.maskAllInputs,maskInputOptions:r.maskInputOptions,masking:r.masking,recordHeaders:r.recordHeaders,recordBody:r.recordBody,compressEvents:r.compressEvents,__mutationThrottlerRefillRate:r.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:r.__mutationThrottlerBucketSize}}get isEnabled(){var i,e=this._instance.getConfig(),n=null!==(i=this.U.enabled)&&void 0!==i&&i,r=!e.disable_session_recording;return!!t&&n&&r}get isStarted(){var t;return this.O&&!!(null===(t=this.ut)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.ut)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.vt(t),this.O=!0,console.info(he+" starting")):this.stop()}}stop(){M(()=>{var t;null===(t=this.ut)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.U=de.extractConfig(t),null===(i=this.ut)||void 0===i||i.updateConfig(this.U),this.startIfEnabledOrStop("config_updated")}onRemoteConfig(t){var i,e,n,r,s,o,a;if(t.sessionRecording){var l=t.sessionRecording;this.U=v({},this.U,{enabled:null!==(i=this.U.enabled)&&void 0!==i?i:l.enabled,sampleRate:null!==(e=this.U.sampleRate)&&void 0!==e?e:l.sampleRate,minimumDurationMs:null!==(n=this.U.minimumDurationMs)&&void 0!==n?n:l.minimumDurationMs,fullSnapshotIntervalMs:null!==(r=this.U.fullSnapshotIntervalMs)&&void 0!==r?r:l.fullSnapshotIntervalMs,maskAllInputs:null!==(s=this.U.maskAllInputs)&&void 0!==s?s:l.maskAllInputs,captureConsole:null!==(o=this.U.captureConsole)&&void 0!==o?o:l.captureConsole,captureCanvas:null!==(a=this.U.captureCanvas)&&void 0!==a?a:l.captureCanvas}),this.startIfEnabledOrStop("remote_config")}}get started(){return this.isStarted}get status(){var t;return(null===(t=this.ut)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.ut)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.ut)||void 0===e?void 0:e.log)?this.ut.log(t,i):console.warn(he+" log called before recorder was ready")}updateConfig(t){var i;this.U=v({},this.U,t),null===(i=this.ut)||void 0===i||i.updateConfig(this.U)}get ct(){return"recorder"}vt(t){var i,e,n,r;if(this.isEnabled)if((null===(e=null===(i=null==l?void 0:l.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(n=l.__VTiltExtensions__)||void 0===n?void 0:n.initSessionRecording))this.ft(t);else{var s=null===(r=l.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this.ct,i=>{i?console.error(he+" could not load recorder:",i):this.ft(t)}):console.error(he+" loadExternalDependency not available. Session recording cannot start.")}}ft(t){var i,e=null===(i=l.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.ut||(this.ut=e(this._instance,this.U)),this.ut.start(t)):console.error(he+" initSessionRecording not available after script load")}}var ue=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ue||{}),ve=Uint8Array,ce=Uint16Array,fe=Int32Array,pe=new ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ge=new ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),me=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),be=function(t,i){for(var e=new ce(31),n=0;n<31;++n)e[n]=i+=1<<t[n-1];var r=new fe(e[30]);for(n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)r[s]=s-e[n]<<5|n;return{b:e,r:r}},ye=be(pe,2),_e=ye.b,we=ye.r;_e[28]=258,we[258]=28;for(var xe=be(ge,0).r,ke=new ce(32768),Se=0;Se<32768;++Se){var Ce=(43690&Se)>>1|(21845&Se)<<1;Ce=(61680&(Ce=(52428&Ce)>>2|(13107&Ce)<<2))>>4|(3855&Ce)<<4,ke[Se]=((65280&Ce)>>8|(255&Ce)<<8)>>1}var Ee=function(t,i,e){for(var n=t.length,r=0,s=new ce(i);r<n;++r)t[r]&&++s[t[r]-1];var o,a=new ce(i);for(r=1;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(e){o=new ce(1<<i);var l=15-i;for(r=0;r<n;++r)if(t[r])for(var h=r<<4|t[r],d=i-t[r],u=a[t[r]-1]++<<d,v=u|(1<<d)-1;u<=v;++u)o[ke[u]>>l]=h}else for(o=new ce(n),r=0;r<n;++r)t[r]&&(o[r]=ke[a[t[r]-1]++]>>15-t[r]);return o},Te=new ve(288);for(Se=0;Se<144;++Se)Te[Se]=8;for(Se=144;Se<256;++Se)Te[Se]=9;for(Se=256;Se<280;++Se)Te[Se]=7;for(Se=280;Se<288;++Se)Te[Se]=8;var $e=new ve(32);for(Se=0;Se<32;++Se)$e[Se]=5;var Ie=Ee(Te,9,0),Me=Ee($e,5,0),Re=function(t){return(t+7)/8|0},Ae=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new ve(t.subarray(i,e))},Oe=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8},Pe=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8,t[n+2]|=e>>16},Le=function(t,i){for(var e=[],n=0;n<t.length;++n)t[n]&&e.push({s:n,f:t[n]});var r=e.length,s=e.slice();if(!r)return{t:Fe,l:0};if(1==r){var o=new ve(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,d=1,u=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=r-1;)a=e[e[h].f<e[u].f?h++:u++],l=e[h!=d&&e[h].f<e[u].f?h++:u++],e[d++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(n=1;n<r;++n)s[n].s>v&&(v=s[n].s);var c=new ce(v+1),f=Ue(e[d-1],c,0);if(f>i){n=0;var p=0,g=f-i,m=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});n<r;++n){var b=s[n].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[n].s;c[y]<i?p-=1<<i-c[y]++-1:++n}for(;n>=0&&p;--n){var _=s[n].s;c[_]==i&&(--c[_],++p)}f=i}return{t:new ve(c),l:f}},Ue=function(t,i,e){return-1==t.s?Math.max(Ue(t.l,i,e+1),Ue(t.r,i,e+1)):i[t.s]=e},De=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ce(++i),n=0,r=t[0],s=1,o=function(t){e[n++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return{c:e.subarray(0,n),n:i}},ze=function(t,i){for(var e=0,n=0;n<i.length;++n)e+=t[n]*i[n];return e},je=function(t,i,e){var n=e.length,r=Re(i+2);t[r]=255&n,t[r+1]=n>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<n;++s)t[r+s+4]=e[s];return 8*(r+4+n)},Be=function(t,i,e,n,r,s,o,a,l,h,d){Oe(i,d++,e),++r[256];for(var u=Le(r,15),v=u.t,c=u.l,f=Le(s,15),p=f.t,g=f.l,m=De(v),b=m.c,y=m.n,_=De(p),w=_.c,x=_.n,k=new ce(19),S=0;S<b.length;++S)++k[31&b[S]];for(S=0;S<w.length;++S)++k[31&w[S]];for(var C=Le(k,7),E=C.t,T=C.l,I=19;I>4&&!E[me[I-1]];--I);var M,R,A,O,P=h+5<<3,L=ze(r,Te)+ze(s,$e)+o,U=ze(r,v)+ze(s,p)+o+14+3*I+ze(k,E)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&P<=L&&P<=U)return je(i,d,t.subarray(l,l+h));if(Oe(i,d,1+(U<L)),d+=2,U<L){M=Ee(v,c,0),R=v,A=Ee(p,g,0),O=p;var D=Ee(E,T,0);Oe(i,d,y-257),Oe(i,d+5,x-1),Oe(i,d+10,I-4),d+=14;for(S=0;S<I;++S)Oe(i,d+3*S,E[me[S]]);d+=3*I;for(var z=[b,w],j=0;j<2;++j){var B=z[j];for(S=0;S<B.length;++S){var N=31&B[S];Oe(i,d,D[N]),d+=E[N],N>15&&(Oe(i,d,B[S]>>5&127),d+=B[S]>>12)}}}else M=Ie,R=Te,A=Me,O=$e;for(S=0;S<a;++S){var F=n[S];if(F>255){Pe(i,d,M[(N=F>>18&31)+257]),d+=R[N+257],N>7&&(Oe(i,d,F>>23&31),d+=pe[N]);var q=31&F;Pe(i,d,A[q]),d+=O[q],q>3&&(Pe(i,d,F>>5&8191),d+=ge[q])}else Pe(i,d,M[F]),d+=R[F]}return Pe(i,d,M[256]),d+R[256]},Ne=new fe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fe=new ve(0),qe=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,n=9;--n;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Ve=function(t,i,e,n,r){if(!r&&(r={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new ve(s.length+t.length);o.set(s),o.set(t,s.length),t=o,r.w=s.length}return function(t,i,e,n,r,s){var o=s.z||t.length,a=new ve(n+o+5*(1+Math.ceil(o/7e3))+r),l=a.subarray(n,a.length-r),h=s.l,d=7&(s.r||0);if(i){d&&(l[0]=s.r>>3);for(var u=Ne[i-1],v=u>>13,c=8191&u,f=(1<<e)-1,p=s.p||new ce(32768),g=s.h||new ce(f+1),m=Math.ceil(e/3),b=2*m,y=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<b)&f},_=new fe(25e3),w=new ce(288),x=new ce(32),k=0,S=0,C=s.i||0,E=0,T=s.w||0,I=0;C+2<o;++C){var M=y(C),R=32767&C,A=g[M];if(p[R]=A,g[M]=R,T<=C){var O=o-C;if((k>7e3||E>24576)&&(O>423||!h)){d=Be(t,l,0,_,w,x,S,E,I,C-I,d),E=k=S=0,I=C;for(var P=0;P<286;++P)w[P]=0;for(P=0;P<30;++P)x[P]=0}var L=2,U=0,D=c,z=R-A&32767;if(O>2&&M==y(C-z))for(var j=Math.min(v,O)-1,B=Math.min(32767,C),N=Math.min(258,O);z<=B&&--D&&R!=A;){if(t[C+L]==t[C+L-z]){for(var F=0;F<N&&t[C+F]==t[C+F-z];++F);if(F>L){if(L=F,U=z,F>j)break;var q=Math.min(z,F-2),V=0;for(P=0;P<q;++P){var W=C-z+P&32767,H=W-p[W]&32767;H>V&&(V=H,A=W)}}}z+=(R=A)-(A=p[R])&32767}if(U){_[E++]=268435456|we[L]<<18|xe[U];var J=31&we[L],X=31&xe[U];S+=pe[J]+ge[X],++w[257+J],++x[X],T=C+L,++k}else _[E++]=t[C],++w[t[C]]}}for(C=Math.max(C,T);C<o;++C)_[E++]=t[C],++w[t[C]];d=Be(t,l,h,_,w,x,S,E,I,C-I,d),h||(s.r=7&d|l[d/8|0]<<3,d-=7,s.h=g,s.p=p,s.i=C,s.w=T)}else{for(C=s.w||0;C<o+h;C+=65535){var K=C+65535;K>=o&&(l[d/8|0]=h,K=o),d=je(l,d+1,t.subarray(C,K))}s.i=o}return Ae(a,0,n+Re(d)+r)}(t,null==i.level?6:i.level,null==i.mem?r.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,n,r)},We=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function He(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,n=0;n<i.length;++n)e=qe[255&e^i[n]]^e>>>8;t=e},d:function(){return~t}}}(),n=t.length;e.p(t);var r,s=Ve(t,i,10+((r=i).filename?r.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&We(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var n=0;n<=e.length;++n)t[n+10]=e.charCodeAt(n)}}(s,i),We(s,o-8,e.d()),We(s,o-4,n),s}var Je="undefined"!=typeof TextEncoder&&new TextEncoder,Xe="undefined"!=typeof TextDecoder&&new TextDecoder;try{Xe.decode(Fe,{stream:!0})}catch(t){}ue.MouseMove,ue.MouseInteraction,ue.Scroll,ue.ViewportResize,ue.Input,ue.TouchMove,ue.MediaInteraction,ue.Drag;var Ke="[Chat]";class Ge{constructor(t,i){this._instance=t,this.name="Chat",this.gt=null,this.bt=!1,this.yt=!1,this.O=!1,this._t=null,this.wt=[],this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.U=i||Ge.extractConfig(t.getConfig())}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline}}get isEnabled(){var t;return!1!==this.U.enabled&&(!0===this.U.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.gt)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Et().catch(t=>{console.error(Ke+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=Ge.extractConfig(t),this.Tt&&(null===(e=(i=this.Tt).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,e,n,r,s,o,a,l,h;t.chat&&(this.gt=v({},this.gt,{enabled:null!==(n=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(e=this.gt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n,position:null!==(o=null!==(r=t.chat.widgetPosition)&&void 0!==r?r:null===(s=this.gt)||void 0===s?void 0:s.position)&&void 0!==o?o:"bottom-right",color:null!==(h=null!==(a=t.chat.widgetColor)&&void 0!==a?a:null===(l=this.gt)||void 0===l?void 0:l.color)&&void 0!==h?h:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Et(){var t=this;return u(function*(){var i,e,n,r;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(Ke+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.$t()),t.isEnabled?(t.O=!0,null!==(n=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t.gt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n&&t.It(),(null===(r=t.gt)||void 0===r?void 0:r.enabled)&&t.Mt(),console.info(Ke+" ready (lazy-load on demand)")):console.info(Ke+" not enabled (check dashboard settings)")):console.info(Ke+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.yt||null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.Tt)||void 0===t||t.close()}toggle(){this.Tt?this.Tt.toggle():this.open()}show(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.Tt)||void 0===t||t.hide()}getChannels(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.Rt(()=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.Tt)||void 0===t||t.goToChannelList()}sendMessage(t){this.Tt?this.Tt.sendMessage(t):(this.wt.push(t),this.Rt(()=>{this.wt.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.sendMessage(t)}),this.wt=[]}))}markAsRead(){var t;null===(t=this.Tt)||void 0===t||t.markAsRead()}onMessage(t){return this.kt.push(t),this.Tt?this.Tt.onMessage(t):()=>{var i=this.kt.indexOf(t);i>-1&&this.kt.splice(i,1)}}onTyping(t){return this.St.push(t),this.Tt?this.Tt.onTyping(t):()=>{var i=this.St.indexOf(t);i>-1&&this.St.splice(i,1)}}onConnectionChange(t){return this.Ct.push(t),this.Tt?this.Tt.onConnectionChange(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}updateConfig(t){this.U=v({},this.U,t)}getMergedConfig(){var t,i,e,n,r,s,o,a,l,h,d,u,v,c,f,p,g,m,b=this.gt,y=this.U;return{enabled:null!==(i=null!==(t=y.enabled)&&void 0!==t?t:null==b?void 0:b.enabled)&&void 0!==i&&i,autoConfig:null===(e=y.autoConfig)||void 0===e||e,position:null!==(r=null!==(n=y.position)&&void 0!==n?n:null==b?void 0:b.position)&&void 0!==r?r:"bottom-right",greeting:null!==(s=y.greeting)&&void 0!==s?s:null==b?void 0:b.greeting,color:null!==(a=null!==(o=y.color)&&void 0!==o?o:null==b?void 0:b.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=y.aiMode)&&void 0!==l?l:null==b?void 0:b.ai_enabled)||void 0===h||h,aiGreeting:null!==(d=y.aiGreeting)&&void 0!==d?d:null==b?void 0:b.ai_greeting,preload:null!==(u=y.preload)&&void 0!==u&&u,theme:null!==(v=y.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=y.color)&&void 0!==c?c:null==b?void 0:b.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=y.offlineMessage)&&void 0!==p?p:null==b?void 0:b.offline_message,collectEmailOffline:null===(m=null!==(g=y.collectEmailOffline)&&void 0!==g?g:null==b?void 0:b.collect_email_offline)||void 0===m||m}}destroy(){M(()=>{var i,e;null===(i=this.Tt)||void 0===i||i.destroy(),this.Tt=void 0,this.wt=[],this.xt=[],this.kt=[],this.St=[],this.Ct=[];var n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");n&&n.remove()})}$t(){var t=this;return u(function*(){if(!t.bt){var i=t._instance.getConfig(),e=i.token,n=i.api_host;if(!e||!n)return console.warn(Ke+" Cannot fetch settings: missing token or api_host"),void(t.bt=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(r);if(!s.ok)return console.warn(Ke+" Failed to fetch settings: "+s.status),void(t.bt=!0);t.gt=yield s.json(),t.bt=!0,console.info(Ke+" Loaded settings from dashboard")}catch(i){console.warn(Ke+" Error fetching settings:",i),t.bt=!0}}})()}Mt(){if((null==t?void 0:t.document)&&!document.getElementById("vtilt-chat-bubble")){var i=this.getMergedConfig(),e=i.position||"bottom-right",n=i.color||"#6366f1",r=document.createElement("div");r.id="vtilt-chat-bubble",r.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===e?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+n+";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s, box-shadow 0.2s;\n z-index: 999999;\n ").trim()),r.innerHTML='\n <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>\n </svg>\n ',r.addEventListener("mouseenter",()=>{r.style.transform="scale(1.05)",r.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),r.addEventListener("mouseleave",()=>{r.style.transform="scale(1)",r.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),r.addEventListener("click",()=>{this.open()}),document.body.appendChild(r)}}get ct(){return"chat"}It(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.At(),{timeout:5e3}):setTimeout(()=>this.At(),3e3)}Rt(t){this.Tt?t():(this.xt.push(t),this.At())}At(){var t,i;if(!(this.yt||this.Tt||this._t))if(null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.ft();else{this.yt=!0;var e=null===(i=l.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Ke+" loadExternalDependency not available. Chat cannot start."),this.yt=!1,void(this._t="loadExternalDependency not available");e(this._instance,this.ct,t=>{if(this.yt=!1,t)return console.error(Ke+" Failed to load:",t),void(this._t=String(t));this.ft()})}}ft(){var t,i=null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Ke+" initChat not available after script load"),void(this._t="initChat not available");if(!this.Tt){var e=this.getMergedConfig();this.Tt=i(this._instance,e),this.kt.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onMessage(t)}),this.St.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onTyping(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onConnectionChange(t)});var n=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");n&&n.remove()}this.xt.forEach(t=>t()),this.xt=[],console.info(Ke+" loaded and ready")}}var Ze="[VtdOverlay]";class Qe{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Ot=null,this.Pt=null,this.yt=!0,this.Lt=null,this.Ut=null,this.Dt=null,this._instance=t,this.U=i||Qe.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.U.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&&M(()=>{this.zt(),this.O=!1})}onConfigUpdate(t){this.U=Qe.extractConfig(t),!this.isEnabled&&this.O&&this.stop()}setDestinationUrl(i){var e;if(this.isEnabled)if(null==i?void 0:i.trim()){var n=i;try{n=decodeURIComponent(i)}catch(t){n=i}if(this.jt(n)){var r=this.Bt(n);this.Pt=n,this.Ot=r,this.yt=!0,this.Nt(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:n,$vtd_embed_url:r!==n?r:void 0,$current_url:null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.href})}else console.warn(Ze+" Invalid URL: "+n)}else console.warn(Ze+" Empty URL provided");else console.warn(Ze+" Feature is disabled")}getDestinationUrl(){return this.Ot}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Pt}),this.Lt?(this.Lt.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.zt(),this.O=!1,this.Ot=null,this.Pt=null},200)):(this.zt(),this.O=!1,this.Ot=null,this.Pt=null)}jt(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Bt(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var n=i.searchParams.get("v");if(n){var r=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+n+"?autoplay=1";return r&&(s+="&start="+r.replace("s","")),s}}if("youtu.be"===e){var o=i.pathname.slice(1);if(o){var a=i.searchParams.get("t"),l="https://www.youtube.com/embed/"+o+"?autoplay=1";return a&&(l+="&start="+a.replace("s","")),l}}if("vimeo.com"===e||"www.vimeo.com"===e){var h=i.pathname.match(/^\/(\d+)/);if(h)return"https://player.vimeo.com/video/"+h[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var d=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(d)return"https://www.loom.com/embed/"+d[1]+"?autoplay=1"}if(e.endsWith("wistia.com")){var u=i.pathname.match(/^\/medias\/([a-zA-Z0-9]+)/);if(u)return"https://fast.wistia.net/embed/iframe/"+u[1]+"?autoplay=1"}if("dailymotion.com"===e||"www.dailymotion.com"===e){var v=i.pathname.match(/^\/video\/([a-zA-Z0-9]+)/);if(v)return"https://www.dailymotion.com/embed/video/"+v[1]+"?autoplay=1"}if("open.spotify.com"===e){var c=i.pathname.match(/^\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);if(c)return"https://open.spotify.com/embed/"+c[1]+"/"+c[2]}return"drive.google.com"===e&&i.pathname.includes("/view")?t.replace("/view","/preview"):t}catch(i){return t}}Ft(t){try{return new URL(t).hostname}catch(i){return t}}qt(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}Nt(){if(n&&this.Ot){this.zt(),this.Lt=n.createElement("div"),this.Lt.id="vtilt-vtd-overlay",this.Lt.className="vtilt-vtd-opening",this.Lt.setAttribute("style",this.Vt());var t=n.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Wt());var i=n.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Ht()),i.innerHTML=this.Jt(),t.appendChild(i);var e=n.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Xt()),this.Dt=n.createElement("div"),this.Dt.className="vtilt-vtd-loading",this.Dt.setAttribute("style",this.Kt()),this.Dt.innerHTML=this.Gt(),e.appendChild(this.Dt),this.Ut=n.createElement("iframe"),this.Ut.id="vtilt-vtd-iframe",this.Ut.className="vtilt-vtd-iframe",this.Ut.setAttribute("style",this.Zt()),this.Ut.setAttribute("frameborder","0"),this.Ut.setAttribute("allowfullscreen","true"),this.Ut.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this.yt=!1,this.Dt&&(this.Dt.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Dt)||void 0===t?void 0:t.parentNode)&&(this.Dt.style.display="none")},300)),this.Ut&&(this.Ut.style.opacity="1")};this.Ut.onload=r,this.Ut.onerror=r,setTimeout(()=>{this.yt&&r()},5e3),e.appendChild(this.Ut),this.Ut.src=this.Ot,t.appendChild(e),this.Lt.appendChild(t);var s=n.createElement("style");s.id="vtilt-vtd-styles",s.textContent=this.Qt(),n.head.appendChild(s),n.body.appendChild(this.Lt),this.Yt(),n.body.style.overflow="hidden"}}zt(){var t;(null===(t=this.Lt)||void 0===t?void 0:t.parentNode)&&(this.Lt.parentNode.removeChild(this.Lt),this.Lt=null,this.Ut=null,this.Dt=null);var i=null==n?void 0:n.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==n?void 0:n.body)&&(n.body.style.overflow="")}Yt(){var i,e,r,s=null===(i=this.Lt)||void 0===i?void 0:i.querySelector(".vtilt-vtd-close");null==s||s.addEventListener("click",()=>this.close());var o=null===(e=this.Lt)||void 0===e?void 0:e.querySelector(".vtilt-vtd-open");null==o||o.addEventListener("click",()=>{this.Pt&&(null==t||t.open(this.Pt,"_blank"))}),null===(r=this.Lt)||void 0===r||r.addEventListener("click",t=>{t.target===this.Lt&&this.close()});var a=t=>{"Escape"===t.key&&(this.close(),null==n||n.removeEventListener("keydown",a))};null==n||n.addEventListener("keydown",a)}Vt(){return'\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n '}Wt(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Ht(){return"\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n height: 56px;\n background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n gap: 16px;\n "}Jt(){var t=this.Pt||this.Ot,i=t?this.Ft(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.qt(t):"")+'" \n alt="" \n style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;"\n onerror="this.style.display=\'none\'"\n />\n <div style="\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 2px;\n ">\n <div style="\n color: rgba(255, 255, 255, 0.95);\n font-size: 14px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ti(i)+'</div>\n <div style="\n color: rgba(255, 255, 255, 0.45);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ti(this.ii(t||"",50))+'</div>\n </div>\n </div>\n <div style="display: flex; align-items: center; gap: 8px; flex-shrink: 0;">\n <button class="vtilt-vtd-open vtilt-vtd-btn" title="Open in new tab">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>\n <polyline points="15 3 21 3 21 9"></polyline>\n <line x1="10" y1="14" x2="21" y2="3"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Open</span>\n </button>\n <button class="vtilt-vtd-close vtilt-vtd-btn vtilt-vtd-btn-primary" title="Close (Esc)">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Close</span>\n </button>\n </div>\n '}Xt(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Kt(){return"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #0a0a0a;\n z-index: 1;\n transition: opacity 0.3s ease;\n "}Gt(){var t=this.Pt||this.Ot,i=t?this.Ft(t):"";return'\n <div class="vtilt-vtd-spinner"></div>\n <div style="\n margin-top: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 14px;\n font-weight: 500;\n ">Loading '+this.ti(i)+'...</div>\n <div style="\n margin-top: 8px;\n color: rgba(255, 255, 255, 0.35);\n font-size: 12px;\n ">Press <kbd style="\n display: inline-block;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-family: inherit;\n font-size: 11px;\n ">Esc</kbd> to close</div>\n '}Zt(){return"\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: white;\n opacity: 0;\n transition: opacity 0.3s ease;\n "}Qt(){return"\n /* Animations */\n @keyframes vtilt-vtd-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes vtilt-vtd-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n \n @keyframes vtilt-vtd-scale-in {\n from { opacity: 0; transform: scale(0.96); }\n to { opacity: 1; transform: scale(1); }\n }\n \n @keyframes vtilt-vtd-spin {\n to { transform: rotate(360deg); }\n }\n \n /* Container animations */\n #vtilt-vtd-overlay.vtilt-vtd-opening {\n animation: vtilt-vtd-fade-in 0.2s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-opening .vtilt-vtd-modal {\n animation: vtilt-vtd-scale-in 0.25s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-closing {\n animation: vtilt-vtd-fade-out 0.2s ease-in forwards;\n }\n \n /* Loading spinner */\n .vtilt-vtd-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.8);\n border-radius: 50%;\n animation: vtilt-vtd-spin 0.8s linear infinite;\n }\n \n /* Button base styles */\n .vtilt-vtd-btn {\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n padding: 8px 14px;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s ease;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n }\n \n .vtilt-vtd-btn:hover {\n background: rgba(255, 255, 255, 0.14);\n border-color: rgba(255, 255, 255, 0.18);\n }\n \n .vtilt-vtd-btn:active {\n background: rgba(255, 255, 255, 0.18);\n transform: scale(0.98);\n }\n \n .vtilt-vtd-btn:focus-visible {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);\n }\n \n /* Primary button variant */\n .vtilt-vtd-btn-primary {\n background: rgba(255, 255, 255, 0.95);\n border-color: transparent;\n color: #0a0a0a;\n }\n \n .vtilt-vtd-btn-primary:hover {\n background: rgba(255, 255, 255, 1);\n border-color: transparent;\n }\n \n .vtilt-vtd-btn-primary:active {\n background: rgba(255, 255, 255, 0.85);\n }\n \n /* Desktop responsive - modal with margin */\n @media (min-width: 768px) {\n #vtilt-vtd-overlay {\n padding: 32px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1200px;\n max-height: 90vh;\n width: 100%;\n height: auto;\n min-height: 500px;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);\n }\n \n .vtilt-vtd-header {\n border-radius: 16px 16px 0 0;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 0 16px 16px;\n min-height: 400px;\n }\n }\n \n /* Large desktop - bigger modal */\n @media (min-width: 1400px) {\n #vtilt-vtd-overlay {\n padding: 48px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1400px;\n max-height: 85vh;\n }\n }\n \n /* Tablet */\n @media (min-width: 768px) and (max-width: 1024px) {\n #vtilt-vtd-overlay {\n padding: 24px;\n }\n \n .vtilt-vtd-modal {\n max-width: 95%;\n max-height: 90vh;\n }\n }\n \n /* Mobile - fullscreen */\n @media (max-width: 767px) {\n #vtilt-vtd-overlay {\n padding: 0 !important;\n background: #0a0a0a !important;\n }\n \n .vtilt-vtd-modal {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0 !important;\n }\n \n .vtilt-vtd-header {\n border-radius: 0 !important;\n padding: 0 12px !important;\n height: 52px !important;\n }\n \n .vtilt-vtd-btn {\n padding: 8px 10px !important;\n }\n \n .vtilt-vtd-btn-text {\n display: none !important;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 !important;\n }\n }\n \n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n #vtilt-vtd-overlay,\n #vtilt-vtd-overlay *,\n .vtilt-vtd-spinner {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n "}ii(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}ti(t){if(void 0===n)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");var i=n.createElement("div");return i.textContent=t,i.innerHTML}}var Ye,tn="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ye||(Ye={}));var en=t=>{var{data:i,compression:e}=t;if(i){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),r=new Blob([n]).size;if(e===Ye.GZipJS&&r>=1024)try{var s=He(function(t,i){if(Je)return Je.encode(t);for(var e=t.length,n=new ve(t.length+(t.length>>1)),r=0,s=function(t){n[r++]=t},o=0;o<e;++o){if(r+5>n.length){var a=new ve(r+8+(e-o<<1));a.set(n),n=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|63&l)):(s(224|l>>12),s(128|l>>6&63),s(128|63&l))}return Ae(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:tn});if(o.size<.95*r)return{contentType:tn,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:r}}},nn=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var i=en(t);if(i){var{contentType:e,body:n,estimatedSize:r}=i,s=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,o=v({"Content-Type":e},t.headers||{}),a=new AbortController,l=t.timeout?setTimeout(()=>a.abort(),t.timeout):null;fetch(s,{method:t.method||"POST",headers:o,body:n,keepalive:r<52428.8,signal:a.signal}).then(function(){var i=u(function*(i){var e,n=yield i.text(),r={statusCode:i.status,text:n};if(200===i.status)try{r.json=JSON.parse(n)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,r)});return function(t){return i.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=en(t);if(i){var{contentType:e,body:n}=i,r=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",r,!0),t.headers&&Object.entries(t.headers).forEach(t=>{var[i,e]=t;s.setRequestHeader(i,e)}),s.setRequestHeader("Content-Type",e),t.timeout&&(s.timeout=t.timeout),s.onreadystatechange=()=>{var i;if(4===s.readyState){var e={statusCode:s.status,text:s.responseText};if(200===s.status)try{e.json=JSON.parse(s.responseText)}catch(t){}null===(i=t.callback)||void 0===i||i.call(t,e)}},s.onerror=()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},s.send(n)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=en(t);if(i){var{contentType:e,body:n}=i;try{var r="string"==typeof n?new Blob([n],{type:e}):n,s=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,r)}catch(t){}}}}],rn=t=>{var i,e=t.transport||"fetch",n=nn.find(t=>t.name===e&&t.available)||nn.find(t=>t.available);if(!n)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));n.method(t)};class sn{constructor(t,i){var e,n,r,s;this.ei=!0,this.ni=[],this.ri=(e=(null==i?void 0:i.flush_interval_ms)||3e3,n=250,r=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,n),r)),this.si=t}get length(){return this.ni.length}enqueue(t){this.ni.push(t),this.oi||this.ai()}unload(){if(this.li(),0!==this.ni.length){var t=this.hi();for(var i in t){var e=t[i];this.si(v({},e,{transport:"sendBeacon"}))}}}enable(){this.ei=!1,this.ai()}pause(){this.ei=!0,this.li()}flush(){this.li(),this.di(),this.ai()}ai(){this.ei||(this.oi=setTimeout(()=>{this.li(),this.di(),this.ni.length>0&&this.ai()},this.ri))}li(){this.oi&&(clearTimeout(this.oi),this.oi=void 0)}di(){if(0!==this.ni.length){var t=this.hi(),i=Date.now();for(var e in t){var n=t[e];n.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.si(n)}}}hi(){var t={};return this.ni.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.ni=[],t}}class on{constructor(i){this.ui=!1,this.ci=3e3,this.ni=[],this.fi=!0,this.si=i.sendRequest,this.pi=i.sendBeacon,t&&void 0!==e&&"onLine"in e&&(this.fi=e.onLine,V(t,"online",()=>{this.fi=!0,this.N()}),V(t,"offline",()=>{this.fi=!1}))}get length(){return this.ni.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,n=Math.min(18e5,i),r=(Math.random()-.5)*(n-e);return Math.ceil(n+r)}(i),n=Date.now()+e;this.ni.push({retryAt:n,request:t,retriesPerformedSoFar:i+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.fi||(r+=" (Browser is offline)"),console.warn(r),this.ui||(this.ui=!0,this.gi())}}retriableRequest(t){var i=this;return u(function*(){try{var e=yield i.si(t);200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&i.enqueue(t,0)}catch(e){i.enqueue(t,0)}})()}gi(){this.mi&&clearTimeout(this.mi),this.mi=setTimeout(()=>{this.fi&&this.ni.length>0&&this.N(),this.ni.length>0?this.gi():this.ui=!1},this.ci)}N(){var t=this,i=Date.now(),e=[],n=[];this.ni.forEach(t=>{t.retryAt<i?n.push(t):e.push(t)}),this.ni=e,n.forEach(function(){var i=u(function*(i){var{request:e,retriesPerformedSoFar:n}=i;try{var r=yield t.si(e);200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&t.enqueue(e,n)}catch(i){t.enqueue(e,n)}});return function(t){return i.apply(this,arguments)}}())}unload(){this.mi&&(clearTimeout(this.mi),this.mi=void 0),this.ni.forEach(t=>{var{request:i}=t;try{this.pi(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.ni=[]}}var an="vt_rate_limit";class ln{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,n,r;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(an))&&void 0!==e?e:{tokens:this.eventsBurstLimit,last:s},a=(s-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=s,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var l=o.tokens<1;return l||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||null===(n=this.captureWarning)||void 0===n||n.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(r=this.persistence)||void 0===r||r.set(an,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class hn{constructor(t){this.bi=null,this.yi=t}get config(){return this.bi}onApply(t){this.wi=t}onLoad(t){this.xi=t}load(){var i,e=this.yi.getConfig();if(e.token){if(null===(i=e.bootstrap)||void 0===i?void 0:i.remoteConfig)return this.bi=e.bootstrap.remoteConfig,this.ki(this.bi),void this.Si();var n=M(()=>t.__VTILT_BOOTSTRAP__);if(null==n?void 0:n.remoteConfig)return this.bi=n.remoteConfig,this.ki(this.bi),void this.Si();M(()=>{var t=localStorage.getItem(_+"_"+e.token);t&&(this.bi=JSON.parse(t),this.ki(this.bi))}),this.Si()}}Si(){var t=this.yi.getConfig();if(t.token&&t.api_host){var i=t.api_host+"/api/decide?token="+t.token,e=new AbortController,n=setTimeout(()=>e.abort(),3e3);(s||fetch)(i,{method:"GET",signal:e.signal,headers:{Accept:"application/json"}}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),this.bi=i,M(()=>{localStorage.setItem(_+"_"+t.token,JSON.stringify(i))}),this.ki(i),null===(e=this.xi)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n)})}}ki(t){var i,e,n,r,s,o,a,l,h,d=this.yi.getConfig(),u={},v=!1,c=!1,f=!1;t.sessionRecording&&void 0===d.session_recording&&(u.session_recording={enabled:t.sessionRecording.enabled,sampleRate:t.sessionRecording.sampleRate,minimumDurationMs:t.sessionRecording.minimumDurationMs,fullSnapshotIntervalMs:t.sessionRecording.fullSnapshotIntervalMs,maskAllInputs:t.sessionRecording.maskAllInputs,captureConsole:t.sessionRecording.captureConsole,captureCanvas:t.sessionRecording.captureCanvas},t.sessionRecording.enabled&&(v=!0)),(null===(i=t.chat)||void 0===i?void 0:i.enabled)&&void 0===d.chat&&(u.chat={enabled:t.chat.enabled,position:t.chat.widgetPosition,color:t.chat.widgetColor},c=!0),t.analytics&&(void 0!==t.analytics.capturePageview&&void 0===d.capture_pageview&&(u.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===d.capture_pageleave&&(u.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===d.capture_performance&&(u.capture_performance=t.analytics.capturePerformance),void 0!==t.analytics.autocapture&&void 0===d.autocapture&&(u.autocapture=t.analytics.autocapture,t.analytics.autocapture&&(f=!0))),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===d.respect_dnt&&(u.respect_dnt=t.privacy.respectDnt),Object.keys(u).length>0&&this.yi.updateConfig(u),null===(n=this.wi)||void 0===n||n.call(this,t),this.yi.__loaded&&(v&&(null===(s=(r=this.yi).startSessionRecording)||void 0===s||s.call(r)),c&&(null===(a=(o=this.yi).Ci)||void 0===a||a.call(o)),f&&(null===(h=(l=this.yi).startAutocapture)||void 0===h||h.call(l)))}}class dn{constructor(t){this.Ei=!1,this.Ti=!1,this.$i=null,this.Ii=null,this.yi=t}setVtPersonId(t){this.Ii=t}capture(t,i,n){var r;if(this.yi.sessionManager.setSessionId(),(null==e?void 0:e.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(e.userAgent)&&((null==n?void 0:n.skip_client_rate_limiting)||this.yi.rateLimiter.shouldAllowEvent())){var s,o=this.yi.buildUrl(),a=this.yi.getConfig(),l=this.Mi(t,i);if(!1!==a.stringifyPayload){if(!F(s=JSON.stringify(v({},l,a.globalAttributes))))return}else if(s=v({},l,a.globalAttributes),!F(JSON.stringify(s)))return;var h="$identify"===t?this.yi.userManager.getAnonymousId():null!==(r=this.yi.userManager.getDistinctId())&&void 0!==r?r:this.yi.userManager.getAnonymousId(),d={timestamp:(new Date).toISOString(),event:t,payload:s,distinct_id:h,anonymous_id:this.yi.userManager.getAnonymousId()};this.yi.sendRequest(o,d,!0)}}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}captureInitialPageview(){n&&("visible"===n.visibilityState?this.Ti||(this.Ti=!0,setTimeout(()=>{n&&r&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.$i&&(n.removeEventListener("visibilitychange",this.$i),this.$i=null)):this.$i||(this.$i=()=>this.captureInitialPageview(),V(n,"visibilitychange",this.$i)))}Mi(t,i){var e=ui(),r=this.yi.userManager.getUserProperties(),s=this.yi.userManager.get_initial_props(),o=this.yi.sessionManager.getSessionId(),a=this.yi.sessionManager.getWindowId(),l=this.yi.userManager.getAnonymousId(),h={};!this.Ei&&Object.keys(s).length>0&&Object.assign(h,s),i.$set_once&&Object.assign(h,i.$set_once);var d=v({},e,r,{$session_id:o,$window_id:a},l?{$anon_distinct_id:l}:{},this.Ii?{$vt:this.Ii}:{},Object.keys(h).length>0?{$set_once:h}:{},i.$set?{$set:i.$set}:{},i);return!this.Ei&&Object.keys(s).length>0&&(this.Ei=!0),"$pageview"===t&&n&&(d.title=n.title),d}}class un{constructor(t){this.yi=t}identify(t,i,e){var n,r;if("number"==typeof t&&(t=String(t),console.warn("identify: first argument should be a string, not a number")),t)if(this.yi.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=this.yi.userManager.getDistinctId(),o=this.yi.userManager.getAnonymousId(),a=this.yi.userManager.getDeviceId(),l="anonymous"===this.yi.userManager.getUserState();a||this.yi.userManager.ensureDeviceId(s||o),t!==s&&l?(this.yi.userManager.setUserState("identified"),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),this.yi.userManager.setDistinctId(t),null===(n=this.yi.Ri)||void 0===n||n.emit("user:identified",{distinctId:t})):t!==s?(this.yi.userManager.setUserState("identified"),this.yi.userManager.setDistinctId(t),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),null===(r=this.yi.Ri)||void 0===r||r.emit("user:identified",{distinctId:t})):(i||e)&&(l&&this.yi.userManager.setUserState("identified"),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$set",{$set:i||{},$set_once:e||{}}))}else console.error("identify: cannot use sentinel value as distinct_id");else console.error("identify: unique user id is required")}setUserProperties(t,i){var e;this.yi.userManager.setUserProperties(t,i)&&(this.yi.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.yi.Ri)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.yi.sessionManager.resetSessionId(),this.yi.userManager.reset(t),null===(i=this.yi.Ri)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.yi.userManager.createAlias(t,i);e?this.yi.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.yi.userManager.getDistinctId()||this.yi.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.yi.userManager.getUserIdentity()}getDeviceId(){return this.yi.userManager.getDeviceId()}getUserState(){return this.yi.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.yi.userManager.getDistinctId())&&void 0!==t?t:this.yi.userManager.getAnonymousId()}getAnonymousId(){return this.yi.userManager.getAnonymousId()}}class vn{constructor(t){this.Ai=new Map,this.yi=t}onFeatureStarted(t){this.Oi=t}onFeatureStopped(t){this.Pi=t}register(t){this.Ai.set(t.name,t)}get(t){var i;return null===(i=this.Ai.get(t))||void 0===i?void 0:i.instance}initAll(){this.Ai.forEach(t=>{this.Li(t)})}init(t){var i=this.Ai.get(t);if(i)return this.Li(i),i.instance}start(t){var i,e=this.Ai.get(t);if(e&&(e.instance||this.Li(e),e.instance)){if(e.instance.onConfigUpdate){var n=this.yi.getConfig();e.instance.onConfigUpdate(n)}e.instance.startIfEnabled(),null===(i=this.Oi)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.Ai.get(t);(null==e?void 0:e.instance)&&(e.instance.stop(),null===(i=this.Pi)||void 0===i||i.call(this,t))}isActive(t){var i,e,n;return null!==(n=null===(e=null===(i=this.Ai.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n}notifyConfigUpdate(t){this.Ai.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&M(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.Ai.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onRemoteConfig)&&M(()=>i.instance.onRemoteConfig(t))})}getAll(){var t=[];return this.Ai.forEach(i=>{i.instance&&t.push(i.instance)}),t}Li(t){if(!t.instance){var i=this.yi.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||M(()=>{var i;t.instance=new t.FeatureClass(this.yi),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.Oi)||void 0===i||i.call(this,t.name))})}}}var cn="vt";class fn{constructor(t){void 0===t&&(t={}),this.version=c,this.__loaded=!1,this.__request_queue=[],this.Ui=!1,this.Ri=new R,this.configManager=new I(t);var i=this.configManager.getConfig();this.sessionManager=new Q(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new vi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new ln({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.Di.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new on({sendRequest:t=>this.zi(t),sendBeacon:t=>this.ji(t)}),this.requestQueue=new sn(t=>this.Bi(t),{flush_interval_ms:3e3}),this.Di=new dn(this),this.Ni=new un(this),this.Fi=new hn(this),this.qi=new vn(this),this.Fi.onApply(t=>{this.qi.notifyRemoteConfig(t)}),this.Fi.onLoad(t=>{this.Ri.emit(P,{config:t})}),this.qi.onFeatureStarted(t=>{this.Ri.emit(L,{feature:t})}),this.qi.onFeatureStopped(t=>{this.Ri.emit(U,{feature:t})})}init(t,i,e){var n;if(e&&e!==cn){var r=null!==(n=pn[e])&&void 0!==n?n:new fn;return r._init(t,i,e),pn[e]=r,pn[cn][e]=r,r}return this._init(t,i,e)}_init(t,i,e){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: Already initialized! Re-initializing is a no-op"),this;this.updateConfig(v({},i,{token:t||i.token,name:e})),this.__loaded=!0,this.Vi(),this.Fi.load();var n=this.configManager.getConfig();return this.userManager.set_initial_person_info(n.mask_personal_data_properties,n.custom_personal_data_properties),this.Wi(),this.Hi(),this.Ji(),!1!==n.capture_pageview&&this.Di.captureInitialPageview(),this.Ri.emit(A,{config:n}),this}Wi(){this.Xi(),this.Ki(),this.Gi(),this.Zi(),this.Ci()}Xi(){this.historyAutocapture||(this.historyAutocapture=new yi(this),this.historyAutocapture.startIfEnabled())}Ki(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new le(this),this.autocapture.startIfEnabled())}Gi(){this.webVitals||(this.webVitals=new mi(this),this.webVitals.startIfEnabled())}Zi(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new de(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(z))))}Ci(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new Ge(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new le(this)),this.autocapture.updateConfig({enabled:!0}),this.autocapture.startIfEnabled()}stopAutocapture(){var t;null===(t=this.autocapture)||void 0===t||t.stop()}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.autocapture)||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}startSessionRecording(){this.sessionRecording||(this.sessionRecording=new de(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(z)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.Ri.emit(j)}isRecordingActive(){var t;return"active"===(null===(t=this.sessionRecording)||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.sessionRecording)||void 0===t?void 0:t.sessionId)||null}capture(t,i,e){this.Di.capture(t,i,e),this.Ri.emit(D,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.Di.trackEvent(t,i)}identify(t,i,e){this.Ni.identify(t,i,e)}setUserProperties(t,i){this.Ni.setUserProperties(t,i)}resetUser(t){this.Ni.resetUser(t)}createAlias(t,i){this.Ni.createAlias(t,i)}getUserIdentity(){return this.Ni.getUserIdentity()}getDeviceId(){return this.Ni.getDeviceId()}getUserState(){return this.Ni.getUserState()}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.Ni.getDistinctId()}getAnonymousId(){return this.Ni.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:cn;return i!==cn&&(i="vt."+i),i}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new Q(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new vi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.Qi(i),this.Ri.emit(O,{config:i})}Qi(t){[this.historyAutocapture,this.autocapture,this.webVitals,this.sessionRecording,this.chat,this.vtdOverlay].forEach(i=>{(null==i?void 0:i.onConfigUpdate)&&M(()=>i.onConfigUpdate(t))})}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:n,token:r}=t;return i||(e?e+"/api/tracking?token="+r:n?n.replace(/\/+$/gm,"")+"/api/tracking?token="+r:"/api/tracking?token="+r)}sendRequest(i,e,n){if(this.Yi()){if(n&&void 0!==t)if(t.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:i,event:e});this.requestQueue.enqueue({url:i,event:e})}}Yi(){return!!this.configManager.getConfig().token||(this.Ui||(console.warn("VTilt: token is required for tracking"),this.Ui=!0),!1)}Bi(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.ji(t)}zi(t){return new Promise(i=>{var{url:e,events:n}=t,r=1===n.length?n[0]:{events:n},s=this.configManager.getConfig().disable_compression?Ye.None:Ye.GZipJS;rn({url:e,data:r,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}ji(t){var{url:i,events:e}=t,n=1===e.length?e[0]:{events:e},r=this.configManager.getConfig().disable_compression?Ye.None:Ye.GZipJS;rn({url:i,data:n,method:"POST",transport:"sendBeacon",compression:r})}te(t){this.sendRequest(t.url,t.event,!1)}Hi(){if(t){var i=()=>{this.requestQueue.unload(),this.retryQueue.unload()};V(t,"beforeunload",i),V(t,"pagehide",i)}}Ji(){this.requestQueue.enable()}Vi(){M(()=>{var i,e;if(void 0!==r&&r.search){var n=new URL(r.href),s=n.searchParams.get("vt"),o=n.searchParams.get("vtd");if((null==s?void 0:s.trim())&&(this.Di.setVtPersonId(s.trim()),n.searchParams.delete("vt")),(null==o?void 0:o.trim())&&(this.ie(o.trim()),n.searchParams.delete("vtd")),(null==s?void 0:s.trim())||(null==o?void 0:o.trim())){var a=n.pathname+(n.search||"")+n.hash;null===(e=null===(i=null==t?void 0:t.history)||void 0===i?void 0:i.replaceState)||void 0===e||e.call(i,{},"",a)}}})}ie(t){this.vtdOverlay||(this.vtdOverlay=new Qe(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){Array.isArray(t)&&t.forEach(t=>{if(t&&Array.isArray(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&M(()=>this[i](...e))}})}_dom_loaded(){this.__request_queue.forEach(t=>this.te(t)),this.__request_queue=[],this.Ji()}}var pn={},gn=!(void 0!==o||void 0!==s)&&-1===(null==a?void 0:a.indexOf("MSIE"))&&-1===(null==a?void 0:a.indexOf("Mozilla"));null!=t&&(t.__VTILT_ENQUEUE_REQUESTS=gn);var mn,bn=(mn=pn[cn]=new fn,function(){function i(){i.done||(i.done=!0,gn=!1,null!=t&&(t.__VTILT_ENQUEUE_REQUESTS=!1),q(pn,t=>t._dom_loaded()))}n&&"function"==typeof n.addEventListener?"complete"===n.readyState?i():V(n,"DOMContentLoaded",i,{capture:!1}):t&&console.error("Browser doesn't support document.addEventListener")}(),mn);export{ci as ALL_WEB_VITALS_METRICS,fi as DEFAULT_WEB_VITALS_METRICS,fn as VTilt,bn as default,bn as vt};
1
+ var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t,e=null==i?void 0:i.navigator,n=null==i?void 0:i.document,r=null==i?void 0:i.location,s=null==i?void 0:i.fetch;t&&n&&n.createElement;var o=null==i?void 0:i.XMLHttpRequest;null==i||i.AbortController;var a=null==e?void 0:e.userAgent,l=null!=t?t:{},h="[ExternalScriptsLoader]";function u(t,i,e,n,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(n,r)}function d(t){return function(){var i=this,e=arguments;return new Promise(function(n,r){var s=t.apply(i,e);function o(t){u(s,n,r,o,a,"next",t)}function a(t){u(s,n,r,o,a,"throw",t)}o(void 0)})}}function v(){return v=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},v.apply(null,arguments)}l.__VTiltExtensions__=l.__VTiltExtensions__||{},l.__VTiltExtensions__.loadExternalDependency=(t,i,e)=>{var r=((t,i)=>{var e=t.getConfig();return e.script_host?e.script_host.replace(/\/+$/gm,"")+"/"+i+".js":e.api_host?e.api_host.replace(/\/+$/gm,"")+"/dist/"+i+".js":(console.error(h+" Cannot load "+i+".js: api_host is required"),"")})(t,i);((t,i,e)=>{if(t.getConfig().disable_external_dependency_loading)return console.warn(h+" "+i+" was requested but loading of external scripts is disabled."),e("Loading of external scripts is disabled");var r=null==n?void 0:n.querySelectorAll("script");if(r)for(var s,o=function(){if(r[a].src===i){var t=r[a];return t.__vtilt_loading_callback_fired?{v:e()}:(t.addEventListener("load",i=>{t.__vtilt_loading_callback_fired=!0,e(void 0,i)}),t.onerror=t=>e(t),{v:void 0})}},a=0;a<r.length;a++)if(s=o())return s.v;var l=()=>{var t;if(!n)return e("document not found");var r=n.createElement("script");r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=t=>{r.__vtilt_loading_callback_fired=!0,e(void 0,t)},r.onerror=t=>e(t);var s=n.querySelectorAll("body > script");s.length>0?null===(t=s[0].parentNode)||void 0===t||t.insertBefore(r,s[0]):n.body.appendChild(r)};(null==n?void 0:n.body)?l():null==n||n.addEventListener("DOMContentLoaded",l)})(t,r,e)};var c="1.10.9",f="__vt_session",p="__vt_window_id",g="__vt_primary_window",m="__vt_user_state",b="__vt_device_id",y="__vt_anonymous_id",_="__vt_remote_config",w="__vt_distinct_id",x="__vt_user_properties",k="localStorage",S="localStorage+cookie",C="sessionStorage",E="memory",T="$initial_person_info";class I{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!(null==n?void 0:n.currentScript))return v({token:t.token||""},t);var i=n.currentScript,e=v({token:""},t);e.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,e.script_host=i.getAttribute("data-script-host")||t.script_host,e.proxy=i.getAttribute("data-proxy")||t.proxy,e.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,e.token=i.getAttribute("data-token")||t.token||"",e.domain=i.getAttribute("data-domain")||t.domain,e.storage=i.getAttribute("data-storage")||t.storage,e.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var r="true"===i.getAttribute("data-capture-performance");if(e.capture_performance=!!r||t.capture_performance,e.proxy&&e.proxyUrl)throw console.error("Error: Both data-proxy and data-proxy-url are specified. Please use only one of them."),new Error("Both data-proxy and data-proxy-url are specified. Please use only one of them.");for(var s of(e.globalAttributes=v({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(e.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return e}getConfig(){return v({},this.config)}updateConfig(t){this.config=v({},this.config,t)}}function M(t,i){try{return t()}catch(t){return i}}class R{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,n;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in event listener for "'+t+'":',i)}});var r=this.m.get(t);r&&(r.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(n=this.o.get("*"))||void 0===n||n.forEach(e=>{try{e({event:t,payload:i})}catch(t){console.error("[vTilt] Error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,n,r;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(r=null===(n=this.m.get(t))||void 0===n?void 0:n.size)&&void 0!==r?r:0)}hasListeners(t){return this.listenerCount(t)>0}}var A="sdk:initialized",O="sdk:config_updated",P="sdk:remote_config_loaded",L="feature:started",U="feature:stopped",D="event:captured",z="recording:started",j="recording:stopped",B="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function N(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),n="";n.length<t;)for(var r=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&n.length<t;s++){var o=r[s]&i;o<57&&(n+=B[o])}return n}function F(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function q(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,n)=>{i.call(e,t,n)});else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.call(e,t[n],n)}function V(t,i,e,n){var{capture:r=!1,passive:s=!0}=null!=n?n:{};null==t||t.addEventListener(i,e,{capture:r,passive:s})}function W(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function H(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];for(var r of e)for(var s of r)t.push(s);return t}var J=[y,b,w,m],X=31536e3,K=["herokuapp.com","vercel.app","netlify.app"];function G(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var n=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return n?"."+n[0]:""}class Z{constructor(t){var i,e,n;this.memoryStorage=new Map,this.k=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!K.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(n=t.secure)&&void 0!==n?n:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.k)return this.k;if(void 0===t||!t.localStorage)return this.k=!1,!1;try{var i="__vt_ls_test__";t.localStorage.setItem(i,"1");var e="1"===t.localStorage.getItem(i);return t.localStorage.removeItem(i),this.k=e,e||console.warn("[vTilt] localStorage unavailable, using cookies"),e}catch(t){return this.k=!1,console.warn("[vTilt] localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return J.includes(t)}get(t){var i;try{switch(this.method){case E:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case S:return this.getLocalStoragePlusCookie(t);case k:return this.getLocalStorage(t);case C:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return console.warn('[vTilt] Storage get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case E:this.memoryStorage.set(t,i);break;case S:this.setLocalStoragePlusCookie(t,i,e);break;case k:this.setLocalStorage(t,i);break;case C:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:X)}}catch(i){console.warn('[vTilt] Storage set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case E:this.memoryStorage.delete(t);break;case S:this.removeLocalStoragePlusCookie(t);break;case k:this.removeLocalStorage(t);break;case C:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){console.warn('[vTilt] Storage remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(i){if(this.isCriticalProperty(i)){var e=this.getCookie(i),n=this.getLocalStorage(i);if(null!==e){if(n!==e&&this.isLocalStorageSupported())try{null==t||t.localStorage.setItem(i,e)}catch(t){}return e}return n}return this.getLocalStorage(i)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&this.setCookie(t,i,null!=e?e:X)}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&this.removeCookie(t)}getLocalStorage(i){var e;if(!this.isLocalStorageSupported())return null;try{return null!==(e=null==t?void 0:t.localStorage.getItem(i))&&void 0!==e?e:null}catch(t){return null}}setLocalStorage(i,e){if(this.isLocalStorageSupported())try{null==t||t.localStorage.setItem(i,e)}catch(t){console.warn("[vTilt] localStorage write error:",t)}}removeLocalStorage(i){if(this.isLocalStorageSupported())try{null==t||t.localStorage.removeItem(i)}catch(t){}}readFromSessionStorage(i){var e;try{return null!==(e=null==t?void 0:t.sessionStorage.getItem(i))&&void 0!==e?e:null}catch(t){return null}}writeToSessionStorage(i,e){try{null==t||t.sessionStorage.setItem(i,e)}catch(t){console.warn("[vTilt] sessionStorage write error:",t)}}removeFromSessionStorage(i){try{null==t||t.sessionStorage.removeItem(i)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var n=e.trim();if(n.startsWith(i))try{return decodeURIComponent(n.slice(i.length))}catch(t){return n.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var n=G(this.cross_subdomain),r=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(r+="; Secure"),n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=G(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,e){var n=v({value:i},e?{expiry:Date.now()+e}:{});this.set(t,JSON.stringify(n))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===t||!(null==t?void 0:t.sessionStorage))return!1;try{var i="__vt_ss_test__";return t.sessionStorage.setItem(i,"1"),t.sessionStorage.removeItem(i),!0}catch(t){return!1}}getSessionStorage(){var i;return this.canUseSessionStorage()&&null!==(i=null==t?void 0:t.sessionStorage)&&void 0!==i?i:null}setMethod(t){this.method=t}getMethod(){return this.method}}class Q{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.S=void 0,this.C()}getSessionId(){var t=this.T();return t||(t=N(16),this.$(t)),t}setSessionId(){var t=this.T()||N(16);return this.$(t),t}resetSessionId(){this.I(),this.setSessionId(),this.M(N(16))}T(){return this.storage.get(f)}$(t){this.storage.set(f,t,1800)}I(){this.storage.remove(f)}getWindowId(){if(this.S)return this.S;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(p);if(i)return this.S=i,i}var e=N(16);return this.M(e),e}M(t){if(t!==this.S){this.S=t;var i=this.storage.getSessionStorage();i&&i.setItem(p,t)}}C(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(g),e=t.getItem(p);e&&!i?this.S=e:(e&&t.removeItem(p),this.M(N(16))),t.setItem(g,"true"),this.R()}else this.S=N(16)}R(){var i=this.storage.getSessionStorage();t&&i&&V(t,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(g)},{capture:!1})}updateStorageMethod(t,i){this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Y(t){if(!n)return null;var i=n.createElement("a");return i.href=t,i}function tt(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<e.length;n++){var r=e[n].split("=");if(r[0]===i){if(r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function it(t,i,e){if(!t||!i||!i.length)return t;for(var n=t.split("#"),r=n[0]||"",s=n[1],o=r.split("?"),a=o[1],l=o[0],h=(a||"").split("&"),u=[],d=0;d<h.length;d++){var v=h[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?u.push(c+"="+e):c&&u.push(c+(f?"="+f:""))}var p=u.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}function et(t){return"function"==typeof t}var nt="Mobile",rt="iOS",st="Android",ot="Tablet",at=st+" "+ot,lt="iPad",ht="Apple",ut=ht+" Watch",dt="Safari",vt="BlackBerry",ct="Samsung",ft=ct+"Browser",pt=ct+" Internet",gt="Chrome",mt=gt+" OS",bt=gt+" "+rt,yt="Internet Explorer",_t=yt+" "+nt,wt="Opera",xt=wt+" Mini",kt="Edge",St="Microsoft "+kt,Ct="Firefox",Et=Ct+" "+rt,Tt="Nintendo",$t="PlayStation",It="Xbox",Mt=st+" "+nt,Rt=nt+" "+dt,At="Windows",Ot=At+" Phone",Pt="Nokia",Lt="Ouya",Ut="Generic",Dt=Ut+" "+nt.toLowerCase(),zt=Ut+" "+ot.toLowerCase(),jt="Konqueror",Bt="(\\d+(\\.\\d+)?)",Nt=new RegExp("Version/"+Bt),Ft=new RegExp(It,"i"),qt=new RegExp($t+" \\w+","i"),Vt=new RegExp(Tt+" \\w+","i"),Wt=new RegExp(vt+"|PlayBook|BB10","i"),Ht={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function Jt(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Xt=(t,i)=>i&&Jt(i,ht)||function(t){return Jt(t,dt)&&!Jt(t,gt)&&!Jt(t,st)}(t),Kt=function(t,i){return i=i||"",Jt(t," OPR/")&&Jt(t,"Mini")?xt:Jt(t," OPR/")?wt:Wt.test(t)?vt:Jt(t,"IE"+nt)||Jt(t,"WPDesktop")?_t:Jt(t,ft)?pt:Jt(t,kt)||Jt(t,"Edg/")?St:Jt(t,"FBIOS")?"Facebook "+nt:Jt(t,"UCWEB")||Jt(t,"UCBrowser")?"UC Browser":Jt(t,"CriOS")?bt:Jt(t,"CrMo")||Jt(t,gt)?gt:Jt(t,st)&&Jt(t,dt)?Mt:Jt(t,"FxiOS")?Et:Jt(t.toLowerCase(),jt.toLowerCase())?jt:Xt(t,i)?Jt(t,nt)?Rt:dt:Jt(t,Ct)?Ct:Jt(t,"MSIE")||Jt(t,"Trident/")?yt:Jt(t,"Gecko")?Ct:""},Gt={[_t]:[new RegExp("rv:"+Bt)],[St]:[new RegExp(kt+"?\\/"+Bt)],[gt]:[new RegExp("("+gt+"|CrMo)\\/"+Bt)],[bt]:[new RegExp("CriOS\\/"+Bt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Bt)],[dt]:[Nt],[Rt]:[Nt],[wt]:[new RegExp("(Opera|OPR)\\/"+Bt)],[Ct]:[new RegExp(Ct+"\\/"+Bt)],[Et]:[new RegExp("FxiOS\\/"+Bt)],[jt]:[new RegExp("Konqueror[:/]?"+Bt,"i")],[vt]:[new RegExp(vt+" "+Bt),Nt],[Mt]:[new RegExp("android\\s"+Bt,"i")],[pt]:[new RegExp(ft+"\\/"+Bt)],[yt]:[new RegExp("(rv:|MSIE )"+Bt)],Mozilla:[new RegExp("rv:"+Bt)]},Zt=function(t,i){var e=Kt(t,i),n=Gt[e];if(void 0===n)return null;for(var r=0;r<n.length;r++){var s=n[r],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Qt=[[new RegExp(It+"; "+It+" (.*?)[);]","i"),t=>[It,t&&t[1]||""]],[new RegExp(Tt,"i"),[Tt,""]],[new RegExp($t,"i"),[$t,""]],[Wt,[vt,""]],[new RegExp(At,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Ot,""];if(new RegExp(nt).test(i)&&!/IEMobile\b/.test(i))return[At+" "+nt,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var n=e[1],r=Ht[n]||"";return/arm/i.test(i)&&(r="RT"),[At,r]}return[At,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[rt,i.join(".")]}return[rt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+st+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+st+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[st,i.join(".")]}return[st,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[mt,""]],[/Linux|debian/i,["Linux",""]]],Yt=function(t){return Vt.test(t)?Tt:qt.test(t)?$t:Ft.test(t)?It:new RegExp(Lt,"i").test(t)?Lt:new RegExp("("+Ot+"|WPDesktop)","i").test(t)?Ot:/iPad/.test(t)?lt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ut:Wt.test(t)?vt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Pt,"i").test(t)?Pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(nt).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?st:at:st:new RegExp("(pda|"+nt+")","i").test(t)?Dt:new RegExp(ot,"i").test(t)&&!new RegExp(ot+" pc","i").test(t)?zt:""},ti="https?://(.*)",ii=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ei=H(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ii),ni="<masked>";function ri(t){var i=function(t){return t?0===t.search(ti+"google.([^/?]*)")?"google":0===t.search(ti+"bing.com")?"bing":0===t.search(ti+"yahoo.com")?"yahoo":0===t.search(ti+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(null!==i){r.$search_engine=i;var s=n?tt(n.referrer,e):"";s.length&&(r.ph_keyword=s)}return r}function si(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function oi(){return(null==n?void 0:n.referrer)||"$direct"}function ai(){var t;return(null==n?void 0:n.referrer)&&(null===(t=Y(n.referrer))||void 0===t?void 0:t.host)||"$direct"}function li(t){var i,{r:e,u:n}=t,r={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Y(e))||void 0===i?void 0:i.host};if(n){r.$current_url=n;var s=Y(n);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=ei.concat([]),e={};return q(i,function(i){var n=tt(t,i);e[i]=n||null}),e}(n);W(r,o)}e&&W(r,ri(e));return r}function hi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ui(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function di(i,e){if(!a)return{};var n,s,o,[l,h]=function(t){for(var i=0;i<Qt.length;i++){var[e,n]=Qt[i],r=e.exec(t),s=r&&(et(n)?n(r,t):n);if(s)return s}return["",""]}(a);return W(function(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!=n&&""!==n&&(i[e]=n)}return i}({$os:l,$os_version:h,$browser:Kt(a,navigator.vendor),$device:Yt(a),$device_type:(s=a,o=Yt(s),o===lt||o===at||"Kobo"===o||"Kindle Fire"===o||o===zt?ot:o===Tt||o===It||o===$t||o===Lt?"Console":o===ut?"Wearable":o?nt:"Desktop"),$timezone:hi(),$timezone_offset:ui()}),{$current_url:it(null==r?void 0:r.href,[],ni),$host:null==r?void 0:r.host,$pathname:null==r?void 0:r.pathname,$raw_user_agent:a.length>1e3?a.substring(0,997)+"...":a,$browser_version:Zt(a,navigator.vendor),$browser_language:si(),$browser_language_prefix:(n=si(),"string"==typeof n?n.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:"web",$lib_version:c,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class vi{constructor(t,i){void 0===t&&(t="localStorage"),this.A=null,this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return v({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(y,this.userIdentity.anonymous_id,X)),this.userIdentity.anonymous_id}getUserProperties(){return v({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(t,i,e){if("number"==typeof t&&(t=t.toString(),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),t)if(this.isDistinctIdStringLike(t))console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==t){var n=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=t,!this.userIdentity.device_id){var r=n||this.userIdentity.anonymous_id;this.userIdentity.device_id=r,this.userIdentity.properties=v({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:r})}t!==n&&(this.userIdentity.distinct_id=t);var s="anonymous"===this.userIdentity.user_state;t!==n&&s?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=v({},this.userIdentity.properties,i)),e&&Object.keys(e).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=e[t])}),this.saveUserIdentity()):i||e?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=v({},this.userIdentity.properties,i)),e&&Object.keys(e).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=e[t])}),this.saveUserIdentity()):t!==n&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(t,i){if(!t&&!i)return!1;var e=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,n=this.getPersonPropertiesHash(e,t,i);return this.A===n?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=v({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.A=n,!0)}reset(t){var i=this.generateAnonymousId(),e=this.userIdentity.device_id,n=t?this.generateDeviceId():e;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:n,properties:{},user_state:"anonymous"},this.A=null,this.saveUserIdentity(),this.userIdentity.properties=v({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(t){this.userIdentity.distinct_id=t,this.saveUserIdentity()}setUserState(t){this.userIdentity.user_state=t,this.saveUserIdentity()}updateUserProperties(t,i){t&&(this.userIdentity.properties=v({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity()}ensureDeviceId(t){this.userIdentity.device_id||(this.userIdentity.device_id=t,this.userIdentity.properties=v({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:t}),this.saveUserIdentity())}createAlias(t,i){return this.isValidDistinctId(t)?(void 0===i&&(i=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(i)?t===i?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:t,original:i}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(t){return this.isDistinctIdStringLike(t)}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[T]){var e=function(t,i){var e=t?H([],ii,i||[]):[],n=null==r?void 0:r.href.substring(0,1e3);return{r:oi().substring(0,1e3),u:n?it(n,e,ni):void 0}}(t,i);this.register_once({[T]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[T];return e?(t=li(e),i={},q(t,function(t,e){var n;i["$initial_"+(n=String(e),n.startsWith("$")?n.substring(1):n)]=t}),i):{}}update_referrer_info(){var t={$referrer:oi(),$referring_domain:ai()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(y),i=this.storage.get(b),e=this.storage.get(w),n=this.storage.get(m),r=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),a=e||null,l=n||"anonymous",h=s||this.generateAnonymousId();return t||this.storage.set(y,h,X),i||this.storage.set(b,o,X),n||this.storage.set(m,l,X),{distinct_id:a,anonymous_id:h,device_id:o,properties:r,user_state:l}}saveUserIdentity(){this.storage.set(y,this.userIdentity.anonymous_id,X),this.storage.set(b,this.userIdentity.device_id,X),this.storage.set(m,this.userIdentity.user_state,X),this.userIdentity.distinct_id?this.storage.set(w,this.userIdentity.distinct_id,X):this.storage.remove(w),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(x)||{}}setStoredUserProperties(t){this.storage.setJSON(x,t,X)}register_once(t,i){var e=this.getStoredUserProperties(),n=!1;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(e[r]=t[r],n=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],n=!0));n&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+N(16)}generateDeviceId(){return"device_"+N(16)}getPersonPropertiesHash(t,i,e){return JSON.stringify({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}isValidDistinctId(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(i)&&0!==t.trim().length}isDistinctIdStringLike(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(i)}updateStorageMethod(t,i){this.storage=new Z({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var ci=["LCP","CLS","FCP","INP","TTFB"],fi=["LCP","CLS","FCP","INP"],pi=9e5,gi="[WebVitals]";class mi{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t){this.name="WebVitals",this.O=!1,this._instance=t,this.P=this.L(),this.U=mi.extractConfig(t.getConfig())}get isEnabled(){var t=null==r?void 0:r.protocol;return("http:"===t||"https:"===t)&&!0===this.U.web_vitals}get isStarted(){return this.O}startIfEnabled(){if(this.isEnabled&&!this.O&&t){var i=this.D();i?this.j(i):this.B()}}stop(){this.O&&(this.N(),this.F&&(clearTimeout(this.F),this.F=void 0),this.O=!1)}onConfigUpdate(t){var i=mi.extractConfig(t),e=this.isEnabled;this.U=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}get allowedMetrics(){return this.U.web_vitals_allowed_metrics||fi}get flushTimeoutMs(){return this.U.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.U.__web_vitals_max_value;return void 0===t?pi:0===t?0:t<6e4?pi:t}L(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}D(){var t;return null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}B(){var t,i=null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this._instance,"web-vitals",t=>{if(t)console.error(gi+" Failed to load web-vitals:",t);else{var i=this.D();i?this.j(i):console.error(gi+" web-vitals loaded but callbacks not registered")}}):console.warn(gi+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}j(t){if(!this.O){var i=this.allowedMetrics,e=this.q.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e),this.O=!0}}V(){var i;return null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.href}W(){return null==r?void 0:r.pathname}q(i){try{if(!t||!n||!r)return;if(!(null==i?void 0:i.name)||void 0===(null==i?void 0:i.value))return void console.warn(gi+" Invalid metric received",i);if(this.maxAllowedValue>0&&i.value>=this.maxAllowedValue&&"CLS"!==i.name)return void console.warn(gi+" Ignoring "+i.name+" with value >= "+this.maxAllowedValue+"ms");var e=this.V(),s=this.W();if(!e)return void console.warn(gi+" Could not determine current URL");this.P.url&&this.P.url!==e&&this.N(),this.P.url||(this.P.url=e,this.P.pathname=s),this.P.firstMetricTimestamp||(this.P.firstMetricTimestamp=Date.now());var o=this.H(i.attribution),a=this._instance.getSessionId(),l=this.J(),h=v({},i,{attribution:o,timestamp:Date.now(),$current_url:e,$session_id:a,$window_id:l}),u=this.P.metrics.findIndex(t=>t.name===i.name);u>=0?this.P.metrics[u]=h:this.P.metrics.push(h),this.X(),this.P.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(gi+" Error adding metric to buffer:",t)}}H(t){if(t){var i=v({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}J(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}X(){this.F&&clearTimeout(this.F),this.F=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.F&&(clearTimeout(this.F),this.F=void 0),0!==this.P.metrics.length){try{var t={$pathname:this.P.pathname,$current_url:this.P.url};for(var i of this.P.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){console.error(gi+" Error flushing metrics:",t)}this.P=this.L()}}}function bi(t,i,e){try{if(!(i in t))return()=>{};var n=t[i],r=e(n);return et(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=r,()=>{t[i]=n}}catch(t){return()=>{}}}class yi{constructor(i,e){var n;this.name="HistoryAutocapture",this.O=!1,this._instance=i,this.U=e||yi.extractConfig(i.getConfig()),this.K=(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.U.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.G()}stop(){this.O&&(this.Z&&(this.Z(),this.Z=void 0),this.O=!1)}onConfigUpdate(t){this.U=yi.extractConfig(t),this.isEnabled&&!this.O?this.G():!this.isEnabled&&this.O&&this.stop()}G(){t&&r&&(this.K=r.pathname||"",this.Y(),this.tt(),this.O=!0)}Y(){var i,e;if(null==t?void 0:t.history){var n=this;(null===(i=t.history.pushState)||void 0===i?void 0:i.__vtilt_wrapped__)||bi(t.history,"pushState",t=>function(i,e,r){t.call(this,i,e,r),n.it("pushState")}),(null===(e=t.history.replaceState)||void 0===e?void 0:e.__vtilt_wrapped__)||bi(t.history,"replaceState",t=>function(i,e,r){t.call(this,i,e,r),n.it("replaceState")})}}tt(){if(!this.Z&&t){var i=()=>{this.it("popstate")};V(t,"popstate",i),this.Z=()=>{null==t||t.removeEventListener("popstate",i)}}}it(i){this.isEnabled&&this.O&&M(()=>{var e,s=null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.pathname;if(s&&r&&n){if(s!==this.K){var o={navigation_type:i};this._instance.capture("$pageview",o)}this.K=s}})}}var _i=["a","button","form","input","select","textarea","label"],wi="$copy_autocapture",xi=['[id*="cookie" i]','[class*="cookie" i]','[id*="consent" i]','[class*="consent" i]','[id*="gdpr" i]','[class*="gdpr" i]','[id*="privacy-banner" i]','[class*="privacy-banner" i]','[id*="cookie-banner" i]','[class*="cookie-banner" i]','[id*="cookie-notice" i]','[class*="cookie-notice" i]',"#CybotCookiebotDialog",'[class^="CybotCookiebotDialog"]','[id^="onetrust"]','[class^="onetrust"]','[id^="cc-"]',".cc-banner",".cc-window",".cc-revoke",'[id^="cookieconsent"]','[class^="cookieconsent"]','[id^="gdpr-cookie"]','[id^="qc-cmp"]',"#termly-code-snippet-support",'[id^="iubenda"]','[id^="truste"]','[class^="truste"]',"#consent_blackbar",'[id^="didomi"]','[id^="usercentrics"]',"#uc-center-container",".klaro","#klaro","#cookiescript_injected",".cky-consent-container","#cky-consent","#cmplz-cookiebanner-container","#gdpr-cookie-message",'[class*="fs-cc"]','[class*="fc-cc"]',"[fs-cc]","[fs-cc-checkbox]",'[class*="cookie-preferences"]',"#cookie-preferences",'[role="dialog"][aria-label*="cookie" i]','[role="dialog"][aria-label*="consent" i]','[aria-describedby*="cookie" i]','[aria-label*="Cookie Preferences" i]'];function ki(t){return null==t}function Si(t){return"string"==typeof t}function Ci(t){return void 0===t}function Ei(t){return t.replace(/^\s+|\s+$/g,"")}function Ti(t,i){return t.indexOf(i)>-1}function $i(t){return 1===(null==t?void 0:t.nodeType)}function Ii(t){return 3===(null==t?void 0:t.nodeType)}function Mi(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ri(t){return 11===(null==t?void 0:t.nodeType)}function Ai(t){return t?Ei(t).split(/\s+/):[]}function Oi(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ai(i)}function Pi(t){return ki(t)?null:Ei(t).split(/(\s+)/).filter(t=>Ji(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Li(t){var i,e="";if(Ki(t)&&!Gi(t)&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];Ii(r)&&r.textContent&&(e+=null!==(i=Pi(r.textContent))&&void 0!==i?i:"")}return Ei(e)}function Ui(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(r&&"span"===(null===(i=r.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Li(r)).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Ui(r)).trim())}catch(t){}}return e}function Di(t){var i=Li(t);return Ji(i=(i+" "+Ui(t)).trim())?i:""}function zi(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!$i(i));return i}function ji(t){var i=t.parentNode;return!(!i||!$i(i))&&i}function Bi(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}var Ni="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Fi=new RegExp("^(?:"+Ni+")$"),qi=new RegExp(Ni),Vi="\\d{3}-?\\d{2}-?\\d{4}",Wi=new RegExp("^("+Vi+")$"),Hi=new RegExp("("+Vi+")");function Ji(t,i){if(void 0===i&&(i=!0),ki(t))return!1;if(Si(t)){if(t=Ei(t),(i?Fi:qi).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Wi:Hi).test(t))return!1}return!0}function Xi(t){return!!Si(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Ki(t){for(var i=t;i&&i.parentNode&&!Mi(i,"body");i=i.parentNode){var e=Oi(i);if(Ti(e,"vt-sensitive")||Ti(e,"vt-no-capture"))return!1}if(Ti(Oi(t),"vt-include"))return!0;var n=t.type||"";if(Si(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";if(Si(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Gi(t){return!!(Mi(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Mi(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Zi(t){if(!Ki(t))return null;if(Mi(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var n={$el_value:i.checked?"true":"false"},r=function(t){var i=t.closest("label");if(i){var e=Ei(i.textContent||"");if(e&&Ji(e))return Pi(e)||null}if(t.id)try{var n=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(n){var r=Ei(n.textContent||"");if(r&&Ji(r))return Pi(r)||null}}catch(t){}return null}(i);return r?n.$selected_text=r:i.value&&Ji(i.value)&&(n.$selected_text=i.value),n}var s=i.value;if(s&&Ji(s)){var o=Pi(s);if(o)return{$el_value:o}}return null}if(Mi(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var h=a.options[l],u={};h.value&&Ji(h.value)&&(u.$el_value=h.value);var d=h.text;if(d&&Ji(d)){var v=Pi(d);v&&(u.$selected_text=v)}if(u.$el_value||u.$selected_text)return u}return null}return Mi(t,"textarea"),null}function Qi(i,e,n,r,s){if(void 0===n&&(n=void 0),!t||!i||Mi(i,"html")||!$i(i))return!1;if((null==n?void 0:n.url_allowlist)&&!Bi(n.url_allowlist))return!1;if((null==n?void 0:n.url_ignorelist)&&Bi(n.url_ignorelist))return!1;if(null==n?void 0:n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some(t=>e.type===t))return!1}for(var a=!1,l=[i],h=!0,u=i;u.parentNode&&!Mi(u,"body");)if(Ri(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!(h=ji(u)))break;if(r||_i.indexOf(h.tagName.toLowerCase())>-1)a=!0;else{var d=t.getComputedStyle(h);d&&"pointer"===d.getPropertyValue("cursor")&&(a=!0)}l.push(h),u=h}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(Ci(e))return!0;var n,r=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(l,n))return!1;if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(Ci(e))return!0;var n,r=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(l,n))return!1;if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,n=void 0===e?xi:e;if(0===n.length)return!1;for(var r of t)for(var s of n)try{if(r.matches(s))return!0}catch(t){}return!1}(l,n))return!1;var v=t.getComputedStyle(i);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0;var c=i.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return a?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(_i.indexOf(c)>-1||"true"===i.getAttribute("contenteditable"))}}function Yi(t,i){return i.length>t?i.slice(0,t)+"...":i}function te(t,i,e,n){var r=t.tagName.toLowerCase(),s={tag_name:r};_i.indexOf(r)>-1&&!e&&(s.$el_text=Yi(1024,"a"===r||"button"===r?Di(t):Li(t)));var o=Oi(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!Gi(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==n?void 0:n.includes(l.name))&&!i&&Ji(l.value)&&!Xi(l.name))){var h=l.value;"class"===l.name&&(h=Ai(h).join(" ")),s["attr__"+l.name]=Yi(1024,h)}}for(var u=1,d=1,v=t;v=zi(v);)u++,v.tagName===t.tagName&&d++;return s.nth_child=u,s.nth_of_type=d,s}function ie(t){if(!Ki(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var n=t.attributes[e];if(n.name&&0===n.name.indexOf("data-vt-capture-attribute")){var r=n.name.replace("data-vt-capture-attribute-",""),s=n.value;r&&s&&Ji(s)&&(i[r]=s)}}return i}function ee(t){return t.replace(/"|\\"/g,'\\"')}function ne(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Ai(e)):void 0}function re(t){return function(t){var i=t.map(t=>{var i,e,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var r of(t.attr_class.sort(),t.attr_class))n+="."+r.replace(/"/g,"");var s=v({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(e=t.nth_of_type)&&void 0!==e?e:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Object.entries(s).sort((t,i)=>{var[e]=t,[n]=i;return e.localeCompare(n)}).forEach(t=>{var[i,e]=t;return o[ee(i.toString())]=ee(String(e))}),(n+=":")+Object.entries(o).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,n={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:ne(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return n.attributes[i]=e}),n})}(t))}function se(t,i){return t.indexOf(i)>-1}class oe{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var n=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-n.x,2)+Math.pow(i-n.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function ae(i,e){for(var n,r,s,o,{e:a,maskAllElementAttributes:l,maskAllText:h,elementAttributeIgnoreList:u,elementsChainAsString:d,captureElementValues:v}=e,c=[i],f=i;f.parentNode&&!Mi(f,"body");)Ri(f.parentNode)?(c.push(f.parentNode.host),f=f.parentNode.host):(c.push(f.parentNode),f=f.parentNode);var p,g=[],m={},b=!1,y=!1;for(var _ of c){var w=Ki(_);if("a"===_.tagName.toLowerCase()){var x=_.getAttribute("href");b=!!(w&&x&&Ji(x))&&x}se(Oi(_),"vt-no-capture")&&(y=!0),g.push(te(_,l,h,u));var k=ie(_);Object.assign(m,k)}if(y)return{props:{},explicitNoCapture:y};if(h||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?g[0].$el_text=Di(i):g[0].$el_text=Li(i)),"change"===a.type&&v){var S=Zi(i);S&&(S.$el_value&&(g[0].$el_value=S.$el_value),S.$selected_text&&(g[0].$selected_text=S.$selected_text))}if(b){g[0].attr__href=b;var C=null===(n=Y(b))||void 0===n?void 0:n.host,E=null===(r=null==t?void 0:t.location)||void 0===r?void 0:r.host;C&&E&&C!==E&&(p=b)}var T=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:a.type,$ce_version:1},d?{}:{$elements:g},{$elements_chain:re(g)},(null===(s=g[0])||void 0===s?void 0:s.$el_text)?{$el_text:null===(o=g[0])||void 0===o?void 0:o.$el_text}:{},p&&"click"===a.type?{$external_click_url:p}:{},m);return{props:T}}class le{constructor(t){this.name="Autocapture",this.et=!1,this.nt=null,this.rt=null,this.st=new oe,this.ot=!1,this._instance=t}get U(){var t,i=this._instance.getConfig(),e="object"!=typeof(t=i.autocapture)||null===t||Array.isArray(t)?{}:i.autocapture;return e.url_allowlist&&(e.url_allowlist=e.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),e.url_ignorelist&&(e.url_ignorelist=e.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),e}get isEnabled(){var t,i=null!==(t=this.nt)&&void 0!==t&&t;return!!this._instance.getConfig().autocapture&&!i}get isStarted(){return this.et}startIfEnabled(){this.isEnabled&&!this.et&&(this.lt(),this.et=!0)}stop(){this.et=!1}onConfigUpdate(t){this.isEnabled&&!this.et&&this.startIfEnabled()}onRemoteConfig(t){t.elementsChainAsString&&(this.ot=t.elementsChainAsString),this.nt=!!t.autocapture_opt_out,this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&t.enabled&&(this.nt=!1)}setElementSelectors(t){this.rt=t}getElementSelectors(t){var i,e=[];return null===(i=this.rt)||void 0===i||i.forEach(i=>{var r=null==n?void 0:n.querySelectorAll(i);null==r||r.forEach(n=>{t===n&&e.push(i)})}),e}lt(){if(this.ht()&&t&&n){var i=i=>{i=i||(null==t?void 0:t.event);try{this.ut(i)}catch(t){}};if(V(n,"submit",i,{capture:!0}),V(n,"change",i,{capture:!0}),V(n,"click",i,{capture:!0}),this.U.capture_copied_text){var e=i=>{i=i||(null==t?void 0:t.event),this.ut(i,wi)};V(n,"copy",e,{capture:!0}),V(n,"cut",e,{capture:!0})}}}ut(i,e){var n,r,s,o,a;if(void 0===e&&(e="$autocapture"),this.isEnabled&&i.isTrusted){var l=function(t){var i;return Ci(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(i);if(Ii(l)&&(l=l.parentNode||null),"$autocapture"===e&&"click"===i.type&&i instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(n=this.st)||void 0===n?void 0:n.isRageClick(i.clientX,i.clientY,(new Date).getTime()))&&this.ut(i,"$rageclick");var h=e===wi;if(l&&Qi(l,i,this.U,h,h?["copy","cut"]:void 0)){var u=this._instance.getConfig(),{props:d,explicitNoCapture:v}=ae(l,{e:i,maskAllElementAttributes:null!==(r=u.mask_all_element_attributes)&&void 0!==r&&r,maskAllText:null!==(s=u.mask_all_text)&&void 0!==s&&s,elementAttributeIgnoreList:this.U.element_attribute_ignorelist,elementsChainAsString:this.ot,captureElementValues:null!==(o=this.U.capture_element_values)&&void 0!==o&&o});if(v)return!1;var c=this.getElementSelectors(l);if(c&&c.length>0&&(d.$element_selectors=c),e===wi){var f=Pi(null===(a=null==t?void 0:t.getSelection())||void 0===a?void 0:a.toString()),p=i.type||"clipboard";if(!f)return!1;d.$selected_content=f,d.$copy_type=p}return this._instance.capture(e,d),!0}}}ht(){return"function"==typeof(null==n?void 0:n.querySelectorAll)}}var he="[SessionRecording]";class ue{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||ue.extractConfig(t.getConfig())}static extractConfig(t){var i,e,n,r=t.session_recording||{};return{enabled:null!==(i=r.enabled)&&void 0!==i&&i,sampleRate:r.sampleRate,minimumDurationMs:r.minimumDurationMs,sessionIdleThresholdMs:r.sessionIdleThresholdMs,fullSnapshotIntervalMs:r.fullSnapshotIntervalMs,captureConsole:null!==(e=r.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(n=r.captureNetwork)&&void 0!==n&&n,captureCanvas:r.captureCanvas,blockClass:r.blockClass,blockSelector:r.blockSelector,ignoreClass:r.ignoreClass,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,maskAllInputs:r.maskAllInputs,maskInputOptions:r.maskInputOptions,masking:r.masking,recordHeaders:r.recordHeaders,recordBody:r.recordBody,compressEvents:r.compressEvents,__mutationThrottlerRefillRate:r.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:r.__mutationThrottlerBucketSize}}get isEnabled(){var i,e=this._instance.getConfig(),n=null!==(i=this.U.enabled)&&void 0!==i&&i,r=!e.disable_session_recording;return!!t&&n&&r}get isStarted(){var t;return this.O&&!!(null===(t=this.dt)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.dt)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.vt(t),this.O=!0,console.info(he+" starting")):this.stop()}}stop(){M(()=>{var t;null===(t=this.dt)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.U=ue.extractConfig(t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U),this.startIfEnabledOrStop("config_updated")}onRemoteConfig(t){var i,e,n,r,s,o,a;if(t.sessionRecording){var l=t.sessionRecording;this.U=v({},this.U,{enabled:null!==(i=this.U.enabled)&&void 0!==i?i:l.enabled,sampleRate:null!==(e=this.U.sampleRate)&&void 0!==e?e:l.sampleRate,minimumDurationMs:null!==(n=this.U.minimumDurationMs)&&void 0!==n?n:l.minimumDurationMs,fullSnapshotIntervalMs:null!==(r=this.U.fullSnapshotIntervalMs)&&void 0!==r?r:l.fullSnapshotIntervalMs,maskAllInputs:null!==(s=this.U.maskAllInputs)&&void 0!==s?s:l.maskAllInputs,captureConsole:null!==(o=this.U.captureConsole)&&void 0!==o?o:l.captureConsole,captureCanvas:null!==(a=this.U.captureCanvas)&&void 0!==a?a:l.captureCanvas}),this.startIfEnabledOrStop("remote_config")}}get started(){return this.isStarted}get status(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.dt)||void 0===e?void 0:e.log)?this.dt.log(t,i):console.warn(he+" log called before recorder was ready")}updateConfig(t){var i;this.U=v({},this.U,t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U)}get ct(){return"recorder"}vt(t){var i,e,n,r;if(this.isEnabled)if((null===(e=null===(i=null==l?void 0:l.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(n=l.__VTiltExtensions__)||void 0===n?void 0:n.initSessionRecording))this.ft(t);else{var s=null===(r=l.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this.ct,i=>{i?console.error(he+" could not load recorder:",i):this.ft(t)}):console.error(he+" loadExternalDependency not available. Session recording cannot start.")}}ft(t){var i,e=null===(i=l.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.dt||(this.dt=e(this._instance,this.U)),this.dt.start(t)):console.error(he+" initSessionRecording not available after script load")}}var de=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(de||{}),ve=Uint8Array,ce=Uint16Array,fe=Int32Array,pe=new ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ge=new ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),me=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),be=function(t,i){for(var e=new ce(31),n=0;n<31;++n)e[n]=i+=1<<t[n-1];var r=new fe(e[30]);for(n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)r[s]=s-e[n]<<5|n;return{b:e,r:r}},ye=be(pe,2),_e=ye.b,we=ye.r;_e[28]=258,we[258]=28;for(var xe=be(ge,0).r,ke=new ce(32768),Se=0;Se<32768;++Se){var Ce=(43690&Se)>>1|(21845&Se)<<1;Ce=(61680&(Ce=(52428&Ce)>>2|(13107&Ce)<<2))>>4|(3855&Ce)<<4,ke[Se]=((65280&Ce)>>8|(255&Ce)<<8)>>1}var Ee=function(t,i,e){for(var n=t.length,r=0,s=new ce(i);r<n;++r)t[r]&&++s[t[r]-1];var o,a=new ce(i);for(r=1;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(e){o=new ce(1<<i);var l=15-i;for(r=0;r<n;++r)if(t[r])for(var h=r<<4|t[r],u=i-t[r],d=a[t[r]-1]++<<u,v=d|(1<<u)-1;d<=v;++d)o[ke[d]>>l]=h}else for(o=new ce(n),r=0;r<n;++r)t[r]&&(o[r]=ke[a[t[r]-1]++]>>15-t[r]);return o},Te=new ve(288);for(Se=0;Se<144;++Se)Te[Se]=8;for(Se=144;Se<256;++Se)Te[Se]=9;for(Se=256;Se<280;++Se)Te[Se]=7;for(Se=280;Se<288;++Se)Te[Se]=8;var $e=new ve(32);for(Se=0;Se<32;++Se)$e[Se]=5;var Ie=Ee(Te,9,0),Me=Ee($e,5,0),Re=function(t){return(t+7)/8|0},Ae=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new ve(t.subarray(i,e))},Oe=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8},Pe=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8,t[n+2]|=e>>16},Le=function(t,i){for(var e=[],n=0;n<t.length;++n)t[n]&&e.push({s:n,f:t[n]});var r=e.length,s=e.slice();if(!r)return{t:Fe,l:0};if(1==r){var o=new ve(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,u=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=e[e[h].f<e[d].f?h++:d++],l=e[h!=u&&e[h].f<e[d].f?h++:d++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(n=1;n<r;++n)s[n].s>v&&(v=s[n].s);var c=new ce(v+1),f=Ue(e[u-1],c,0);if(f>i){n=0;var p=0,g=f-i,m=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});n<r;++n){var b=s[n].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[n].s;c[y]<i?p-=1<<i-c[y]++-1:++n}for(;n>=0&&p;--n){var _=s[n].s;c[_]==i&&(--c[_],++p)}f=i}return{t:new ve(c),l:f}},Ue=function(t,i,e){return-1==t.s?Math.max(Ue(t.l,i,e+1),Ue(t.r,i,e+1)):i[t.s]=e},De=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ce(++i),n=0,r=t[0],s=1,o=function(t){e[n++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return{c:e.subarray(0,n),n:i}},ze=function(t,i){for(var e=0,n=0;n<i.length;++n)e+=t[n]*i[n];return e},je=function(t,i,e){var n=e.length,r=Re(i+2);t[r]=255&n,t[r+1]=n>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<n;++s)t[r+s+4]=e[s];return 8*(r+4+n)},Be=function(t,i,e,n,r,s,o,a,l,h,u){Oe(i,u++,e),++r[256];for(var d=Le(r,15),v=d.t,c=d.l,f=Le(s,15),p=f.t,g=f.l,m=De(v),b=m.c,y=m.n,_=De(p),w=_.c,x=_.n,k=new ce(19),S=0;S<b.length;++S)++k[31&b[S]];for(S=0;S<w.length;++S)++k[31&w[S]];for(var C=Le(k,7),E=C.t,T=C.l,I=19;I>4&&!E[me[I-1]];--I);var M,R,A,O,P=h+5<<3,L=ze(r,Te)+ze(s,$e)+o,U=ze(r,v)+ze(s,p)+o+14+3*I+ze(k,E)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&P<=L&&P<=U)return je(i,u,t.subarray(l,l+h));if(Oe(i,u,1+(U<L)),u+=2,U<L){M=Ee(v,c,0),R=v,A=Ee(p,g,0),O=p;var D=Ee(E,T,0);Oe(i,u,y-257),Oe(i,u+5,x-1),Oe(i,u+10,I-4),u+=14;for(S=0;S<I;++S)Oe(i,u+3*S,E[me[S]]);u+=3*I;for(var z=[b,w],j=0;j<2;++j){var B=z[j];for(S=0;S<B.length;++S){var N=31&B[S];Oe(i,u,D[N]),u+=E[N],N>15&&(Oe(i,u,B[S]>>5&127),u+=B[S]>>12)}}}else M=Ie,R=Te,A=Me,O=$e;for(S=0;S<a;++S){var F=n[S];if(F>255){Pe(i,u,M[(N=F>>18&31)+257]),u+=R[N+257],N>7&&(Oe(i,u,F>>23&31),u+=pe[N]);var q=31&F;Pe(i,u,A[q]),u+=O[q],q>3&&(Pe(i,u,F>>5&8191),u+=ge[q])}else Pe(i,u,M[F]),u+=R[F]}return Pe(i,u,M[256]),u+R[256]},Ne=new fe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fe=new ve(0),qe=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,n=9;--n;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Ve=function(t,i,e,n,r){if(!r&&(r={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new ve(s.length+t.length);o.set(s),o.set(t,s.length),t=o,r.w=s.length}return function(t,i,e,n,r,s){var o=s.z||t.length,a=new ve(n+o+5*(1+Math.ceil(o/7e3))+r),l=a.subarray(n,a.length-r),h=s.l,u=7&(s.r||0);if(i){u&&(l[0]=s.r>>3);for(var d=Ne[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new ce(32768),g=s.h||new ce(f+1),m=Math.ceil(e/3),b=2*m,y=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<b)&f},_=new fe(25e3),w=new ce(288),x=new ce(32),k=0,S=0,C=s.i||0,E=0,T=s.w||0,I=0;C+2<o;++C){var M=y(C),R=32767&C,A=g[M];if(p[R]=A,g[M]=R,T<=C){var O=o-C;if((k>7e3||E>24576)&&(O>423||!h)){u=Be(t,l,0,_,w,x,S,E,I,C-I,u),E=k=S=0,I=C;for(var P=0;P<286;++P)w[P]=0;for(P=0;P<30;++P)x[P]=0}var L=2,U=0,D=c,z=R-A&32767;if(O>2&&M==y(C-z))for(var j=Math.min(v,O)-1,B=Math.min(32767,C),N=Math.min(258,O);z<=B&&--D&&R!=A;){if(t[C+L]==t[C+L-z]){for(var F=0;F<N&&t[C+F]==t[C+F-z];++F);if(F>L){if(L=F,U=z,F>j)break;var q=Math.min(z,F-2),V=0;for(P=0;P<q;++P){var W=C-z+P&32767,H=W-p[W]&32767;H>V&&(V=H,A=W)}}}z+=(R=A)-(A=p[R])&32767}if(U){_[E++]=268435456|we[L]<<18|xe[U];var J=31&we[L],X=31&xe[U];S+=pe[J]+ge[X],++w[257+J],++x[X],T=C+L,++k}else _[E++]=t[C],++w[t[C]]}}for(C=Math.max(C,T);C<o;++C)_[E++]=t[C],++w[t[C]];u=Be(t,l,h,_,w,x,S,E,I,C-I,u),h||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=g,s.p=p,s.i=C,s.w=T)}else{for(C=s.w||0;C<o+h;C+=65535){var K=C+65535;K>=o&&(l[u/8|0]=h,K=o),u=je(l,u+1,t.subarray(C,K))}s.i=o}return Ae(a,0,n+Re(u)+r)}(t,null==i.level?6:i.level,null==i.mem?r.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,n,r)},We=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function He(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,n=0;n<i.length;++n)e=qe[255&e^i[n]]^e>>>8;t=e},d:function(){return~t}}}(),n=t.length;e.p(t);var r,s=Ve(t,i,10+((r=i).filename?r.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&We(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var n=0;n<=e.length;++n)t[n+10]=e.charCodeAt(n)}}(s,i),We(s,o-8,e.d()),We(s,o-4,n),s}var Je="undefined"!=typeof TextEncoder&&new TextEncoder,Xe="undefined"!=typeof TextDecoder&&new TextDecoder;try{Xe.decode(Fe,{stream:!0})}catch(t){}de.MouseMove,de.MouseInteraction,de.Scroll,de.ViewportResize,de.Input,de.TouchMove,de.MediaInteraction,de.Drag;var Ke="[Chat]";class Ge{constructor(t,i){this._instance=t,this.name="Chat",this.gt=null,this.bt=!1,this.yt=!1,this.O=!1,this._t=null,this.wt=[],this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.U=i||Ge.extractConfig(t.getConfig())}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline}}get isEnabled(){var t;return!1!==this.U.enabled&&(!0===this.U.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.gt)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Et().catch(t=>{console.error(Ke+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=Ge.extractConfig(t),this.Tt&&(null===(e=(i=this.Tt).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,e,n,r,s,o,a,l,h;t.chat&&(this.gt=v({},this.gt,{enabled:null!==(n=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(e=this.gt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n,position:null!==(o=null!==(r=t.chat.widgetPosition)&&void 0!==r?r:null===(s=this.gt)||void 0===s?void 0:s.position)&&void 0!==o?o:"bottom-right",color:null!==(h=null!==(a=t.chat.widgetColor)&&void 0!==a?a:null===(l=this.gt)||void 0===l?void 0:l.color)&&void 0!==h?h:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Et(){var t=this;return d(function*(){var i,e,n,r;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(Ke+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.$t()),t.isEnabled?(t.O=!0,null!==(n=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t.gt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n&&t.It(),(null===(r=t.gt)||void 0===r?void 0:r.enabled)&&t.Mt(),console.info(Ke+" ready (lazy-load on demand)")):console.info(Ke+" not enabled (check dashboard settings)")):console.info(Ke+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.yt||null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.Tt)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.Tt)||void 0===t||t.close()}toggle(){this.Tt?this.Tt.toggle():this.open()}show(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.Tt)||void 0===t||t.hide()}getChannels(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.Rt(()=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.Rt(()=>{var t;return null===(t=this.Tt)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.Tt)||void 0===t||t.goToChannelList()}sendMessage(t){this.Tt?this.Tt.sendMessage(t):(this.wt.push(t),this.Rt(()=>{this.wt.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.sendMessage(t)}),this.wt=[]}))}markAsRead(){var t;null===(t=this.Tt)||void 0===t||t.markAsRead()}onMessage(t){return this.kt.push(t),this.Tt?this.Tt.onMessage(t):()=>{var i=this.kt.indexOf(t);i>-1&&this.kt.splice(i,1)}}onTyping(t){return this.St.push(t),this.Tt?this.Tt.onTyping(t):()=>{var i=this.St.indexOf(t);i>-1&&this.St.splice(i,1)}}onConnectionChange(t){return this.Ct.push(t),this.Tt?this.Tt.onConnectionChange(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}updateConfig(t){this.U=v({},this.U,t)}getMergedConfig(){var t,i,e,n,r,s,o,a,l,h,u,d,v,c,f,p,g,m,b=this.gt,y=this.U;return{enabled:null!==(i=null!==(t=y.enabled)&&void 0!==t?t:null==b?void 0:b.enabled)&&void 0!==i&&i,autoConfig:null===(e=y.autoConfig)||void 0===e||e,position:null!==(r=null!==(n=y.position)&&void 0!==n?n:null==b?void 0:b.position)&&void 0!==r?r:"bottom-right",greeting:null!==(s=y.greeting)&&void 0!==s?s:null==b?void 0:b.greeting,color:null!==(a=null!==(o=y.color)&&void 0!==o?o:null==b?void 0:b.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=y.aiMode)&&void 0!==l?l:null==b?void 0:b.ai_enabled)||void 0===h||h,aiGreeting:null!==(u=y.aiGreeting)&&void 0!==u?u:null==b?void 0:b.ai_greeting,preload:null!==(d=y.preload)&&void 0!==d&&d,theme:null!==(v=y.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=y.color)&&void 0!==c?c:null==b?void 0:b.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=y.offlineMessage)&&void 0!==p?p:null==b?void 0:b.offline_message,collectEmailOffline:null===(m=null!==(g=y.collectEmailOffline)&&void 0!==g?g:null==b?void 0:b.collect_email_offline)||void 0===m||m}}destroy(){M(()=>{var i,e;null===(i=this.Tt)||void 0===i||i.destroy(),this.Tt=void 0,this.wt=[],this.xt=[],this.kt=[],this.St=[],this.Ct=[];var n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");n&&n.remove()})}$t(){var t=this;return d(function*(){if(!t.bt){var i=t._instance.getConfig(),e=i.token,n=i.api_host;if(!e||!n)return console.warn(Ke+" Cannot fetch settings: missing token or api_host"),void(t.bt=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(r);if(!s.ok)return console.warn(Ke+" Failed to fetch settings: "+s.status),void(t.bt=!0);t.gt=yield s.json(),t.bt=!0,console.info(Ke+" Loaded settings from dashboard")}catch(i){console.warn(Ke+" Error fetching settings:",i),t.bt=!0}}})()}Mt(){if((null==t?void 0:t.document)&&!document.getElementById("vtilt-chat-bubble")){var i=this.getMergedConfig(),e=i.position||"bottom-right",n=i.color||"#6366f1",r=document.createElement("div");r.id="vtilt-chat-bubble",r.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===e?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+n+";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s, box-shadow 0.2s;\n z-index: 999999;\n ").trim()),r.innerHTML='\n <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>\n </svg>\n ',r.addEventListener("mouseenter",()=>{r.style.transform="scale(1.05)",r.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),r.addEventListener("mouseleave",()=>{r.style.transform="scale(1)",r.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),r.addEventListener("click",()=>{this.open()}),document.body.appendChild(r)}}get ct(){return"chat"}It(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.At(),{timeout:5e3}):setTimeout(()=>this.At(),3e3)}Rt(t){this.Tt?t():(this.xt.push(t),this.At())}At(){var t,i;if(!(this.yt||this.Tt||this._t))if(null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.ft();else{this.yt=!0;var e=null===(i=l.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Ke+" loadExternalDependency not available. Chat cannot start."),this.yt=!1,void(this._t="loadExternalDependency not available");e(this._instance,this.ct,t=>{if(this.yt=!1,t)return console.error(Ke+" Failed to load:",t),void(this._t=String(t));this.ft()})}}ft(){var t,i=null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Ke+" initChat not available after script load"),void(this._t="initChat not available");if(!this.Tt){var e=this.getMergedConfig();this.Tt=i(this._instance,e),this.kt.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onMessage(t)}),this.St.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onTyping(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.Tt)||void 0===i?void 0:i.onConnectionChange(t)});var n=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");n&&n.remove()}this.xt.forEach(t=>t()),this.xt=[],console.info(Ke+" loaded and ready")}}var Ze="[VtdOverlay]";class Qe{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Ot=null,this.Pt=null,this.yt=!0,this.Lt=null,this.Ut=null,this.Dt=null,this._instance=t,this.U=i||Qe.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.U.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&&M(()=>{this.zt(),this.O=!1})}onConfigUpdate(t){this.U=Qe.extractConfig(t),!this.isEnabled&&this.O&&this.stop()}setDestinationUrl(i){var e;if(this.isEnabled)if(null==i?void 0:i.trim()){var n=i;try{n=decodeURIComponent(i)}catch(t){n=i}if(this.jt(n)){var r=this.Bt(n);this.Pt=n,this.Ot=r,this.yt=!0,this.Nt(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:n,$vtd_embed_url:r!==n?r:void 0,$current_url:null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.href})}else console.warn(Ze+" Invalid URL: "+n)}else console.warn(Ze+" Empty URL provided");else console.warn(Ze+" Feature is disabled")}getDestinationUrl(){return this.Ot}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Pt}),this.Lt?(this.Lt.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.zt(),this.O=!1,this.Ot=null,this.Pt=null},200)):(this.zt(),this.O=!1,this.Ot=null,this.Pt=null)}jt(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Bt(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var n=i.searchParams.get("v");if(n){var r=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+n+"?autoplay=1";return r&&(s+="&start="+r.replace("s","")),s}}if("youtu.be"===e){var o=i.pathname.slice(1);if(o){var a=i.searchParams.get("t"),l="https://www.youtube.com/embed/"+o+"?autoplay=1";return a&&(l+="&start="+a.replace("s","")),l}}if("vimeo.com"===e||"www.vimeo.com"===e){var h=i.pathname.match(/^\/(\d+)/);if(h)return"https://player.vimeo.com/video/"+h[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var u=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(u)return"https://www.loom.com/embed/"+u[1]+"?autoplay=1"}if(e.endsWith("wistia.com")){var d=i.pathname.match(/^\/medias\/([a-zA-Z0-9]+)/);if(d)return"https://fast.wistia.net/embed/iframe/"+d[1]+"?autoplay=1"}if("dailymotion.com"===e||"www.dailymotion.com"===e){var v=i.pathname.match(/^\/video\/([a-zA-Z0-9]+)/);if(v)return"https://www.dailymotion.com/embed/video/"+v[1]+"?autoplay=1"}if("open.spotify.com"===e){var c=i.pathname.match(/^\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);if(c)return"https://open.spotify.com/embed/"+c[1]+"/"+c[2]}return"drive.google.com"===e&&i.pathname.includes("/view")?t.replace("/view","/preview"):t}catch(i){return t}}Ft(t){try{return new URL(t).hostname}catch(i){return t}}qt(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}Nt(){if(n&&this.Ot){this.zt(),this.Lt=n.createElement("div"),this.Lt.id="vtilt-vtd-overlay",this.Lt.className="vtilt-vtd-opening",this.Lt.setAttribute("style",this.Vt());var t=n.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Wt());var i=n.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Ht()),i.innerHTML=this.Jt(),t.appendChild(i);var e=n.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Xt()),this.Dt=n.createElement("div"),this.Dt.className="vtilt-vtd-loading",this.Dt.setAttribute("style",this.Kt()),this.Dt.innerHTML=this.Gt(),e.appendChild(this.Dt),this.Ut=n.createElement("iframe"),this.Ut.id="vtilt-vtd-iframe",this.Ut.className="vtilt-vtd-iframe",this.Ut.setAttribute("style",this.Zt()),this.Ut.setAttribute("frameborder","0"),this.Ut.setAttribute("allowfullscreen","true"),this.Ut.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this.yt=!1,this.Dt&&(this.Dt.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Dt)||void 0===t?void 0:t.parentNode)&&(this.Dt.style.display="none")},300)),this.Ut&&(this.Ut.style.opacity="1")};this.Ut.onload=r,this.Ut.onerror=r,setTimeout(()=>{this.yt&&r()},5e3),e.appendChild(this.Ut),this.Ut.src=this.Ot,t.appendChild(e),this.Lt.appendChild(t);var s=n.createElement("style");s.id="vtilt-vtd-styles",s.textContent=this.Qt(),n.head.appendChild(s),n.body.appendChild(this.Lt),this.Yt(),n.body.style.overflow="hidden"}}zt(){var t;(null===(t=this.Lt)||void 0===t?void 0:t.parentNode)&&(this.Lt.parentNode.removeChild(this.Lt),this.Lt=null,this.Ut=null,this.Dt=null);var i=null==n?void 0:n.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==n?void 0:n.body)&&(n.body.style.overflow="")}Yt(){var i,e,r,s=null===(i=this.Lt)||void 0===i?void 0:i.querySelector(".vtilt-vtd-close");null==s||s.addEventListener("click",()=>this.close());var o=null===(e=this.Lt)||void 0===e?void 0:e.querySelector(".vtilt-vtd-open");null==o||o.addEventListener("click",()=>{this.Pt&&(null==t||t.open(this.Pt,"_blank"))}),null===(r=this.Lt)||void 0===r||r.addEventListener("click",t=>{t.target===this.Lt&&this.close()});var a=t=>{"Escape"===t.key&&(this.close(),null==n||n.removeEventListener("keydown",a))};null==n||n.addEventListener("keydown",a)}Vt(){return'\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n '}Wt(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Ht(){return"\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n height: 56px;\n background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n gap: 16px;\n "}Jt(){var t=this.Pt||this.Ot,i=t?this.Ft(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.qt(t):"")+'" \n alt="" \n style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;"\n onerror="this.style.display=\'none\'"\n />\n <div style="\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 2px;\n ">\n <div style="\n color: rgba(255, 255, 255, 0.95);\n font-size: 14px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ti(i)+'</div>\n <div style="\n color: rgba(255, 255, 255, 0.45);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ti(this.ii(t||"",50))+'</div>\n </div>\n </div>\n <div style="display: flex; align-items: center; gap: 8px; flex-shrink: 0;">\n <button class="vtilt-vtd-open vtilt-vtd-btn" title="Open in new tab">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>\n <polyline points="15 3 21 3 21 9"></polyline>\n <line x1="10" y1="14" x2="21" y2="3"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Open</span>\n </button>\n <button class="vtilt-vtd-close vtilt-vtd-btn vtilt-vtd-btn-primary" title="Close (Esc)">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Close</span>\n </button>\n </div>\n '}Xt(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Kt(){return"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #0a0a0a;\n z-index: 1;\n transition: opacity 0.3s ease;\n "}Gt(){var t=this.Pt||this.Ot,i=t?this.Ft(t):"";return'\n <div class="vtilt-vtd-spinner"></div>\n <div style="\n margin-top: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 14px;\n font-weight: 500;\n ">Loading '+this.ti(i)+'...</div>\n <div style="\n margin-top: 8px;\n color: rgba(255, 255, 255, 0.35);\n font-size: 12px;\n ">Press <kbd style="\n display: inline-block;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-family: inherit;\n font-size: 11px;\n ">Esc</kbd> to close</div>\n '}Zt(){return"\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: white;\n opacity: 0;\n transition: opacity 0.3s ease;\n "}Qt(){return"\n /* Animations */\n @keyframes vtilt-vtd-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes vtilt-vtd-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n \n @keyframes vtilt-vtd-scale-in {\n from { opacity: 0; transform: scale(0.96); }\n to { opacity: 1; transform: scale(1); }\n }\n \n @keyframes vtilt-vtd-spin {\n to { transform: rotate(360deg); }\n }\n \n /* Container animations */\n #vtilt-vtd-overlay.vtilt-vtd-opening {\n animation: vtilt-vtd-fade-in 0.2s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-opening .vtilt-vtd-modal {\n animation: vtilt-vtd-scale-in 0.25s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-closing {\n animation: vtilt-vtd-fade-out 0.2s ease-in forwards;\n }\n \n /* Loading spinner */\n .vtilt-vtd-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.8);\n border-radius: 50%;\n animation: vtilt-vtd-spin 0.8s linear infinite;\n }\n \n /* Button base styles */\n .vtilt-vtd-btn {\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n padding: 8px 14px;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s ease;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n }\n \n .vtilt-vtd-btn:hover {\n background: rgba(255, 255, 255, 0.14);\n border-color: rgba(255, 255, 255, 0.18);\n }\n \n .vtilt-vtd-btn:active {\n background: rgba(255, 255, 255, 0.18);\n transform: scale(0.98);\n }\n \n .vtilt-vtd-btn:focus-visible {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);\n }\n \n /* Primary button variant */\n .vtilt-vtd-btn-primary {\n background: rgba(255, 255, 255, 0.95);\n border-color: transparent;\n color: #0a0a0a;\n }\n \n .vtilt-vtd-btn-primary:hover {\n background: rgba(255, 255, 255, 1);\n border-color: transparent;\n }\n \n .vtilt-vtd-btn-primary:active {\n background: rgba(255, 255, 255, 0.85);\n }\n \n /* Desktop responsive - modal with margin */\n @media (min-width: 768px) {\n #vtilt-vtd-overlay {\n padding: 32px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1200px;\n max-height: 90vh;\n width: 100%;\n height: auto;\n min-height: 500px;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);\n }\n \n .vtilt-vtd-header {\n border-radius: 16px 16px 0 0;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 0 16px 16px;\n min-height: 400px;\n }\n }\n \n /* Large desktop - bigger modal */\n @media (min-width: 1400px) {\n #vtilt-vtd-overlay {\n padding: 48px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1400px;\n max-height: 85vh;\n }\n }\n \n /* Tablet */\n @media (min-width: 768px) and (max-width: 1024px) {\n #vtilt-vtd-overlay {\n padding: 24px;\n }\n \n .vtilt-vtd-modal {\n max-width: 95%;\n max-height: 90vh;\n }\n }\n \n /* Mobile - fullscreen */\n @media (max-width: 767px) {\n #vtilt-vtd-overlay {\n padding: 0 !important;\n background: #0a0a0a !important;\n }\n \n .vtilt-vtd-modal {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0 !important;\n }\n \n .vtilt-vtd-header {\n border-radius: 0 !important;\n padding: 0 12px !important;\n height: 52px !important;\n }\n \n .vtilt-vtd-btn {\n padding: 8px 10px !important;\n }\n \n .vtilt-vtd-btn-text {\n display: none !important;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 !important;\n }\n }\n \n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n #vtilt-vtd-overlay,\n #vtilt-vtd-overlay *,\n .vtilt-vtd-spinner {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n "}ii(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}ti(t){if(void 0===n)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");var i=n.createElement("div");return i.textContent=t,i.innerHTML}}var Ye,tn="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ye||(Ye={}));var en=t=>{var{data:i,compression:e}=t;if(i){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),r=new Blob([n]).size;if(e===Ye.GZipJS&&r>=1024)try{var s=He(function(t,i){if(Je)return Je.encode(t);for(var e=t.length,n=new ve(t.length+(t.length>>1)),r=0,s=function(t){n[r++]=t},o=0;o<e;++o){if(r+5>n.length){var a=new ve(r+8+(e-o<<1));a.set(n),n=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|63&l)):(s(224|l>>12),s(128|l>>6&63),s(128|63&l))}return Ae(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:tn});if(o.size<.95*r)return{contentType:tn,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:r}}},nn=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var i=en(t);if(i){var{contentType:e,body:n,estimatedSize:r}=i,s=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,o=v({"Content-Type":e},t.headers||{}),a=new AbortController,l=t.timeout?setTimeout(()=>a.abort(),t.timeout):null;fetch(s,{method:t.method||"POST",headers:o,body:n,keepalive:r<52428.8,signal:a.signal}).then(function(){var i=d(function*(i){var e,n=yield i.text(),r={statusCode:i.status,text:n};if(200===i.status)try{r.json=JSON.parse(n)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,r)});return function(t){return i.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=en(t);if(i){var{contentType:e,body:n}=i,r=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",r,!0),t.headers&&Object.entries(t.headers).forEach(t=>{var[i,e]=t;s.setRequestHeader(i,e)}),s.setRequestHeader("Content-Type",e),t.timeout&&(s.timeout=t.timeout),s.onreadystatechange=()=>{var i;if(4===s.readyState){var e={statusCode:s.status,text:s.responseText};if(200===s.status)try{e.json=JSON.parse(s.responseText)}catch(t){}null===(i=t.callback)||void 0===i||i.call(t,e)}},s.onerror=()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},s.send(n)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=en(t);if(i){var{contentType:e,body:n}=i;try{var r="string"==typeof n?new Blob([n],{type:e}):n,s=t.compression===Ye.GZipJS&&e===tn?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,r)}catch(t){}}}}],rn=t=>{var i,e=t.transport||"fetch",n=nn.find(t=>t.name===e&&t.available)||nn.find(t=>t.available);if(!n)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));n.method(t)};class sn{constructor(t,i){var e,n,r,s;this.ei=!0,this.ni=[],this.ri=(e=(null==i?void 0:i.flush_interval_ms)||3e3,n=250,r=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,n),r)),this.si=t}get length(){return this.ni.length}enqueue(t){this.ni.push(t),this.oi||this.ai()}unload(){if(this.li(),0!==this.ni.length){var t=this.hi();for(var i in t){var e=t[i];this.si(v({},e,{transport:"sendBeacon"}))}}}enable(){this.ei=!1,this.ai()}pause(){this.ei=!0,this.li()}flush(){this.li(),this.ui(),this.ai()}ai(){this.ei||(this.oi=setTimeout(()=>{this.li(),this.ui(),this.ni.length>0&&this.ai()},this.ri))}li(){this.oi&&(clearTimeout(this.oi),this.oi=void 0)}ui(){if(0!==this.ni.length){var t=this.hi(),i=Date.now();for(var e in t){var n=t[e];n.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.si(n)}}}hi(){var t={};return this.ni.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.ni=[],t}}class on{constructor(i){this.di=!1,this.ci=3e3,this.ni=[],this.fi=!0,this.si=i.sendRequest,this.pi=i.sendBeacon,t&&void 0!==e&&"onLine"in e&&(this.fi=e.onLine,V(t,"online",()=>{this.fi=!0,this.N()}),V(t,"offline",()=>{this.fi=!1}))}get length(){return this.ni.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,n=Math.min(18e5,i),r=(Math.random()-.5)*(n-e);return Math.ceil(n+r)}(i),n=Date.now()+e;this.ni.push({retryAt:n,request:t,retriesPerformedSoFar:i+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.fi||(r+=" (Browser is offline)"),console.warn(r),this.di||(this.di=!0,this.gi())}}retriableRequest(t){var i=this;return d(function*(){try{var e=yield i.si(t);200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&i.enqueue(t,0)}catch(e){i.enqueue(t,0)}})()}gi(){this.mi&&clearTimeout(this.mi),this.mi=setTimeout(()=>{this.fi&&this.ni.length>0&&this.N(),this.ni.length>0?this.gi():this.di=!1},this.ci)}N(){var t=this,i=Date.now(),e=[],n=[];this.ni.forEach(t=>{t.retryAt<i?n.push(t):e.push(t)}),this.ni=e,n.forEach(function(){var i=d(function*(i){var{request:e,retriesPerformedSoFar:n}=i;try{var r=yield t.si(e);200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&t.enqueue(e,n)}catch(i){t.enqueue(e,n)}});return function(t){return i.apply(this,arguments)}}())}unload(){this.mi&&(clearTimeout(this.mi),this.mi=void 0),this.ni.forEach(t=>{var{request:i}=t;try{this.pi(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.ni=[]}}var an="vt_rate_limit";class ln{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,n,r;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(an))&&void 0!==e?e:{tokens:this.eventsBurstLimit,last:s},a=(s-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=s,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var l=o.tokens<1;return l||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||null===(n=this.captureWarning)||void 0===n||n.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(r=this.persistence)||void 0===r||r.set(an,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class hn{constructor(t){this.bi=null,this.yi=t}get config(){return this.bi}onApply(t){this.wi=t}onLoad(t){this.xi=t}load(){var i,e=this.yi.getConfig();if(e.token){if(null===(i=e.bootstrap)||void 0===i?void 0:i.remoteConfig)return this.bi=e.bootstrap.remoteConfig,this.ki(this.bi),void this.Si();var n=M(()=>t.__VTILT_BOOTSTRAP__);if(null==n?void 0:n.remoteConfig)return this.bi=n.remoteConfig,this.ki(this.bi),void this.Si();M(()=>{var t=localStorage.getItem(_+"_"+e.token);t&&(this.bi=JSON.parse(t),this.ki(this.bi))}),this.Si()}}Si(){var t=this.yi.getConfig();if(t.token&&t.api_host){var i=t.api_host+"/api/decide?token="+t.token,e=new AbortController,n=setTimeout(()=>e.abort(),3e3);(s||fetch)(i,{method:"GET",signal:e.signal,headers:{Accept:"application/json"}}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),this.bi=i,M(()=>{localStorage.setItem(_+"_"+t.token,JSON.stringify(i))}),this.ki(i),null===(e=this.xi)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n)})}}ki(t){var i,e,n,r,s,o,a,l,h,u=this.yi.getConfig(),d={},v=!1,c=!1,f=!1;t.sessionRecording&&void 0===u.session_recording&&(d.session_recording={enabled:t.sessionRecording.enabled,sampleRate:t.sessionRecording.sampleRate,minimumDurationMs:t.sessionRecording.minimumDurationMs,fullSnapshotIntervalMs:t.sessionRecording.fullSnapshotIntervalMs,maskAllInputs:t.sessionRecording.maskAllInputs,captureConsole:t.sessionRecording.captureConsole,captureCanvas:t.sessionRecording.captureCanvas},t.sessionRecording.enabled&&(v=!0)),(null===(i=t.chat)||void 0===i?void 0:i.enabled)&&void 0===u.chat&&(d.chat={enabled:t.chat.enabled,position:t.chat.widgetPosition,color:t.chat.widgetColor},c=!0),t.analytics&&(void 0!==t.analytics.capturePageview&&void 0===u.capture_pageview&&(d.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===u.capture_pageleave&&(d.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===u.capture_performance&&(d.capture_performance=t.analytics.capturePerformance),void 0!==t.analytics.autocapture&&void 0===u.autocapture&&(d.autocapture=t.analytics.autocapture,t.analytics.autocapture&&(f=!0))),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===u.respect_dnt&&(d.respect_dnt=t.privacy.respectDnt),Object.keys(d).length>0&&this.yi.updateConfig(d),null===(n=this.wi)||void 0===n||n.call(this,t),this.yi.__loaded&&(v&&(null===(s=(r=this.yi).startSessionRecording)||void 0===s||s.call(r)),c&&(null===(a=(o=this.yi).Ci)||void 0===a||a.call(o)),f&&(null===(h=(l=this.yi).startAutocapture)||void 0===h||h.call(l)))}}class un{constructor(t){this.Ei=!1,this.Ti=!1,this.$i=null,this.Ii=null,this.yi=t}setVtPersonId(t){this.Ii=t}capture(t,i,n){var r;if(this.yi.sessionManager.setSessionId(),(null==e?void 0:e.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(e.userAgent)&&((null==n?void 0:n.skip_client_rate_limiting)||this.yi.rateLimiter.shouldAllowEvent())){var s,o=this.yi.buildUrl(),a=this.yi.getConfig(),l=this.Mi(t,i);if(!1!==a.stringifyPayload){if(!F(s=JSON.stringify(v({},l,a.globalAttributes))))return}else if(s=v({},l,a.globalAttributes),!F(JSON.stringify(s)))return;var h="$identify"===t?this.yi.userManager.getAnonymousId():null!==(r=this.yi.userManager.getDistinctId())&&void 0!==r?r:this.yi.userManager.getAnonymousId(),u={timestamp:(new Date).toISOString(),event:t,payload:s,distinct_id:h,anonymous_id:this.yi.userManager.getAnonymousId()};this.yi.sendRequest(o,u,!0)}}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}captureInitialPageview(){n&&("visible"===n.visibilityState?this.Ti||(this.Ti=!0,setTimeout(()=>{n&&r&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.$i&&(n.removeEventListener("visibilitychange",this.$i),this.$i=null)):this.$i||(this.$i=()=>this.captureInitialPageview(),V(n,"visibilitychange",this.$i)))}Mi(t,i){var e=di(),r=this.yi.userManager.getUserProperties(),s=this.yi.userManager.get_initial_props(),o=this.yi.sessionManager.getSessionId(),a=this.yi.sessionManager.getWindowId(),l=this.yi.userManager.getAnonymousId(),h={};!this.Ei&&Object.keys(s).length>0&&Object.assign(h,s),i.$set_once&&Object.assign(h,i.$set_once);var u=v({},e,r,{$session_id:o,$window_id:a},l?{$anon_distinct_id:l}:{},this.Ii?{$vt:this.Ii}:{},Object.keys(h).length>0?{$set_once:h}:{},i.$set?{$set:i.$set}:{},i);return!this.Ei&&Object.keys(s).length>0&&(this.Ei=!0),"$pageview"===t&&n&&(u.title=n.title),u}}class dn{constructor(t){this.yi=t}identify(t,i,e){var n,r;if("number"==typeof t&&(t=String(t),console.warn("identify: first argument should be a string, not a number")),t)if(this.yi.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=this.yi.userManager.getDistinctId(),o=this.yi.userManager.getAnonymousId(),a=this.yi.userManager.getDeviceId(),l="anonymous"===this.yi.userManager.getUserState();a||this.yi.userManager.ensureDeviceId(s||o),t!==s&&l?(this.yi.userManager.setUserState("identified"),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),this.yi.userManager.setDistinctId(t),null===(n=this.yi.Ri)||void 0===n||n.emit("user:identified",{distinctId:t})):t!==s?(this.yi.userManager.setUserState("identified"),this.yi.userManager.setDistinctId(t),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),null===(r=this.yi.Ri)||void 0===r||r.emit("user:identified",{distinctId:t})):(i||e)&&(l&&this.yi.userManager.setUserState("identified"),this.yi.userManager.updateUserProperties(i,e),this.yi.capture("$set",{$set:i||{},$set_once:e||{}}))}else console.error("identify: cannot use sentinel value as distinct_id");else console.error("identify: unique user id is required")}setUserProperties(t,i){var e;this.yi.userManager.setUserProperties(t,i)&&(this.yi.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.yi.Ri)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.yi.sessionManager.resetSessionId(),this.yi.userManager.reset(t),null===(i=this.yi.Ri)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.yi.userManager.createAlias(t,i);e?this.yi.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.yi.userManager.getDistinctId()||this.yi.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.yi.userManager.getUserIdentity()}getDeviceId(){return this.yi.userManager.getDeviceId()}getUserState(){return this.yi.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.yi.userManager.getDistinctId())&&void 0!==t?t:this.yi.userManager.getAnonymousId()}getAnonymousId(){return this.yi.userManager.getAnonymousId()}}class vn{constructor(t){this.Ai=new Map,this.yi=t}onFeatureStarted(t){this.Oi=t}onFeatureStopped(t){this.Pi=t}register(t){this.Ai.set(t.name,t)}get(t){var i;return null===(i=this.Ai.get(t))||void 0===i?void 0:i.instance}initAll(){this.Ai.forEach(t=>{this.Li(t)})}init(t){var i=this.Ai.get(t);if(i)return this.Li(i),i.instance}start(t){var i,e=this.Ai.get(t);if(e&&(e.instance||this.Li(e),e.instance)){if(e.instance.onConfigUpdate){var n=this.yi.getConfig();e.instance.onConfigUpdate(n)}e.instance.startIfEnabled(),null===(i=this.Oi)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.Ai.get(t);(null==e?void 0:e.instance)&&(e.instance.stop(),null===(i=this.Pi)||void 0===i||i.call(this,t))}isActive(t){var i,e,n;return null!==(n=null===(e=null===(i=this.Ai.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n}notifyConfigUpdate(t){this.Ai.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&M(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.Ai.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onRemoteConfig)&&M(()=>i.instance.onRemoteConfig(t))})}getAll(){var t=[];return this.Ai.forEach(i=>{i.instance&&t.push(i.instance)}),t}Li(t){if(!t.instance){var i=this.yi.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||M(()=>{var i;t.instance=new t.FeatureClass(this.yi),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.Oi)||void 0===i||i.call(this,t.name))})}}}var cn="vt";class fn{constructor(t){void 0===t&&(t={}),this.version=c,this.__loaded=!1,this.__request_queue=[],this.Ui=!1,this.Ri=new R,this.configManager=new I(t);var i=this.configManager.getConfig();this.sessionManager=new Q(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new vi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new ln({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.Di.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new on({sendRequest:t=>this.zi(t),sendBeacon:t=>this.ji(t)}),this.requestQueue=new sn(t=>this.Bi(t),{flush_interval_ms:3e3}),this.Di=new un(this),this.Ni=new dn(this),this.Fi=new hn(this),this.qi=new vn(this),this.Fi.onApply(t=>{this.qi.notifyRemoteConfig(t)}),this.Fi.onLoad(t=>{this.Ri.emit(P,{config:t})}),this.qi.onFeatureStarted(t=>{this.Ri.emit(L,{feature:t})}),this.qi.onFeatureStopped(t=>{this.Ri.emit(U,{feature:t})})}init(t,i,e){var n;if(e&&e!==cn){var r=null!==(n=pn[e])&&void 0!==n?n:new fn;return r._init(t,i,e),pn[e]=r,pn[cn][e]=r,r}return this._init(t,i,e)}_init(t,i,e){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: Already initialized! Re-initializing is a no-op"),this;this.updateConfig(v({},i,{token:t||i.token,name:e})),this.__loaded=!0,this.Vi(),this.Fi.load();var n=this.configManager.getConfig();return this.userManager.set_initial_person_info(n.mask_personal_data_properties,n.custom_personal_data_properties),this.Wi(),this.Hi(),this.Ji(),!1!==n.capture_pageview&&this.Di.captureInitialPageview(),this.Ri.emit(A,{config:n}),this}Wi(){this.Xi(),this.Ki(),this.Gi(),this.Zi(),this.Ci()}Xi(){this.historyAutocapture||(this.historyAutocapture=new yi(this),this.historyAutocapture.startIfEnabled())}Ki(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new le(this),this.autocapture.startIfEnabled())}Gi(){this.webVitals||(this.webVitals=new mi(this),this.webVitals.startIfEnabled())}Zi(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new ue(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(z))))}Ci(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new Ge(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new le(this)),this.autocapture.updateConfig({enabled:!0}),this.autocapture.startIfEnabled()}stopAutocapture(){var t;null===(t=this.autocapture)||void 0===t||t.stop()}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.autocapture)||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}startSessionRecording(){this.sessionRecording||(this.sessionRecording=new ue(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(z)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.Ri.emit(j)}isRecordingActive(){var t;return"active"===(null===(t=this.sessionRecording)||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.sessionRecording)||void 0===t?void 0:t.sessionId)||null}capture(t,i,e){this.Di.capture(t,i,e),this.Ri.emit(D,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.Di.trackEvent(t,i)}identify(t,i,e){this.Ni.identify(t,i,e)}setUserProperties(t,i){this.Ni.setUserProperties(t,i)}resetUser(t){this.Ni.resetUser(t)}createAlias(t,i){this.Ni.createAlias(t,i)}getUserIdentity(){return this.Ni.getUserIdentity()}getDeviceId(){return this.Ni.getDeviceId()}getUserState(){return this.Ni.getUserState()}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.Ni.getDistinctId()}getAnonymousId(){return this.Ni.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:cn;return i!==cn&&(i="vt."+i),i}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new Q(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new vi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.Qi(i),this.Ri.emit(O,{config:i})}Qi(t){[this.historyAutocapture,this.autocapture,this.webVitals,this.sessionRecording,this.chat,this.vtdOverlay].forEach(i=>{(null==i?void 0:i.onConfigUpdate)&&M(()=>i.onConfigUpdate(t))})}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:n,token:r}=t;return i||(e?e+"/api/tracking?token="+r:n?n.replace(/\/+$/gm,"")+"/api/tracking?token="+r:"/api/tracking?token="+r)}sendRequest(i,e,n){if(this.Yi()){if(n&&void 0!==t)if(t.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:i,event:e});this.requestQueue.enqueue({url:i,event:e})}}Yi(){return!!this.configManager.getConfig().token||(this.Ui||(console.warn("VTilt: token is required for tracking"),this.Ui=!0),!1)}Bi(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.ji(t)}zi(t){return new Promise(i=>{var{url:e,events:n}=t,r=1===n.length?n[0]:{events:n},s=this.configManager.getConfig().disable_compression?Ye.None:Ye.GZipJS;rn({url:e,data:r,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}ji(t){var{url:i,events:e}=t,n=1===e.length?e[0]:{events:e},r=this.configManager.getConfig().disable_compression?Ye.None:Ye.GZipJS;rn({url:i,data:n,method:"POST",transport:"sendBeacon",compression:r})}te(t){this.sendRequest(t.url,t.event,!1)}Hi(){if(t){var i=()=>{this.requestQueue.unload(),this.retryQueue.unload()};V(t,"beforeunload",i),V(t,"pagehide",i)}}Ji(){this.requestQueue.enable()}Vi(){M(()=>{var i,e;if(void 0!==r&&r.search){var n=new URL(r.href),s=n.searchParams.get("vt"),o=n.searchParams.get("vtd");if((null==s?void 0:s.trim())&&(this.Di.setVtPersonId(s.trim()),n.searchParams.delete("vt")),(null==o?void 0:o.trim())&&(this.ie(o.trim()),n.searchParams.delete("vtd")),(null==s?void 0:s.trim())||(null==o?void 0:o.trim())){var a=n.pathname+(n.search||"")+n.hash;null===(e=null===(i=null==t?void 0:t.history)||void 0===i?void 0:i.replaceState)||void 0===e||e.call(i,{},"",a)}}})}ie(t){this.vtdOverlay||(this.vtdOverlay=new Qe(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){Array.isArray(t)&&t.forEach(t=>{if(t&&Array.isArray(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&M(()=>this[i](...e))}})}_dom_loaded(){this.__request_queue.forEach(t=>this.te(t)),this.__request_queue=[],this.Ji()}}var pn={},gn=!(void 0!==o||void 0!==s)&&-1===(null==a?void 0:a.indexOf("MSIE"))&&-1===(null==a?void 0:a.indexOf("Mozilla"));null!=t&&(t.__VTILT_ENQUEUE_REQUESTS=gn);var mn,bn=(mn=pn[cn]=new fn,function(){function i(){i.done||(i.done=!0,gn=!1,null!=t&&(t.__VTILT_ENQUEUE_REQUESTS=!1),q(pn,t=>t._dom_loaded()))}n&&"function"==typeof n.addEventListener?"complete"===n.readyState?i():V(n,"DOMContentLoaded",i,{capture:!1}):t&&console.error("Browser doesn't support document.addEventListener")}(),mn);export{ci as ALL_WEB_VITALS_METRICS,fi as DEFAULT_WEB_VITALS_METRICS,fn as VTilt,bn as default,bn as vt};
2
2
  //# sourceMappingURL=module.js.map