@v-tilt/browser 1.10.10 → 1.12.0
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/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/autocapture-types.d.ts +17 -0
- package/dist/autocapture-utils.d.ts +24 -1
- package/dist/autocapture.d.ts +94 -5
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/config.d.ts +8 -1
- package/dist/constants.d.ts +19 -13
- package/dist/core/capture.d.ts +15 -5
- package/dist/core/config-utils.d.ts +15 -0
- package/dist/core/consent.d.ts +62 -0
- package/dist/core/event-buffer.d.ts +60 -0
- package/dist/core/fb-cookies.d.ts +32 -0
- package/dist/core/feature-manager.d.ts +61 -69
- package/dist/core/fifo-queue.d.ts +23 -0
- package/dist/core/identity.d.ts +23 -33
- package/dist/core/index.d.ts +7 -1
- package/dist/core/page-lifecycle.d.ts +41 -0
- package/dist/core/remote-config.d.ts +14 -17
- package/dist/extensions/chat/bubble-drag.d.ts +30 -0
- package/dist/extensions/chat/chat-api.d.ts +15 -0
- package/dist/extensions/chat/chat-styles.d.ts +27 -0
- package/dist/extensions/chat/chat-wrapper.d.ts +20 -145
- package/dist/extensions/chat/chat.d.ts +129 -12
- package/dist/extensions/chat/message-content-styles.d.ts +1 -0
- package/dist/extensions/chat/message-html.d.ts +6 -0
- package/dist/extensions/chat/message-markdown.d.ts +8 -0
- package/dist/extensions/chat/normalize-send-content.d.ts +24 -0
- package/dist/extensions/chat/types.d.ts +19 -57
- package/dist/extensions/chat/widget-registry.d.ts +53 -0
- package/dist/extensions/chat/widgets/collect-email.d.ts +6 -0
- package/dist/extensions/chat/widgets/escalate-to-human.d.ts +6 -0
- package/dist/extensions/ga4-proxy.d.ts +59 -0
- package/dist/extensions/google-tag-gateway/consent-bridge.d.ts +27 -0
- package/dist/extensions/google-tag-gateway/enhanced-conversions.d.ts +35 -0
- package/dist/extensions/google-tag-gateway/event-bridge.d.ts +74 -0
- package/dist/extensions/google-tag-gateway/google-tag-gateway.d.ts +95 -0
- package/dist/extensions/google-tag-gateway/gtag-loader.d.ts +85 -0
- package/dist/extensions/google-tag-gateway/index.d.ts +7 -0
- package/dist/extensions/google-tag-gateway/normalize.d.ts +28 -0
- package/dist/extensions/google-tag-gateway/public-api.d.ts +23 -0
- package/dist/extensions/history-autocapture.d.ts +2 -2
- package/dist/extensions/replay/index.d.ts +1 -1
- package/dist/extensions/replay/session-recording-utils.d.ts +13 -43
- package/dist/extensions/replay/session-recording-wrapper.d.ts +10 -66
- package/dist/extensions/replay/session-recording.d.ts +53 -1
- package/dist/extensions/replay/types.d.ts +6 -1
- package/dist/extensions/web-vitals/web-vitals-manager.d.ts +14 -43
- package/dist/external-scripts-loader.js +1 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/feature.d.ts +54 -172
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +728 -753
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +728 -753
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/rate-limiter.d.ts +0 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/request.d.ts +34 -20
- package/dist/scroll-depth-tracker.d.ts +42 -0
- package/dist/server.d.ts +114 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +12 -0
- package/dist/types.d.ts +204 -9
- package/dist/user-manager.d.ts +26 -52
- package/dist/utils/base64.d.ts +30 -0
- package/dist/utils/bot-detection.d.ts +28 -0
- package/dist/utils/endpoint-url.d.ts +36 -0
- package/dist/utils/event-emitter.d.ts +1 -0
- package/dist/utils/globals.d.ts +71 -2
- package/dist/utils/index.d.ts +20 -5
- package/dist/utils/logger.d.ts +66 -0
- package/dist/utils/request-utils.d.ts +5 -0
- package/dist/utils/safewrap.d.ts +6 -1
- package/dist/utils/transport-health.d.ts +55 -0
- package/dist/utils/type-guards.d.ts +1 -1
- package/dist/vtilt.d.ts +85 -25
- package/dist/web-vitals.js.map +1 -1
- package/package.json +9 -4
package/dist/array.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";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.10",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",L="sdk:remote_config_loaded",P="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 q(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function F(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",Lt="Nokia",Pt="Ouya",Ut="Generic",Dt=Ut+" "+nt.toLowerCase(),zt=Ut+" "+ot.toLowerCase(),jt="Konqueror",Bt="(\\d+(\\.\\d+)?)",Nt=new RegExp("Version/"+Bt),qt=new RegExp(It,"i"),Ft=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:Ft.test(t)?$t:qt.test(t)?It:new RegExp(Pt,"i").test(t)?Pt: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(Lt,"i").test(t)?Lt:/(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 F(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===Pt?"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={},F(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"],fi=9e5,pi="[WebVitals]";class gi{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.L=this.P(),this.U=gi.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.q&&(clearTimeout(this.q),this.q=void 0),this.O=!1)}onConfigUpdate(t){var i=gi.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||ci}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?fi:0===t?0:t<6e4?fi:t}P(){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(pi+" Failed to load web-vitals:",t);else{var i=this.D();i?this.j(i):console.error(pi+" web-vitals loaded but callbacks not registered")}}):console.warn(pi+" 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.F.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}F(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(pi+" Invalid metric received",i);if(this.maxAllowedValue>0&&i.value>=this.maxAllowedValue&&"CLS"!==i.name)return void console.warn(pi+" Ignoring "+i.name+" with value >= "+this.maxAllowedValue+"ms");var e=this.V(),s=this.W();if(!e)return void console.warn(pi+" Could not determine current URL");this.L.url&&this.L.url!==e&&this.N(),this.L.url||(this.L.url=e,this.L.pathname=s),this.L.firstMetricTimestamp||(this.L.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.L.metrics.findIndex(t=>t.name===i.name);u>=0?this.L.metrics[u]=h:this.L.metrics.push(h),this.X(),this.L.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(pi+" 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.q&&clearTimeout(this.q),this.q=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.q&&(clearTimeout(this.q),this.q=void 0),0!==this.L.metrics.length){try{var t={$pathname:this.L.pathname,$current_url:this.L.url};for(var i of this.L.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(pi+" Error flushing metrics:",t)}this.L=this.P()}}}function mi(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 bi{constructor(i,e){var n;this.name="HistoryAutocapture",this.O=!1,this._instance=i,this.U=e||bi.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=bi.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__)||mi(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__)||mi(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 yi=["a","button","form","input","select","textarea","label"],_i="$copy_autocapture",wi=['[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 xi(t){return null==t}function ki(t){return"string"==typeof t}function Si(t){return void 0===t}function Ci(t){return t.replace(/^\s+|\s+$/g,"")}function Ei(t,i){return t.indexOf(i)>-1}function Ti(t){return 1===(null==t?void 0:t.nodeType)}function $i(t){return 3===(null==t?void 0:t.nodeType)}function Ii(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Mi(t){return 11===(null==t?void 0:t.nodeType)}function Ri(t){return t?Ci(t).split(/\s+/):[]}function Ai(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 Ri(i)}function Oi(t){return xi(t)?null:Ci(t).split(/(\s+)/).filter(t=>Hi(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Li(t){var i,e="";if(Xi(t)&&!Ki(t)&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];$i(r)&&r.textContent&&(e+=null!==(i=Oi(r.textContent))&&void 0!==i?i:"")}return Ci(e)}function Pi(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+" "+Pi(r)).trim())}catch(t){}}return e}function Ui(t){var i=Li(t);return Hi(i=(i+" "+Pi(t)).trim())?i:""}function Di(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!Ti(i));return i}function zi(t){var i=t.parentNode;return!(!i||!Ti(i))&&i}function ji(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}var Bi="(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})",Ni=new RegExp("^(?:"+Bi+")$"),qi=new RegExp(Bi),Fi="\\d{3}-?\\d{2}-?\\d{4}",Vi=new RegExp("^("+Fi+")$"),Wi=new RegExp("("+Fi+")");function Hi(t,i){if(void 0===i&&(i=!0),xi(t))return!1;if(ki(t)){if(t=Ci(t),(i?Ni:qi).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Vi:Wi).test(t))return!1}return!0}function Ji(t){return!!ki(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Xi(t){for(var i=t;i&&i.parentNode&&!Ii(i,"body");i=i.parentNode){var e=Ai(i);if(Ei(e,"vt-sensitive")||Ei(e,"vt-no-capture"))return!1}if(Ei(Ai(t),"vt-include"))return!0;var n=t.type||"";if(ki(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";if(ki(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 Ki(t){return!!(Ii(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Ii(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Gi(t){if(!Xi(t))return null;if(Ii(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=Ci(i.textContent||"");if(e&&Hi(e))return Oi(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=Ci(n.textContent||"");if(r&&Hi(r))return Oi(r)||null}}catch(t){}return null}(i);return r?n.$selected_text=r:i.value&&Hi(i.value)&&(n.$selected_text=i.value),n}var s=i.value;if(s&&Hi(s)){var o=Oi(s);if(o)return{$el_value:o}}return null}if(Ii(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var h=a.options[l],u={};h.value&&Hi(h.value)&&(u.$el_value=h.value);var d=h.text;if(d&&Hi(d)){var v=Oi(d);v&&(u.$selected_text=v)}if(u.$el_value||u.$selected_text)return u}return null}return Ii(t,"textarea"),null}function Zi(i,e,n,r,s){if(void 0===n&&(n=void 0),!t||!i||Ii(i,"html")||!Ti(i))return!1;if((null==n?void 0:n.url_allowlist)&&!ji(n.url_allowlist))return!1;if((null==n?void 0:n.url_ignorelist)&&ji(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&&!Ii(u,"body");)if(Mi(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!(h=zi(u)))break;if(r||yi.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(Si(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(Si(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?wi: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&&(yi.indexOf(c)>-1||"true"===i.getAttribute("contenteditable"))}}function Qi(t,i){return i.length>t?i.slice(0,t)+"...":i}function Yi(t,i,e,n){var r=t.tagName.toLowerCase(),s={tag_name:r};yi.indexOf(r)>-1&&!e&&(s.$el_text=Qi(1024,"a"===r||"button"===r?Ui(t):Li(t)));var o=Ai(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((!Ki(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==n?void 0:n.includes(l.name))&&!i&&Hi(l.value)&&!Ji(l.name))){var h=l.value;"class"===l.name&&(h=Ri(h).join(" ")),s["attr__"+l.name]=Qi(1024,h)}}for(var u=1,d=1,v=t;v=Di(v);)u++,v.tagName===t.tagName&&d++;return s.nth_child=u,s.nth_of_type=d,s}function te(t){if(!Xi(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&&Hi(s)&&(i[r]=s)}}return i}function ie(t){return t.replace(/"|\\"/g,'\\"')}function ee(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Ri(e)):void 0}function ne(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[ie(i.toString())]=ie(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:ee(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 re(t,i){return t.indexOf(i)>-1}class se{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 oe(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&&!Ii(f,"body");)Mi(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=Xi(_);if("a"===_.tagName.toLowerCase()){var x=_.getAttribute("href");b=!!(w&&x&&Hi(x))&&x}re(Ai(_),"vt-no-capture")&&(y=!0),g.push(Yi(_,l,h,u));var k=te(_);Object.assign(m,k)}if(y)return{props:{},explicitNoCapture:y};if(h||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?g[0].$el_text=Ui(i):g[0].$el_text=Li(i)),"change"===a.type&&v){var S=Gi(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:ne(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 ae{constructor(t){this.name="Autocapture",this.et=!1,this.nt=null,this.rt=null,this.st=new se,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,_i)};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 Si(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($i(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===_i;if(l&&Zi(l,i,this.U,h,h?["copy","cut"]:void 0)){var u=this._instance.getConfig(),{props:d,explicitNoCapture:v}=oe(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===_i){var f=Oi(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 le="[SessionRecording]";class he{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||he.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.ct(t),this.O=!0,console.info(le+" 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=he.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(le+" 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 ft(){return"recorder"}ct(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.gt(t);else{var s=null===(r=l.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this.ft,i=>{i?console.error(le+" could not load recorder:",i):this.gt(t)}):console.error(le+" loadExternalDependency not available. Session recording cannot start.")}}gt(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(le+" 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||{}),de=Uint8Array,ve=Uint16Array,ce=Int32Array,fe=new de([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]),pe=new de([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]),ge=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),me=function(t,i){for(var e=new ve(31),n=0;n<31;++n)e[n]=i+=1<<t[n-1];var r=new ce(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}},be=me(fe,2),ye=be.b,_e=be.r;ye[28]=258,_e[258]=28;for(var we=me(pe,0).r,xe=new ve(32768),ke=0;ke<32768;++ke){var Se=(43690&ke)>>1|(21845&ke)<<1;Se=(61680&(Se=(52428&Se)>>2|(13107&Se)<<2))>>4|(3855&Se)<<4,xe[ke]=((65280&Se)>>8|(255&Se)<<8)>>1}var Ce=function(t,i,e){for(var n=t.length,r=0,s=new ve(i);r<n;++r)t[r]&&++s[t[r]-1];var o,a=new ve(i);for(r=1;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(e){o=new ve(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[xe[d]>>l]=h}else for(o=new ve(n),r=0;r<n;++r)t[r]&&(o[r]=xe[a[t[r]-1]++]>>15-t[r]);return o},Ee=new de(288);for(ke=0;ke<144;++ke)Ee[ke]=8;for(ke=144;ke<256;++ke)Ee[ke]=9;for(ke=256;ke<280;++ke)Ee[ke]=7;for(ke=280;ke<288;++ke)Ee[ke]=8;var Te=new de(32);for(ke=0;ke<32;++ke)Te[ke]=5;var $e=Ce(Ee,9,0),Ie=Ce(Te,5,0),Me=function(t){return(t+7)/8|0},Re=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new de(t.subarray(i,e))},Ae=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8},Oe=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:Ne,l:0};if(1==r){var o=new de(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 ve(v+1),f=Pe(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 de(c),l:f}},Pe=function(t,i,e){return-1==t.s?Math.max(Pe(t.l,i,e+1),Pe(t.r,i,e+1)):i[t.s]=e},Ue=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ve(++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}},De=function(t,i){for(var e=0,n=0;n<i.length;++n)e+=t[n]*i[n];return e},ze=function(t,i,e){var n=e.length,r=Me(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)},je=function(t,i,e,n,r,s,o,a,l,h,u){Ae(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=Ue(v),b=m.c,y=m.n,_=Ue(p),w=_.c,x=_.n,k=new ve(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[ge[I-1]];--I);var M,R,A,O,L=h+5<<3,P=De(r,Ee)+De(s,Te)+o,U=De(r,v)+De(s,p)+o+14+3*I+De(k,E)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&L<=P&&L<=U)return ze(i,u,t.subarray(l,l+h));if(Ae(i,u,1+(U<P)),u+=2,U<P){M=Ce(v,c,0),R=v,A=Ce(p,g,0),O=p;var D=Ce(E,T,0);Ae(i,u,y-257),Ae(i,u+5,x-1),Ae(i,u+10,I-4),u+=14;for(S=0;S<I;++S)Ae(i,u+3*S,E[ge[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];Ae(i,u,D[N]),u+=E[N],N>15&&(Ae(i,u,B[S]>>5&127),u+=B[S]>>12)}}}else M=$e,R=Ee,A=Ie,O=Te;for(S=0;S<a;++S){var q=n[S];if(q>255){Oe(i,u,M[(N=q>>18&31)+257]),u+=R[N+257],N>7&&(Ae(i,u,q>>23&31),u+=fe[N]);var F=31&q;Oe(i,u,A[F]),u+=O[F],F>3&&(Oe(i,u,q>>5&8191),u+=pe[F])}else Oe(i,u,M[q]),u+=R[q]}return Oe(i,u,M[256]),u+R[256]},Be=new ce([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ne=new de(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}(),Fe=function(t,i,e,n,r){if(!r&&(r={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new de(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 de(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=Be[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new ve(32768),g=s.h||new ve(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 ce(25e3),w=new ve(288),x=new ve(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=je(t,l,0,_,w,x,S,E,I,C-I,u),E=k=S=0,I=C;for(var L=0;L<286;++L)w[L]=0;for(L=0;L<30;++L)x[L]=0}var P=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+P]==t[C+P-z]){for(var q=0;q<N&&t[C+q]==t[C+q-z];++q);if(q>P){if(P=q,U=z,q>j)break;var F=Math.min(z,q-2),V=0;for(L=0;L<F;++L){var W=C-z+L&32767,H=W-p[W]&32767;H>V&&(V=H,A=W)}}}z+=(R=A)-(A=p[R])&32767}if(U){_[E++]=268435456|_e[P]<<18|we[U];var J=31&_e[P],X=31&we[U];S+=fe[J]+pe[X],++w[257+J],++x[X],T=C+P,++k}else _[E++]=t[C],++w[t[C]]}}for(C=Math.max(C,T);C<o;++C)_[E++]=t[C],++w[t[C]];u=je(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=ze(l,u+1,t.subarray(C,K))}s.i=o}return Re(a,0,n+Me(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)},Ve=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function We(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=Fe(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&&Ve(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),Ve(s,o-8,e.d()),Ve(s,o-4,n),s}var He="undefined"!=typeof TextEncoder&&new TextEncoder,Je="undefined"!=typeof TextDecoder&&new TextDecoder;try{Je.decode(Ne,{stream:!0})}catch(t){}ue.MouseMove,ue.MouseInteraction,ue.Scroll,ue.ViewportResize,ue.Input,ue.TouchMove,ue.MediaInteraction,ue.Drag;var Xe="[Chat]";class Ke{constructor(t,i){this._instance=t,this.name="Chat",this.bt=null,this.yt=!1,this._t=!1,this.O=!1,this.wt=null,this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.Et=[],this.U=i||Ke.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.bt)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Tt().catch(t=>{console.error(Xe+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=Ke.extractConfig(t),this.$t&&(null===(e=(i=this.$t).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,e,n,r,s,o,a,l,h;t.chat&&(this.bt=v({},this.bt,{enabled:null!==(n=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(e=this.bt)||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.bt)||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.bt)||void 0===l?void 0:l.color)&&void 0!==h?h:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Tt(){var t=this;return d(function*(){var i,e,n,r;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(Xe+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.It()),t.isEnabled?(t.O=!0,null!==(n=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t.bt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n&&t.Mt(),(null===(r=t.bt)||void 0===r?void 0:r.enabled)&&t.Rt(),console.info(Xe+" ready (lazy-load on demand)")):console.info(Xe+" not enabled (check dashboard settings)")):console.info(Xe+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this._t||null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.$t)||void 0===t||t.close()}toggle(){this.$t?this.$t.toggle():this.open()}show(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.$t)||void 0===t||t.hide()}getChannels(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.At(()=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.$t)||void 0===t||t.goToChannelList()}sendMessage(t){this.$t?this.$t.sendMessage(t):(this.xt.push(t),this.At(()=>{this.xt.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.sendMessage(t)}),this.xt=[]}))}markAsRead(){var t;null===(t=this.$t)||void 0===t||t.markAsRead()}onMessage(t){return this.St.push(t),this.$t?this.$t.onMessage(t):()=>{var i=this.St.indexOf(t);i>-1&&this.St.splice(i,1)}}onTyping(t){return this.Ct.push(t),this.$t?this.$t.onTyping(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}onConnectionChange(t){return this.Et.push(t),this.$t?this.$t.onConnectionChange(t):()=>{var i=this.Et.indexOf(t);i>-1&&this.Et.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.bt,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.$t)||void 0===i||i.destroy(),this.$t=void 0,this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.Et=[];var n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");n&&n.remove()})}It(){var t=this;return d(function*(){if(!t.yt){var i=t._instance.getConfig(),e=i.token,n=i.api_host;if(!e||!n)return console.warn(Xe+" Cannot fetch settings: missing token or api_host"),void(t.yt=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(r);if(!s.ok)return console.warn(Xe+" Failed to fetch settings: "+s.status),void(t.yt=!0);t.bt=yield s.json(),t.yt=!0,console.info(Xe+" Loaded settings from dashboard")}catch(i){console.warn(Xe+" Error fetching settings:",i),t.yt=!0}}})()}Rt(){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 ft(){return"chat"}Mt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.Ot(),{timeout:5e3}):setTimeout(()=>this.Ot(),3e3)}At(t){this.$t?t():(this.kt.push(t),this.Ot())}Ot(){var t,i;if(!(this._t||this.$t||this.wt))if(null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.gt();else{this._t=!0;var e=null===(i=l.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Xe+" loadExternalDependency not available. Chat cannot start."),this._t=!1,void(this.wt="loadExternalDependency not available");e(this._instance,this.ft,t=>{if(this._t=!1,t)return console.error(Xe+" Failed to load:",t),void(this.wt=String(t));this.gt()})}}gt(){var t,i=null===(t=l.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Xe+" initChat not available after script load"),void(this.wt="initChat not available");if(!this.$t){var e=this.getMergedConfig();this.$t=i(this._instance,e),this.St.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.onMessage(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.onTyping(t)}),this.Et.forEach(t=>{var i;return null===(i=this.$t)||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.kt.forEach(t=>t()),this.kt=[],console.info(Xe+" loaded and ready")}}var Ge="[VtdOverlay]";class Ze{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Lt=null,this.Pt=null,this._t=!0,this.Ut=null,this.Dt=null,this.zt=null,this._instance=t,this.U=i||Ze.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.jt(),this.O=!1})}onConfigUpdate(t){this.U=Ze.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.Bt(n)){var r=this.Nt(n);this.Pt=n,this.Lt=r,this._t=!0,this.qt(),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(Ge+" Invalid URL: "+n)}else console.warn(Ge+" Empty URL provided");else console.warn(Ge+" Feature is disabled")}getDestinationUrl(){return this.Lt}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Pt}),this.Ut?(this.Ut.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.jt(),this.O=!1,this.Lt=null,this.Pt=null},200)):(this.jt(),this.O=!1,this.Lt=null,this.Pt=null)}Bt(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Nt(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}}Vt(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}qt(){if(n&&this.Lt){this.jt(),this.Ut=n.createElement("div"),this.Ut.id="vtilt-vtd-overlay",this.Ut.className="vtilt-vtd-opening",this.Ut.setAttribute("style",this.Wt());var t=n.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Ht());var i=n.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Jt()),i.innerHTML=this.Xt(),t.appendChild(i);var e=n.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Kt()),this.zt=n.createElement("div"),this.zt.className="vtilt-vtd-loading",this.zt.setAttribute("style",this.Gt()),this.zt.innerHTML=this.Zt(),e.appendChild(this.zt),this.Dt=n.createElement("iframe"),this.Dt.id="vtilt-vtd-iframe",this.Dt.className="vtilt-vtd-iframe",this.Dt.setAttribute("style",this.Qt()),this.Dt.setAttribute("frameborder","0"),this.Dt.setAttribute("allowfullscreen","true"),this.Dt.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this._t=!1,this.zt&&(this.zt.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.zt)||void 0===t?void 0:t.parentNode)&&(this.zt.style.display="none")},300)),this.Dt&&(this.Dt.style.opacity="1")};this.Dt.onload=r,this.Dt.onerror=r,setTimeout(()=>{this._t&&r()},5e3),e.appendChild(this.Dt),this.Dt.src=this.Lt,t.appendChild(e),this.Ut.appendChild(t);var s=n.createElement("style");s.id="vtilt-vtd-styles",s.textContent=this.Yt(),n.head.appendChild(s),n.body.appendChild(this.Ut),this.ti(),n.body.style.overflow="hidden"}}jt(){var t;(null===(t=this.Ut)||void 0===t?void 0:t.parentNode)&&(this.Ut.parentNode.removeChild(this.Ut),this.Ut=null,this.Dt=null,this.zt=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="")}ti(){var i,e,r,s=null===(i=this.Ut)||void 0===i?void 0:i.querySelector(".vtilt-vtd-close");null==s||s.addEventListener("click",()=>this.close());var o=null===(e=this.Ut)||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.Ut)||void 0===r||r.addEventListener("click",t=>{t.target===this.Ut&&this.close()});var a=t=>{"Escape"===t.key&&(this.close(),null==n||n.removeEventListener("keydown",a))};null==n||n.addEventListener("keydown",a)}Wt(){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 '}Ht(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Jt(){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 "}Xt(){var t=this.Pt||this.Lt,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.Vt(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.ii(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.ii(this.ei(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 '}Kt(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Gt(){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 "}Zt(){var t=this.Pt||this.Lt,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.ii(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 '}Qt(){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 "}Yt(){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 "}ei(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}ii(t){if(void 0===n)return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");var i=n.createElement("div");return i.textContent=t,i.innerHTML}}var Qe,Ye="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Qe||(Qe={}));var tn=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===Qe.GZipJS&&r>=1024)try{var s=We(function(t,i){if(He)return He.encode(t);for(var e=t.length,n=new de(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 de(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 Re(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:Ye});if(o.size<.95*r)return{contentType:Ye,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:r}}},en=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var i=tn(t);if(i){var{contentType:e,body:n,estimatedSize:r}=i,s=t.compression===Qe.GZipJS&&e===Ye?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=tn(t);if(i){var{contentType:e,body:n}=i,r=t.compression===Qe.GZipJS&&e===Ye?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=tn(t);if(i){var{contentType:e,body:n}=i;try{var r="string"==typeof n?new Blob([n],{type:e}):n,s=t.compression===Qe.GZipJS&&e===Ye?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,r)}catch(t){}}}}],nn=t=>{var i,e=t.transport||"fetch",n=en.find(t=>t.name===e&&t.available)||en.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 rn{constructor(t,i){var e,n,r,s;this.ni=!0,this.ri=[],this.si=(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.oi=t}get length(){return this.ri.length}enqueue(t){this.ri.push(t),this.ai||this.li()}unload(){if(this.hi(),0!==this.ri.length){var t=this.ui();for(var i in t){var e=t[i];this.oi(v({},e,{transport:"sendBeacon"}))}}}enable(){this.ni=!1,this.li()}pause(){this.ni=!0,this.hi()}flush(){this.hi(),this.di(),this.li()}li(){this.ni||(this.ai=setTimeout(()=>{this.hi(),this.di(),this.ri.length>0&&this.li()},this.si))}hi(){this.ai&&(clearTimeout(this.ai),this.ai=void 0)}di(){if(0!==this.ri.length){var t=this.ui(),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.oi(n)}}}ui(){var t={};return this.ri.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.ri=[],t}}class sn{constructor(i){this.ci=!1,this.fi=3e3,this.ri=[],this.pi=!0,this.oi=i.sendRequest,this.gi=i.sendBeacon,t&&void 0!==e&&"onLine"in e&&(this.pi=e.onLine,V(t,"online",()=>{this.pi=!0,this.N()}),V(t,"offline",()=>{this.pi=!1}))}get length(){return this.ri.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.ri.push({retryAt:n,request:t,retriesPerformedSoFar:i+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.pi||(r+=" (Browser is offline)"),console.warn(r),this.ci||(this.ci=!0,this.mi())}}retriableRequest(t){var i=this;return d(function*(){try{var e=yield i.oi(t);200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&i.enqueue(t,0)}catch(e){i.enqueue(t,0)}})()}mi(){this.bi&&clearTimeout(this.bi),this.bi=setTimeout(()=>{this.pi&&this.ri.length>0&&this.N(),this.ri.length>0?this.mi():this.ci=!1},this.fi)}N(){var t=this,i=Date.now(),e=[],n=[];this.ri.forEach(t=>{t.retryAt<i?n.push(t):e.push(t)}),this.ri=e,n.forEach(function(){var i=d(function*(i){var{request:e,retriesPerformedSoFar:n}=i;try{var r=yield t.oi(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.bi&&(clearTimeout(this.bi),this.bi=void 0),this.ri.forEach(t=>{var{request:i}=t;try{this.gi(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.ri=[]}}var on="vt_rate_limit";class an{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(on))&&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(on,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class ln{constructor(t){this.yi=null,this.wi=t}get config(){return this.yi}onApply(t){this.xi=t}onLoad(t){this.ki=t}load(){var i,e=this.wi.getConfig();if(e.token){if(null===(i=e.bootstrap)||void 0===i?void 0:i.remoteConfig)return this.yi=e.bootstrap.remoteConfig,this.Si(this.yi),void this.Ci();var n=M(()=>t.__VTILT_BOOTSTRAP__);if(null==n?void 0:n.remoteConfig)return this.yi=n.remoteConfig,this.Si(this.yi),void this.Ci();M(()=>{var t=localStorage.getItem(_+"_"+e.token);t&&(this.yi=JSON.parse(t),this.Si(this.yi))}),this.Ci()}}Ci(){var t=this.wi.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.yi=i,M(()=>{localStorage.setItem(_+"_"+t.token,JSON.stringify(i))}),this.Si(i),null===(e=this.ki)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n)})}}Si(t){var i,e,n,r,s,o,a,l,h,u=this.wi.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.wi.updateConfig(d),null===(n=this.xi)||void 0===n||n.call(this,t),this.wi.__loaded&&(v&&(null===(s=(r=this.wi).startSessionRecording)||void 0===s||s.call(r)),c&&(null===(a=(o=this.wi).Ei)||void 0===a||a.call(o)),f&&(null===(h=(l=this.wi).startAutocapture)||void 0===h||h.call(l)))}}class hn{constructor(t){this.Ti=!1,this.$i=!1,this.Ii=null,this.Mi=null,this.wi=t}setVtPersonId(t){this.Mi=t}capture(t,i,n){var r;if(this.wi.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.wi.rateLimiter.shouldAllowEvent())){var s,o=this.wi.buildUrl(),a=this.wi.getConfig(),l=this.Ri(t,i);if(!1!==a.stringifyPayload){if(!q(s=JSON.stringify(v({},l,a.globalAttributes))))return}else if(s=v({},l,a.globalAttributes),!q(JSON.stringify(s)))return;var h="$identify"===t?this.wi.userManager.getAnonymousId():null!==(r=this.wi.userManager.getDistinctId())&&void 0!==r?r:this.wi.userManager.getAnonymousId(),u={timestamp:(new Date).toISOString(),event:t,payload:s,distinct_id:h,anonymous_id:this.wi.userManager.getAnonymousId()};this.wi.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.$i||(this.$i=!0,setTimeout(()=>{n&&r&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.Ii&&(n.removeEventListener("visibilitychange",this.Ii),this.Ii=null)):this.Ii||(this.Ii=()=>this.captureInitialPageview(),V(n,"visibilitychange",this.Ii)))}Ri(t,i){var e=di(),r=this.wi.userManager.getUserProperties(),s=this.wi.userManager.get_initial_props(),o=this.wi.sessionManager.getSessionId(),a=this.wi.sessionManager.getWindowId(),l=this.wi.userManager.getAnonymousId(),h={};!this.Ti&&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.Mi?{$vt:this.Mi}:{},Object.keys(h).length>0?{$set_once:h}:{},i.$set?{$set:i.$set}:{},i);return!this.Ti&&Object.keys(s).length>0&&(this.Ti=!0),"$pageview"===t&&n&&(u.title=n.title),u}}class un{constructor(t){this.wi=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.wi.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=this.wi.userManager.getDistinctId(),o=this.wi.userManager.getAnonymousId(),a=this.wi.userManager.getDeviceId(),l="anonymous"===this.wi.userManager.getUserState();a||this.wi.userManager.ensureDeviceId(s||o),t!==s&&l?(this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),this.wi.userManager.setDistinctId(t),null===(n=this.wi.Ai)||void 0===n||n.emit("user:identified",{distinctId:t})):t!==s?(this.wi.userManager.setUserState("identified"),this.wi.userManager.setDistinctId(t),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),null===(r=this.wi.Ai)||void 0===r||r.emit("user:identified",{distinctId:t})):(i||e)&&(l&&this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.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.wi.userManager.setUserProperties(t,i)&&(this.wi.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.wi.Ai)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.wi.sessionManager.resetSessionId(),this.wi.userManager.reset(t),null===(i=this.wi.Ai)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.wi.userManager.createAlias(t,i);e?this.wi.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.wi.userManager.getDistinctId()||this.wi.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.wi.userManager.getUserIdentity()}getDeviceId(){return this.wi.userManager.getDeviceId()}getUserState(){return this.wi.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.wi.userManager.getDistinctId())&&void 0!==t?t:this.wi.userManager.getAnonymousId()}getAnonymousId(){return this.wi.userManager.getAnonymousId()}}class dn{constructor(t){this.Oi=new Map,this.wi=t}onFeatureStarted(t){this.Li=t}onFeatureStopped(t){this.Pi=t}register(t){this.Oi.set(t.name,t)}get(t){var i;return null===(i=this.Oi.get(t))||void 0===i?void 0:i.instance}initAll(){this.Oi.forEach(t=>{this.Ui(t)})}init(t){var i=this.Oi.get(t);if(i)return this.Ui(i),i.instance}start(t){var i,e=this.Oi.get(t);if(e&&(e.instance||this.Ui(e),e.instance)){if(e.instance.onConfigUpdate){var n=this.wi.getConfig();e.instance.onConfigUpdate(n)}e.instance.startIfEnabled(),null===(i=this.Li)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.Oi.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.Oi.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n}notifyConfigUpdate(t){this.Oi.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&M(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.Oi.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.Oi.forEach(i=>{i.instance&&t.push(i.instance)}),t}Ui(t){if(!t.instance){var i=this.wi.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||M(()=>{var i;t.instance=new t.FeatureClass(this.wi),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.Li)||void 0===i||i.call(this,t.name))})}}}var vn="vt",cn=Array.isArray;class fn{constructor(t){void 0===t&&(t={}),this.version=c,this.__loaded=!1,this.__request_queue=[],this.Di=!1,this.Ai=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 an({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.zi.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new sn({sendRequest:t=>this.ji(t),sendBeacon:t=>this.Bi(t)}),this.requestQueue=new rn(t=>this.Ni(t),{flush_interval_ms:3e3}),this.zi=new hn(this),this.qi=new un(this),this.Fi=new ln(this),this.Vi=new dn(this),this.Fi.onApply(t=>{this.Vi.notifyRemoteConfig(t)}),this.Fi.onLoad(t=>{this.Ai.emit(L,{config:t})}),this.Vi.onFeatureStarted(t=>{this.Ai.emit(P,{feature:t})}),this.Vi.onFeatureStopped(t=>{this.Ai.emit(U,{feature:t})})}init(t,i,e){var n;if(e&&e!==vn){var r=null!==(n=pn[e])&&void 0!==n?n:new fn;return r._init(t,i,e),pn[e]=r,pn[vn][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.Wi(),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.Hi(),this.Ji(),this.Xi(),!1!==n.capture_pageview&&this.zi.captureInitialPageview(),this.Ai.emit(A,{config:n}),this}Hi(){this.Ki(),this.Gi(),this.Zi(),this.Qi(),this.Ei()}Ki(){this.historyAutocapture||(this.historyAutocapture=new bi(this),this.historyAutocapture.startIfEnabled())}Gi(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new ae(this),this.autocapture.startIfEnabled())}Zi(){this.webVitals||(this.webVitals=new gi(this),this.webVitals.startIfEnabled())}Qi(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new he(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(z))))}Ei(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new Ke(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new ae(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 he(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(z)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.Ai.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.zi.capture(t,i,e),this.Ai.emit(D,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.zi.trackEvent(t,i)}identify(t,i,e){this.qi.identify(t,i,e)}setUserProperties(t,i){this.qi.setUserProperties(t,i)}resetUser(t){this.qi.resetUser(t)}createAlias(t,i){this.qi.createAlias(t,i)}getUserIdentity(){return this.qi.getUserIdentity()}getDeviceId(){return this.qi.getDeviceId()}getUserState(){return this.qi.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.Fi.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.qi.getDistinctId()}getAnonymousId(){return this.qi.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:vn;return i!==vn&&(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.Yi(i),this.Ai.emit(O,{config:i})}Yi(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.te()){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})}}te(){return!!this.configManager.getConfig().token||(this.Di||(console.warn("VTilt: token is required for tracking"),this.Di=!0),!1)}Ni(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.Bi(t)}ji(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?Qe.None:Qe.GZipJS;nn({url:e,data:r,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}Bi(t){var{url:i,events:e}=t,n=1===e.length?e[0]:{events:e},r=this.configManager.getConfig().disable_compression?Qe.None:Qe.GZipJS;nn({url:i,data:n,method:"POST",transport:"sendBeacon",compression:r})}ie(t){this.sendRequest(t.url,t.event,!1)}Ji(){if(t){var i=()=>{this.requestQueue.unload(),this.retryQueue.unload()};V(t,"beforeunload",i),V(t,"pagehide",i)}}Xi(){this.requestQueue.enable()}Wi(){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.zi.setVtPersonId(s.trim()),n.searchParams.delete("vt")),(null==o?void 0:o.trim())&&(this.ee(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)}}})}ee(t){this.vtdOverlay||(this.vtdOverlay=new Ze(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.ie(t)),this.__request_queue=[],this.Xi()}}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[vn]=new fn,(bn=l.vt)&&F(bn._i,function(t){if(t&&cn(t)){var i=mn.init(t[0],t[1],t[2]),e=bn[t[2]||"vt"]||bn;i&&i._execute_array(e)}}),l.vt=mn,function(){function i(){i.done||(i.done=!0,gn=!1,null!=t&&(t.__VTILT_ENQUEUE_REQUESTS=!1),F(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")}()}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t,e=null==i?void 0:i.navigator,r=null==i?void 0:i.document,n=null==i?void 0:i.location,s=null==i?void 0:i.fetch;t&&r&&r.createElement,null==i||i.XMLHttpRequest,null==i||i.AbortController;var o=null==e?void 0:e.userAgent,a=null!=t?t:{},l={none:0,error:1,warn:2,info:3,debug:4},u="[vTilt]",h=new Set(["none","error","warn","info","debug"]);function d(){return"undefined"!=typeof console}function v(t){var i=t.length>0&&"string"==typeof t[0]?t[0]:"",e=i?t.slice(1):t;return[i?u+":"+i:u,...e]}var c="warn",f=!1;var p=null;function g(){return p||(p={setLevel(t,i){void 0===i&&(i=!1),c=t,i&&(f=!0)},setLevelFromRemote(t){f||t&&h.has(t)&&(c=t)},getLevel:()=>c,isLockedByInit:()=>f,debug(){if(!(l[c]<l.debug)&&d()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...v(i))}},info(){if(!(l[c]<l.info)&&d()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...v(i))}},warn(){if(!(l[c]<l.warn)&&d()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.warn(...v(i))}},error(){if(!(l[c]<l.error)&&d()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.error(...v(i))}}}),p}function m(t,i){void 0===i&&(i=!0);var e=void 0!==t.log_level||!!t.debug,r=function(t){return t.log_level&&h.has(t.log_level)?t.log_level:t.debug?"debug":"warn"}(t);return g().setLevel(r,i&&e),r}var b="external-scripts";function y(t,i,e,r,n,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(r,n)}function _(t){return function(){var i=this,e=arguments;return new Promise(function(r,n){var s=t.apply(i,e);function o(t){y(s,r,n,o,a,"next",t)}function a(t){y(s,r,n,o,a,"throw",t)}o(void 0)})}}function w(){return w=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},w.apply(null,arguments)}a.__VTiltExtensions__=a.__VTiltExtensions__||{},a.__VTiltExtensions__.loadExternalDependency=(t,i,e)=>{var n=((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":(g().error(b,"cannot load "+i+".js: api_host is required"),"")})(t,i);((t,i,e)=>{if(t.getConfig().disable_external_dependency_loading)return g().warn(b,i+" was requested but loading of external scripts is disabled."),e("Loading of external scripts is disabled");var n=null==r?void 0:r.querySelectorAll("script");if(n)for(var s,o=function(){if(n[a].src===i){var t=n[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<n.length;a++)if(s=o())return s.v;var l=()=>{var t;if(!r)return e("document not found");var n=r.createElement("script");n.type="text/javascript",n.crossOrigin="anonymous",n.src=i,n.onload=t=>{n.__vtilt_loading_callback_fired=!0,e(void 0,t)},n.onerror=t=>e(t);var s=r.querySelectorAll("body > script");s.length>0?null===(t=s[0].parentNode)||void 0===t||t.insertBefore(n,s[0]):r.body.appendChild(n)};(null==r?void 0:r.body)?l():null==r||r.addEventListener("DOMContentLoaded",l)})(t,n,e)};var x="1.12.0",k="__vt_session",S="__vt_window_id",C="__vt_primary_window",M="__vt_user_state",A="__vt_device_id",E="__vt_anonymous_id",R="__vt_remote_config",T="__vt_distinct_id",I="__vt_user_properties",O="localStorage",P="localStorage+cookie",L="sessionStorage",D="memory",U="$initial_person_info",j="$pageview",B="$pageleave",z="$identify",N="$alias",q="$set",F="$performance_event",H="$autocapture",W="$scroll_depth",V="$snapshot",G="$snapshot_items",K="$$client_ingestion_warning",J="$current_url",X="$pathname",Z="$prev_pageview_duration",Q="$prev_pageview_pathname",Y="$prev_pageview_url",tt="$scroll_depth_pct",it="$scroll_depth_max_pct",et="$prev_pageview_scroll_depth_pct";class rt{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!(null==r?void 0:r.currentScript))return w({token:t.token||""},t);var i=r.currentScript,e=w({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.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");for(var s of(e.capture_performance=!!n||t.capture_performance,e.globalAttributes=w({},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 w({},this.config)}updateConfig(t){this.config=w({},this.config,t)}}function nt(t){return"string"==typeof t}function st(t){return void 0===t}function ot(t){return null==t}function at(t){return Array.isArray(t)}function lt(t){return"function"==typeof t}function ut(t,i){try{return t()}catch(t){return i}}var ht="x-api-key";function dt(t,i,e){void 0===e&&(e={});var{api_host:r,token:n}=t,s=""+(r?r.replace(/\/+$/gm,""):"")+i;if(e.includeTokenQuery&&n){var o=s.includes("?")?"&":"?";s=""+s+o+"token="+n}return s}function vt(t){return t.token?{[ht]:t.token}:{}}class ct{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,r;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){g().error("emitter",'error in event listener for "'+t+'":',i)}});var n=this.m.get(t);n&&(n.forEach(e=>{try{e(i)}catch(i){g().error("emitter",'error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(r=this.o.get("*"))||void 0===r||r.forEach(e=>{try{e({event:t,payload:i})}catch(t){g().error("emitter","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,r,n;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(n=null===(r=this.m.get(t))||void 0===r?void 0:r.size)&&void 0!==n?n:0)}hasListeners(t){return this.listenerCount(t)>0}}var ft="sdk:initialized",pt="sdk:config_updated",gt="sdk:remote_config_loaded",mt="consent:updated",bt="event:captured",yt="recording:started",_t="recording:stopped",wt=0,xt=!1,kt=!1;function St(t){(wt+=1)<2||(xt=!0,kt||(kt=!0,g().warn(t,"vTilt network requests are being cancelled before reaching the server (likely an ad blocker, privacy extension, or DNS-level filter). Further retries and snapshots have been suspended for this page. Route SDK traffic through your own domain to avoid this — see https://www.vtilt.com/docs/browser/reverse-proxy.")))}function Ct(){wt=0}function Mt(){return xt}var $t="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function At(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),r="";r.length<t;)for(var n=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&r.length<t;s++){var o=n[s]&i;o<57&&(r+=$t[o])}return r}var Et=1048576;function Rt(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,r)=>{i.call(e,t,r)});else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&i.call(e,t[r],r)}function Tt(t,i,e,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:n,passive:s})}function It(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function Ot(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];for(var n of e)for(var s of n)t.push(s);return t}function Pt(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];null!=r&&""!==r&&(i[e]=r)}return i}var Lt=[E,A,T,M],Dt=31536e3,Ut=["herokuapp.com","vercel.app","netlify.app"];function jt(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 r=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class Bt{constructor(t){var i,e,r;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!Ut.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(r=t.secure)&&void 0!==r?r:"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||g().warn("storage","localStorage unavailable, using cookies"),e}catch(t){return this.k=!1,g().warn("storage","localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return Lt.includes(t)}get(t){var i;try{switch(this.method){case D:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case P:return this.getLocalStoragePlusCookie(t);case O:return this.getLocalStorage(t);case L:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return g().warn("storage",'get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case D:this.memoryStorage.set(t,i);break;case P:this.setLocalStoragePlusCookie(t,i,e);break;case O:this.setLocalStorage(t,i);break;case L:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:Dt)}}catch(i){g().warn("storage",'set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case D:this.memoryStorage.delete(t);break;case P:this.removeLocalStoragePlusCookie(t);break;case O:this.removeLocalStorage(t);break;case L:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){g().warn("storage",'remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(i){if(this.isCriticalProperty(i)){var e=this.getCookie(i),r=this.getLocalStorage(i);if(null!==e){if(r!==e&&this.isLocalStorageSupported())try{null==t||t.localStorage.setItem(i,e)}catch(t){}return e}return null!==r?r:this.readFromSessionStorage(i)}return this.getLocalStorage(i)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&(this.setCookie(t,i,null!=e?e:Dt),this.writeToSessionStorage(t,i))}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&(this.removeCookie(t),this.removeFromSessionStorage(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){g().warn("storage","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){g().warn("storage","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 r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=jt(this.cross_subdomain),n=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(n+="; Secure"),r&&(n+="; domain="+r),document.cookie=n}}removeCookie(t){if("undefined"!=typeof document){var i=jt(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 r=w({value:i},e?{expiry:Date.now()+e}:{});this.set(t,JSON.stringify(r))}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 zt{constructor(t,i){void 0===t&&(t="cookie"),this.S=!1,this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.C=void 0,g().debug("session","ctor")}hydrateFromStorage(){g().debug("session","hydrate"),this.M()}getSessionId(){var t=this.$();return t||(t=At(16),this.A(t),this.S=!0),t}setSessionId(){var t=this.$(),i=t||At(16);return t||(this.S=!0),this.A(i),i}resetSessionId(){this.R(),this.S=!0,this.setSessionId(),this.T(At(16))}consumeSessionStart(){return!!this.S&&(this.S=!1,!0)}$(){return this.storage.get(k)}A(t){this.storage.set(k,t,1800)}R(){this.storage.remove(k)}getWindowId(){if(this.C)return this.C;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(S);if(i)return this.C=i,i}var e=At(16);return this.T(e),e}T(t){if(t!==this.C){this.C=t;var i=this.storage.getSessionStorage();i&&i.setItem(S,t)}}M(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(C),e=t.getItem(S);e&&!i?this.C=e:(e&&t.removeItem(S),this.T(At(16))),t.setItem(C,"true"),this.I()}else this.C=At(16)}I(){var i=this.storage.getSessionStorage();t&&i&&Tt(t,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(C)},{capture:!1})}updateStorageMethod(t,i){this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Nt(t){if(!r)return null;var i=r.createElement("a");return i.href=t,i}function qt(t){try{return decodeURIComponent(t).replace(/\+/g," ")}catch(i){return t.replace(/\+/g," ")}}function Ft(t){for(var i={},e=function(t){return((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"")}(t).split("&"),r=0;r<e.length;r++){var n=e[r];if(n){var s=n.indexOf("="),o=-1===s?n:n.slice(0,s);if(o){var a=qt(o),l=-1===s?"":n.slice(s+1);i[a]=qt(l)}}}return i}function Ht(t,i){var e;return null!==(e=Ft(t)[i])&&void 0!==e?e:""}function Wt(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?h.push(c+"="+e):c&&h.push(c+(f?"="+f:""))}var p=h.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}var Vt="_fbp",Gt="_fbc",Kt=15552e3,Jt=7776e3;function Xt(){void 0!==r&&(function(){if(Zt(Vt))return;var t=Date.now(),i=Math.floor(1e9+9e9*Math.random());Qt(Vt,"fb.1."+t+"."+i,Kt)}(),function(){if(!(null==n?void 0:n.search))return;try{var t=new URL(n.href).searchParams.get("fbclid");if(!(null==t?void 0:t.trim()))return;var i="fb.1."+Date.now()+"."+t.trim();Qt(Gt,i,Jt)}catch(t){}}())}function Zt(t){if(void 0===r||!(null==r?void 0:r.cookie))return null;var i=t+"=";for(var e of r.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}function Qt(t,i,e){if(void 0!==r){var s=void 0!==n&&"https:"===n.protocol?"; Secure":"";r.cookie=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite=Lax"+s}}var Yt="Mobile",ti="iOS",ii="Android",ei="Tablet",ri=ii+" "+ei,ni="iPad",si="Apple",oi=si+" Watch",ai="Safari",li="BlackBerry",ui="Samsung",hi=ui+"Browser",di=ui+" Internet",vi="Chrome",ci=vi+" OS",fi=vi+" "+ti,pi="Internet Explorer",gi=pi+" "+Yt,mi="Opera",bi=mi+" Mini",yi="Edge",_i="Microsoft "+yi,wi="Firefox",xi=wi+" "+ti,ki="Nintendo",Si="PlayStation",Ci="Xbox",Mi=ii+" "+Yt,$i=Yt+" "+ai,Ai="Windows",Ei=Ai+" Phone",Ri="Nokia",Ti="Ouya",Ii="Generic",Oi=Ii+" "+Yt.toLowerCase(),Pi=Ii+" "+ei.toLowerCase(),Li="Konqueror",Di="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+Di),ji=new RegExp(Ci,"i"),Bi=new RegExp(Si+" \\w+","i"),zi=new RegExp(ki+" \\w+","i"),Ni=new RegExp(li+"|PlayBook|BB10","i"),qi={"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 Fi(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Hi=(t,i)=>i&&Fi(i,si)||function(t){return Fi(t,ai)&&!Fi(t,vi)&&!Fi(t,ii)}(t),Wi=function(t,i){return i=i||"",Fi(t," OPR/")&&Fi(t,"Mini")?bi:Fi(t," OPR/")?mi:Ni.test(t)?li:Fi(t,"IE"+Yt)||Fi(t,"WPDesktop")?gi:Fi(t,hi)?di:Fi(t,yi)||Fi(t,"Edg/")?_i:Fi(t,"FBIOS")?"Facebook "+Yt:Fi(t,"UCWEB")||Fi(t,"UCBrowser")?"UC Browser":Fi(t,"CriOS")?fi:Fi(t,"CrMo")||Fi(t,vi)?vi:Fi(t,ii)&&Fi(t,ai)?Mi:Fi(t,"FxiOS")?xi:Fi(t.toLowerCase(),Li.toLowerCase())?Li:Hi(t,i)?Fi(t,Yt)?$i:ai:Fi(t,wi)?wi:Fi(t,"MSIE")||Fi(t,"Trident/")?pi:Fi(t,"Gecko")?wi:""},Vi={[gi]:[new RegExp("rv:"+Di)],[_i]:[new RegExp(yi+"?\\/"+Di)],[vi]:[new RegExp("("+vi+"|CrMo)\\/"+Di)],[fi]:[new RegExp("CriOS\\/"+Di)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Di)],[ai]:[Ui],[$i]:[Ui],[mi]:[new RegExp("(Opera|OPR)\\/"+Di)],[wi]:[new RegExp(wi+"\\/"+Di)],[xi]:[new RegExp("FxiOS\\/"+Di)],[Li]:[new RegExp("Konqueror[:/]?"+Di,"i")],[li]:[new RegExp(li+" "+Di),Ui],[Mi]:[new RegExp("android\\s"+Di,"i")],[di]:[new RegExp(hi+"\\/"+Di)],[pi]:[new RegExp("(rv:|MSIE )"+Di)],Mozilla:[new RegExp("rv:"+Di)]},Gi=function(t,i){var e=Wi(t,i),r=Vi[e];if(void 0===r)return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Ki=[[new RegExp(Ci+"; "+Ci+" (.*?)[);]","i"),t=>[Ci,t&&t[1]||""]],[new RegExp(ki,"i"),[ki,""]],[new RegExp(Si,"i"),[Si,""]],[Ni,[li,""]],[new RegExp(Ai,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Ei,""];if(new RegExp(Yt).test(i)&&!/IEMobile\b/.test(i))return[Ai+" "+Yt,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=qi[r]||"";return/arm/i.test(i)&&(n="RT"),[Ai,n]}return[Ai,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[ti,i.join(".")]}return[ti,""]}],[/(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("("+ii+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ii+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[ii,i.join(".")]}return[ii,""]}],[/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/,[ci,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(t){return zi.test(t)?ki:Bi.test(t)?Si:ji.test(t)?Ci:new RegExp(Ti,"i").test(t)?Ti:new RegExp("("+Ei+"|WPDesktop)","i").test(t)?Ei:/iPad/.test(t)?ni:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?oi:Ni.test(t)?li:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ri,"i").test(t)?Ri:/(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(Yt).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)?ii:ri:ii:new RegExp("(pda|"+Yt+")","i").test(t)?Oi:new RegExp(ei,"i").test(t)&&!new RegExp(ei+" pc","i").test(t)?Pi:""},Xi="https?://(.*)",Zi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Qi=Ot(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Zi),Yi="<masked>";function te(t,i){var e=Qi.concat([]),r=It({},function(t){var i={};return Rt(Ft(t),function(t,e){"string"==typeof e&&e.startsWith("utm_")&&t&&(i[e]=t)}),i}(t));return Rt(e,function(i){if(i.startsWith("utm_")){if(!(i in r)){var e=Ht(t,i);r[i]=e||null}}else{var n=Ht(t,i);r[i]=n||null}}),r}function ie(t){var i=function(t){return t?0===t.search(Xi+"google.([^/?]*)")?"google":0===t.search(Xi+"bing.com")?"bing":0===t.search(Xi+"yahoo.com")?"yahoo":0===t.search(Xi+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",n={};if(!function(t){return null===t}(i)){n.$search_engine=i;var s=r?Ht(r.referrer,e):"";s.length&&(n.ph_keyword=s)}return n}function ee(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function re(){return(null==r?void 0:r.referrer)||"$direct"}function ne(){var t;return(null==r?void 0:r.referrer)&&(null===(t=Nt(r.referrer))||void 0===t?void 0:t.host)||"$direct"}function se(t){var i=function(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Nt(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=Nt(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname,It(n,te(r))}return e&&It(n,ie(e)),n}(t),e={};return Rt(i,function(t,i){var r;e["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=t}),e}function oe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ae(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function le(i,e){if(!o)return{};var r,s,a,l=i?Ot([],Zi,e||[]):[],[u,h]=function(t){for(var i=0;i<Ki.length;i++){var[e,r]=Ki[i],n=e.exec(t);if(n){var s="function"==typeof r?r(n,t):r;if(s)return s}}return["",""]}(o),d=Zt(Vt)||void 0,v=Zt(Gt)||void 0;return It(Pt({$os:u,$os_version:h,$browser:Wi(o,navigator.vendor),$device:Ji(o),$device_type:(s=o,a=Ji(s),a===ni||a===ri||"Kobo"===a||"Kindle Fire"===a||a===Pi?ei:a===ki||a===Ci||a===Si||a===Ti?"Console":a===oi?"Wearable":a?Yt:"Desktop"),$timezone:oe(),$timezone_offset:ae(),$fb_browser_id:d,$fb_click_id:v}),{$current_url:Wt(null==n?void 0:n.href,l,Yi),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:o.length>1e3?o.substring(0,997)+"...":o,$browser_version:Gi(o,navigator.vendor),$browser_language:ee(),$browser_language_prefix:(r=ee(),"string"==typeof r?r.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:x,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10)})}class ue{constructor(t,i){void 0===t&&(t="localStorage"),this.O=!1,this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.generateEphemeralIdentity(),g().debug("user","ctor","ephemeral identity only")}hydrateFromStorage(){g().debug("user","hydrate start"),this.userIdentity=this.loadUserIdentity();var t=this.userIdentity.anonymous_id,i=this.userIdentity.distinct_id;g().debug("user","hydrate done","anonymous_id",t?t.slice(0,12)+"...":"n/a","distinct_id",i?i.slice(0,12)+"...":"null")}generateEphemeralIdentity(){return{distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:this.generateDeviceId(),properties:{},user_state:"anonymous"}}getUserIdentity(){return w({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){var t=this.userIdentity.anonymous_id;return t||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(E,this.userIdentity.anonymous_id,Dt),g().debug("user","getAnonymousId generated (was missing)",this.userIdentity.anonymous_id.slice(0,12)+"..."),this.userIdentity.anonymous_id)}getUserProperties(){return w({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}consumeFirstVisit(){return!!this.O&&(this.O=!1,!0)}applyUpdate(t){if(void 0!==t.distinct_id&&(this.userIdentity.distinct_id=t.distinct_id),void 0!==t.user_state&&(this.userIdentity.user_state=t.user_state),void 0!==t.device_id&&(this.userIdentity.device_id=t.device_id),t.properties_set&&(this.userIdentity.properties=w({},this.userIdentity.properties,t.properties_set)),t.properties_set_once)for(var i of Object.keys(t.properties_set_once))i in this.userIdentity.properties||(this.userIdentity.properties[i]=t.properties_set_once[i]);this.saveUserIdentity()}reset(t){this.userIdentity={distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:t?this.generateDeviceId():this.userIdentity.device_id,properties:{$last_vtilt_reset:(new Date).toISOString()},user_state:"anonymous"},this.saveUserIdentity()}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[U]){var e=function(t,i){var e=t?Ot([],Zi,i||[]):[],r=null==n?void 0:n.href.substring(0,1e3);return{r:re().substring(0,1e3),u:r?Wt(r,e,Yi):void 0}}(t,i);this.register_once({[U]:e},void 0)}}get_initial_props(){var t=this.getStoredUserProperties()[U];return t?se(t):{}}update_referrer_info(){var t={$referrer:re(),$referring_domain:ne()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(E),i=this.storage.get(A),e=this.storage.get(T),r=this.storage.get(M),n=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),a=e||null,l=r||"anonymous";t?g().debug("user","hydrate","loaded from storage",t.slice(0,12)+"..."):(this.O=!0,g().debug("user","hydrate","generated new anonymous_id"));var u=s||this.generateAnonymousId();return t||this.storage.set(E,u,Dt),i||this.storage.set(A,o,Dt),r||this.storage.set(M,l,Dt),{distinct_id:a,anonymous_id:u,device_id:o,properties:n,user_state:l}}saveUserIdentity(){this.storage.set(E,this.userIdentity.anonymous_id,Dt),this.storage.set(A,this.userIdentity.device_id,Dt),this.storage.set(M,this.userIdentity.user_state,Dt),this.userIdentity.distinct_id?this.storage.set(T,this.userIdentity.distinct_id,Dt):this.storage.remove(T),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(I)||{}}setStoredUserProperties(t){this.storage.setJSON(I,t,Dt)}register_once(t,i){var e=this.getStoredUserProperties(),r=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in e||(e[n]=t[n],r=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],r=!0));r&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+At(16)}generateDeviceId(){return"device_"+At(16)}updateStorageMethod(t,i){this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"})}}var he=["LCP","CLS","FCP","INP"];class de{constructor(t,i){this.P=!1,this.L=!1,this.D=!1,this.U=[],this._instance=t,this.j=i}get isEnabled(){return!1!==this.j.enabled}get isStarted(){return this.P}get isLoaded(){return!!this.B}N(t){var i;if(this.B)t(this.B);else if(!this.L){this.L=!0;var e=null===(i=a.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return g().error("feature",this.name,"loadExternalDependency not available"),void(this.L=!1);e(this._instance,this.scriptName,i=>{this.L=!1,i?g().error("feature",this.name,"could not load "+this.scriptName+":",i):(this.B||(this.B=this.q()),t(this.B))})}}startIfEnabled(){this.isEnabled&&!this.P&&(this.P=!0,this.N(t=>this.F(t)))}F(t){}stop(){this.P=!1}updateConfig(t){this.j=w({},this.j,t)}H(t){this.D?t():this.U.push(t)}W(){if(!this.D){this.D=!0;var t=this.U;for(var i of(this.U=[],t))try{i()}catch(t){g().error("feature",this.name,"deferred call error:",t)}}}V(){this.D=!1,this.U=[]}}class ve extends de{startIfEnabledOrStop(t){if(this.isEnabled){if(this.P&&this.B)return;this.P=!0,this.N(t=>this.F(t))}else this.stop()}}var ce=9e5,fe="web-vitals";class pe extends de{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,i){super(t,null!=i?i:pe.extractConfig(t.getConfig())),this.name="WebVitals",this.scriptName="web-vitals",this.G=this.K()}get isEnabled(){var t=null==n?void 0:n.protocol;return("http:"===t||"https:"===t)&&!0===this.j.web_vitals}startIfEnabled(){if(this.isEnabled&&!this.P&&t){var i=this.J();i?(this.P=!0,this.B=i,this.X(i)):(this.P=!0,this.N(t=>this.F(t)))}}stop(){this.P&&(this.Z(),this.Y&&(clearTimeout(this.Y),this.Y=void 0),this.P=!1)}onConfigUpdate(t){var i=pe.extractConfig(t),e=this.isEnabled;this.j=i,e||!this.isEnabled||this.P?e&&!this.isEnabled&&this.P&&this.stop():this.startIfEnabled()}q(){var t=this.J();if(!t)throw new Error("[vTilt:web-vitals] web-vitals loaded but callbacks not registered");return t}F(t){this.X(t)}get allowedMetrics(){return this.j.web_vitals_allowed_metrics||he}get flushTimeoutMs(){return this.j.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.j.__web_vitals_max_value;return void 0===t?ce:0===t?0:t<6e4?ce:t}K(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}J(){var t;return null===(t=a.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}X(t){var i=this.allowedMetrics,e=this.tt.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)}it(){var i;return null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.href}et(){return null==n?void 0:n.pathname}tt(i){var e,s,o;try{if(!t||!r||!n)return;if(!(null==i?void 0:i.name)||void 0===(null==i?void 0:i.value))return void g().warn(fe,"invalid metric received",i);if(this.maxAllowedValue>0&&i.value>=this.maxAllowedValue&&"CLS"!==i.name)return void g().warn(fe,"ignoring "+i.name+" with value >= "+this.maxAllowedValue+"ms");var a=this.it(),l=this.et();if(!a)return void g().warn(fe,"could not determine current URL");this.G.url&&this.G.url!==a&&this.Z(),this.G.url||(this.G.url=a,this.G.pathname=l),this.G.firstMetricTimestamp||(this.G.firstMetricTimestamp=Date.now());var u=this.rt(i.attribution),h=null!==(o=null===(s=(e=this._instance).getSessionId)||void 0===s?void 0:s.call(e))&&void 0!==o?o:null,d=this.nt(),v=w({},i,{attribution:u,timestamp:Date.now(),$current_url:a,$session_id:h,$window_id:d}),c=this.G.metrics.findIndex(t=>t.name===i.name);c>=0?this.G.metrics[c]=v:this.G.metrics.push(v),this.st(),this.G.metrics.length>=this.allowedMetrics.length&&this.Z()}catch(t){g().error(fe,"error adding metric to buffer:",t)}}rt(t){if(t){var i=w({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}nt(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}st(){this.Y&&clearTimeout(this.Y),this.Y=setTimeout(()=>{this.Z()},this.flushTimeoutMs)}Z(){if(this.Y&&(clearTimeout(this.Y),this.Y=void 0),0!==this.G.metrics.length){try{var t={$pathname:this.G.pathname,$current_url:this.G.url};for(var i of this.G.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){g().error(fe,"error flushing metrics:",t)}this.G=this.K()}}}function ge(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return lt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class me{constructor(i,e){var r;this.name="HistoryAutocapture",this.P=!1,this._instance=i,this.j=e||me.extractConfig(i.getConfig()),this.ot=(null===(r=null==t?void 0:t.location)||void 0===r?void 0:r.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.j.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.P}startIfEnabled(){this.isEnabled&&!this.P&&this.lt()}stop(){this.P&&(this.ut&&(this.ut(),this.ut=void 0),this.P=!1)}onConfigUpdate(t){this.j=me.extractConfig(t),this.isEnabled&&!this.P?this.lt():!this.isEnabled&&this.P&&this.stop()}lt(){t&&n&&(this.ot=n.pathname||"",this.ht(),this.dt(),this.P=!0,g().info("history-autocapture","started"))}ht(){var i,e;if(null==t?void 0:t.history){var r=this;(null===(i=t.history.pushState)||void 0===i?void 0:i.__vtilt_wrapped__)||ge(t.history,"pushState",t=>function(i,e,n){r.ct(n),t.call(this,i,e,n),r.ft("pushState")}),(null===(e=t.history.replaceState)||void 0===e?void 0:e.__vtilt_wrapped__)||ge(t.history,"replaceState",t=>function(i,e,n){r.ct(n),t.call(this,i,e,n),r.ft("replaceState")})}}ct(t){var i;if(n){var e=n.pathname||"",r=null!==(i=function(t){if(!n)return null;if(null==t||""===t)return n.pathname||null;try{return new URL(String(t),n.href).pathname}catch(t){return null}}(t))&&void 0!==i?i:e;r!==e&&this._instance.tryCapturePageleave("spa_transition")}}dt(){if(!this.ut&&t){var i=()=>{this.ft("popstate")};Tt(t,"popstate",i),this.ut=()=>{null==t||t.removeEventListener("popstate",i)}}}ft(i){this.isEnabled&&this.P&&ut(()=>{var e,s=null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.pathname;if(s&&n&&r)if(s!==this.ot){g().debug("history-autocapture",i,s),this.ot=s;var o={navigation_type:i};this._instance.capture(j,o)}else this.ot=s})}}var be=["a","button","form","input","select","textarea","label"],ye="$copy_autocapture",_e=['[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 we(t){return t.replace(/^\s+|\s+$/g,"")}function xe(t,i){return t.indexOf(i)>-1}function ke(t){return 1===(null==t?void 0:t.nodeType)}function Se(t){return 3===(null==t?void 0:t.nodeType)}function Ce(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Me(t){return 11===(null==t?void 0:t.nodeType)}function $e(t){return t?we(t).split(/\s+/):[]}function Ae(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 $e(i)}function Ee(t){return ot(t)?null:we(t).split(/(\s+)/).filter(t=>qe(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Re(t){var i,e="";if(He(t)&&!We(t)&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];Se(n)&&n.textContent&&(e+=null!==(i=Ee(n.textContent))&&void 0!==i?i:"")}return we(e)}function Te(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(n&&"span"===(null===(i=n.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Re(n)).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Te(n)).trim())}catch(t){}}return e}function Ie(t){var i=Re(t);return qe(i=(i+" "+Te(t)).trim())?i:""}function Oe(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!ke(i));return i}function Pe(t){var i=t.parentNode;return!(!i||!ke(i))&&i}function Le(i){var e=null==t?void 0:t.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}var De="(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})",Ue=new RegExp("^(?:"+De+")$"),je=new RegExp(De),Be="\\d{3}-?\\d{2}-?\\d{4}",ze=new RegExp("^("+Be+")$"),Ne=new RegExp("("+Be+")");function qe(t,i){if(void 0===i&&(i=!0),ot(t))return!1;if(nt(t)){if(t=we(t),(i?Ue:je).test((t||"").replace(/[- ]/g,"")))return!1;if((i?ze:Ne).test(t))return!1}return!0}function Fe(t){return!!nt(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function He(t){for(var i=t;i&&i.parentNode&&!Ce(i,"body");i=i.parentNode){var e=Ae(i);if(xe(e,"vt-sensitive")||xe(e,"vt-no-capture"))return!1}if(xe(Ae(t),"vt-include"))return!0;var r=t.type||"";if(nt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(nt(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function We(t){return!!(Ce(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Ce(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Ve(t){if(!He(t))return null;if(Ce(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var r={$el_value:i.checked?"true":"false"},n=function(t){var i=t.closest("label");if(i){var e=we(i.textContent||"");if(e&&qe(e))return Ee(e)||null}if(t.id)try{var r=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(r){var n=we(r.textContent||"");if(n&&qe(n))return Ee(n)||null}}catch(t){}return null}(i);return n?r.$selected_text=n:i.value&&qe(i.value)&&(r.$selected_text=i.value),r}var s=i.value;if(s&&qe(s)){var o=Ee(s);if(o)return{$el_value:o}}return null}if(Ce(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var u=a.options[l],h={};u.value&&qe(u.value)&&(h.$el_value=u.value);var d=u.text;if(d&&qe(d)){var v=Ee(d);v&&(h.$selected_text=v)}if(h.$el_value||h.$selected_text)return h}return null}return Ce(t,"textarea"),null}function Ge(i,e,r,n,s){if(void 0===r&&(r=void 0),!t)return{capture:!1,reason:"no_window"};if(!i)return{capture:!1,reason:"no_element"};if(Ce(i,"html")||!ke(i))return{capture:!1,reason:"html_element"};if((null==r?void 0:r.url_allowlist)&&!Le(r.url_allowlist))return{capture:!1,reason:"url_allowlist_miss"};if((null==r?void 0:r.url_ignorelist)&&Le(r.url_ignorelist))return{capture:!1,reason:"url_ignorelist_hit"};if(null==r?void 0:r.dom_event_allowlist){var o=r.dom_event_allowlist;if(o&&!o.some(t=>e.type===t))return{capture:!1,reason:"dom_event_not_allowed"}}for(var a=!1,l=[i],u=!0,h=i;h.parentNode&&!Ce(h,"body");)if(Me(h.parentNode))l.push(h.parentNode.host),h=h.parentNode.host;else{if(!(u=Pe(h)))break;if(n||be.indexOf(u.tagName.toLowerCase())>-1)a=!0;else{var d=t.getComputedStyle(u);d&&"pointer"===d.getPropertyValue("cursor")&&(a=!0)}l.push(u),h=u}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(st(e))return!0;var r,n=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(l,r))return{capture:!1,reason:"element_allowlist_miss"};if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(st(e))return!0;var r,n=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(l,r))return{capture:!1,reason:"css_selector_allowlist_miss"};if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,r=void 0===e?_e:e;if(0===r.length)return!1;for(var n of t)for(var s of r)try{if(n.matches(s))return!0}catch(t){}return!1}(l,r))return{capture:!1,reason:"css_selector_ignorelist_hit"};var v=t.getComputedStyle(i);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return{capture:!0};var c=i.tagName.toLowerCase();switch(c){case"html":return{capture:!1,reason:"tag_html"};case"form":return(s||["submit"]).indexOf(e.type)>=0?{capture:!0}:{capture:!1,reason:"form_event_not_allowed"};case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0?{capture:!0}:{capture:!1,reason:"input_event_not_allowed"};default:return a?(s||["click"]).indexOf(e.type)>=0?{capture:!0}:{capture:!1,reason:"dom_event_not_allowed"}:(s||["click"]).indexOf(e.type)>=0&&(be.indexOf(c)>-1||"true"===i.getAttribute("contenteditable"))?{capture:!0}:{capture:!1,reason:"tag_not_capturable"}}}function Ke(t,i){return i.length>t?i.slice(0,t)+"...":i}function Je(t,i,e,r){var n=t.tagName.toLowerCase(),s={tag_name:n};be.indexOf(n)>-1&&!e&&(s.$el_text=Ke(1024,"a"===n||"button"===n?Ie(t):Re(t)));var o=Ae(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((!We(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==r?void 0:r.includes(l.name))&&!i&&qe(l.value)&&!Fe(l.name))){var u=l.value;"class"===l.name&&(u=$e(u).join(" ")),s["attr__"+l.name]=Ke(1024,u)}}for(var h=1,d=1,v=t;v=Oe(v);)h++,v.tagName===t.tagName&&d++;return s.nth_child=h,s.nth_of_type=d,s}function Xe(t){if(!He(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var r=t.attributes[e];if(r.name&&0===r.name.indexOf("data-vt-capture-attribute")){var n=r.name.replace("data-vt-capture-attribute-",""),s=r.value;n&&s&&qe(s)&&(i[n]=s)}}return i}function Ze(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){var i=t.attr__class;return i?at(i)?i:$e(i):void 0}function Ye(t){return function(t){var i=t.map(t=>{var i,e,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=w({},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,[r]=i;return e.localeCompare(r)}).forEach(t=>{var[i,e]=t;return o[Ze(i.toString())]=Ze(String(e))}),(r+=":")+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,r={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:Qe(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 r.attributes[i]=e}),r})}(t))}var tr=[25,50,75,100];function ir(t){var i;if(!t)return null;var e=t.milestones,r=!0===e||"object"==typeof e&&null!==e,n="object"==typeof e&&null!==e&&(null===(i=e.thresholds)||void 0===i?void 0:i.length)?[...e.thresholds].sort((t,i)=>t-i):[...tr],s=!0===t.pageleave;return r||s?{milestones:r,thresholds:n,pageleave:s,scroll_root_selector:t.scroll_root_selector}:null}class er{constructor(t){this.gt=t,this.bt=0,this.yt=new Set,this._t=null,this.wt=null,this.xt=null,this.kt=null}start(){this.stop(),this.wt=function(i){if(!t)return null;if(i){var e=Array.isArray(i)?i:[i];for(var n of e){var s=null==r?void 0:r.querySelector(n);if(s instanceof Element)return s}}return t}(this.gt.scroll_root_selector),this.wt&&(this._t=()=>this.St(),Tt(this.wt,"scroll",this._t,{passive:!0}),this.Ct(),this.kt=this.gt.onPageview(()=>this.reset()))}stop(){this.kt&&(this.kt(),this.kt=null),null!=this.xt&&t&&(t.cancelAnimationFrame(this.xt),this.xt=null),this._t&&this.wt&&(this.wt.removeEventListener("scroll",this._t,{passive:!0}),this._t=null,this.wt=null)}reset(){this.bt=0,this.yt.clear(),this.Ct()}getMaxPct(){return this.bt}St(){t&&null==this.xt&&(this.xt=t.requestAnimationFrame(()=>{this.xt=null,this.Ct()}))}Ct(){if(this.wt){var i=function(i){var e,n,s,o,a,l;if(!i)return 0;if(i===t){var u=null!==(e=t.scrollY)&&void 0!==e?e:0,h=null!==(n=t.innerHeight)&&void 0!==n?n:0,d=null==r?void 0:r.documentElement,v=null==r?void 0:r.body,c=Math.max(null!==(s=null==d?void 0:d.scrollHeight)&&void 0!==s?s:0,null!==(o=null==v?void 0:v.scrollHeight)&&void 0!==o?o:0,null!==(a=null==d?void 0:d.offsetHeight)&&void 0!==a?a:0,null!==(l=null==v?void 0:v.offsetHeight)&&void 0!==l?l:0)-h;return c<=0?100:Math.round(Math.min(100,u/c*100))}var f=i,p=f.scrollHeight-f.clientHeight;return p<=0?100:Math.round(Math.min(100,f.scrollTop/p*100))}(this.wt);if(i>this.bt&&(this.bt=i),this.gt.milestones&&this.gt.isUrlAllowed())for(var e of this.gt.thresholds)this.bt>=e&&!this.yt.has(e)&&(this.yt.add(e),this.gt.capture(W,{[tt]:e,[it]:this.bt}))}}}function rr(t,i){return t.indexOf(i)>-1}class nr{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 r=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-r.x,2)+Math.pow(i-r.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 sr(i,e){for(var r,n,s,o,{e:a,maskAllElementAttributes:l,maskAllText:u,elementAttributeIgnoreList:h,elementsChainAsString:d,captureElementValues:v}=e,c=[i],f=i;f.parentNode&&!Ce(f,"body");)Me(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=He(_);if("a"===_.tagName.toLowerCase()){var x=_.getAttribute("href");b=!!(w&&x&&qe(x))&&x}rr(Ae(_),"vt-no-capture")&&(y=!0),g.push(Je(_,l,u,h));var k=Xe(_);Object.assign(m,k)}if(y)return{props:{},explicitNoCapture:y};if(u||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?g[0].$el_text=Ie(i):g[0].$el_text=Re(i)),"change"===a.type&&v){var S=Ve(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===(r=Nt(b))||void 0===r?void 0:r.host,M=null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.host;C&&M&&C!==M&&(p=b)}var A=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:Ye(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:A}}var or=["copy","cut"];class ar{static extractConfig(t){return{enabled:!1!==t.autocapture}}constructor(t,i){this.name="Autocapture",this.Mt=!1,this.$t=null,this.At=null,this.Et=null,this.Rt=new nr,this.Tt=!0,this.It=null,this.Ot=null,this.Pt=null,this.Lt=null,this.Dt=!1,this.Ut=null,this.jt=null,this._instance=t}get j(){var t=this._instance.getConfig().autocapture;if(t===this.Ot&&this.It)return this.It;this.Ot=t;var i=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}(t)?t:{};return i.url_allowlist&&(i.url_allowlist=i.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),i.url_ignorelist&&(i.url_ignorelist=i.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),this.It=i,i}get isEnabled(){return this.Bt().enabled}get isStarted(){return this.Mt}startIfEnabled(){var{enabled:t,reason:i}=this.Bt();t?this.Mt?(this.zt(),this.Nt()):(this.qt(),this.Mt=!0,g().info("autocapture","started; listening for click/change/submit events")):this.Mt?(g().info("autocapture","stopping; reason:",null!=i?i:"unknown"),this.Ft(),this.Mt=!1):(g().debug("autocapture","not started; reason:",null!=i?i:"unknown"),this.Ht())}stop(){this.Mt&&(this.Ft(),this.Mt=!1,g().info("autocapture","stopped (DOM listeners detached)")),this.Ht()}getMaxScrollDepthPctForPageleave(){var t=ir(this.j.scroll_depth);return(null==t?void 0:t.pageleave)&&this.Ut?this.Ut.getMaxPct():null}onConfigUpdate(t){var i=t;"boolean"==typeof i.elementsChainAsString&&(this.Tt=i.elementsChainAsString),void 0!==i.autocapture_opt_out&&(this.$t=!!i.autocapture_opt_out),this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&(this.At=t.enabled,t.enabled&&(this.$t=!1),this.startIfEnabled())}getDiagnostics(){var t,i,e,{enabled:r,reason:n}=this.Bt(),s=ir(this.j.scroll_depth);return{isEnabled:r,isStarted:this.Mt,disabledReason:r?null:n,inputs:{configAutocapture:this._instance.getConfig().autocapture,isDisabledServerSide:null!==(t=this.$t)&&void 0!==t&&t,userOverride:this.At,elementsChainAsString:this.Tt,captureCopiedText:!!this.j.capture_copied_text,scrollDepthMilestones:null!==(i=null==s?void 0:s.milestones)&&void 0!==i&&i,scrollDepthPageleave:null!==(e=null==s?void 0:s.pageleave)&&void 0!==e&&e,scrollDepthListenerAttached:null!==this.Ut}}}setElementSelectors(t){this.Et=t}getElementSelectors(t){var i,e=[];return null===(i=this.Et)||void 0===i||i.forEach(i=>{var n=null==r?void 0:r.querySelectorAll(i);null==n||n.forEach(r=>{t===r&&e.push(i)})}),e}Bt(){if(!1===this.At)return{enabled:!1,reason:"user_stop_called"};if(this.$t)return{enabled:!1,reason:"server_opt_out"};if(!0===this.At)return{enabled:!0,reason:null};var t=this._instance.getConfig().autocapture;return!1===t?{enabled:!1,reason:"config_autocapture_false"}:null==t?{enabled:!1,reason:"config_autocapture_undefined"}:{enabled:!0,reason:null}}qt(){this.Wt()?t&&r&&(this.Pt=i=>{var e=i||(null==t?void 0:t.event);if(e)try{this.Vt(e)}catch(t){g().error("autocapture","capture handler threw",t)}},Tt(r,"submit",this.Pt,{capture:!0}),Tt(r,"change",this.Pt,{capture:!0}),Tt(r,"click",this.Pt,{capture:!0}),this.zt(),this.Nt()):g().warn("autocapture","browser unsupported (no querySelectorAll)")}Ft(){r&&(this.Pt&&(r.removeEventListener("submit",this.Pt,!0),r.removeEventListener("change",this.Pt,!0),r.removeEventListener("click",this.Pt,!0),this.Pt=null),this.Lt&&this.Dt&&(r.removeEventListener("copy",this.Lt,!0),r.removeEventListener("cut",this.Lt,!0),this.Dt=!1,this.Lt=null),this.Ht())}Nt(){var i,e=ir(this.j.scroll_depth),r=this.isEnabled&&null!==e&&null!==ir(null==(i=this.j)?void 0:i.scroll_depth);r&&!this.Ut?(this.Ut=new er({milestones:e.milestones,pageleave:e.pageleave,thresholds:e.thresholds,scroll_root_selector:e.scroll_root_selector,capture:(t,i)=>this._instance.capture(t,i),isUrlAllowed:()=>{return i=this.j,!(!t||(null==i?void 0:i.url_allowlist)&&!Le(i.url_allowlist)||(null==i?void 0:i.url_ignorelist)&&Le(i.url_ignorelist));var i},onPageview:t=>(this.jt&&this.jt(),this.jt=this._instance.on(bt,i=>{(null==i?void 0:i.event)===j&&t()}),()=>{var t;null===(t=this.jt)||void 0===t||t.call(this),this.jt=null})}),this.Ut.start(),g().info("autocapture","scroll depth tracking started",{milestones:e.milestones,pageleave:e.pageleave})):r||this.Ht()}Ht(){this.Ut&&(this.Ut.stop(),this.Ut=null,g().info("autocapture","scroll depth tracking stopped")),this.jt&&(this.jt(),this.jt=null)}zt(){if(r){var i=!!this.j.capture_copied_text;i&&!this.Dt?(this.Lt=i=>{var e=i||(null==t?void 0:t.event);if(e)try{this.Vt(e,ye)}catch(t){g().error("autocapture","copy handler threw",t)}},Tt(r,"copy",this.Lt,{capture:!0}),Tt(r,"cut",this.Lt,{capture:!0}),this.Dt=!0):!i&&this.Dt&&this.Lt&&(r.removeEventListener("copy",this.Lt,!0),r.removeEventListener("cut",this.Lt,!0),this.Dt=!1,this.Lt=null)}}Vt(i,e){var r,n,s,o,a,l,u,h;if(void 0===e&&(e="$autocapture"),this.isEnabled)if(i.isTrusted){var d=function(t){var i;return st(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(Se(d)&&(d=d.parentNode||null),"$autocapture"===e&&"click"===i.type&&i instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(r=this.Rt)||void 0===r?void 0:r.isRageClick(i.clientX,i.clientY,(new Date).getTime()))&&(g().info("autocapture","$rageclick detected"),this.Vt(i,"$rageclick"));var v=e===ye;if(d){var c=Ge(d,i,this.j,v,v?[...or]:void 0);if(c.capture){var f=this._instance.getConfig(),{props:p,explicitNoCapture:m}=sr(d,{e:i,maskAllElementAttributes:null!==(o=f.mask_all_element_attributes)&&void 0!==o&&o,maskAllText:null!==(a=f.mask_all_text)&&void 0!==a&&a,elementAttributeIgnoreList:this.j.element_attribute_ignorelist,elementsChainAsString:this.Tt,captureElementValues:null!==(l=this.j.capture_element_values)&&void 0!==l&&l});if(m)return g().debug("autocapture","skip: vt-no-capture class on element chain",{tag:null===(u=d.tagName)||void 0===u?void 0:u.toLowerCase()}),!1;var b=this.getElementSelectors(d);if(b&&b.length>0&&(p.$element_selectors=b),e===ye){var y=Ee(null===(h=null==t?void 0:t.getSelection())||void 0===h?void 0:h.toString()),_=i.type||"clipboard";if(!y)return g().debug("autocapture","skip copy: empty selection"),!1;p.$selected_content=y,p.$copy_type=_}return this._instance.capture(e,p),!0}g().debug("autocapture","skip:",null!==(n=c.reason)&&void 0!==n?n:"unknown",{type:i.type,tag:null===(s=d.tagName)||void 0===s?void 0:s.toLowerCase()})}else g().debug("autocapture","skip: no event target",{type:i.type})}else g().debug("autocapture","skip: synthetic event (isTrusted=false)",{type:i.type})}Wt(){return lt(null==r?void 0:r.querySelectorAll)}}var lr="replay";class ur extends ve{constructor(t,i){super(t,i||ur.extractConfig(t.getConfig())),this.name="SessionRecording",this.scriptName="recorder"}static extractConfig(t){var i,e,r,n=t.session_recording||{};return{enabled:null!==(i=n.enabled)&&void 0!==i&&i,sampleRate:n.sampleRate,minimumDurationMs:n.minimumDurationMs,sessionIdleThresholdMs:n.sessionIdleThresholdMs,fullSnapshotIntervalMs:n.fullSnapshotIntervalMs,captureConsole:null!==(e=n.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(r=n.captureNetwork)&&void 0!==r&&r,captureCanvas:n.captureCanvas,blockClass:n.blockClass,blockSelector:n.blockSelector,skipDefaultInvisibleBlocking:n.skipDefaultInvisibleBlocking,ignoreClass:n.ignoreClass,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,maskAllInputs:n.maskAllInputs,maskInputOptions:n.maskInputOptions,masking:n.masking,recordHeaders:n.recordHeaders,recordBody:n.recordBody,compressEvents:n.compressEvents,__mutationThrottlerRefillRate:n.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:n.__mutationThrottlerBucketSize}}get isEnabled(){var i,e=this._instance.getConfig(),r=null!==(i=this.j.enabled)&&void 0!==i&&i,n=!e.disable_session_recording;return!!t&&r&&n}get isStarted(){var t;return this.P&&!!(null===(t=this.B)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.B)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.P=!0,this.N(i=>this.F(i,t)),g().info(lr,"starting")):this.stop()}}stop(){ut(()=>{var t;null===(t=this.B)||void 0===t||t.stop(),this.P=!1})}onConfigUpdate(t){var i;this.j=ur.extractConfig(t),null===(i=this.B)||void 0===i||i.updateConfig(this.j),this.startIfEnabledOrStop("config_updated")}q(){var t,i=null===(t=a.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;if(!i)throw new Error("[vTilt:replay] initSessionRecording not available after script load");return i(this._instance,this.j)}F(t,i){t.start(i)}get started(){return this.isStarted}get status(){var t;return(null===(t=this.B)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.B)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.B)||void 0===e?void 0:e.log)?this.B.log(t,i):g().warn(lr,"log called before recorder was ready")}updateConfig(t){var i;this.j=w({},this.j,t),null===(i=this.B)||void 0===i||i.updateConfig(this.j)}}var hr=(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))(hr||{});hr.MouseMove,hr.MouseInteraction,hr.Scroll,hr.ViewportResize,hr.Input,hr.TouchMove,hr.MediaInteraction,hr.Drag;var dr=Uint8Array,vr=Uint16Array,cr=Int32Array,fr=new dr([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]),pr=new dr([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]),gr=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),mr=function(t,i){for(var e=new vr(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new cr(e[30]);for(r=1;r<30;++r)for(var s=e[r];s<e[r+1];++s)n[s]=s-e[r]<<5|r;return{b:e,r:n}},br=mr(fr,2),yr=br.b,_r=br.r;yr[28]=258,_r[258]=28;for(var wr=mr(pr,0).r,xr=new vr(32768),kr=0;kr<32768;++kr){var Sr=(43690&kr)>>1|(21845&kr)<<1;Sr=(61680&(Sr=(52428&Sr)>>2|(13107&Sr)<<2))>>4|(3855&Sr)<<4,xr[kr]=((65280&Sr)>>8|(255&Sr)<<8)>>1}var Cr=function(t,i,e){for(var r=t.length,n=0,s=new vr(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new vr(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new vr(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=i-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[xr[d]>>l]=u}else for(o=new vr(r),n=0;n<r;++n)t[n]&&(o[n]=xr[a[t[n]-1]++]>>15-t[n]);return o},Mr=new dr(288);for(kr=0;kr<144;++kr)Mr[kr]=8;for(kr=144;kr<256;++kr)Mr[kr]=9;for(kr=256;kr<280;++kr)Mr[kr]=7;for(kr=280;kr<288;++kr)Mr[kr]=8;var $r=new dr(32);for(kr=0;kr<32;++kr)$r[kr]=5;var Ar=Cr(Mr,9,0),Er=Cr($r,5,0),Rr=function(t){return(t+7)/8|0},Tr=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new dr(t.subarray(i,e))},Ir=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Or=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8,t[r+2]|=e>>16},Pr=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var n=e.length,s=e.slice();if(!n)return{t:Nr,l:0};if(1==n){var o=new dr(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],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new vr(v+1),f=Lr(e[h-1],c,0);if(f>i){r=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});r<n;++r){var b=s[r].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[r].s;c[y]<i?p-=1<<i-c[y]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==i&&(--c[_],++p)}f=i}return{t:new dr(c),l:f}},Lr=function(t,i,e){return-1==t.s?Math.max(Lr(t.l,i,e+1),Lr(t.r,i,e+1)):i[t.s]=e},Dr=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new vr(++i),r=0,n=t[0],s=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==n&&a!=i)++s;else{if(!n&&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(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return{c:e.subarray(0,r),n:i}},Ur=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},jr=function(t,i,e){var r=e.length,n=Rr(i+2);t[n]=255&r,t[n+1]=r>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=e[s];return 8*(n+4+r)},Br=function(t,i,e,r,n,s,o,a,l,u,h){Ir(i,h++,e),++n[256];for(var d=Pr(n,15),v=d.t,c=d.l,f=Pr(s,15),p=f.t,g=f.l,m=Dr(v),b=m.c,y=m.n,_=Dr(p),w=_.c,x=_.n,k=new vr(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=Pr(k,7),M=C.t,A=C.l,E=19;E>4&&!M[gr[E-1]];--E);var R,T,I,O,P=u+5<<3,L=Ur(n,Mr)+Ur(s,$r)+o,D=Ur(n,v)+Ur(s,p)+o+14+3*E+Ur(k,M)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&P<=L&&P<=D)return jr(i,h,t.subarray(l,l+u));if(Ir(i,h,1+(D<L)),h+=2,D<L){R=Cr(v,c,0),T=v,I=Cr(p,g,0),O=p;var U=Cr(M,A,0);Ir(i,h,y-257),Ir(i,h+5,x-1),Ir(i,h+10,E-4),h+=14;for(S=0;S<E;++S)Ir(i,h+3*S,M[gr[S]]);h+=3*E;for(var j=[b,w],B=0;B<2;++B){var z=j[B];for(S=0;S<z.length;++S){var N=31&z[S];Ir(i,h,U[N]),h+=M[N],N>15&&(Ir(i,h,z[S]>>5&127),h+=z[S]>>12)}}}else R=Ar,T=Mr,I=Er,O=$r;for(S=0;S<a;++S){var q=r[S];if(q>255){Or(i,h,R[(N=q>>18&31)+257]),h+=T[N+257],N>7&&(Ir(i,h,q>>23&31),h+=fr[N]);var F=31&q;Or(i,h,I[F]),h+=O[F],F>3&&(Or(i,h,q>>5&8191),h+=pr[F])}else Or(i,h,R[q]),h+=T[q]}return Or(i,h,R[256]),h+T[256]},zr=new cr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nr=new dr(0),qr=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Fr=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new dr(s.length+t.length);o.set(s),o.set(t,s.length),t=o,n.w=s.length}return function(t,i,e,r,n,s){var o=s.z||t.length,a=new dr(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),u=s.l,h=7&(s.r||0);if(i){h&&(l[0]=s.r>>3);for(var d=zr[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new vr(32768),g=s.h||new vr(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 cr(25e3),w=new vr(288),x=new vr(32),k=0,S=0,C=s.i||0,M=0,A=s.w||0,E=0;C+2<o;++C){var R=y(C),T=32767&C,I=g[R];if(p[T]=I,g[R]=T,A<=C){var O=o-C;if((k>7e3||M>24576)&&(O>423||!u)){h=Br(t,l,0,_,w,x,S,M,E,C-E,h),M=k=S=0,E=C;for(var P=0;P<286;++P)w[P]=0;for(P=0;P<30;++P)x[P]=0}var L=2,D=0,U=c,j=T-I&32767;if(O>2&&R==y(C-j))for(var B=Math.min(v,O)-1,z=Math.min(32767,C),N=Math.min(258,O);j<=z&&--U&&T!=I;){if(t[C+L]==t[C+L-j]){for(var q=0;q<N&&t[C+q]==t[C+q-j];++q);if(q>L){if(L=q,D=j,q>B)break;var F=Math.min(j,q-2),H=0;for(P=0;P<F;++P){var W=C-j+P&32767,V=W-p[W]&32767;V>H&&(H=V,I=W)}}}j+=(T=I)-(I=p[T])&32767}if(D){_[M++]=268435456|_r[L]<<18|wr[D];var G=31&_r[L],K=31&wr[D];S+=fr[G]+pr[K],++w[257+G],++x[K],A=C+L,++k}else _[M++]=t[C],++w[t[C]]}}for(C=Math.max(C,A);C<o;++C)_[M++]=t[C],++w[t[C]];h=Br(t,l,u,_,w,x,S,M,E,C-E,h),u||(s.r=7&h|l[h/8|0]<<3,h-=7,s.h=g,s.p=p,s.i=C,s.w=A)}else{for(C=s.w||0;C<o+u;C+=65535){var J=C+65535;J>=o&&(l[h/8|0]=u,J=o),h=jr(l,h+1,t.subarray(C,J))}s.i=o}return Tr(a,0,r+Rr(h)+n)}(t,null==i.level?6:i.level,null==i.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,r,n)},Hr=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Wr(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=qr[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=Fr(t,i,10+((n=i).filename?n.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&&Hr(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(s,i),Hr(s,o-8,e.d()),Hr(s,o-4,r),s}var Vr="undefined"!=typeof TextEncoder&&new TextEncoder,Gr="undefined"!=typeof TextDecoder&&new TextDecoder;try{Gr.decode(Nr,{stream:!0})}catch(t){}var Kr="vtilt-bubble-pos";function Jr(t,i,e){var r=t.getBoundingClientRect(),n=r.left-i,s=r.top-e,o=window.innerWidth-t.offsetWidth-n,a=-n,l=window.innerHeight-t.offsetHeight-s,u=-s;return{x:Math.min(Math.max(i,a),o),y:Math.min(Math.max(e,u),l)}}function Xr(t,i,e){t.style.transform="translate3d("+i+"px, "+e+"px, 0)"}function Zr(t,i){var e=t,r=0,n=0,s=0,o=0,a=0,l=0,u=!1,h=!1,d=function(){try{var t=localStorage.getItem(Kr);if(!t)return null;var i=JSON.parse(t);if("number"==typeof i.x&&"number"==typeof i.y)return i}catch(t){}return null}();if(d){r=d.x,n=d.y;var v=t.style.transition;t.style.transition="none",Xr(t,r,n);var c=Jr(t,r,n);r=c.x,n=c.y,Xr(t,r,n),t.offsetHeight,t.style.transition=v}e.style.cursor="grab",e.style.touchAction="none";var f=i=>{0===i.button&&(u=!0,h=!1,s=i.clientX,o=i.clientY,a=r,l=n,e.setPointerCapture(i.pointerId),e.style.cursor="grabbing",t.style.transition="none")},p=i=>{if(u){var e=i.clientX-s,d=i.clientY-o;if(!(!h&&Math.abs(e)<5&&Math.abs(d)<5)){h=!0;var v={x:a+e,y:l+d},c=Jr(t,v.x,v.y);r=c.x,n=c.y,Xr(t,r,n)}}},g=()=>{u&&(u=!1,e.style.cursor="grab",t.style.transition="",h&&function(t){try{localStorage.setItem(Kr,JSON.stringify(t))}catch(t){}}({x:r,y:n}))},m=t=>{h&&(t.stopPropagation(),t.preventDefault(),h=!1)},b=()=>{var i=Jr(t,r,n);r=i.x,n=i.y,Xr(t,r,n)};return e.addEventListener("pointerdown",f),e.addEventListener("pointermove",p),e.addEventListener("pointerup",g),e.addEventListener("pointercancel",g),e.addEventListener("click",m,!0),window.addEventListener("resize",b),{destroy(){e.removeEventListener("pointerdown",f),e.removeEventListener("pointermove",p),e.removeEventListener("pointerup",g),e.removeEventListener("pointercancel",g),e.removeEventListener("click",m,!0),window.removeEventListener("resize",b)}}}var Qr="chat";class Yr extends de{constructor(t,i){super(t,i||Yr.extractConfig(t.getConfig())),this.name="Chat",this.scriptName="chat",this.Gt=null,this.Kt=!1,this.Jt=null,this.Xt=null,this.Zt=[],this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.ei=!1,this.ri=()=>{"visible"===document.visibilityState&&this.ni()}}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,bubble:e.bubble}}get isEnabled(){var t;return!1!==this.j.enabled&&(!0===this.j.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.Gt)||void 0===t?void 0:t.enabled))}startIfEnabled(){g().debug(Qr,"startIfEnabled"),this.si().catch(t=>{g().error(Qr,"error starting:",t)})}stop(){this.destroy(),this.P=!1}onConfigUpdate(t){var i,e;this.j=Yr.extractConfig(t),this.B&&(null===(e=(i=this.B).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}q(){var i,e,r,n=null===(i=a.__VTiltExtensions__)||void 0===i?void 0:i.initChat;if(!n)throw new Error("[vTilt:chat] initChat not available after script load");var s=this.getMergedConfig(),o=n(this._instance,s);this.ei&&o.show(),this.Yt.forEach(t=>o.onMessage(t)),this.ti.forEach(t=>o.onTyping(t)),this.ii.forEach(t=>o.onConnectionChange(t)),null===(e=this.Xt)||void 0===e||e.destroy(),this.Xt=null;var l=null===(r=null==t?void 0:t.document)||void 0===r?void 0:r.getElementById("vtilt-chat-bubble");return l&&!l.closest("#vtilt-chat-container")&&l.remove(),o}F(t){this.Qt.forEach(t=>t()),this.Qt=[],g().info(Qr,"loaded and ready")}si(){var t=this;return _(function*(){var i,e,r,n,s;try{if(!1===t.j.enabled)return void g().info(Qr,"disabled by code config");if(t._instance.getConfig().disable_chat)return void g().info(Qr,"disabled by disable_chat config");if(!1!==t.j.autoConfig&&(yield t.oi()),!t.isEnabled)return void g().info(Qr,"not enabled (check dashboard settings)");g().debug(Qr,"startIfEnabled enabled"),t.P=!0,null!==(r=null!==(i=t.j.preload)&&void 0!==i?i:null===(e=t.Gt)||void 0===e?void 0:e.enabled)&&void 0!==r&&r&&t.ai();var o=t.getMergedConfig();(null===(n=t.Gt)||void 0===n?void 0:n.enabled)&&!1!==(null===(s=o.bubble)||void 0===s?void 0:s.visible)&&t.li(),g().info(Qr,"ready (lazy-load on demand)")}finally{t.W()}})()}get isOpen(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.L||null!==(i=null===(t=this.B)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.B)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.open()})})}close(){this.H(()=>{this.B?this.B.close():this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.close()})})}toggle(){this.H(()=>{this.B?this.B.toggle():this.open()})}show(){this.H(()=>{this.ei=!0,this.B?this.B.show():this.P&&this.li()})}hide(){this.H(()=>{var i;if(this.ei=!1,this.B)this.B.hide();else{var e=null===(i=null==t?void 0:t.document)||void 0===i?void 0:i.getElementById("vtilt-chat-bubble");e&&(e.style.display="none")}})}getChannels(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.getChannels()})})}selectChannel(t){this.H(()=>{this.ui(()=>{var i;return null===(i=this.B)||void 0===i?void 0:i.selectChannel(t)})})}createChannel(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.createChannel()})})}goToChannelList(){this.H(()=>{this.B?this.B.goToChannelList():this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.goToChannelList()})})}sendMessage(t,i){this.H(()=>{this.B?this.B.sendMessage(t,i):(this.Zt.push({content:t,options:i}),this.ui(()=>{this.Zt.forEach(t=>{var i,{content:e,options:r}=t;null===(i=this.B)||void 0===i||i.sendMessage(e,r)}),this.Zt=[]}))})}markAsRead(){this.H(()=>{this.B?this.B.markAsRead():this.ui(()=>{var t;return null===(t=this.B)||void 0===t?void 0:t.markAsRead()})})}registerWidget(t){this.H(()=>{var i,e;this.B?null===(e=(i=this.B).registerWidget)||void 0===e||e.call(i,t):this.ui(()=>{var i,e;null===(e=null===(i=this.B)||void 0===i?void 0:i.registerWidget)||void 0===e||e.call(i,t)})})}onMessage(t){return this.Yt.push(t),this.B?this.B.onMessage(t):()=>{var i=this.Yt.indexOf(t);i>-1&&this.Yt.splice(i,1)}}onTyping(t){return this.ti.push(t),this.B?this.B.onTyping(t):()=>{var i=this.ti.indexOf(t);i>-1&&this.ti.splice(i,1)}}onConnectionChange(t){return this.ii.push(t),this.B?this.B.onConnectionChange(t):()=>{var i=this.ii.indexOf(t);i>-1&&this.ii.splice(i,1)}}updateConfig(t){var i,e;this.j=w({},this.j,t),this.B&&(null===(e=(i=this.B).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}getMergedConfig(){var t,i,e,r,n,s,o,a,l,u,h,d,v,c,f,p,g,m,b,y,_,w,x,k,S=this.Gt,C=this.j;return{enabled:null!==(i=null!==(t=C.enabled)&&void 0!==t?t:null==S?void 0:S.enabled)&&void 0!==i&&i,autoConfig:null===(e=C.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=C.position)&&void 0!==r?r:null==S?void 0:S.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=C.greeting)&&void 0!==s?s:null==S?void 0:S.greeting,color:null!==(a=null!==(o=C.color)&&void 0!==o?o:null==S?void 0:S.color)&&void 0!==a?a:"#6366f1",aiMode:null===(u=null!==(l=C.aiMode)&&void 0!==l?l:null==S?void 0:S.ai_enabled)||void 0===u||u,aiGreeting:null!==(h=C.aiGreeting)&&void 0!==h?h:null==S?void 0:S.ai_greeting,preload:null!==(d=C.preload)&&void 0!==d&&d,theme:null!==(v=C.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=C.color)&&void 0!==c?c:null==S?void 0:S.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=C.offlineMessage)&&void 0!==p?p:null==S?void 0:S.offline_message,collectEmailOffline:null===(m=null!==(g=C.collectEmailOffline)&&void 0!==g?g:null==S?void 0:S.collect_email_offline)||void 0===m||m,bubble:{draggable:null!==(_=null!==(y=null===(b=C.bubble)||void 0===b?void 0:b.draggable)&&void 0!==y?y:null==S?void 0:S.bubble_draggable)&&void 0!==_&&_,visible:null===(k=null!==(x=null===(w=C.bubble)||void 0===w?void 0:w.visible)&&void 0!==x?x:null==S?void 0:S.bubble_visible)||void 0===k||k}}}destroy(){ut(()=>{var i,e,r;document.removeEventListener("visibilitychange",this.ri),null===(i=this.B)||void 0===i||i.destroy(),this.B=void 0,this.ei=!1,this.Zt=[],this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.V(),null===(e=this.Xt)||void 0===e||e.destroy(),this.Xt=null;var n=null===(r=null==t?void 0:t.document)||void 0===r?void 0:r.getElementById("vtilt-chat-bubble");n&&n.remove()})}oi(){var t=this;return _(function*(){if(!t.Kt){var i=t._instance.getConfig();if(!i.token)return g().warn(Qr,"cannot fetch settings: missing token"),void(t.Kt=!0);try{var e=dt(i,"/api/chat/settings"),r=yield fetch(e,{headers:vt(i)});if(!r.ok)return g().warn(Qr,"failed to fetch settings: "+r.status),void(t.Kt=!0);t.Gt=yield r.json(),t.Kt=!0,g().info(Qr,"loaded settings from dashboard")}catch(i){g().warn(Qr,"error fetching settings:",i),t.Kt=!0}}})()}ni(){var t=this;return _(function*(){var i,e,r,n,s=t._instance.getConfig(),o=s.token,a=null!==(r=null===(e=(i=t._instance).getDistinctId)||void 0===e?void 0:e.call(i))&&void 0!==r?r:"";if(g().debug("chat","fetchUnread","distinctId",a?a.slice(0,12)+"...":"empty"),o&&a)try{var l=dt(s,"/api/chat/widget/unread"),u=l.includes("?")?"&":"?",h=""+l+u+"distinct_id="+encodeURIComponent(a),d=yield fetch(h,{headers:vt(s)});if(!d.ok)return;var v=yield d.json(),c=Number(null!==(n=v.unread_count)&&void 0!==n?n:0),f=document.getElementById("vtilt-chat-bubble");if(!f)return;var p=f.querySelector(".vtilt-chat-bubble-badge");if(!p)return;c>0?(p.style.display="flex",p.textContent=c>99?"99+":String(c)):p.style.display="none"}catch(t){}else{var m=o?"missing distinctId":"missing token";g().debug("chat","fetchUnread skip","reason",m)}})()}li(){var i,e;if(null==t?void 0:t.document){var r=document.getElementById("vtilt-chat-bubble");if(r)r.style.display="flex";else{var n=this.getMergedConfig(),s=n.position||"bottom-right",o=n.color||"#6366f1",a=document.createElement("div");a.id="vtilt-chat-bubble",a.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===s?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+o+";\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()),a.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 <div class="vtilt-chat-bubble-badge" style="\n display: none;\n position: absolute;\n top: -4px;\n right: -4px;\n background: #E53935;\n color: white;\n font-size: 11px;\n font-weight: 700;\n min-width: 20px;\n height: 20px;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n box-sizing: border-box;\n border: 2px solid white;\n ">0</div>\n ';var l=!0===(null===(i=n.bubble)||void 0===i?void 0:i.draggable);l||(a.addEventListener("mouseenter",()=>{a.style.transform="scale(1.05)",a.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),a.addEventListener("mouseleave",()=>{a.style.transform="scale(1)",a.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"})),a.addEventListener("click",()=>{this.open()}),document.body.appendChild(a),l&&(null===(e=this.Xt)||void 0===e||e.destroy(),this.Xt=Zr(a)),this.ni(),document.addEventListener("visibilitychange",this.ri)}}}ai(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.N(()=>{}),{timeout:5e3}):setTimeout(()=>this.N(()=>{}),3e3)}ui(t){this.B?t():(this.Qt.push(t),this.N(t=>this.F(t)))}}function tn(t,i){t("js",new Date);var{tagIds:e,configParams:r,sendPageView:n,debugMode:s,conversionLinker:o,linkerDomains:a}=i,l=w({},r||{});for(var u of(!1===n&&(l.send_page_view=!1),s&&(l.debug_mode=!0),!1===o&&(l.conversion_linker=!1),a&&a.length>0&&(l.linker={domains:a,decorate_forms:!0}),e))u&&t("config",u,l)}function en(i,e){var r,n=(i.tagIds||[]).filter(t=>!!t);if(0===n.length)return null;var s,o,a,l=null!==(r=i.proxyMode)&&void 0!==r?r:"proxied";if("direct"===l)s=nn,o=nn,a="";else{var u=function(i){var e,r=void 0!==t&&(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.origin)?t.location.origin:"";if(!i)return r?{base:r,absoluteBase:r}:null;var n=i.replace(/\/+$/g,"");if(!n)return r?{base:r,absoluteBase:r}:null;try{var s=new URL(n),o=s.pathname.replace(/\/$/,""),a=""+s.origin+o;return{base:a,absoluteBase:a}}catch(t){}if(n.startsWith("/"))return{base:n,absoluteBase:r?""+r+n:n};return r?{base:r,absoluteBase:r}:null}(e);if(!u)return null;s=u.base,o=u.absoluteBase,a=rn}var h={};if("direct"!==l){var d=function(t){if(!t)return"";var i=t.startsWith("/")?t:"/"+t;return i.replace(/\/$/,"")}(a);h.transport_url=""+o.replace(/\/$/,"")+d}return{origin:s,gatewayPath:a,primaryTagId:n.find(t=>t.startsWith("G-"))||n[0]||"",tagIds:n,configParams:h,sendPageView:!1!==i.capturePageview,debugMode:!!i.debugMode,conversionLinker:!1!==i.conversionLinker,linkerDomains:i.linkerDomains}}var rn="/gt",nn="https://www.googletagmanager.com";function sn(t,i){var e=!0===t.advertising,r={ad_storage:e?"granted":"denied",ad_user_data:e?"granted":"denied",ad_personalization:e?"granted":"denied",analytics_storage:!0===t.analytics?"granted":"denied"};if(!i)return r;var n=w({},r);return Object.keys(r).forEach(e=>{var r=i[e];void 0!==r&&(n[e]=function(t,i){return"granted"===i?"granted":"denied"===i?"denied":"follow_advertising"===i?!0===t.advertising?"granted":"denied":"follow_analytics"===i&&!0===t.analytics?"granted":"denied"}(t,r))}),n}function on(t){if(null==t)return null;var i=String(t).trim().toLowerCase();return i||null}function an(t,i){if(t&&i){var e=i.split("."),r=t;for(var n of e){if(null==r||"object"!=typeof r)return;r=r[n]}return r}}function ln(t){if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t&&""!==t.trim()){var i=Number(t);if(Number.isFinite(i))return i}}function un(t){if(null!=t)return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?String(t):void 0}function hn(t){var{mapping:i,payload:e}=t,r={send_to:i.send_to},n=i.value_param_path||"value",s=i.currency_param_path||"currency",o=ln(an(e,n));void 0!==o&&(r.value=o);var a=un(an(e,s))||i.default_currency||void 0;if(a&&(r.currency=a),!1!==i.send_transaction_id){var l=un(an(e,i.transaction_id_param_path||"transaction_id"));l&&(r.transaction_id=l)}return{send_to:i.send_to,params:r}}var dn=[{source:"$pageview",destination:"page_view",buildParams:t=>{var i,e={},r=un(t.$current_url);r&&(e.page_location=r);var n=un(t.$pathname);n&&(e.page_path=n);var s=null!==(i=un(t.title))&&void 0!==i?i:un(t.$title);s&&(e.page_title=s);var o=un(t.$referrer);return o&&(e.page_referrer=o),e}},{source:"$pageleave",destination:"user_engagement",buildParams:t=>{var i,e,r={},n=ln(null!==(e=null!==(i=t.$dwell_time_ms)&&void 0!==i?i:t.engagement_time_msec)&&void 0!==e?e:t.$time_on_page_ms);return void 0!==n&&(r.engagement_time_msec=Math.round(n)),r}}];function vn(t,i,e){var r=i.split(".").filter(Boolean);if(0!==r.length)if(1!==r.length){for(var n=t,s=0;s<r.length-1;s++){var o=r[s],a=r[s+1];if(null==n||"object"!=typeof n||Array.isArray(n))return;var l=n;if(/^\d+$/.test(a)){var u=Array.isArray(l[o])?l[o]:[];Array.isArray(l[o])||(l[o]=u);for(var h=parseInt(a,10);u.length<=h;)u.push({});if(s+1===r.length-1)return void(u[h]=e);var d=u[h];d&&"object"==typeof d&&!Array.isArray(d)||(d={},u[h]=d),n=d,s++}else{var v=l[o];v&&"object"==typeof v&&!Array.isArray(v)||(v={},l[o]=v),n=v}}var c=r[r.length-1];n&&"object"==typeof n&&!Array.isArray(n)&&(n[c]=e)}else t[r[0]]=e}var cn=new Set(["client_id","user_id","first_visit","session_start"]);function fn(t,i,e,r){if(!function(t,i){return!(i&&(Array.isArray(i.exclude)&&i.exclude.includes(t)||Array.isArray(i.include)&&i.include.length>0&&!i.include.includes(t)))}(i,r.eventFilter))return{fired:!1};var n=(r.eventMappings||[]).find(t=>(null==t?void 0:t.source)===i);if(n&&n.destination){var{name:s,params:o}=function(t,i){var e={},r=Array.isArray(t.param_mappings)?t.param_mappings:[];for(var n of r){var s=null==n?void 0:n.source,o=null==n?void 0:n.destination;if(s&&o){var a=an(i,s);void 0!==a&&(o.includes(".")?vn(e,o,a):e[o]=a)}}return{name:t.destination,params:e}}(n,e);return t("event",s,o),{fired:!0,eventName:s,params:o,source:"mapping"}}if(!1===r.autoForward)return{fired:!1};var a=dn.find(t=>t.source===i);if(a){var l=a.buildParams(e);return t("event",a.destination,l),{fired:!0,eventName:a.destination,params:l,source:"preset"}}if(i.startsWith("$"))return{fired:!1};var u=function(t){var i={};for(var[e,r]of Object.entries(t))e.startsWith("$")||cn.has(e)||void 0!==r&&(i[e]=r);return i}(e);return t("event",i,u),{fired:!0,eventName:i,params:u,source:"auto"}}function pn(){var t=null,i=[],e=[];return{call:function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if((t=>{e.push(t),e.length>50&&e.shift()})(n),t)try{t(...n)}catch(t){}else i.push(n)},flush(e){for(t=e;i.length;){var r=i.shift();try{e(...r)}catch(t){}}},getRecentCalls:()=>e.slice()}}function gn(t){return mn.apply(this,arguments)}function mn(){return(mn=_(function*(t){try{var i="undefined"!=typeof crypto&&crypto.subtle?crypto.subtle:null;if(!i)return null;var e=(new TextEncoder).encode(t),r=yield i.digest("SHA-256",e);return Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch(t){return null}})).apply(this,arguments)}function bn(){return(bn=_(function*(t){var i={},e=function(t){if(!t)return null;var i=String(t).trim().toLowerCase();if(!i)return null;if(!i.includes("@"))return null;var[e,r]=i.split("@");if(!e||!r)return null;if("gmail.com"===r||"googlemail.com"===r){var n=e.split("+")[0].replace(/\./g,"");return n?n+"@"+r:null}return e+"@"+r}(t.email),r=function(t){if(!t)return null;var i=String(t).trim();if(!i)return null;if(i.startsWith("+")){var e=i.slice(1).replace(/\D/g,"");return e?"+"+e:null}return null}(t.phone),n=on(t.first_name),s=on(t.last_name),o=on(t.street),a=on(t.city),l=on(t.region),u=function(t){if(!t)return null;var i=String(t).trim().toUpperCase().replace(/\s+/g,"");return i||null}(t.postal_code),h=on(t.country);if(e){var d=yield gn(e);d&&(i.sha256_email_address=d)}if(r){var v=yield gn(r);v&&(i.sha256_phone_number=v)}var c={};if(n){var f=yield gn(n);f&&(c.sha256_first_name=f)}if(s){var p=yield gn(s);p&&(c.sha256_last_name=p)}if(o){var g=yield gn(o);g&&(c.sha256_street=g)}return a&&(c.city=a),l&&(c.region=l),u&&(c.postal_code=u),h&&(c.country=h),Object.keys(c).length>0&&(i.address=c),0===Object.keys(i).length?null:i})).apply(this,arguments)}class yn{constructor(t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.hi=t,this.di=[]}get length(){return this.di.length}enqueue(t){return!(this.di.length>=this.hi)&&(this.di.push(t),!0)}takeAll(){if(0===this.di.length)return[];var t=this.di;return this.di=[],t}clear(){this.di=[]}}var _n="google-tag";class wn{constructor(t,i){this.name="GoogleTagGateway",this.P=!1,this.ci=!1,this.fi=!1,this.pi=!1,this.gi=null,this.mi=null,this.bi=null,this.yi=null,this.wi=[],this.xi=100,this.ki=new yn(100),this._instance=t,this.j=i||wn.extractConfig(t.getConfig()),this.Si=pn(),this.Ci()}static extractConfig(t){if(t.disable_google_tag)return{enabled:!1};var i=t.google_tag;return i?{enabled:(i.tagIds||[]).some(t=>!!t),remote:i}:{enabled:!1}}get isEnabled(){return!1!==this.j.enabled&&!!this.j.remote}get isStarted(){return this.P}get gtag(){return this.Si.call}get deliveryLog(){return this.wi.slice()}startIfEnabled(){this.P||this.isEnabled&&this._instance.getConfig().__remote_config_loaded&&this.lt()}stop(){var t;this.P&&(null===(t=this.yi)||void 0===t||t.call(this),this.yi=null,this.P=!1)}onConfigUpdate(t){var i=wn.extractConfig(t),e=this.isEnabled;this.j=i;var r=!0===t.__remote_config_loaded;if(e&&!this.isEnabled)this.stop();else if(this.P&&i.remote&&this.mi){var n=en(i.remote,this._instance.getConfig().api_host);n&&(this.mi=n,tn(this.gi,n))}r&&!this.isEnabled&&this.ki.clear(),r&&this.isEnabled&&!this.P&&this.startIfEnabled()}setUserData(t){var i=this;return _(function*(){var e=i.j.remote;if(e&&e.enhancedConversions){var r=yield function(t){return bn.apply(this,arguments)}(t);r&&i.Si.call("set","user_data",r)}})()}getRecentPublicCalls(){return this.Si.getRecentCalls()}lt(){var i=this.j.remote;if(i){var e=en(i,this._instance.getConfig().api_host);if(e){this.mi=e;var{gtag:r}=function(){var t,i,e=a,r=null!==(t=(i=e).dataLayer)&&void 0!==t?t:i.dataLayer=[],n=e.gtag;if(n)return{gtag:n,dataLayer:r};var s=function(){r.push(arguments)};return e.gtag=s,{gtag:s,dataLayer:r}}();this.gi=r,this.Si.flush(r),this.Mi(),tn(r,e),this.ci||(this.ci=!0,function(i,e,r){var n=null==t?void 0:t.document;if(!n)return null;var{origin:s,gatewayPath:o,primaryTagId:a}=i;if(!s||!a)return null;var l=""+s.replace(/\/$/,"")+(o?o.startsWith("/")?o.replace(/\/$/,""):"/"+o.replace(/\/$/,""):"")+"/gtag/js?id="+encodeURIComponent(a)+"&l=dataLayer",u=n.querySelector('script[data-vtilt-gtag-loader="'+a+'"]');if(u)return u;var h=n.createElement("script");h.async=!0,h.src=l,h.setAttribute("data-vtilt-gtag-loader",a),h.onload=()=>null==e?void 0:e(),h.onerror=()=>{var t=new Error("[GoogleTagGateway] failed to load "+l);null==r||r(t)},(n.head||n.body||n.documentElement).appendChild(h)}(e,()=>{this.fi=!0},t=>{g().warn(_n,t.message)})),this.$i(),this.P=!0,this.Ai()}else g().warn(_n,"skipped — missing tag_ids or resolvable origin")}}Ai(){for(var t of this.ki.takeAll())this.Ei(t.event,t.payload)}Mi(){var t;if(!this.pi&&this.gi){var i=ut(()=>this._instance.consentManager.getConsent());!function(t,i,e){t("consent","default",w({},sn(i,e),{wait_for_update:500}))}(this.gi,i||{},null===(t=this.j.remote)||void 0===t?void 0:t.consentOverride),this.pi=!0}}Ci(){if(!this.bi){this.bi=this._instance.Ri.on(bt,t=>{var i=t;i&&"string"==typeof i.event&&this.Ei(i.event,i.payload||{})})}}Ei(t,i){var e=this._instance.getConfig();if(!e.disable_google_tag)if(e.__remote_config_loaded){if(this.isEnabled&&(this.P||this.startIfEnabled(),this.gi&&this.j.remote&&this.P)){var r=this.j.remote,n=r.tagIds||[],s=fn(this.gi,t,i,r);if(s.fired&&s.eventName&&this.Ti({ts:Date.now(),tag_ids:n,event_name:t,send_to:"ga4:"+s.eventName,status:"fired",reason:s.source}),!1!==r.sendAdsConversions){var o=function(t,i,e,r){var n=(r.conversions||[]).filter(t=>t.event_name===i);if(0===n.length)return[];var s=[];for(var o of n){var a=hn({mapping:o,payload:e});t("event","conversion",a.params),s.push(a)}return s}(this.gi,t,i,r);for(var a of o)this.Ti({ts:Date.now(),tag_ids:n,event_name:t,send_to:a.send_to,status:"fired"})}}}else this.ki.enqueue({event:t,payload:i})}$i(){if(!this.yi){this.yi=this._instance.Ri.on(mt,t=>{var i;if(this.gi){var e,r,n,s=t;e=this.gi,r=s.consent||{},n=null===(i=this.j.remote)||void 0===i?void 0:i.consentOverride,e("consent","update",sn(r,n))}})}}Ti(t){this.wi.push(t),this.wi.length>this.xi&&this.wi.shift()}}var xn="vtd-overlay";class kn{constructor(t,i){this.name="VtdOverlay",this.P=!1,this.Ii=null,this.Oi=null,this.L=!0,this.Pi=null,this.Li=null,this.Di=null,this._instance=t,this.j=i||kn.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.j.enabled}get isStarted(){return this.P}startIfEnabled(){}stop(){this.P&&ut(()=>{this.Ui(),this.P=!1})}onConfigUpdate(t){this.j=kn.extractConfig(t),!this.isEnabled&&this.P&&this.stop()}setDestinationUrl(i){var e;if(this.isEnabled)if(null==i?void 0:i.trim()){var r=i;try{r=decodeURIComponent(i)}catch(t){r=i}if(this.ji(r)){var n=this.Bi(r);this.Oi=r,this.Ii=n,this.L=!0,this.zi(),this.P=!0,this._instance.capture("$vtd_view",{$vtd_url:r,$vtd_embed_url:n!==r?n:void 0,$current_url:null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.href})}else g().warn(xn,"invalid URL: "+r)}else g().warn(xn,"empty URL provided");else g().warn(xn,"feature is disabled")}getDestinationUrl(){return this.Ii}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Oi}),this.Pi?(this.Pi.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.Ui(),this.P=!1,this.Ii=null,this.Oi=null},200)):(this.Ui(),this.P=!1,this.Ii=null,this.Oi=null)}ji(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Bi(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var r=i.searchParams.get("v");if(r){var n=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+r+"?autoplay=1";return n&&(s+="&start="+n.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 u=i.pathname.match(/^\/(\d+)/);if(u)return"https://player.vimeo.com/video/"+u[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var h=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(h)return"https://www.loom.com/embed/"+h[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}}Ni(t){try{return new URL(t).hostname}catch(i){return t}}qi(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}zi(){if(r&&this.Ii){this.Ui(),this.Pi=r.createElement("div"),this.Pi.id="vtilt-vtd-overlay",this.Pi.className="vtilt-vtd-opening",this.Pi.setAttribute("style",this.Fi());var t=r.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Hi());var i=r.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Wi()),i.innerHTML=this.Vi(),t.appendChild(i);var e=r.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Gi()),this.Di=r.createElement("div"),this.Di.className="vtilt-vtd-loading",this.Di.setAttribute("style",this.Ki()),this.Di.innerHTML=this.Ji(),e.appendChild(this.Di),this.Li=r.createElement("iframe"),this.Li.id="vtilt-vtd-iframe",this.Li.className="vtilt-vtd-iframe",this.Li.setAttribute("style",this.Xi()),this.Li.setAttribute("frameborder","0"),this.Li.setAttribute("allowfullscreen","true"),this.Li.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var n=()=>{this.L=!1,this.Di&&(this.Di.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Di)||void 0===t?void 0:t.parentNode)&&(this.Di.style.display="none")},300)),this.Li&&(this.Li.style.opacity="1")};this.Li.onload=n,this.Li.onerror=n,setTimeout(()=>{this.L&&n()},5e3),e.appendChild(this.Li),this.Li.src=this.Ii,t.appendChild(e),this.Pi.appendChild(t);var s=r.createElement("style");s.id="vtilt-vtd-styles",s.textContent=this.Zi(),r.head.appendChild(s),r.body.appendChild(this.Pi),this.Qi(),r.body.style.overflow="hidden"}}Ui(){var t;(null===(t=this.Pi)||void 0===t?void 0:t.parentNode)&&(this.Pi.parentNode.removeChild(this.Pi),this.Pi=null,this.Li=null,this.Di=null);var i=null==r?void 0:r.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==r?void 0:r.body)&&(r.body.style.overflow="")}Qi(){var i,e,n,s=null===(i=this.Pi)||void 0===i?void 0:i.querySelector(".vtilt-vtd-close");null==s||s.addEventListener("click",()=>this.close());var o=null===(e=this.Pi)||void 0===e?void 0:e.querySelector(".vtilt-vtd-open");null==o||o.addEventListener("click",()=>{this.Oi&&(null==t||t.open(this.Oi,"_blank"))}),null===(n=this.Pi)||void 0===n||n.addEventListener("click",t=>{t.target===this.Pi&&this.close()});var a=t=>{"Escape"===t.key&&(this.close(),null==r||r.removeEventListener("keydown",a))};null==r||r.addEventListener("keydown",a)}Fi(){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 '}Hi(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Wi(){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 "}Vi(){var t=this.Oi||this.Ii,i=t?this.Ni(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.qi(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.Yi(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.Yi(this.te(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 '}Gi(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Ki(){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 "}Ji(){var t=this.Oi||this.Ii,i=t?this.Ni(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.Yi(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 '}Xi(){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 "}Zi(){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 "}te(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}Yi(t){if(void 0===r)return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");var i=r.createElement("div");return i.textContent=t,i.innerHTML}}var Sn,Cn="text/plain",Mn=61440;!function(t){t.GZipJS="gzip-js",t.Base64="base64",t.None="none"}(Sn||(Sn={}));var $n=function(t,i){void 0===i&&(i="binary");var{data:e,compression:r}=t;if(e){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(e),s=new Blob([n]).size;if(r===Sn.GZipJS&&s>=1024)try{var o=Wr(function(t,i){if(Vr)return Vr.encode(t);for(var e=t.length,r=new dr(t.length+(t.length>>1)),n=0,s=function(t){r[n++]=t},o=0;o<e;++o){if(n+5>r.length){var a=new dr(n+8+(e-o<<1));a.set(r),r=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 Tr(r,0,n)}(n),{mtime:0});if("text-base64"===i){var a=function(t){if("undefined"==typeof btoa)throw new Error("btoa is not available in this environment");for(var i="",e=0;e<t.length;e+=32768){var r=Math.min(e+32768,t.length),n=t.subarray(e,r);i+=String.fromCharCode.apply(null,n)}return btoa(i)}(o);if(a.length>0&&a.length<.95*s)return{contentType:Cn,body:a,estimatedSize:a.length,compressionApplied:Sn.Base64}}else{var l=new Blob([o],{type:Cn});if(l.size>0&&l.size<.95*s)return{contentType:Cn,body:l,estimatedSize:l.size,compressionApplied:Sn.GZipJS}}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:s,compressionApplied:null}}};function An(t,i){return i.compressionApplied?(e=t.url,r=i.compressionApplied,n=e.includes("?")?"&":"?",""+e+n+"compression="+r):t.url;var e,r,n}function En(t,i){var e={};return i&&(e["Content-Type"]=i),t.headers&&Object.assign(e,t.headers),t.projectToken&&(e[ht]=t.projectToken),e}var Rn=[{name:"fetch",isAvailable:()=>"undefined"!=typeof fetch,method:t=>{var i=$n(t,"binary");if(i){var{contentType:e,body:r,estimatedSize:n}=i,s=An(t,i),o=En(t,e),a=new AbortController,l=t.timeout?setTimeout(()=>a.abort(),t.timeout):null;fetch(s,{method:t.method||"POST",headers:o,body:r,keepalive:n<Mn,signal:a.signal}).then(function(){var i=_(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status){Ct();try{n.json=JSON.parse(r)}catch(t){}}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return i.apply(this,arguments)}}()).catch(()=>{var i;St("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",isAvailable:()=>"undefined"!=typeof XMLHttpRequest,method:t=>{var i=$n(t,"binary");if(i){var{contentType:e,body:r}=i,n=An(t,i),s=En(t,e),o=new XMLHttpRequest;for(var[a,l]of(o.open(t.method||"POST",n,!0),Object.entries(s)))o.setRequestHeader(a,l);t.timeout&&(o.timeout=t.timeout),o.onreadystatechange=()=>{var i;if(4===o.readyState){var e={statusCode:o.status,text:o.responseText};if(200===o.status){Ct();try{e.json=JSON.parse(o.responseText)}catch(t){}}null===(i=t.callback)||void 0===i||i.call(t,e)}},o.onerror=()=>{var i;St("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},o.send(r)}}},{name:"sendBeacon",isAvailable:()=>"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=$n(t,"text-base64");if(i){var{contentType:e,body:r,estimatedSize:n}=i;if(0!==n){var s=An(t,i),o=t.projectToken?function(t,i){if(!i||/[?&]token=/.test(t))return t;var e=t.includes("?")?"&":"?";return""+t+e+"token="+i}(s,t.projectToken):s;if(n<=Mn)try{var a="string"==typeof r?new Blob([r],{type:e}):r;if("undefined"!=typeof navigator&&navigator.sendBeacon)if(navigator.sendBeacon(o,a))return}catch(t){}try{var l="string"==typeof r?new Blob([r],{type:e}):r,u=w({"Content-Type":e},t.headers||{});fetch(o,{method:t.method||"POST",headers:u,body:l,keepalive:n<Mn}).catch(()=>{})}catch(t){}}}}}],Tn=t=>{var i,e;if(Mt())null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0});else{var r=t.transport||"fetch",n=Rn.find(t=>t.name===r&&t.isAvailable())||Rn.find(t=>t.isAvailable());if(!n)return g().error("request","no available transport method"),void(null===(e=t.callback)||void 0===e||e.call(t,{statusCode:0}));n.method(t)}};class In{constructor(t,i){var e,r,n,s;this.ie=!0,this.ee=[],this.re=(e=(null==i?void 0:i.flush_interval_ms)||3e3,r=250,n=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,r),n)),this.ne=t}get length(){return this.ee.length}enqueue(t){this.ee.push(t),this.se||this.oe()}unload(){if(this.ae(),0!==this.ee.length){var t=this.le();for(var i in t){var e=t[i];this.ne(w({},e,{transport:"sendBeacon"}))}}}enable(){this.ie=!1,this.oe()}pause(){this.ie=!0,this.ae()}flush(){this.ae(),this.ue(),this.oe()}oe(){this.ie||(this.se=setTimeout(()=>{this.ae(),this.ue(),this.ee.length>0&&this.oe()},this.re))}ae(){this.se&&(clearTimeout(this.se),this.se=void 0)}ue(){if(0!==this.ee.length){var t=this.le(),i=Date.now();for(var e in t){var r=t[e];r.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.ne(r)}}}le(){var t={};return this.ee.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.ee=[],t}}class On{constructor(i){this.he=!1,this.de=3e3,this.ee=[],this.ve=!0,this.ne=i.sendRequest,this.ce=i.sendBeacon,t&&void 0!==e&&"onLine"in e&&(this.ve=e.onLine,Tt(t,"online",()=>{this.ve=!0,this.Z()}),Tt(t,"offline",()=>{this.ve=!1}))}get length(){return this.ee.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)g().error("retry","request failed after 10 retries, giving up");else if(!Mt()){var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.ee.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.ve||(n+=" (browser is offline)"),g().warn("retry",n),this.he||(this.he=!0,this.fe())}}retriableRequest(t){var i=this;return _(function*(){try{var e=yield i.ne(t);200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&i.enqueue(t,0)}catch(e){i.enqueue(t,0)}})()}fe(){this.pe&&clearTimeout(this.pe),this.pe=setTimeout(()=>{this.ve&&this.ee.length>0&&this.Z(),this.ee.length>0?this.fe():this.he=!1},this.de)}Z(){var t=this,i=Date.now(),e=[],r=[];this.ee.forEach(t=>{t.retryAt<i?r.push(t):e.push(t)}),this.ee=e,r.forEach(function(){var i=_(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.ne(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return i.apply(this,arguments)}}())}unload(){this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.ee.forEach(t=>{var{request:i}=t;try{this.ce(i)}catch(t){g().error("retry","failed to send beacon on unload",t)}}),this.ee=[]}}var Pn="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,r,n;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(Pn))&&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===(r=this.captureWarning)||void 0===r||r.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(n=this.persistence)||void 0===n||n.set(Pn,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Dn{constructor(t){this.ge=null,this.me=null,this.be=t}get config(){return this.ge}onApply(t){this.ye=t}onLoad(t){this._e=t}load(){var i,e=this.be.getConfig();if(e.token){if(this.me||(this.me=w({},e)),null===(i=e.bootstrap)||void 0===i?void 0:i.remoteConfig)return this.ge=e.bootstrap.remoteConfig,this.we(this.ge),void this.xe();var r=ut(()=>t.__VTILT_BOOTSTRAP__);if(null==r?void 0:r.remoteConfig)return this.ge=r.remoteConfig,this.we(this.ge),void this.xe();ut(()=>{var t=localStorage.getItem(R+"_"+e.token);t&&(this.ge=JSON.parse(t),this.we(this.ge,!0))}),this.xe()}}xe(){var t=this.be.getConfig();if(t.token)if(Mt())this.be.updateConfig({__remote_config_loaded:!0});else{var i=this.be.buildEndpointUrl("/api/d"),e=new AbortController,r=setTimeout(()=>e.abort(),3e3);(s||fetch)(i,{method:"GET",signal:e.signal,headers:w({Accept:"application/json"},vt(t))}).then(t=>t.json()).then(i=>{var e;clearTimeout(r),Ct(),this.ge=i,ut(()=>{localStorage.setItem(R+"_"+t.token,JSON.stringify(i))}),this.we(i),null===(e=this._e)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(r),St("config"),this.be.updateConfig({__remote_config_loaded:!0})})}}we(t,i){var e,r,n,s;void 0===i&&(i=!1);var o=this.me||this.be.getConfig(),a={};for(var[,l]of this.be.featureManager.getDescriptors())if(l.remoteConfig&&l.configKey){var u=t[l.remoteConfig.key];u&&void 0===o[l.configKey]&&(a[l.configKey]=l.remoteConfig.map(u))}if(t.analytics&&!i&&(void 0!==t.analytics.capturePageview&&void 0===o.capture_pageview&&(a.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===o.capture_pageleave&&(a.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===o.capture_performance&&(a.capture_performance=t.analytics.capturePerformance),void 0===o.autocapture)){var h=t.analytics.autocapture,d=t.analytics.scrollDepthMilestones,v=t.analytics.scrollDepthPageleave;void 0!==h&&(a.autocapture=h&&(d||v)?{scroll_depth:w({},d?{milestones:!0}:{},v?{pageleave:!0}:{})}:h)}i||(a.__remote_config_loaded=!0),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===o.respect_dnt&&(a.respect_dnt=t.privacy.respectDnt),void 0!==(null===(r=t.privacy)||void 0===r?void 0:r.requireConsent)&&void 0===o.require_consent&&(a.require_consent=t.privacy.requireConsent),void 0!==t.autocapture_opt_out&&(a.autocapture_opt_out=t.autocapture_opt_out),void 0!==t.elementsChainAsString&&(a.elementsChainAsString=t.elementsChainAsString),(null===(n=t.diagnostics)||void 0===n?void 0:n.defaultLogLevel)&&g().setLevelFromRemote(t.diagnostics.defaultLogLevel),Object.keys(a).length>0&&this.be.updateConfig(a),null===(s=this.ye)||void 0===s||s.call(this,t)}}var Un=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"];function jn(t,i){if(void 0===i&&(i=[]),!t)return!1;var e=t.toLowerCase();return[...Un,...i].some(t=>-1!==e.indexOf(t.toLowerCase()))}function Bn(t,i){var e;if(void 0===i&&(i=[]),!t)return!1;var r=t.userAgent;if(r&&jn(r,i))return!0;try{var n=t.userAgentData;if(null===(e=null==n?void 0:n.brands)||void 0===e?void 0:e.some(t=>jn(null==t?void 0:t.brand,i)))return!0}catch(t){}return!!t.webdriver}var zn=36e5;function Nn(){var i,e,r;return null!==(r=null===(e=null===(i=null==t?void 0:t.performance)||void 0===i?void 0:i.now)||void 0===e?void 0:e.call(i))&&void 0!==r?r:Date.now()}class qn{constructor(){this.ke=Nn(),this.Se=null,this.Ce=Nn(),this.Me="",this.$e="",this.Ae="",this.Ee=""}onAfterPageview(){var t=Nn();this.ke=t,this.Se=t,this.Ee="",n&&(this.Me=n.href||"",this.$e=n.pathname||""),r&&(this.Ae=r.title||"")}peekEngagementSinceLastCaptureMs(){var t,i=Nn(),e=null!==(t=this.Se)&&void 0!==t?t:this.Ce,r=Math.round(i-e);return r<1&&(r=1),r>zn&&(r=zn),r}commitCaptureClock(){this.Se=Nn()}Re(){return this.Me+"\0"+this.$e}clearLeaveDedupe(){this.Ee=""}tryCapturePageleave(t,i,e,r){if(function(t){var i=t.capture_pageleave;return!1!==i&&(!0===i||!1!==t.capture_pageview)}(t)){var n=this.Re();if((this.Me||this.$e)&&n&&this.Ee!==n){this.Ee=n;var s=Nn(),o=Math.round(s-this.ke);o<1&&(o=1),o>zn&&(o=zn);var a={navigation_type:e,engagement_time_msec:o,[J]:this.Me,[X]:this.$e,[Z]:Math.round(o/1e3),[Q]:this.$e,[Y]:this.Me},l=this.Me?function(t){try{return new URL(t).host}catch(t){return""}}(this.Me):"";l&&(a.$host=l),this.Ae&&(a.title=this.Ae),r&&Object.assign(a,r),i(B,a,{skip_engagement:!0})}}}}var Fn=[z,N,q,B,V,G,F,K],Hn=new Set([z,N,q]),Wn=new Set([B,K,V,G,F]);class Vn{constructor(t){this.Te=!1,this.Ie=!1,this.Oe=null,this.Pe=null,this.Le=new qn,this.be=t}setVtPersonId(t){this.Pe=t}capture(t,i,r){var n,s,o;this.be.sessionManager.setSessionId();var a=this.be.getConfig();if(a.opt_out_useragent_filter||!Bn(e,null!==(n=a.custom_blocked_useragents)&&void 0!==n?n:[]))if((null==e?void 0:e.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(e.userAgent))if((null==r?void 0:r.skip_client_rate_limiting)||Fn.includes(t)||this.be.rateLimiter.shouldAllowEvent())if(!this.be.getConfig().require_consent||Hn.has(t)||(null===(s=this.be.consentManager)||void 0===s?void 0:s.hasConsent())){var l=this.be.buildUrl(),u=!0===(null==r?void 0:r.skip_engagement)||Wn.has(t),h=w({},i);u||"number"==typeof h.engagement_time_msec||(h=w({},h,{engagement_time_msec:this.Le.peekEngagementSinceLastCaptureMs()}));var d=w({},this.De(t,h),a.globalAttributes),v=JSON.stringify(d);if(!(c=v)||"string"!=typeof c||c.length<2||c.length>Et)g().debug("capture","dropped",t,{reason:"payload_invalid_size",bytes:v.length,limitBytes:Et,hint:t===H?"Trim global / event properties; $elements is already off by default in compact mode.":"Trim event properties; payload exceeded the runaway-guard cap."});else{var c,f=t===z?this.be.userManager.getAnonymousId():null!==(o=this.be.userManager.getDistinctId())&&void 0!==o?o:this.be.userManager.getAnonymousId(),p={timestamp:(new Date).toISOString(),event:t,payload:d,distinct_id:f,anonymous_id:this.be.userManager.getAnonymousId()};this.be.bufferEvent(t,l,p),g().debug("capture","enqueued",t,w({distinct_id:f,$current_url:d.$current_url,$session_id:d.$session_id,$debug:d.$debug},t===H&&"object"==typeof d&&null!==d?{$event_type:d.$event_type}:{})),this.Pe&&(this.Pe=null),t===j?this.Le.onAfterPageview():this.Le.commitCaptureClock()}}else g().debug("capture","dropped",t,{reason:"require_consent_and_no_consent"});else g().debug("capture","dropped",t,{reason:"client_rate_limited",hint:"Token bucket (~10/s, burst ~100). $autocapture counts toward the same limit as custom events."});else g().debug("capture","dropped",t,{reason:"invalid_or_missing_user_agent"});else g().debug("capture","dropped",t,{reason:"bot"})}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}captureInitialPageview(){r&&("visible"===r.visibilityState?this.Ie||(this.Ie=!0,setTimeout(()=>{r&&n&&!1!==this.be.getConfig().capture_pageview&&this.capture(j,{navigation_type:"initial_load"})},300),this.Oe&&(r.removeEventListener("visibilitychange",this.Oe),this.Oe=null)):this.Oe||(this.Oe=()=>this.captureInitialPageview(),Tt(r,"visibilitychange",this.Oe)))}tryCapturePageleave(t,i){this.Le.tryCapturePageleave(this.be.getConfig(),(t,i,e)=>this.capture(t,i,e),t,i)}resetPageleaveDedupe(){this.Le.clearLeaveDedupe()}Ue(){if(this.be.getConfig().debug)return!0;try{if(null==n?void 0:n.search)if("1"===new URLSearchParams(n.search).get("vtilt_debug"))return!0}catch(t){}return!1}De(t,i){var e,n,s=this.be.getConfig(),o=s.mask_personal_data_properties,a=s.custom_personal_data_properties,l=le(o,a),u=Pt(function(t,i,e){if(!r)return{};var n=i?Ot([],Zi,e||[]):[];return It({},te(Wt(r.URL,n,Yi)))}(0,o,a)),h=this.be.userManager.getUserProperties(),d=this.be.userManager.get_initial_props(),v=this.be.sessionManager.getSessionId(),c=this.be.sessionManager.getWindowId(),f={};!this.Te&&Object.keys(d).length>0&&Object.assign(f,d),i.$set_once&&Object.assign(f,i.$set_once);var p=w({},l,u,h,null!==(n=null===(e=this.be.consentManager)||void 0===e?void 0:e.getConsentProperties())&&void 0!==n?n:{},{$session_id:v,$window_id:c},this.Pe?{$vt:this.Pe}:{},Object.keys(f).length>0?{$set_once:f}:{},i.$set?{$set:i.$set}:{},i);!this.Te&&Object.keys(d).length>0&&(this.Te=!0),t===j&&r&&(p.title=r.title),this.Ue()&&(p.$debug=!0);var g=this.be.sessionManager.consumeSessionStart(),m=this.be.userManager.consumeFirstVisit();return g&&(p.$session_start=!0),m&&(p.$first_visit=!0),p}}var Gn=["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"];function Kn(t){return!(!t||"string"!=typeof t)&&Gn.includes(t.toLowerCase().trim())}class Jn{constructor(t){this.je=null,this.Be=null,this.be=t}identify(t,i,e){var r;if("number"==typeof t&&(t=String(t),g().warn("identify","first argument should be a string, not a number")),t)if(Kn(t))g().error("identify",'"'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var n=JSON.stringify([t,i,e]);if(this.je!==n){var s=this.be.userManager,o=s.getDistinctId(),a=s.getAnonymousId(),l=s.getDeviceId();if(!("identified"===s.getUserState())&&a!==t||t!==o){this.be.capture(z,{distinct_id:t,$set:i||{},$set_once:e||{}});var u={user_state:"identified",distinct_id:t,properties_set:i,properties_set_once:e};if(!l){var h=o||a;u.device_id=h,u.properties_set=w({$had_persisted_distinct_id:!0,$device_id:h},u.properties_set||{})}s.applyUpdate(u),null===(r=this.be.Ri)||void 0===r||r.emit("user:identified",{distinctId:t})}else(i||e)&&this.setUserProperties(i,e);this.je=n}}else g().error("identify","cannot use sentinel value as distinct_id");else g().error("identify","unique user id is required")}setUserProperties(t,i){var e,r;if(t||i){var n=this.be.userManager,s=JSON.stringify([null!==(e=n.getDistinctId())&&void 0!==e?e:n.getAnonymousId(),t,i]);this.Be!==s&&(n.applyUpdate({properties_set:t,properties_set_once:i}),this.be.capture(q,{$set:t||{},$set_once:i||{}}),null===(r=this.be.Ri)||void 0===r||r.emit("user:properties_set",{properties:t}),this.Be=s)}}resetUser(t){var i;this.be.sessionManager.resetSessionId(),this.be.userManager.reset(t),this.je=null,this.Be=null,null===(i=this.be.Ri)||void 0===i||i.emit("user:reset")}alias(t,i){var e;if(t&&!Kn(t)){var r=this.be.userManager,n=null!==(e=null!=i?i:r.getDistinctId())&&void 0!==e?e:r.getAnonymousId();n&&!Kn(n)?t!==n?this.be.capture(N,{$original_id:n,$alias_id:t}):this.identify(t):g().warn("alias","invalid original distinct ID")}else g().warn("alias","invalid alias")}getUserIdentity(){return this.be.userManager.getUserIdentity()}getDeviceId(){return this.be.userManager.getDeviceId()}getUserState(){return this.be.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.be.userManager.getDistinctId())&&void 0!==t?t:this.be.userManager.getAnonymousId()}getAnonymousId(){return this.be.userManager.getAnonymousId()}}var Xn="_vtilt_consent";class Zn{constructor(t){this.ze={},this.Ne=!1,this.be=t,this.qe()}setConsent(t){var i;this.ze=w({},this.ze,t),this.Ne=!0,this.Fe(),null===(i=this.be.Ri)||void 0===i||i.emit("consent:updated",{consent:this.ze})}getConsent(){return w({},this.ze)}hasConsent(){return this.Ne}setDefaultGranted(){this.Ne||(this.ze={analytics:!0,marketing:!0,advertising:!0},this.Ne=!0)}getConsentProperties(){var t={};return void 0!==this.ze.analytics&&(t.$consent_analytics=this.ze.analytics),void 0!==this.ze.marketing&&(t.$consent_marketing=this.ze.marketing),void 0!==this.ze.advertising&&(t.$consent_advertising=this.ze.advertising),t}reset(){this.ze={},this.Ne=!1,this.He()}qe(){if(void 0!==r&&(null==r?void 0:r.cookie)){var t=Xn+"=";for(var i of r.cookie.split(";")){var e=i.trim();if(e.startsWith(t)){try{var n=decodeURIComponent(e.slice(15)),s=JSON.parse(n);s&&"object"==typeof s&&(this.ze=s,this.Ne=!0)}catch(t){}return}}}}Fe(){if(void 0!==r){var t=encodeURIComponent(JSON.stringify(this.ze)),i="undefined"!=typeof location&&"https:"===location.protocol?"; Secure":"";r.cookie=Xn+"="+t+"; Max-Age=31536000; path=/; SameSite=Lax"+i}}He(){void 0!==r&&(r.cookie=Xn+"=; Max-Age=0; path=/")}}class Qn{constructor(t){this.We=new Map,this.Ve=new Map,this.be=t}register(t){this.We.set(t.name,t)}createInstances(){var t=this,i=this.be.getConfig(),e=function(e,r){return t.Ve.has(e)||t.Ge(i,r)?0:void ut(()=>{var n=r.FeatureClass.extractConfig(i),s=new r.FeatureClass(t.be,n);t.Ve.set(e,s)})};for(var[r,n]of this.We)e(r,n)}initAll(){this.createInstances();var t=function(t){ut(()=>{t.isStarted||t.startIfEnabled()})};for(var[,i]of this.Ve)t(i)}notifyAll(t){var i=function(i){i.onConfigUpdate&&ut(()=>i.onConfigUpdate(t))};for(var[,e]of this.Ve)i(e)}get(t){return this.Ve.get(t)}set(t,i){this.Ve.set(t,i)}getDescriptors(){return this.We}Ge(t,i){if(i.disableKey&&!0===t[i.disableKey])return!0;if(i.configKey){var e=t[i.configKey];if(e&&"object"==typeof e&&!1===e.enabled)return!0}return!1}}class Yn{constructor(t){this.ee=new yn,this.Ke=!1,this.Je=!1,this.be=t,this.Xe(),this.Ke||(this.Ze=setTimeout(()=>this.forceFlush(),5e3))}push(t){this.Ke?this.Qe(t):this.ee.enqueue(t)}markConfigReady(){this.Je||(this.Je=!0,this.Ye())}forceFlush(){this.tr(),this.Z(),this.Ke=!0}Xe(){this.Ke=this.Je}Ye(){this.Xe(),this.Ke&&(this.tr(),this.Z())}Z(){var t=this.ee.takeAll();for(var i of t)this.Qe(i);t.length>0&&this.be.requestQueue.flush()}Qe(t){if(this.Je){if(this.ir(t.name))return}else this.er(t.event);this.be.sendRequest(t.url,t.event)}ir(t){var i=this.be.getConfig();switch(t){case j:return!1===i.capture_pageview;case B:return!1===i.capture_pageleave;case F:return!1===i.capture_performance;case H:case W:return!1===i.autocapture;default:return!1}}er(t){"object"==typeof t.payload&&null!==t.payload&&(t.payload.$config_pending=!0)}tr(){void 0!==this.Ze&&(clearTimeout(this.Ze),this.Ze=void 0)}}var ts="vt";class is{constructor(t){void 0===t&&(t={}),this.version=x,this.__loaded=!1,this.rr=!1,this.nr=!1,this.sr=[],this.ar=!1,g().debug("ctor","start"),this.Ri=new ct,this.configManager=new rt(t);var i=this.configManager.getConfig();m(i),this.sessionManager=new zt(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new ue(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new Ln({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.lr.captureInternal(K,{$$client_ingestion_warning_message:t})}}),this.retryQueue=new On({sendRequest:t=>this.ur(t),sendBeacon:t=>this.hr(t)}),this.requestQueue=new In(t=>this.dr(t),{flush_interval_ms:3e3}),this.consentManager=new Zn(this),this.lr=new Vn(this),this.vr=new Jn(this),this.cr=new Qn(this),this.pr=new Dn(this),this.gr(),this.pr.onLoad(t=>{this.Ri.emit(gt,{config:t})}),this.mr(),g().debug("ctor","boot gate installed")}gr(){this.cr.register({name:"HistoryAutocapture",configKey:"capture_pageview",FeatureClass:me}),this.cr.register({name:"Autocapture",configKey:"autocapture",FeatureClass:ar}),this.cr.register({name:"WebVitals",configKey:"capture_performance",FeatureClass:pe}),this.cr.register({name:"SessionRecording",configKey:"session_recording",disableKey:"disable_session_recording",remoteConfig:{key:"sessionRecording",map:t=>({enabled:t.enabled,sampleRate:t.sampleRate,minimumDurationMs:t.minimumDurationMs,fullSnapshotIntervalMs:t.fullSnapshotIntervalMs,maskAllInputs:t.maskAllInputs,captureConsole:t.captureConsole,captureCanvas:t.captureCanvas})},FeatureClass:ur}),this.cr.register({name:"Chat",configKey:"chat",disableKey:"disable_chat",remoteConfig:{key:"chat",map:t=>({enabled:t.enabled,position:t.widgetPosition,color:t.widgetColor})},FeatureClass:Yr}),this.cr.register({name:"GoogleTagGateway",configKey:"google_tag",disableKey:"disable_google_tag",remoteConfig:{key:"googleTag",map:t=>t},FeatureClass:wn})}mr(){var t=this,i=function(i){var e=t[i];t[i]=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if(t.nr)return e.apply(t,n);t.sr.push([i,...n])}};for(var e of is.BOOT_GATED_METHODS)i(e)}br(){if(!this.nr){for(var t of(this.nr=!0,g().debug("boot","start"),is.BOOT_GATED_METHODS))delete this[t];g().debug("boot","gate removed"),this.__loaded&&!this.ar?(g().debug("boot","running _runPostBootInit"),this.yr()):g().debug("boot","skipping _runPostBootInit","loaded?",this.__loaded,"postBootDone?",this.ar),g().debug("boot","flush pendingCalls",this.sr.length),this._execute_array(this.sr),this.sr=[]}}init(t,i,e){var r;if(e&&e!==ts){var n=null!==(r=ns[e])&&void 0!==r?r:new is;return n._init(t,i,e),ns[e]=n,ns[ts][e]=n,n}return this._init(t,i,e)}_init(t,i,e){if(void 0===i&&(i={}),this.__loaded)return g().warn("init","already initialized; re-initializing is a no-op"),this;this.configManager.updateConfig(w({},i,{token:t||i.token,name:e}));var n=this.configManager.getConfig();return m(n),this.__loaded=!0,g().debug("init","start","token present?",!!n.token,"name",null!=e?e:"vt"),this.cr.createInstances(),this.nr||void 0===r||"interactive"!==r.readyState&&"complete"!==r.readyState||(g().debug("init","self-boot?",r.readyState),this.br()),this.nr&&!this.ar&&this.yr(),g().debug("init","postBootInitDone",this.ar),this}yr(){if(!this.ar){this.ar=!0,g().debug("postBoot","start");var t=this.configManager.getConfig();this.sessionManager=new zt(t.storage||"cookie",t.cross_subdomain_cookie),this.sessionManager.hydrateFromStorage(),g().debug("postBoot","sessionManager hydrated");var i=t.persistence||"localStorage+cookie";this.userManager.updateStorageMethod(i,t.cross_subdomain_cookie),this.userManager.hydrateFromStorage(),g().debug("postBoot","userManager hydrated"),t.require_consent||this.consentManager.hasConsent()||this.consentManager.setDefaultGranted(),!0===this.consentManager.getConsent().advertising&&Xt(),this.Ri.on("consent:updated",t=>{var i=t.consent;!0===i.advertising?Xt():!1===i.advertising&&void 0!==r&&(r.cookie=Vt+"=; Max-Age=0; path=/",r.cookie=Gt+"=; Max-Age=0; path=/")}),this._r(),this.userManager.set_initial_person_info(t.mask_personal_data_properties,t.custom_personal_data_properties),this.wr=new Yn({sendRequest:(t,i)=>this.sendRequest(t,i),requestQueue:this.requestQueue,getConfig:()=>this.configManager.getConfig()}),this.cr.initAll(),g().debug("postBoot","features inited"),this.pr.load(),this.kr(),this.Sr();var e=this.configManager.getConfig();!1!==e.capture_pageview&&this.lr.captureInitialPageview(),this.cr.notifyAll(e),this.Ri.emit(ft,{config:e}),g().debug("postBoot","done"),g().info("init","SDK ready")}}startAutocapture(){var t=this.cr.get("Autocapture");if(!t){var i=ar.extractConfig(this.configManager.getConfig());t=new ar(this,i),this.cr.set("Autocapture",t)}t.updateConfig({enabled:!0})}stopAutocapture(){var t=this.cr.get("Autocapture");t&&t.updateConfig({enabled:!1})}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.cr.get("Autocapture"))||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}getAutocaptureDiagnostics(){var t,i;return null!==(i=null===(t=this.cr.get("Autocapture"))||void 0===t?void 0:t.getDiagnostics())&&void 0!==i?i:null}startSessionRecording(){var t=this.cr.get("SessionRecording");t||(t=new ur(this),this.cr.set("SessionRecording",t)),t.updateConfig({enabled:!0}),t.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(yt)}stopSessionRecording(){var t;null===(t=this.cr.get("SessionRecording"))||void 0===t||t.stop(),this.Ri.emit(_t)}isRecordingActive(){var t;return"active"===(null===(t=this.cr.get("SessionRecording"))||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.cr.get("SessionRecording"))||void 0===t?void 0:t.sessionId)||null}openChat(){var t=this.cr.get("Chat");t?t.open():g().warn("chat","openChat: feature not available")}closeChat(){var t=this.cr.get("Chat");t?t.close():g().warn("chat","closeChat: feature not available")}toggleChat(){var t=this.cr.get("Chat");t?t.toggle():g().warn("chat","toggleChat: feature not available")}showChat(){var t=this.cr.get("Chat");t?t.show():g().warn("chat","showChat: feature not available")}hideChat(){var t=this.cr.get("Chat");t?t.hide():g().warn("chat","hideChat: feature not available")}sendChatMessage(t,i){var e=this.cr.get("Chat");e?e.sendMessage(t,i):g().warn("chat","sendChatMessage: feature not available")}gtag(){for(var t=this.cr.get("GoogleTagGateway"),i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];t?t.gtag(...e):this.sr.push(["gtag",...e])}setGoogleUserData(t){var i=this.cr.get("GoogleTagGateway");return i?i.setUserData(t):Promise.resolve()}get featureManager(){return this.cr}on(t,i){return this.Ri.on(t,i)}once(t,i){return this.Ri.once(t,i)}off(t){this.Ri.off(t)}_is_bot(){var t,i=this.getConfig();return!i.opt_out_useragent_filter&&Bn(e,null!==(t=i.custom_blocked_useragents)&&void 0!==t?t:[])}capture(t,i,e){this.lr.capture(t,i,e),this.Ri.emit(bt,{event:t,payload:i})}tryCapturePageleave(t){var i,e=null===(i=this.cr.get("Autocapture"))||void 0===i?void 0:i.getMaxScrollDepthPctForPageleave(),r=null!=e?{[et]:e}:void 0;this.lr.tryCapturePageleave(t,r)}identify(t,i,e){this.vr.identify(t,i,e)}setUserProperties(t,i){this.vr.setUserProperties(t,i)}resetUser(t){this.vr.resetUser(t)}alias(t,i){this.vr.alias(t,i)}setConsent(t){this.consentManager.setConsent(t)}getConsent(){return this.consentManager.getConsent()}getUserIdentity(){return this.vr.getUserIdentity()}getDeviceId(){return this.vr.getDeviceId()}getUserState(){return this.vr.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.pr.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.vr.getDistinctId()}getAnonymousId(){return this.vr.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:ts;return i!==ts&&(i="vt."+i),i}updateConfig(t){var i,e=this.configManager.getConfig();this.configManager.updateConfig(t);var r=this.configManager.getConfig();!e.__remote_config_loaded&&r.__remote_config_loaded&&(null===(i=this.wr)||void 0===i||i.markConfigReady()),this.cr.notifyAll(r),this.Ri.emit(pt,{config:r})}buildUrl(){return this.buildEndpointUrl("/api/e")}buildEndpointUrl(t){return dt(this.configManager.getConfig(),t)}sendRequest(t,i){this.Cr()&&this.requestQueue.enqueue({url:t,event:i})}bufferEvent(t,i,e){t!==V&&t!==G?this.wr.push({name:t,url:i,event:e}):this.sendRequest(i,e)}Cr(){return!!this.configManager.getConfig().token||(this.rr||(g().warn("config","token is required for tracking"),this.rr=!0),!1)}dr(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.hr(t)}ur(t){return new Promise(i=>{var{url:e,events:r}=t,n=this.configManager.getConfig(),s=1===r.length?r[0]:{events:r},o=n.disable_compression?Sn.None:Sn.GZipJS;Tn({url:e,data:s,method:"POST",transport:"XHR",compression:o,projectToken:n.token,callback:t=>i({statusCode:t.statusCode})})})}hr(t){var{url:i,events:e}=t,r=this.configManager.getConfig(),n=1===e.length?e[0]:{events:e},s=r.disable_compression?Sn.None:Sn.GZipJS;Tn({url:i,data:n,method:"POST",transport:"sendBeacon",compression:s,projectToken:r.token})}Mr(t){this.sendRequest(t.url,t.event)}kr(){if(t){var i=()=>{this.wr.forceFlush(),this.requestQueue.unload(),this.retryQueue.unload()};Tt(t,"beforeunload",i),Tt(t,"pagehide",()=>{this.lr.tryCapturePageleave("pagehide"),i()}),r&&Tt(r,"visibilitychange",()=>{r&&("hidden"===r.visibilityState?this.lr.tryCapturePageleave("visibility_hidden"):"visible"===r.visibilityState&&this.lr.resetPageleaveDedupe())})}}Sr(){this.requestQueue.enable()}_r(){ut(()=>{var i,e;if(void 0!==n&&n.search){var r=new URL(n.href),s=r.searchParams.get("vt"),o=r.searchParams.get("vtd");if((null==s?void 0:s.trim())&&(this.lr.setVtPersonId(s.trim()),r.searchParams.delete("vt")),(null==o?void 0:o.trim())&&(this.$r(o.trim()),r.searchParams.delete("vtd")),(null==s?void 0:s.trim())||(null==o?void 0:o.trim())){var a=r.pathname+(r.search||"")+r.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)}}})}$r(t){this.vtdOverlay||(this.vtdOverlay=new kn(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){at(t)&&t.forEach(t=>{if(t&&at(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&ut(()=>this[i](...e))}})}_dom_loaded(){this.Sr()}}is.BOOT_GATED_METHODS=["capture","identify","setUserProperties","resetUser","alias","setConsent","startAutocapture","stopAutocapture","startSessionRecording","stopSessionRecording","openChat","closeChat","toggleChat","showChat","hideChat","sendChatMessage"];var es,rs,ns={};es=ns[ts]=new is,(rs=a.vt)&&Rt(rs._i,function(t){if(t&&at(t)){var i=es.init(t[0],t[1],t[2]),e=rs[t[2]||"vt"]||rs;i&&i._execute_array(e)}}),a.vt=es,function(){function i(){if(!i.done){i.done=!0,g().debug("dom","handler fired");var t=Object.keys(ns);g().debug("boot","instance count",t.length),Rt(ns,(t,i)=>{g().debug("boot","instance",i),t.br(),t._dom_loaded()})}}if(r&&"function"==typeof r.addEventListener)return g().debug("dom","readyState",r.readyState),void("complete"===r.readyState||"interactive"===r.readyState?(g().debug("dom","running handler sync"),i()):(g().debug("dom","registered DOMContentLoaded listener"),Tt(r,"DOMContentLoaded",i,{capture:!1})));t&&g().error("dom","browser doesn't support document.addEventListener")}()}();
|
|
2
2
|
//# sourceMappingURL=array.js.map
|