@v-tilt/browser 1.4.1 → 1.4.3

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.
@@ -31,7 +31,7 @@
31
31
  * Code config always takes precedence over dashboard settings.
32
32
  */
33
33
  import type { VTilt } from "../../vtilt";
34
- import type { ChatConfig } from "../../utils/globals";
34
+ import type { ChatConfig, ChatChannelSummary, ChatWidgetView } from "../../utils/globals";
35
35
  import type { MessageCallback, TypingCallback, ConnectionCallback, Unsubscribe } from "./types";
36
36
  /** Status when lazy loading is in progress */
37
37
  export declare const CHAT_LOADING: "loading";
@@ -81,6 +81,14 @@ export declare class ChatWrapper {
81
81
  * Current channel (if any)
82
82
  */
83
83
  get channel(): import("./types").ChatChannel | null;
84
+ /**
85
+ * List of user's channels (multi-channel support)
86
+ */
87
+ get channels(): ChatChannelSummary[];
88
+ /**
89
+ * Current view state ('list' or 'conversation')
90
+ */
91
+ get currentView(): ChatWidgetView;
84
92
  /**
85
93
  * Open the chat widget
86
94
  */
@@ -101,6 +109,22 @@ export declare class ChatWrapper {
101
109
  * Hide the chat widget
102
110
  */
103
111
  hide(): void;
112
+ /**
113
+ * Fetch/refresh the list of user's channels
114
+ */
115
+ getChannels(): void;
116
+ /**
117
+ * Select a channel and load its messages
118
+ */
119
+ selectChannel(channelId: string): void;
120
+ /**
121
+ * Create a new channel and enter it
122
+ */
123
+ createChannel(): void;
124
+ /**
125
+ * Go back to channel list from conversation view
126
+ */
127
+ goToChannelList(): void;
104
128
  /**
105
129
  * Send a message
106
130
  */
@@ -1,13 +1,8 @@
1
1
  /**
2
- * Lazy Loaded Chat Implementation
3
- *
4
- * The actual chat widget implementation that is loaded on demand.
5
- * This file is bundled into chat.js and loaded when chat is enabled.
6
- *
7
- * Uses Ably for real-time messaging.
2
+ * Chat Widget - Lazy loaded chat implementation using Ably for real-time messaging.
8
3
  */
9
4
  import type { VTilt } from "../../vtilt";
10
- import type { ChatConfig, ChatChannel, LazyLoadedChatInterface } from "../../utils/globals";
5
+ import type { ChatConfig, ChatChannel, ChatChannelSummary, ChatWidgetView, LazyLoadedChatInterface } from "../../utils/globals";
11
6
  import type { MessageCallback, TypingCallback, ConnectionCallback, Unsubscribe } from "./types";
12
7
  export declare class LazyLoadedChat implements LazyLoadedChatInterface {
13
8
  private _instance;
@@ -23,7 +18,6 @@ export declare class LazyLoadedChat implements LazyLoadedChatInterface {
23
18
  private _messageCallbacks;
24
19
  private _typingCallbacks;
25
20
  private _connectionCallbacks;
26
- private _typingTimeout;
27
21
  private _typingDebounce;
28
22
  private _isUserTyping;
29
23
  private _initialUserReadAt;
@@ -34,27 +28,27 @@ export declare class LazyLoadedChat implements LazyLoadedChatInterface {
34
28
  get isLoading(): boolean;
35
29
  get unreadCount(): number;
36
30
  get channel(): ChatChannel | null;
31
+ get channels(): ChatChannelSummary[];
32
+ get currentView(): ChatWidgetView;
33
+ private get _theme();
34
+ private get _distinctId();
37
35
  open(): void;
38
36
  close(): void;
39
37
  toggle(): void;
40
38
  show(): void;
41
39
  hide(): void;
40
+ getChannels(): Promise<void>;
41
+ selectChannel(channelId: string): Promise<void>;
42
+ createChannel(): Promise<void>;
43
+ goToChannelList(): void;
42
44
  sendMessage(content: string): Promise<void>;
43
45
  markAsRead(): void;
44
- /**
45
- * Automatically mark unread agent/AI messages as read
46
- * Called when widget opens or new messages arrive while open
47
- */
48
46
  private _autoMarkAsRead;
49
- /**
50
- * Check if a message has been read by the user (using initial cursor)
51
- */
52
47
  private _isMessageReadByUser;
53
48
  onMessage(callback: MessageCallback): Unsubscribe;
54
49
  onTyping(callback: TypingCallback): Unsubscribe;
55
50
  onConnectionChange(callback: ConnectionCallback): Unsubscribe;
56
51
  destroy(): void;
57
- private _initializeChannel;
58
52
  private _connectRealtime;
59
53
  private _disconnectRealtime;
60
54
  private _extractProjectId;
@@ -68,6 +62,13 @@ export declare class LazyLoadedChat implements LazyLoadedChatInterface {
68
62
  private _sendTypingIndicator;
69
63
  private _handleSend;
70
64
  private _updateUI;
65
+ private _updateHeader;
66
+ private _getChannelListHTML;
67
+ private _getChannelItemHTML;
68
+ private _getConversationHTML;
69
+ private _attachChannelListListeners;
70
+ private _attachConversationListeners;
71
+ private _formatRelativeTime;
71
72
  private _renderMessages;
72
73
  private _getContainerStyles;
73
74
  private _getBubbleStyles;
@@ -75,9 +76,6 @@ export declare class LazyLoadedChat implements LazyLoadedChatInterface {
75
76
  private _getWidgetStyles;
76
77
  private _getWidgetHTML;
77
78
  private _getMessageHTML;
78
- /**
79
- * Check if a message has been read by the agent using cursor comparison
80
- */
81
79
  private _isMessageReadByAgent;
82
80
  private _apiRequest;
83
81
  private _trackEvent;
@@ -4,7 +4,7 @@
4
4
  * Type definitions for the chat widget extension.
5
5
  * Core types are re-exported from globals.ts for consistency.
6
6
  */
7
- export type { ChatMessage, ChatChannel, ChatConfig, ChatTheme, LazyLoadedChatInterface, } from "../../utils/globals";
7
+ export type { ChatMessage, ChatChannel, ChatChannelSummary, ChatConfig, ChatTheme, ChatWidgetView, LazyLoadedChatInterface, } from "../../utils/globals";
8
8
  /**
9
9
  * Sender types for chat messages
10
10
  */
@@ -106,6 +106,8 @@ export interface ChatWidgetState {
106
106
  isConnected: boolean;
107
107
  isLoading: boolean;
108
108
  unreadCount: number;
109
+ currentView: import("../../utils/globals").ChatWidgetView;
110
+ channels: import("../../utils/globals").ChatChannelSummary[];
109
111
  channel: import("../../utils/globals").ChatChannel | null;
110
112
  messages: import("../../utils/globals").ChatMessage[];
111
113
  isTyping: boolean;
@@ -1,2 +1,2 @@
1
- !function(n){"use strict";var i="undefined"!=typeof window?window:void 0,l="undefined"!=typeof globalThis?globalThis:i,r=null==l?void 0:l.navigator,o=null==l?void 0:l.document;null==l||l.location,null==l||l.fetch,(null==l?void 0:l.XMLHttpRequest)&&"withCredentials"in new l.XMLHttpRequest&&l.XMLHttpRequest,null==l||l.AbortController,null==r||r.userAgent;var t=null!=i?i:{},d=(n,i,l)=>{if(n.getConfig().disable_external_dependency_loading)return console.warn("[ExternalScriptsLoader] "+i+" was requested but loading of external scripts is disabled."),l("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");if(r)for(var t,d=function(){if(r[e].src===i){var n=r[e];return n.__vtilt_loading_callback_fired?{v:l()}:(n.addEventListener("load",i=>{n.__vtilt_loading_callback_fired=!0,l(void 0,i)}),n.onerror=n=>l(n),{v:void 0})}},e=0;e<r.length;e++)if(t=d())return t.v;var a=()=>{var n;if(!o)return l("document not found");var r=o.createElement("script");r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=n=>{r.__vtilt_loading_callback_fired=!0,l(void 0,n)},r.onerror=n=>l(n);var t=o.querySelectorAll("body > script");t.length>0?null===(n=t[0].parentNode)||void 0===n||n.insertBefore(r,t[0]):o.body.appendChild(r)};(null==o?void 0:o.body)?a():null==o||o.addEventListener("DOMContentLoaded",a)},e=(n,i)=>{var l=n.getConfig();return l.script_host?l.script_host.replace(/\/+$/gm,"")+"/dist/"+i+".js":"https://unpkg.com/@v-tilt/browser@1.4.1/dist/"+i+".js"};t.__VTiltExtensions__=t.__VTiltExtensions__||{},t.__VTiltExtensions__.loadExternalDependency=(n,i,l)=>{var r=e(n,i);d(n,r,l)},n.getExtensionUrl=e,n.loadScript=d}({});
1
+ !function(n){"use strict";var i="undefined"!=typeof window?window:void 0,l="undefined"!=typeof globalThis?globalThis:i,r=null==l?void 0:l.navigator,o=null==l?void 0:l.document;null==l||l.location,null==l||l.fetch,(null==l?void 0:l.XMLHttpRequest)&&"withCredentials"in new l.XMLHttpRequest&&l.XMLHttpRequest,null==l||l.AbortController,null==r||r.userAgent;var t=null!=i?i:{},d=(n,i,l)=>{if(n.getConfig().disable_external_dependency_loading)return console.warn("[ExternalScriptsLoader] "+i+" was requested but loading of external scripts is disabled."),l("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");if(r)for(var t,d=function(){if(r[e].src===i){var n=r[e];return n.__vtilt_loading_callback_fired?{v:l()}:(n.addEventListener("load",i=>{n.__vtilt_loading_callback_fired=!0,l(void 0,i)}),n.onerror=n=>l(n),{v:void 0})}},e=0;e<r.length;e++)if(t=d())return t.v;var a=()=>{var n;if(!o)return l("document not found");var r=o.createElement("script");r.type="text/javascript",r.crossOrigin="anonymous",r.src=i,r.onload=n=>{r.__vtilt_loading_callback_fired=!0,l(void 0,n)},r.onerror=n=>l(n);var t=o.querySelectorAll("body > script");t.length>0?null===(n=t[0].parentNode)||void 0===n||n.insertBefore(r,t[0]):o.body.appendChild(r)};(null==o?void 0:o.body)?a():null==o||o.addEventListener("DOMContentLoaded",a)},e=(n,i)=>{var l=n.getConfig();return l.script_host?l.script_host.replace(/\/+$/gm,"")+"/dist/"+i+".js":"https://unpkg.com/@v-tilt/browser@1.4.3/dist/"+i+".js"};t.__VTiltExtensions__=t.__VTiltExtensions__||{},t.__VTiltExtensions__.loadExternalDependency=(n,i,l)=>{var r=e(n,i);d(n,r,l)},n.getExtensionUrl=e,n.loadScript=d}({});
2
2
  //# sourceMappingURL=external-scripts-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-scripts-loader.js","sources":["../src/utils/globals.ts","../src/entrypoints/external-scripts-loader.ts"],"sourcesContent":[null,null],"names":["win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","loadScript","vtilt","url","callback","getConfig","disable_external_dependency_loading","console","warn","LOGGER_PREFIX","existingScripts","querySelectorAll","_ret","_loop","i","src","alreadyExistingScriptTag","__vtilt_loading_callback_fired","v","addEventListener","event","onerror","error","length","addScript","scriptTag","createElement","type","crossOrigin","onload","scripts","_a","parentNode","insertBefore","body","appendChild","getExtensionUrl","kind","config","script_host","replace","__VTiltExtensions__","loadExternalDependency"],"mappings":"0BAaA,IAAMA,EACc,oBAAXC,OAAyBA,YAASC,EAuOrCC,EACkB,oBAAfC,WAA6BA,WAAaJ,EAMtCK,EAAYF,aAAM,EAANA,EAAQE,UACpBC,EAAWH,aAAM,EAANA,EAAQG,SACRH,SAAAA,EAAQI,SACXJ,SAAAA,EAAQK,OAE3BL,aAAM,EAANA,EAAQM,iBAAkB,oBAAqB,IAAIN,EAAOM,gBACtDN,EAAOM,eAEkBN,SAAAA,EAAQO,gBACdL,SAAAA,EAAWM,UAC7B,IAAMC,EAAqCZ,QAAAA,EAAQ,CAAA,ECnPpDa,EAAaA,CACjBC,EACAC,EACAC,KAKA,GAHeF,EAAMG,YAGDC,oCAIlB,OAHAC,QAAQC,KACHC,2BAAiBN,iEAEfC,EAAS,2CAIlB,IAAMM,EAAkBhB,aAAQ,EAARA,EAAUiB,iBAAiB,UACnD,GAAID,EACF,IADmB,IAuBlBE,EAvBkBC,EAAA,WAEjB,GAAIH,EAAgBI,GAAGC,MAAQZ,EAAK,CAClC,IAAMa,EAA2BN,EAC/BI,GAKF,OAAIE,EAAyBC,+BAC3B,CAAAC,EACOd,MAITY,EAAyBG,iBAAiB,OAASC,IACjDJ,EAAyBC,gCAAiC,EAC1Db,OAASd,EAAW8B,KAEtBJ,EAAyBK,QAAWC,GAAUlB,EAASkB,GAAO,CAAAJ,OAAA,GAGhE,CACF,EAtBSJ,EAAI,EAAGA,EAAIJ,EAAgBa,OAAQT,IAAG,GAAAF,EAAAC,IAAA,OAAAD,EAAAM,EAyBjD,IAAMM,EAAYA,WAChB,IAAK9B,EACH,OAAOU,EAAS,sBAGlB,IAAMqB,EAAY/B,EAASgC,cAAc,UAGzCD,EAAUE,KAAO,kBACjBF,EAAUG,YAAc,YACxBH,EAAUV,IAAMZ,EAChBsB,EAAUI,OAAUT,IAClBK,EAAUR,gCAAiC,EAC3Cb,OAASd,EAAW8B,IAEtBK,EAAUJ,QAAWC,GAAUlB,EAASkB,GAExC,IAAMQ,EAAUpC,EAASiB,iBAAiB,iBACtCmB,EAAQP,OAAS,EACE,QAArBQ,EAAAD,EAAQ,GAAGE,kBAAU,IAAAD,GAAAA,EAAEE,aAAaR,EAAWK,EAAQ,IAEvDpC,EAASwC,KAAKC,YAAYV,KAI1B/B,aAAQ,EAARA,EAAUwC,MACZV,IAEA9B,SAAAA,EAAUyB,iBAAiB,mBAAoBK,IAmB7CY,EAAkBA,CAAClC,EAAcmC,KACrC,IAAMC,EAASpC,EAAMG,YAGrB,OAAIiC,EAAOC,YACSD,EAAOC,YAAYC,QAAQ,SAAU,aAC3BH,EAAI,MAKlC,gDAAgEA,EAAI,OAItErC,EAAiByC,oBACfzC,EAAiByC,qBAAuB,CAAA,EAK1CzC,EAAiByC,oBAAoBC,uBAAyB,CAC5DxC,EACAmC,EACAjC,KAEA,IAAMD,EAAMiC,EAAgBlC,EAAOmC,GACnCpC,EAAWC,EAAOC,EAAKC"}
1
+ {"version":3,"file":"external-scripts-loader.js","sources":["../src/utils/globals.ts","../src/entrypoints/external-scripts-loader.ts"],"sourcesContent":[null,null],"names":["win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","loadScript","vtilt","url","callback","getConfig","disable_external_dependency_loading","console","warn","LOGGER_PREFIX","existingScripts","querySelectorAll","_ret","_loop","i","src","alreadyExistingScriptTag","__vtilt_loading_callback_fired","v","addEventListener","event","onerror","error","length","addScript","scriptTag","createElement","type","crossOrigin","onload","scripts","_a","parentNode","insertBefore","body","appendChild","getExtensionUrl","kind","config","script_host","replace","__VTiltExtensions__","loadExternalDependency"],"mappings":"0BAaA,IAAMA,EACc,oBAAXC,OAAyBA,YAASC,EAwQrCC,EACkB,oBAAfC,WAA6BA,WAAaJ,EAMtCK,EAAYF,aAAM,EAANA,EAAQE,UACpBC,EAAWH,aAAM,EAANA,EAAQG,SACRH,SAAAA,EAAQI,SACXJ,SAAAA,EAAQK,OAE3BL,aAAM,EAANA,EAAQM,iBAAkB,oBAAqB,IAAIN,EAAOM,gBACtDN,EAAOM,eAEkBN,SAAAA,EAAQO,gBACdL,SAAAA,EAAWM,UAC7B,IAAMC,EAAqCZ,QAAAA,EAAQ,CAAA,ECpRpDa,EAAaA,CACjBC,EACAC,EACAC,KAKA,GAHeF,EAAMG,YAGDC,oCAIlB,OAHAC,QAAQC,KACHC,2BAAiBN,iEAEfC,EAAS,2CAIlB,IAAMM,EAAkBhB,aAAQ,EAARA,EAAUiB,iBAAiB,UACnD,GAAID,EACF,IADmB,IAuBlBE,EAvBkBC,EAAA,WAEjB,GAAIH,EAAgBI,GAAGC,MAAQZ,EAAK,CAClC,IAAMa,EAA2BN,EAC/BI,GAKF,OAAIE,EAAyBC,+BAC3B,CAAAC,EACOd,MAITY,EAAyBG,iBAAiB,OAASC,IACjDJ,EAAyBC,gCAAiC,EAC1Db,OAASd,EAAW8B,KAEtBJ,EAAyBK,QAAWC,GAAUlB,EAASkB,GAAO,CAAAJ,OAAA,GAGhE,CACF,EAtBSJ,EAAI,EAAGA,EAAIJ,EAAgBa,OAAQT,IAAG,GAAAF,EAAAC,IAAA,OAAAD,EAAAM,EAyBjD,IAAMM,EAAYA,WAChB,IAAK9B,EACH,OAAOU,EAAS,sBAGlB,IAAMqB,EAAY/B,EAASgC,cAAc,UAGzCD,EAAUE,KAAO,kBACjBF,EAAUG,YAAc,YACxBH,EAAUV,IAAMZ,EAChBsB,EAAUI,OAAUT,IAClBK,EAAUR,gCAAiC,EAC3Cb,OAASd,EAAW8B,IAEtBK,EAAUJ,QAAWC,GAAUlB,EAASkB,GAExC,IAAMQ,EAAUpC,EAASiB,iBAAiB,iBACtCmB,EAAQP,OAAS,EACE,QAArBQ,EAAAD,EAAQ,GAAGE,kBAAU,IAAAD,GAAAA,EAAEE,aAAaR,EAAWK,EAAQ,IAEvDpC,EAASwC,KAAKC,YAAYV,KAI1B/B,aAAQ,EAARA,EAAUwC,MACZV,IAEA9B,SAAAA,EAAUyB,iBAAiB,mBAAoBK,IAmB7CY,EAAkBA,CAAClC,EAAcmC,KACrC,IAAMC,EAASpC,EAAMG,YAGrB,OAAIiC,EAAOC,YACSD,EAAOC,YAAYC,QAAQ,SAAU,aAC3BH,EAAI,MAKlC,gDAAgEA,EAAI,OAItErC,EAAiByC,oBACfzC,EAAiByC,qBAAuB,CAAA,EAK1CzC,EAAiByC,oBAAoBC,uBAAyB,CAC5DxC,EACAmC,EACAjC,KAEA,IAAMD,EAAMiC,EAAgBlC,EAAOmC,GACnCpC,EAAWC,EAAOC,EAAKC"}
package/dist/main.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function t(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 i(i){return function(){var e=this,r=arguments;return new Promise(function(n,s){var o=i.apply(e,r);function a(i){t(o,n,s,a,l,"next",i)}function l(i){t(o,n,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=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},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});class r{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!document.currentScript)return e({token:t.token||""},t);var i=document.currentScript,r=e({token:""},t);r.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,r.script_host=i.getAttribute("data-script-host")||t.script_host,r.proxy=i.getAttribute("data-proxy")||t.proxy,r.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,r.token=i.getAttribute("data-token")||t.token||"",r.projectId=i.getAttribute("data-project-id")||t.projectId||"",r.domain=i.getAttribute("data-domain")||t.domain,r.storage=i.getAttribute("data-storage")||t.storage,r.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");if(r.capture_performance=!!n||t.capture_performance,r.proxy&&r.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(r.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(r.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return r}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}var n="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",h="__vt_anonymous_id",u="__vt_distinct_id",d="__vt_user_properties",v="localStorage",c="localStorage+cookie",f="sessionStorage",p="memory",g="$initial_person_info";function _(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))}function m(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function w(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 y(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 b(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function S(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}var x="undefined"!=typeof window?window:void 0,T="undefined"!=typeof globalThis?globalThis:x,E=null==T?void 0:T.navigator,C=null==T?void 0:T.document,I=null==T?void 0:T.location,k=null==T?void 0:T.fetch,M=(null==T?void 0:T.XMLHttpRequest)&&"withCredentials"in new T.XMLHttpRequest?T.XMLHttpRequest:void 0;null==T||T.AbortController;var R=null==E?void 0:E.userAgent,O=null!=x?x:{},P=31536e3,A=["herokuapp.com","vercel.app","netlify.app"];function D(t){var i;if(!t)return"";if("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 L{constructor(t){var i,e;this.memoryStorage=new Map,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(".");for(var r of A)if(e===r)return!1;return!0}(),this.sameSite=t.sameSite||"Lax",this.secure=null!==(e=t.secure)&&void 0!==e?e:"undefined"!=typeof location&&"https:"===location.protocol}get(t){var i;try{if(this.method===p)return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;if(this.usesLocalStorage()){var e=localStorage.getItem(t);return null!==e?e:this.method===c?this.getCookie(t):null}return this.usesSessionStorage()?sessionStorage.getItem(t):this.getCookie(t)}catch(i){return console.warn('[StorageManager] Failed to get "'+t+'":',i),null}}set(t,i,e){try{if(this.method===p)return void this.memoryStorage.set(t,i);if(this.usesLocalStorage())return localStorage.setItem(t,i),void(this.method===c&&this.setCookie(t,i,e||P));if(this.usesSessionStorage())return void sessionStorage.setItem(t,i);this.setCookie(t,i,e||P)}catch(i){console.warn('[StorageManager] Failed to set "'+t+'":',i)}}remove(t){try{if(this.method===p)return void this.memoryStorage.delete(t);if(this.usesLocalStorage())return localStorage.removeItem(t),void(this.method===c&&this.removeCookie(t));if(this.usesSessionStorage())return void sessionStorage.removeItem(t);this.removeCookie(t)}catch(i){console.warn('[StorageManager] Failed to remove "'+t+'":',i)}}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,r){var n=e({value:i},r?{expiry:Date.now()+r}:{});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)}getCookie(t){if("undefined"==typeof document)return null;var i=document.cookie.split(";");for(var e of i){var[r,...n]=e.trim().split("=");if(r===t){var s=n.join("=");try{return decodeURIComponent(s)}catch(t){return s}}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=t+"="+encodeURIComponent(i);r+="; Max-Age="+e,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure");var n=D(this.cross_subdomain);n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=D(this.cross_subdomain),e=t+"=; Max-Age=0; path=/";i&&(e+="; domain="+i),document.cookie=e,document.cookie=t+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===v||this.method===c}usesSessionStorage(){return this.method===f}canUseSessionStorage(){if(void 0===x||!(null==x?void 0:x.sessionStorage))return!1;try{var t="__vt_storage_test__";return x.sessionStorage.setItem(t,"test"),x.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==x?void 0:x.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class U{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.o=void 0,this.v()}getSessionId(){var t=this.m();return t||(t=_(),this.S(t)),t}setSessionId(){var t=this.m()||_();return this.S(t),t}resetSessionId(){this.T(),this.setSessionId(),this.C(_())}m(){return this.storage.get(n)}S(t){this.storage.set(n,t,1800)}T(){this.storage.remove(n)}getWindowId(){if(this.o)return this.o;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.o=i,i}var e=_();return this.C(e),e}C(t){if(t!==this.o){this.o=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}v(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.o=e:(e&&t.removeItem(s),this.C(_())),t.setItem(o,"true"),this.I()}else this.o=_()}I(){var t=this.storage.getSessionStorage();x&&t&&y(x,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"})}}function B(t){if(!C)return null;var i=C.createElement("a");return i.href=t,i}function j(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===i){if(n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function N(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],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 z(t){return"function"==typeof t}var q="Mobile",F="iOS",W="Android",V="Tablet",J=W+" "+V,H="iPad",X="Apple",K=X+" Watch",G="Safari",Q="BlackBerry",Z="Samsung",Y=Z+"Browser",tt=Z+" Internet",it="Chrome",et=it+" OS",rt=it+" "+F,nt="Internet Explorer",st=nt+" "+q,ot="Opera",at=ot+" Mini",lt="Edge",ht="Microsoft "+lt,ut="Firefox",dt=ut+" "+F,vt="Nintendo",ct="PlayStation",ft="Xbox",pt=W+" "+q,gt=q+" "+G,_t="Windows",mt=_t+" Phone",wt="Nokia",yt="Ouya",bt="Generic",St=bt+" "+q.toLowerCase(),xt=bt+" "+V.toLowerCase(),Tt="Konqueror",Et="(\\d+(\\.\\d+)?)",Ct=new RegExp("Version/"+Et),It=new RegExp(ft,"i"),kt=new RegExp(ct+" \\w+","i"),Mt=new RegExp(vt+" \\w+","i"),$t=new RegExp(Q+"|PlayBook|BB10","i"),Rt={"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 Ot(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Pt=(t,i)=>i&&Ot(i,X)||function(t){return Ot(t,G)&&!Ot(t,it)&&!Ot(t,W)}(t),At=function(t,i){return i=i||"",Ot(t," OPR/")&&Ot(t,"Mini")?at:Ot(t," OPR/")?ot:$t.test(t)?Q:Ot(t,"IE"+q)||Ot(t,"WPDesktop")?st:Ot(t,Y)?tt:Ot(t,lt)||Ot(t,"Edg/")?ht:Ot(t,"FBIOS")?"Facebook "+q:Ot(t,"UCWEB")||Ot(t,"UCBrowser")?"UC Browser":Ot(t,"CriOS")?rt:Ot(t,"CrMo")||Ot(t,it)?it:Ot(t,W)&&Ot(t,G)?pt:Ot(t,"FxiOS")?dt:Ot(t.toLowerCase(),Tt.toLowerCase())?Tt:Pt(t,i)?Ot(t,q)?gt:G:Ot(t,ut)?ut:Ot(t,"MSIE")||Ot(t,"Trident/")?nt:Ot(t,"Gecko")?ut:""},Dt={[st]:[new RegExp("rv:"+Et)],[ht]:[new RegExp(lt+"?\\/"+Et)],[it]:[new RegExp("("+it+"|CrMo)\\/"+Et)],[rt]:[new RegExp("CriOS\\/"+Et)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Et)],[G]:[Ct],[gt]:[Ct],[ot]:[new RegExp("(Opera|OPR)\\/"+Et)],[ut]:[new RegExp(ut+"\\/"+Et)],[dt]:[new RegExp("FxiOS\\/"+Et)],[Tt]:[new RegExp("Konqueror[:/]?"+Et,"i")],[Q]:[new RegExp(Q+" "+Et),Ct],[pt]:[new RegExp("android\\s"+Et,"i")],[tt]:[new RegExp(Y+"\\/"+Et)],[nt]:[new RegExp("(rv:|MSIE )"+Et)],Mozilla:[new RegExp("rv:"+Et)]},Lt=function(t,i){var e=At(t,i),r=Dt[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},Ut=[[new RegExp(ft+"; "+ft+" (.*?)[);]","i"),t=>[ft,t&&t[1]||""]],[new RegExp(vt,"i"),[vt,""]],[new RegExp(ct,"i"),[ct,""]],[$t,[Q,""]],[new RegExp(_t,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[mt,""];if(new RegExp(q).test(i)&&!/IEMobile\b/.test(i))return[_t+" "+q,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=Rt[r]||"";return/arm/i.test(i)&&(n="RT"),[_t,n]}return[_t,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[F,i.join(".")]}return[F,""]}],[/(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("("+W+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+W+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[W,i.join(".")]}return[W,""]}],[/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/,[et,""]],[/Linux|debian/i,["Linux",""]]],Bt=function(t){return Mt.test(t)?vt:kt.test(t)?ct:It.test(t)?ft:new RegExp(yt,"i").test(t)?yt:new RegExp("("+mt+"|WPDesktop)","i").test(t)?mt:/iPad/.test(t)?H:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?K:$t.test(t)?Q:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(wt,"i").test(t)?wt:/(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(q).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)?W:J:W:new RegExp("(pda|"+q+")","i").test(t)?St:new RegExp(V,"i").test(t)&&!new RegExp(V+" pc","i").test(t)?xt:""},jt="https?://(.*)",Nt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],zt=S(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Nt),qt="<masked>";function Ft(t){var i=function(t){return t?0===t.search(jt+"google.([^/?]*)")?"google":0===t.search(jt+"bing.com")?"bing":0===t.search(jt+"yahoo.com")?"yahoo":0===t.search(jt+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(null!==i){r.$search_engine=i;var n=C?j(C.referrer,e):"";n.length&&(r.ph_keyword=n)}return r}function Wt(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Vt(){return(null==C?void 0:C.referrer)||"$direct"}function Jt(){var t;return(null==C?void 0:C.referrer)&&(null===(t=B(C.referrer))||void 0===t?void 0:t.host)||"$direct"}function Ht(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=B(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=B(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=zt.concat([]),e={};return w(i,function(i){var r=j(t,i);e[i]=r||null}),e}(r);b(n,o)}e&&b(n,Ft(e));return n}function Xt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Kt(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Gt(t,i){if(!R)return{};var e,r,n,[s,o]=function(t){for(var i=0;i<Ut.length;i++){var[e,r]=Ut[i],n=e.exec(t),s=n&&(z(r)?r(n,t):r);if(s)return s}return["",""]}(R);return b(function(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}({$os:s,$os_version:o,$browser:At(R,navigator.vendor),$device:Bt(R),$device_type:(r=R,n=Bt(r),n===H||n===J||"Kobo"===n||"Kindle Fire"===n||n===xt?V:n===vt||n===ft||n===ct||n===yt?"Console":n===K?"Wearable":n?q:"Desktop"),$timezone:Xt(),$timezone_offset:Kt()}),{$current_url:N(null==I?void 0:I.href,[],qt),$host:null==I?void 0:I.host,$pathname:null==I?void 0:I.pathname,$raw_user_agent:R.length>1e3?R.substring(0,997)+"...":R,$browser_version:Lt(R,navigator.vendor),$browser_language:Wt(),$browser_language_prefix:(e=Wt(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==x?void 0:x.screen.height,$screen_width:null==x?void 0:x.screen.width,$viewport_height:null==x?void 0:x.innerHeight,$viewport_width:null==x?void 0:x.innerWidth,$lib:"web",$lib_version:"1.0.7",$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class Qt{constructor(t,i){void 0===t&&(t="localStorage"),this.k=null,this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(h,this.userIdentity.anonymous_id,P)),this.userIdentity.anonymous_id}getUserProperties(){return e({},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,r){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 s=n||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}t!==n&&(this.userIdentity.distinct_id=t);var o="anonymous"===this.userIdentity.user_state;t!==n&&o?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[t])}),this.saveUserIdentity()):i||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[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 r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,n=this.getPersonPropertiesHash(r,t,i);return this.k===n?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.k=n,!0)}reset(t){var i=this.generateAnonymousId(),r=this.userIdentity.device_id,n=t?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:n,properties:{},user_state:"anonymous"},this.k=null,this.saveUserIdentity(),this.userIdentity.properties=e({},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=e({},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=e({},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()[g]){var e=function(t,i){var e=t?S([],Nt,i||[]):[],r=null==I?void 0:I.href.substring(0,1e3);return{r:Vt().substring(0,1e3),u:r?N(r,e,qt):void 0}}(t,i);this.register_once({[g]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[g];return e?(t=Ht(e),i={},w(t,function(t,e){var r;i["$initial_"+(r=String(e),r.startsWith("$")?r.substring(1):r)]=t}),i):{}}update_referrer_info(){var t={$referrer:Vt(),$referring_domain:Jt()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(h)||this.generateAnonymousId(),i=this.storage.get(u)||null,e=this.storage.get(l)||this.generateDeviceId(),r=this.getStoredUserProperties(),n=this.storage.get(a)||"anonymous";return{distinct_id:i,anonymous_id:t||this.generateAnonymousId(),device_id:e,properties:r,user_state:n}}saveUserIdentity(){this.storage.set(h,this.userIdentity.anonymous_id,P),this.storage.set(l,this.userIdentity.device_id,P),this.storage.set(a,this.userIdentity.user_state,P),this.userIdentity.distinct_id?this.storage.set(u,this.userIdentity.distinct_id,P):this.storage.remove(u),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(d)||{}}setStoredUserProperties(t){this.storage.setJSON(d,t,P)}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_"+_()}generateDeviceId(){return"device_"+_()}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 L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var Zt=["LCP","CLS","FCP","INP"],Yt=9e5,ti="[WebVitals]";class ii{constructor(t,i){this.initialized=!1,this.instance=i,this.buffer=this.createEmptyBuffer(),this.config=this.parseConfig(t.capture_performance),this.isEnabled&&x&&this.startIfEnabled()}parseConfig(t){return"boolean"==typeof t?{web_vitals:t}:"object"==typeof t&&null!==t?t:{web_vitals:!1}}get isEnabled(){var t=null==I?void 0:I.protocol;return("http:"===t||"https:"===t)&&!1!==this.config.web_vitals}get allowedMetrics(){return this.config.web_vitals_allowed_metrics||Zt}get flushTimeoutMs(){return this.config.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.config.__web_vitals_max_value;return void 0===t?Yt:0===t?0:t<6e4?Yt:t}createEmptyBuffer(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}getWebVitalsCallbacks(){var t;return null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}startIfEnabled(){if(this.isEnabled&&!this.initialized){var t=this.getWebVitalsCallbacks();t?this.startCapturing(t):this.loadWebVitals()}}loadWebVitals(){var t,i=null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this.instance,"web-vitals",t=>{if(t)console.error(ti+" Failed to load web-vitals:",t);else{var i=this.getWebVitalsCallbacks();i?this.startCapturing(i):console.error(ti+" web-vitals loaded but callbacks not registered")}}):console.warn(ti+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}startCapturing(t){if(!this.initialized){var i=this.allowedMetrics,e=this.addToBuffer.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.initialized=!0}}getCurrentUrl(){var t;return null===(t=null==x?void 0:x.location)||void 0===t?void 0:t.href}getCurrentPathname(){return null==I?void 0:I.pathname}addToBuffer(t){try{if(!x||!C||!I)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void console.warn(ti+" Invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void console.warn(ti+" Ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var i=this.getCurrentUrl(),r=this.getCurrentPathname();if(!i)return void console.warn(ti+" Could not determine current URL");this.buffer.url&&this.buffer.url!==i&&this.flush(),this.buffer.url||(this.buffer.url=i,this.buffer.pathname=r),this.buffer.firstMetricTimestamp||(this.buffer.firstMetricTimestamp=Date.now());var n=this.cleanAttribution(t.attribution),s=this.instance.getSessionId(),o=this.getWindowId(),a=e({},t,{attribution:n,timestamp:Date.now(),$current_url:i,$session_id:s,$window_id:o}),l=this.buffer.metrics.findIndex(i=>i.name===t.name);l>=0?this.buffer.metrics[l]=a:this.buffer.metrics.push(a),this.scheduleFlush(),this.buffer.metrics.length>=this.allowedMetrics.length&&this.flush()}catch(t){console.error(ti+" Error adding metric to buffer:",t)}}cleanAttribution(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}getWindowId(){var t;try{return(null===(t=this.instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}scheduleFlush(){this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=setTimeout(()=>{this.flush()},this.flushTimeoutMs)}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),0!==this.buffer.metrics.length){try{var t={$pathname:this.buffer.pathname,$current_url:this.buffer.url};for(var i of this.buffer.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(ti+" Error flushing metrics:",t)}this.buffer=this.createEmptyBuffer()}}}function ei(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class ri{constructor(t){var i;this._instance=t,this.M=(null===(i=null==x?void 0:x.location)||void 0===i?void 0:i.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this.$&&this.$(),this.$=void 0}monitorHistoryChanges(){var t,i;if(x&&I&&(this.M=I.pathname||"",x.history)){var e=this;(null===(t=x.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||ei(x.history,"pushState",t=>function(i,r,n){t.call(this,i,r,n),e.R("pushState")}),(null===(i=x.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||ei(x.history,"replaceState",t=>function(i,r,n){t.call(this,i,r,n),e.R("replaceState")}),this.O()}}R(t){var i;try{var e=null===(i=null==x?void 0:x.location)||void 0===i?void 0:i.pathname;if(!e||!I||!C)return;if(e!==this.M&&this.isEnabled){var r={navigation_type:t};this._instance.capture("$pageview",r)}this.M=e}catch(i){console.error("Error capturing "+t+" pageview",i)}}O(){if(!this.$&&x){var t=()=>{this.R("popstate")};y(x,"popstate",t),this.$=()=>{x&&x.removeEventListener("popstate",t)}}}}var ni="[SessionRecording]";class si{constructor(t,i){void 0===i&&(i={}),this._instance=t,this.P=i}get started(){var t;return!!(null===(t=this.A)||void 0===t?void 0:t.isStarted)}get status(){var t;return(null===(t=this.A)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.A)||void 0===t?void 0:t.sessionId)||""}startIfEnabledOrStop(t){var i;if(!this.D||!(null===(i=this.A)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.D&&e?(this.L(t),console.info(ni+" starting")):this.stopRecording()}}stopRecording(){var t;null===(t=this.A)||void 0===t||t.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.A)||void 0===e?void 0:e.log)?this.A.log(t,i):console.warn(ni+" log called before recorder was ready")}updateConfig(t){var i;this.P=e({},this.P,t),null===(i=this.A)||void 0===i||i.updateConfig(this.P)}get D(){var t,i=this._instance.getConfig(),e=null!==(t=this.P.enabled)&&void 0!==t&&t,r=!i.disable_session_recording;return!!x&&e&&r}get U(){return"recorder"}L(t){var i,e,r,n;if(this.D)if((null===(e=null===(i=null==O?void 0:O.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(r=O.__VTiltExtensions__)||void 0===r?void 0:r.initSessionRecording))this.B(t);else{var s=null===(n=O.__VTiltExtensions__)||void 0===n?void 0:n.loadExternalDependency;s?s(this._instance,this.U,i=>{i?console.error(ni+" could not load recorder:",i):this.B(t)}):console.error(ni+" loadExternalDependency not available. Session recording cannot start.")}}B(t){var i,e=null===(i=O.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.A||(this.A=e(this._instance,this.P)),this.A.start(t)):console.error(ni+" initSessionRecording not available after script load")}}var oi=(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))(oi||{}),ai=Uint8Array,li=Uint16Array,hi=Int32Array,ui=new ai([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]),di=new ai([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]),vi=new ai([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ci=function(t,i){for(var e=new li(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new hi(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}},fi=ci(ui,2),pi=fi.b,gi=fi.r;pi[28]=258,gi[258]=28;for(var _i=ci(di,0).r,mi=new li(32768),wi=0;wi<32768;++wi){var yi=(43690&wi)>>1|(21845&wi)<<1;yi=(61680&(yi=(52428&yi)>>2|(13107&yi)<<2))>>4|(3855&yi)<<4,mi[wi]=((65280&yi)>>8|(255&yi)<<8)>>1}var bi=function(t,i,e){for(var r=t.length,n=0,s=new li(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new li(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new li(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var h=n<<4|t[n],u=i-t[n],d=a[t[n]-1]++<<u,v=d|(1<<u)-1;d<=v;++d)o[mi[d]>>l]=h}else for(o=new li(r),n=0;n<r;++n)t[n]&&(o[n]=mi[a[t[n]-1]++]>>15-t[n]);return o},Si=new ai(288);for(wi=0;wi<144;++wi)Si[wi]=8;for(wi=144;wi<256;++wi)Si[wi]=9;for(wi=256;wi<280;++wi)Si[wi]=7;for(wi=280;wi<288;++wi)Si[wi]=8;var xi=new ai(32);for(wi=0;wi<32;++wi)xi[wi]=5;var Ti=bi(Si,9,0),Ei=bi(xi,5,0),Ci=function(t){return(t+7)/8|0},Ii=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new ai(t.subarray(i,e))},ki=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Mi=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},$i=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:Ui,l:0};if(1==n){var o=new ai(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!=n-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(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new li(v+1),f=Ri(e[u-1],c,0);if(f>i){r=0;var p=0,g=f-i,_=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});r<n;++r){var m=s[r].s;if(!(c[m]>i))break;p+=_-(1<<f-c[m]),c[m]=i}for(p>>=g;p>0;){var w=s[r].s;c[w]<i?p-=1<<i-c[w]++-1:++r}for(;r>=0&&p;--r){var y=s[r].s;c[y]==i&&(--c[y],++p)}f=i}return{t:new ai(c),l:f}},Ri=function(t,i,e){return-1==t.s?Math.max(Ri(t.l,i,e+1),Ri(t.r,i,e+1)):i[t.s]=e},Oi=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new li(++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}},Pi=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Ai=function(t,i,e){var r=e.length,n=Ci(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)},Di=function(t,i,e,r,n,s,o,a,l,h,u){ki(i,u++,e),++n[256];for(var d=$i(n,15),v=d.t,c=d.l,f=$i(s,15),p=f.t,g=f.l,_=Oi(v),m=_.c,w=_.n,y=Oi(p),b=y.c,S=y.n,x=new li(19),T=0;T<m.length;++T)++x[31&m[T]];for(T=0;T<b.length;++T)++x[31&b[T]];for(var E=$i(x,7),C=E.t,I=E.l,k=19;k>4&&!C[vi[k-1]];--k);var M,R,O,P,A=h+5<<3,D=Pi(n,Si)+Pi(s,xi)+o,L=Pi(n,v)+Pi(s,p)+o+14+3*k+Pi(x,C)+2*x[16]+3*x[17]+7*x[18];if(l>=0&&A<=D&&A<=L)return Ai(i,u,t.subarray(l,l+h));if(ki(i,u,1+(L<D)),u+=2,L<D){M=bi(v,c,0),R=v,O=bi(p,g,0),P=p;var U=bi(C,I,0);ki(i,u,w-257),ki(i,u+5,S-1),ki(i,u+10,k-4),u+=14;for(T=0;T<k;++T)ki(i,u+3*T,C[vi[T]]);u+=3*k;for(var B=[m,b],j=0;j<2;++j){var N=B[j];for(T=0;T<N.length;++T){var z=31&N[T];ki(i,u,U[z]),u+=C[z],z>15&&(ki(i,u,N[T]>>5&127),u+=N[T]>>12)}}}else M=Ti,R=Si,O=Ei,P=xi;for(T=0;T<a;++T){var q=r[T];if(q>255){Mi(i,u,M[(z=q>>18&31)+257]),u+=R[z+257],z>7&&(ki(i,u,q>>23&31),u+=ui[z]);var F=31&q;Mi(i,u,O[F]),u+=P[F],F>3&&(Mi(i,u,q>>5&8191),u+=di[F])}else Mi(i,u,M[q]),u+=R[q]}return Mi(i,u,M[256]),u+R[256]},Li=new hi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ui=new ai(0),Bi=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}(),ji=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new ai(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 ai(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),h=s.l,u=7&(s.r||0);if(i){u&&(l[0]=s.r>>3);for(var d=Li[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new li(32768),g=s.h||new li(f+1),_=Math.ceil(e/3),m=2*_,w=function(i){return(t[i]^t[i+1]<<_^t[i+2]<<m)&f},y=new hi(25e3),b=new li(288),S=new li(32),x=0,T=0,E=s.i||0,C=0,I=s.w||0,k=0;E+2<o;++E){var M=w(E),R=32767&E,O=g[M];if(p[R]=O,g[M]=R,I<=E){var P=o-E;if((x>7e3||C>24576)&&(P>423||!h)){u=Di(t,l,0,y,b,S,T,C,k,E-k,u),C=x=T=0,k=E;for(var A=0;A<286;++A)b[A]=0;for(A=0;A<30;++A)S[A]=0}var D=2,L=0,U=c,B=R-O&32767;if(P>2&&M==w(E-B))for(var j=Math.min(v,P)-1,N=Math.min(32767,E),z=Math.min(258,P);B<=N&&--U&&R!=O;){if(t[E+D]==t[E+D-B]){for(var q=0;q<z&&t[E+q]==t[E+q-B];++q);if(q>D){if(D=q,L=B,q>j)break;var F=Math.min(B,q-2),W=0;for(A=0;A<F;++A){var V=E-B+A&32767,J=V-p[V]&32767;J>W&&(W=J,O=V)}}}B+=(R=O)-(O=p[R])&32767}if(L){y[C++]=268435456|gi[D]<<18|_i[L];var H=31&gi[D],X=31&_i[L];T+=ui[H]+di[X],++b[257+H],++S[X],I=E+D,++x}else y[C++]=t[E],++b[t[E]]}}for(E=Math.max(E,I);E<o;++E)y[C++]=t[E],++b[t[E]];u=Di(t,l,h,y,b,S,T,C,k,E-k,u),h||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=g,s.p=p,s.i=E,s.w=I)}else{for(E=s.w||0;E<o+h;E+=65535){var K=E+65535;K>=o&&(l[u/8|0]=h,K=o),u=Ai(l,u+1,t.subarray(E,K))}s.i=o}return Ii(a,0,r+Ci(u)+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)},Ni=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function zi(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=Bi[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=ji(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&&Ni(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),Ni(s,o-8,e.d()),Ni(s,o-4,r),s}var qi="undefined"!=typeof TextEncoder&&new TextEncoder,Fi="undefined"!=typeof TextDecoder&&new TextDecoder;try{Fi.decode(Ui,{stream:!0})}catch(t){}oi.MouseMove,oi.MouseInteraction,oi.Scroll,oi.ViewportResize,oi.Input,oi.TouchMove,oi.MediaInteraction,oi.Drag;var Wi="[Chat]";class Vi{constructor(t,i){void 0===i&&(i={}),this._instance=t,this.j=null,this.N=!1,this.q=!1,this.F=null,this.W=[],this.V=[],this.J=[],this.H=[],this.X=[],this.P=i}get isOpen(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.q||null!==(i=null===(t=this.K)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}open(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.K)||void 0===t||t.close()}toggle(){this.K?this.K.toggle():this.open()}show(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.K)||void 0===t||t.hide()}sendMessage(t){this.K?this.K.sendMessage(t):(this.W.push(t),this.G(()=>{this.W.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.sendMessage(t)}),this.W=[]}))}markAsRead(){var t;null===(t=this.K)||void 0===t||t.markAsRead()}onMessage(t){return this.J.push(t),this.K?this.K.onMessage(t):()=>{var i=this.J.indexOf(t);i>-1&&this.J.splice(i,1)}}onTyping(t){return this.H.push(t),this.K?this.K.onTyping(t):()=>{var i=this.H.indexOf(t);i>-1&&this.H.splice(i,1)}}onConnectionChange(t){return this.X.push(t),this.K?this.K.onConnectionChange(t):()=>{var i=this.X.indexOf(t);i>-1&&this.X.splice(i,1)}}startIfEnabled(){var t=this;return i(function*(){var i,e,r,n;!1!==t.P.enabled?t._instance.getConfig().disable_chat?console.info(Wi+" disabled by disable_chat config"):(!1!==t.P.autoConfig&&(yield t.Z()),t.Y?(null!==(r=null!==(i=t.P.preload)&&void 0!==i?i:null===(e=t.j)||void 0===e?void 0:e.enabled)&&void 0!==r&&r&&t.tt(),(null===(n=t.j)||void 0===n?void 0:n.enabled)&&t.it(),console.info(Wi+" ready (lazy-load on demand)")):console.info(Wi+" not enabled (check dashboard settings)")):console.info(Wi+" disabled by code config")})()}updateConfig(t){this.P=e({},this.P,t)}getMergedConfig(){var t,i,e,r,n,s,o,a,l,h,u,d,v,c,f,p,g,_,m=this.j,w=this.P;return{enabled:null!==(i=null!==(t=w.enabled)&&void 0!==t?t:null==m?void 0:m.enabled)&&void 0!==i&&i,autoConfig:null===(e=w.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=w.position)&&void 0!==r?r:null==m?void 0:m.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=w.greeting)&&void 0!==s?s:null==m?void 0:m.greeting,color:null!==(a=null!==(o=w.color)&&void 0!==o?o:null==m?void 0:m.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=w.aiMode)&&void 0!==l?l:null==m?void 0:m.ai_enabled)||void 0===h||h,aiGreeting:null!==(u=w.aiGreeting)&&void 0!==u?u:null==m?void 0:m.ai_greeting,preload:null!==(d=w.preload)&&void 0!==d&&d,theme:null!==(v=w.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=w.color)&&void 0!==c?c:null==m?void 0:m.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=w.offlineMessage)&&void 0!==p?p:null==m?void 0:m.offline_message,collectEmailOffline:null===(_=null!==(g=w.collectEmailOffline)&&void 0!==g?g:null==m?void 0:m.collect_email_offline)||void 0===_||_}}destroy(){var t;null===(t=this.K)||void 0===t||t.destroy(),this.K=void 0,this.W=[],this.V=[],this.J=[],this.H=[],this.X=[]}get Y(){var t;return!1!==this.P.enabled&&(!0===this.P.enabled||!0===(null===(t=this.j)||void 0===t?void 0:t.enabled))}Z(){var t=this;return i(function*(){if(!t.N){var i=t._instance.getConfig(),e=i.token,r=i.api_host;if(!e||!r)return console.warn(Wi+" Cannot fetch settings: missing token or api_host"),void(t.N=!0);try{var n=r+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(n);if(!s.ok)return console.warn(Wi+" Failed to fetch settings: "+s.status),void(t.N=!0);t.j=yield s.json(),t.N=!0,console.info(Wi+" Loaded settings from dashboard")}catch(i){console.warn(Wi+" Error fetching settings:",i),t.N=!0}}})()}it(){if((null==x?void 0:x.document)&&!document.getElementById("vtilt-chat-bubble")){var t=this.getMergedConfig(),i=t.position||"bottom-right",e=t.color||"#6366f1",r=document.createElement("div");r.id="vtilt-chat-bubble",r.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===i?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+e+";\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 U(){return"chat"}tt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.et(),{timeout:5e3}):setTimeout(()=>this.et(),3e3)}G(t){this.K?t():(this.V.push(t),this.et())}et(){var t,i;if(!(this.q||this.K||this.F))if(null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.B();else{this.q=!0;var e=null===(i=O.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Wi+" loadExternalDependency not available. Chat cannot start."),this.q=!1,void(this.F="loadExternalDependency not available");e(this._instance,this.U,t=>{if(this.q=!1,t)return console.error(Wi+" Failed to load:",t),void(this.F=String(t));this.B()})}}B(){var t,i=null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Wi+" initChat not available after script load"),void(this.F="initChat not available");if(!this.K){var e=this.getMergedConfig();this.K=i(this._instance,e),this.J.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onMessage(t)}),this.H.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onTyping(t)}),this.X.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onConnectionChange(t)});var r=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");r&&r.remove()}this.V.forEach(t=>t()),this.V=[],console.info(Wi+" loaded and ready")}}var Ji,Hi="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ji||(Ji={}));var Xi=t=>{var{data:i,compression:e}=t;if(i){var r=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),n=new Blob([r]).size;if(e===Ji.GZipJS&&n>=1024)try{var s=zi(function(t,i){if(qi)return qi.encode(t);for(var e=t.length,r=new ai(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 ai(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 Ii(r,0,n)}(r),{mtime:0}),o=new Blob([s],{type:Hi});if(o.size<.95*n)return{contentType:Hi,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:r,estimatedSize:n}}},Ki=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var r=Xi(t);if(r){var{contentType:n,body:s,estimatedSize:o}=r,a=t.compression===Ji.GZipJS&&n===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,l=e({"Content-Type":n},t.headers||{}),h=new AbortController,u=t.timeout?setTimeout(()=>h.abort(),t.timeout):null;fetch(a,{method:t.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:h.signal}).then(function(){var e=i(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status)try{n.json=JSON.parse(r)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Xi(t);if(i){var{contentType:e,body:r}=i,n=t.compression===Ji.GZipJS&&e===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",n,!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(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Xi(t);if(i){var{contentType:e,body:r}=i;try{var n="string"==typeof r?new Blob([r],{type:e}):r,s=t.compression===Ji.GZipJS&&e===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,n)}catch(t){}}}}],Gi=t=>{var i,e=t.transport||"fetch",r=Ki.find(t=>t.name===e&&t.available)||Ki.find(t=>t.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));r.method(t)};class Qi{constructor(t,i){var e,r,n,s;this.rt=!0,this.nt=[],this.st=(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.ot=t}get length(){return this.nt.length}enqueue(t){this.nt.push(t),this.lt||this.ht()}unload(){if(this.ut(),0!==this.nt.length){var t=this.dt();for(var i in t){var r=t[i];this.ot(e({},r,{transport:"sendBeacon"}))}}}enable(){this.rt=!1,this.ht()}pause(){this.rt=!0,this.ut()}flush(){this.ut(),this.ct(),this.ht()}ht(){this.rt||(this.lt=setTimeout(()=>{this.ut(),this.ct(),this.nt.length>0&&this.ht()},this.st))}ut(){this.lt&&(clearTimeout(this.lt),this.lt=void 0)}ct(){if(0!==this.nt.length){var t=this.dt(),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.ot(r)}}}dt(){var t={};return this.nt.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.nt=[],t}}class Zi{constructor(t){this.ft=!1,this.gt=3e3,this.nt=[],this._t=!0,this.ot=t.sendRequest,this.wt=t.sendBeacon,x&&void 0!==E&&"onLine"in E&&(this._t=E.onLine,y(x,"online",()=>{this._t=!0,this.yt()}),y(x,"offline",()=>{this._t=!1}))}get length(){return this.nt.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,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.nt.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this._t||(n+=" (Browser is offline)"),console.warn(n),this.ft||(this.ft=!0,this.bt())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.ot(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}bt(){this.St&&clearTimeout(this.St),this.St=setTimeout(()=>{this._t&&this.nt.length>0&&this.yt(),this.nt.length>0?this.bt():this.ft=!1},this.gt)}yt(){var t=this,e=Date.now(),r=[],n=[];this.nt.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.nt=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.ot(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.St&&(clearTimeout(this.St),this.St=void 0),this.nt.forEach(t=>{var{request:i}=t;try{this.wt(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.nt=[]}}var Yi="vt_rate_limit";class te{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(Yi))&&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(Yi,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}var ie=Array.isArray;class ee{constructor(t){void 0===t&&(t={}),this.version="1.1.5",this.__loaded=!1,this.xt=!1,this.Tt=null,this.__request_queue=[],this.Et=!1,this.Ct=!1,this.configManager=new r(t);var i=this.configManager.getConfig();this.sessionManager=new U(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new Qt(i.persistence||"localStorage",i.cross_subdomain_cookie),this.webVitalsManager=new ii(i,this),this.rateLimiter=new te({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.It("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new Zi({sendRequest:t=>this.kt(t),sendBeacon:t=>this.Mt(t)}),this.requestQueue=new Qi(t=>this.$t(t),{flush_interval_ms:3e3})}init(t,i,e){var r;if(e&&e!==ne){var n=null!==(r=re[e])&&void 0!==r?r:new ee;return n._init(t,i,e),re[e]=n,re[ne][e]=n,n}return this._init(t,i,e)}_init(t,i,r){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(e({},i,{projectId:t||i.projectId,name:r})),this.__loaded=!0;var n=this.configManager.getConfig();return this.userManager.set_initial_person_info(n.mask_personal_data_properties,n.custom_personal_data_properties),this.historyAutocapture=new ri(this),this.historyAutocapture.startIfEnabled(),this.Rt(),this.Ot(),this.Pt(),this.At(),!1!==n.capture_pageview&&this.Dt(),this}At(){this.requestQueue.enable()}Pt(){if(x){var t=()=>{this.requestQueue.unload(),this.retryQueue.unload()};y(x,"beforeunload",t),y(x,"pagehide",t)}}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:ne;return i!==ne&&(i=ne+"."+i),i}getCurrentDomain(){if(!I)return"";var t=I.protocol,i=I.hostname,e=I.port;return t+"//"+i+(e?":"+e:"")}Lt(){var t=this.configManager.getConfig();return!(!t.projectId||!t.token)||(this.Et||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this.Et=!0),!1)}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:r,token:n}=t;return i||(e?e+"/api/tracking?token="+n:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+n:"/api/tracking?token="+n)}sendRequest(t,i,e){if(this.Lt()){if(e&&void 0!==x)if(x.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:t,event:i});this.requestQueue.enqueue({url:t,event:i})}}$t(t){var{transport:i}=t;"sendBeacon"!==i?this.retryQueue.retriableRequest(t):this.Mt(t)}kt(t){return new Promise(i=>{var{url:e,events:r}=t,n=1===r.length?r[0]:{events:r},s=this.configManager.getConfig().disable_compression?Ji.None:Ji.GZipJS;Gi({url:e,data:n,method:"POST",transport:"XHR",compression:s,callback:t=>{i({statusCode:t.statusCode})}})})}Mt(t){var{url:i,events:e}=t,r=1===e.length?e[0]:{events:e},n=this.configManager.getConfig().disable_compression?Ji.None:Ji.GZipJS;Gi({url:i,data:r,method:"POST",transport:"sendBeacon",compression:n})}Ut(t){this.sendRequest(t.url,t.event,!1)}capture(t,i,r){if(this.sessionManager.setSessionId(),E&&E.userAgent&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(E.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var n=this.buildUrl(),s=Gt(),o=this.userManager.getUserProperties(),a=this.userManager.get_initial_props(),l=this.sessionManager.getSessionId(),h=this.sessionManager.getWindowId(),u=this.userManager.getAnonymousId(),d={};!this.Ct&&Object.keys(a).length>0&&Object.assign(d,a),i.$set_once&&Object.assign(d,i.$set_once);var v=e({},s,o,{$session_id:l,$window_id:h},u?{$anon_distinct_id:u}:{},Object.keys(d).length>0?{$set_once:d}:{},i.$set?{$set:i.$set}:{},i);!this.Ct&&Object.keys(a).length>0&&(this.Ct=!0),"$pageview"===t&&C&&(v.title=C.title);var c,f,p=this.configManager.getConfig();if(!1!==p.stringifyPayload){if(c=Object.assign({},v,p.globalAttributes),!m(c=JSON.stringify(c)))return}else if(c=Object.assign({},v,p.globalAttributes),!m(JSON.stringify(c)))return;f="$identify"===t?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var g={timestamp:(new Date).toISOString(),event:t,project_id:p.projectId||"",payload:c,distinct_id:f,anonymous_id:u};this.sendRequest(n,g,!0)}}It(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}identify(t,i,e){if("number"==typeof t&&(t=String(t),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.userManager.isDistinctIdStringLikePublic(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 r=this.userManager.getDistinctId(),n=this.userManager.getAnonymousId(),s=this.userManager.getDeviceId(),o="anonymous"===this.userManager.getUserState();if(!s){var a=r||n;this.userManager.ensureDeviceId(a)}t!==r&&o?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(i,e),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n,$set:i||{},$set_once:e||{}}),this.userManager.setDistinctId(t)):i||e?(o&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(i,e),this.capture("$set",{$set:i||{},$set_once:e||{}})):t!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(t))}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){this.userManager.setUserProperties(t,i)&&this.capture("$set",{$set:t||{},$set_once:i||{}})}resetUser(t){this.sessionManager.resetSessionId(),this.userManager.reset(t)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(t,i){var e=this.userManager.createAlias(t,i);e?this.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(t)}Dt(){C&&("visible"===C.visibilityState?this.xt||(this.xt=!0,setTimeout(()=>{if(C&&I){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this.Tt&&(C.removeEventListener("visibilitychange",this.Tt),this.Tt=null)):this.Tt||(this.Tt=()=>{this.Dt()},y(C,"visibilitychange",this.Tt)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.userManager.getDistinctId()||this.userManager.getAnonymousId()}getAnonymousId(){return this.userManager.getAnonymousId()}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new U(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new Qt(i.persistence||"localStorage",i.cross_subdomain_cookie),this.webVitalsManager=new ii(i,this),this.sessionRecording&&i.session_recording&&this.sessionRecording.updateConfig(this.Bt(i))}Rt(){var t=this.configManager.getConfig();if(!t.disable_session_recording){var i=this.Bt(t);this.sessionRecording=new si(this,i),i.enabled&&this.sessionRecording.startIfEnabledOrStop("recording_initialized")}}Bt(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,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}}startSessionRecording(){if(!this.sessionRecording){var t=this.configManager.getConfig(),i=this.Bt(t);i.enabled=!0,this.sessionRecording=new si(this,i)}this.sessionRecording.startIfEnabledOrStop("recording_initialized")}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stopRecording()}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}Ot(){var t=this.configManager.getConfig();if(!t.disable_chat){var i=this.jt(t);this.chat=new Vi(this,i),this.chat.startIfEnabled()}}jt(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}}_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);if("function"==typeof this[i])try{this[i](...e)}catch(t){console.error("vTilt: Error executing queued call "+i+":",t)}}})}_dom_loaded(){this.__request_queue.forEach(t=>{this.Ut(t)}),this.__request_queue=[],this.At()}}var re={},ne="vt",se=!(void 0!==M||void 0!==k)&&-1===(null==R?void 0:R.indexOf("MSIE"))&&-1===(null==R?void 0:R.indexOf("Mozilla"));null!=x&&(x.__VTILT_ENQUEUE_REQUESTS=se);var oe,ae,le=function(){function t(){t.done||(t.done=!0,se=!1,null!=x&&(x.__VTILT_ENQUEUE_REQUESTS=!1),w(re,function(t){t._dom_loaded()}))}C&&"function"==typeof C.addEventListener?"complete"===C.readyState?t():y(C,"DOMContentLoaded",t,{capture:!1}):x&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(oe=re[ne]=new ee,(ae=O.vt)&&w(ae._i,function(t){if(t&&ie(t)){var i=oe.init(t[0],t[1],t[2]),e=ae[t[2]||"vt"]||ae;i&&i._execute_array(e)}}),O.vt=oe,le());var he=function(){var t=re[ne]=new ee;return le(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=Zt,exports.VTilt=ee,exports.default=he,exports.vt=he;
1
+ "use strict";function t(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 i(i){return function(){var e=this,r=arguments;return new Promise(function(n,s){var o=i.apply(e,r);function a(i){t(o,n,s,a,l,"next",i)}function l(i){t(o,n,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=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},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});class r{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!document.currentScript)return e({token:t.token||""},t);var i=document.currentScript,r=e({token:""},t);r.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,r.script_host=i.getAttribute("data-script-host")||t.script_host,r.proxy=i.getAttribute("data-proxy")||t.proxy,r.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,r.token=i.getAttribute("data-token")||t.token||"",r.projectId=i.getAttribute("data-project-id")||t.projectId||"",r.domain=i.getAttribute("data-domain")||t.domain,r.storage=i.getAttribute("data-storage")||t.storage,r.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");if(r.capture_performance=!!n||t.capture_performance,r.proxy&&r.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(r.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(r.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return r}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}var n="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",h="__vt_anonymous_id",u="__vt_distinct_id",d="__vt_user_properties",v="localStorage",c="localStorage+cookie",f="sessionStorage",g="memory",p="$initial_person_info";function _(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))}function m(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function w(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 y(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 b(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function S(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}var x="undefined"!=typeof window?window:void 0,T="undefined"!=typeof globalThis?globalThis:x,C=null==T?void 0:T.navigator,E=null==T?void 0:T.document,I=null==T?void 0:T.location,k=null==T?void 0:T.fetch,M=(null==T?void 0:T.XMLHttpRequest)&&"withCredentials"in new T.XMLHttpRequest?T.XMLHttpRequest:void 0;null==T||T.AbortController;var R=null==C?void 0:C.userAgent,O=null!=x?x:{},P=31536e3,A=["herokuapp.com","vercel.app","netlify.app"];function D(t){var i;if(!t)return"";if("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 L{constructor(t){var i,e;this.memoryStorage=new Map,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(".");for(var r of A)if(e===r)return!1;return!0}(),this.sameSite=t.sameSite||"Lax",this.secure=null!==(e=t.secure)&&void 0!==e?e:"undefined"!=typeof location&&"https:"===location.protocol}get(t){var i;try{if(this.method===g)return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;if(this.usesLocalStorage()){var e=localStorage.getItem(t);return null!==e?e:this.method===c?this.getCookie(t):null}return this.usesSessionStorage()?sessionStorage.getItem(t):this.getCookie(t)}catch(i){return console.warn('[StorageManager] Failed to get "'+t+'":',i),null}}set(t,i,e){try{if(this.method===g)return void this.memoryStorage.set(t,i);if(this.usesLocalStorage())return localStorage.setItem(t,i),void(this.method===c&&this.setCookie(t,i,e||P));if(this.usesSessionStorage())return void sessionStorage.setItem(t,i);this.setCookie(t,i,e||P)}catch(i){console.warn('[StorageManager] Failed to set "'+t+'":',i)}}remove(t){try{if(this.method===g)return void this.memoryStorage.delete(t);if(this.usesLocalStorage())return localStorage.removeItem(t),void(this.method===c&&this.removeCookie(t));if(this.usesSessionStorage())return void sessionStorage.removeItem(t);this.removeCookie(t)}catch(i){console.warn('[StorageManager] Failed to remove "'+t+'":',i)}}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,r){var n=e({value:i},r?{expiry:Date.now()+r}:{});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)}getCookie(t){if("undefined"==typeof document)return null;var i=document.cookie.split(";");for(var e of i){var[r,...n]=e.trim().split("=");if(r===t){var s=n.join("=");try{return decodeURIComponent(s)}catch(t){return s}}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=t+"="+encodeURIComponent(i);r+="; Max-Age="+e,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure");var n=D(this.cross_subdomain);n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=D(this.cross_subdomain),e=t+"=; Max-Age=0; path=/";i&&(e+="; domain="+i),document.cookie=e,document.cookie=t+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===v||this.method===c}usesSessionStorage(){return this.method===f}canUseSessionStorage(){if(void 0===x||!(null==x?void 0:x.sessionStorage))return!1;try{var t="__vt_storage_test__";return x.sessionStorage.setItem(t,"test"),x.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==x?void 0:x.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class U{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.o=void 0,this.v()}getSessionId(){var t=this.m();return t||(t=_(),this.S(t)),t}setSessionId(){var t=this.m()||_();return this.S(t),t}resetSessionId(){this.T(),this.setSessionId(),this.C(_())}m(){return this.storage.get(n)}S(t){this.storage.set(n,t,1800)}T(){this.storage.remove(n)}getWindowId(){if(this.o)return this.o;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.o=i,i}var e=_();return this.C(e),e}C(t){if(t!==this.o){this.o=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}v(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.o=e:(e&&t.removeItem(s),this.C(_())),t.setItem(o,"true"),this.I()}else this.o=_()}I(){var t=this.storage.getSessionStorage();x&&t&&y(x,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"})}}function B(t){if(!E)return null;var i=E.createElement("a");return i.href=t,i}function j(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===i){if(n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function N(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],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 g=u.join("&");return l+(g?"?"+g:"")+(s?"#"+s:"")}function z(t){return"function"==typeof t}var q="Mobile",F="iOS",W="Android",V="Tablet",J=W+" "+V,H="iPad",X="Apple",K=X+" Watch",G="Safari",Q="BlackBerry",Z="Samsung",Y=Z+"Browser",tt=Z+" Internet",it="Chrome",et=it+" OS",rt=it+" "+F,nt="Internet Explorer",st=nt+" "+q,ot="Opera",at=ot+" Mini",lt="Edge",ht="Microsoft "+lt,ut="Firefox",dt=ut+" "+F,vt="Nintendo",ct="PlayStation",ft="Xbox",gt=W+" "+q,pt=q+" "+G,_t="Windows",mt=_t+" Phone",wt="Nokia",yt="Ouya",bt="Generic",St=bt+" "+q.toLowerCase(),xt=bt+" "+V.toLowerCase(),Tt="Konqueror",Ct="(\\d+(\\.\\d+)?)",Et=new RegExp("Version/"+Ct),It=new RegExp(ft,"i"),kt=new RegExp(ct+" \\w+","i"),Mt=new RegExp(vt+" \\w+","i"),$t=new RegExp(Q+"|PlayBook|BB10","i"),Rt={"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 Ot(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Pt=(t,i)=>i&&Ot(i,X)||function(t){return Ot(t,G)&&!Ot(t,it)&&!Ot(t,W)}(t),At=function(t,i){return i=i||"",Ot(t," OPR/")&&Ot(t,"Mini")?at:Ot(t," OPR/")?ot:$t.test(t)?Q:Ot(t,"IE"+q)||Ot(t,"WPDesktop")?st:Ot(t,Y)?tt:Ot(t,lt)||Ot(t,"Edg/")?ht:Ot(t,"FBIOS")?"Facebook "+q:Ot(t,"UCWEB")||Ot(t,"UCBrowser")?"UC Browser":Ot(t,"CriOS")?rt:Ot(t,"CrMo")||Ot(t,it)?it:Ot(t,W)&&Ot(t,G)?gt:Ot(t,"FxiOS")?dt:Ot(t.toLowerCase(),Tt.toLowerCase())?Tt:Pt(t,i)?Ot(t,q)?pt:G:Ot(t,ut)?ut:Ot(t,"MSIE")||Ot(t,"Trident/")?nt:Ot(t,"Gecko")?ut:""},Dt={[st]:[new RegExp("rv:"+Ct)],[ht]:[new RegExp(lt+"?\\/"+Ct)],[it]:[new RegExp("("+it+"|CrMo)\\/"+Ct)],[rt]:[new RegExp("CriOS\\/"+Ct)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ct)],[G]:[Et],[pt]:[Et],[ot]:[new RegExp("(Opera|OPR)\\/"+Ct)],[ut]:[new RegExp(ut+"\\/"+Ct)],[dt]:[new RegExp("FxiOS\\/"+Ct)],[Tt]:[new RegExp("Konqueror[:/]?"+Ct,"i")],[Q]:[new RegExp(Q+" "+Ct),Et],[gt]:[new RegExp("android\\s"+Ct,"i")],[tt]:[new RegExp(Y+"\\/"+Ct)],[nt]:[new RegExp("(rv:|MSIE )"+Ct)],Mozilla:[new RegExp("rv:"+Ct)]},Lt=function(t,i){var e=At(t,i),r=Dt[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},Ut=[[new RegExp(ft+"; "+ft+" (.*?)[);]","i"),t=>[ft,t&&t[1]||""]],[new RegExp(vt,"i"),[vt,""]],[new RegExp(ct,"i"),[ct,""]],[$t,[Q,""]],[new RegExp(_t,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[mt,""];if(new RegExp(q).test(i)&&!/IEMobile\b/.test(i))return[_t+" "+q,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=Rt[r]||"";return/arm/i.test(i)&&(n="RT"),[_t,n]}return[_t,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[F,i.join(".")]}return[F,""]}],[/(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("("+W+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+W+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[W,i.join(".")]}return[W,""]}],[/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/,[et,""]],[/Linux|debian/i,["Linux",""]]],Bt=function(t){return Mt.test(t)?vt:kt.test(t)?ct:It.test(t)?ft:new RegExp(yt,"i").test(t)?yt:new RegExp("("+mt+"|WPDesktop)","i").test(t)?mt:/iPad/.test(t)?H:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?K:$t.test(t)?Q:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(wt,"i").test(t)?wt:/(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(q).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)?W:J:W:new RegExp("(pda|"+q+")","i").test(t)?St:new RegExp(V,"i").test(t)&&!new RegExp(V+" pc","i").test(t)?xt:""},jt="https?://(.*)",Nt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],zt=S(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Nt),qt="<masked>";function Ft(t){var i=function(t){return t?0===t.search(jt+"google.([^/?]*)")?"google":0===t.search(jt+"bing.com")?"bing":0===t.search(jt+"yahoo.com")?"yahoo":0===t.search(jt+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(null!==i){r.$search_engine=i;var n=E?j(E.referrer,e):"";n.length&&(r.ph_keyword=n)}return r}function Wt(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Vt(){return(null==E?void 0:E.referrer)||"$direct"}function Jt(){var t;return(null==E?void 0:E.referrer)&&(null===(t=B(E.referrer))||void 0===t?void 0:t.host)||"$direct"}function Ht(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=B(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=B(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=zt.concat([]),e={};return w(i,function(i){var r=j(t,i);e[i]=r||null}),e}(r);b(n,o)}e&&b(n,Ft(e));return n}function Xt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Kt(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Gt(t,i){if(!R)return{};var e,r,n,[s,o]=function(t){for(var i=0;i<Ut.length;i++){var[e,r]=Ut[i],n=e.exec(t),s=n&&(z(r)?r(n,t):r);if(s)return s}return["",""]}(R);return b(function(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}({$os:s,$os_version:o,$browser:At(R,navigator.vendor),$device:Bt(R),$device_type:(r=R,n=Bt(r),n===H||n===J||"Kobo"===n||"Kindle Fire"===n||n===xt?V:n===vt||n===ft||n===ct||n===yt?"Console":n===K?"Wearable":n?q:"Desktop"),$timezone:Xt(),$timezone_offset:Kt()}),{$current_url:N(null==I?void 0:I.href,[],qt),$host:null==I?void 0:I.host,$pathname:null==I?void 0:I.pathname,$raw_user_agent:R.length>1e3?R.substring(0,997)+"...":R,$browser_version:Lt(R,navigator.vendor),$browser_language:Wt(),$browser_language_prefix:(e=Wt(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==x?void 0:x.screen.height,$screen_width:null==x?void 0:x.screen.width,$viewport_height:null==x?void 0:x.innerHeight,$viewport_width:null==x?void 0:x.innerWidth,$lib:"web",$lib_version:"1.0.7",$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class Qt{constructor(t,i){void 0===t&&(t="localStorage"),this.k=null,this.storage=new L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(h,this.userIdentity.anonymous_id,P)),this.userIdentity.anonymous_id}getUserProperties(){return e({},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,r){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 s=n||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}t!==n&&(this.userIdentity.distinct_id=t);var o="anonymous"===this.userIdentity.user_state;t!==n&&o?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[t])}),this.saveUserIdentity()):i||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[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 r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,n=this.getPersonPropertiesHash(r,t,i);return this.k===n?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.k=n,!0)}reset(t){var i=this.generateAnonymousId(),r=this.userIdentity.device_id,n=t?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:n,properties:{},user_state:"anonymous"},this.k=null,this.saveUserIdentity(),this.userIdentity.properties=e({},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=e({},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=e({},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()[p]){var e=function(t,i){var e=t?S([],Nt,i||[]):[],r=null==I?void 0:I.href.substring(0,1e3);return{r:Vt().substring(0,1e3),u:r?N(r,e,qt):void 0}}(t,i);this.register_once({[p]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[p];return e?(t=Ht(e),i={},w(t,function(t,e){var r;i["$initial_"+(r=String(e),r.startsWith("$")?r.substring(1):r)]=t}),i):{}}update_referrer_info(){var t={$referrer:Vt(),$referring_domain:Jt()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(h)||this.generateAnonymousId(),i=this.storage.get(u)||null,e=this.storage.get(l)||this.generateDeviceId(),r=this.getStoredUserProperties(),n=this.storage.get(a)||"anonymous";return{distinct_id:i,anonymous_id:t||this.generateAnonymousId(),device_id:e,properties:r,user_state:n}}saveUserIdentity(){this.storage.set(h,this.userIdentity.anonymous_id,P),this.storage.set(l,this.userIdentity.device_id,P),this.storage.set(a,this.userIdentity.user_state,P),this.userIdentity.distinct_id?this.storage.set(u,this.userIdentity.distinct_id,P):this.storage.remove(u),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(d)||{}}setStoredUserProperties(t){this.storage.setJSON(d,t,P)}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_"+_()}generateDeviceId(){return"device_"+_()}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 L({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var Zt=["LCP","CLS","FCP","INP"],Yt=9e5,ti="[WebVitals]";class ii{constructor(t,i){this.initialized=!1,this.instance=i,this.buffer=this.createEmptyBuffer(),this.config=this.parseConfig(t.capture_performance),this.isEnabled&&x&&this.startIfEnabled()}parseConfig(t){return"boolean"==typeof t?{web_vitals:t}:"object"==typeof t&&null!==t?t:{web_vitals:!1}}get isEnabled(){var t=null==I?void 0:I.protocol;return("http:"===t||"https:"===t)&&!1!==this.config.web_vitals}get allowedMetrics(){return this.config.web_vitals_allowed_metrics||Zt}get flushTimeoutMs(){return this.config.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.config.__web_vitals_max_value;return void 0===t?Yt:0===t?0:t<6e4?Yt:t}createEmptyBuffer(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}getWebVitalsCallbacks(){var t;return null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}startIfEnabled(){if(this.isEnabled&&!this.initialized){var t=this.getWebVitalsCallbacks();t?this.startCapturing(t):this.loadWebVitals()}}loadWebVitals(){var t,i=null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this.instance,"web-vitals",t=>{if(t)console.error(ti+" Failed to load web-vitals:",t);else{var i=this.getWebVitalsCallbacks();i?this.startCapturing(i):console.error(ti+" web-vitals loaded but callbacks not registered")}}):console.warn(ti+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}startCapturing(t){if(!this.initialized){var i=this.allowedMetrics,e=this.addToBuffer.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.initialized=!0}}getCurrentUrl(){var t;return null===(t=null==x?void 0:x.location)||void 0===t?void 0:t.href}getCurrentPathname(){return null==I?void 0:I.pathname}addToBuffer(t){try{if(!x||!E||!I)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void console.warn(ti+" Invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void console.warn(ti+" Ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var i=this.getCurrentUrl(),r=this.getCurrentPathname();if(!i)return void console.warn(ti+" Could not determine current URL");this.buffer.url&&this.buffer.url!==i&&this.flush(),this.buffer.url||(this.buffer.url=i,this.buffer.pathname=r),this.buffer.firstMetricTimestamp||(this.buffer.firstMetricTimestamp=Date.now());var n=this.cleanAttribution(t.attribution),s=this.instance.getSessionId(),o=this.getWindowId(),a=e({},t,{attribution:n,timestamp:Date.now(),$current_url:i,$session_id:s,$window_id:o}),l=this.buffer.metrics.findIndex(i=>i.name===t.name);l>=0?this.buffer.metrics[l]=a:this.buffer.metrics.push(a),this.scheduleFlush(),this.buffer.metrics.length>=this.allowedMetrics.length&&this.flush()}catch(t){console.error(ti+" Error adding metric to buffer:",t)}}cleanAttribution(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}getWindowId(){var t;try{return(null===(t=this.instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}scheduleFlush(){this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=setTimeout(()=>{this.flush()},this.flushTimeoutMs)}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),0!==this.buffer.metrics.length){try{var t={$pathname:this.buffer.pathname,$current_url:this.buffer.url};for(var i of this.buffer.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(ti+" Error flushing metrics:",t)}this.buffer=this.createEmptyBuffer()}}}function ei(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class ri{constructor(t){var i;this._instance=t,this.M=(null===(i=null==x?void 0:x.location)||void 0===i?void 0:i.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this.$&&this.$(),this.$=void 0}monitorHistoryChanges(){var t,i;if(x&&I&&(this.M=I.pathname||"",x.history)){var e=this;(null===(t=x.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||ei(x.history,"pushState",t=>function(i,r,n){t.call(this,i,r,n),e.R("pushState")}),(null===(i=x.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||ei(x.history,"replaceState",t=>function(i,r,n){t.call(this,i,r,n),e.R("replaceState")}),this.O()}}R(t){var i;try{var e=null===(i=null==x?void 0:x.location)||void 0===i?void 0:i.pathname;if(!e||!I||!E)return;if(e!==this.M&&this.isEnabled){var r={navigation_type:t};this._instance.capture("$pageview",r)}this.M=e}catch(i){console.error("Error capturing "+t+" pageview",i)}}O(){if(!this.$&&x){var t=()=>{this.R("popstate")};y(x,"popstate",t),this.$=()=>{x&&x.removeEventListener("popstate",t)}}}}var ni="[SessionRecording]";class si{constructor(t,i){void 0===i&&(i={}),this._instance=t,this.P=i}get started(){var t;return!!(null===(t=this.A)||void 0===t?void 0:t.isStarted)}get status(){var t;return(null===(t=this.A)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.A)||void 0===t?void 0:t.sessionId)||""}startIfEnabledOrStop(t){var i;if(!this.D||!(null===(i=this.A)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.D&&e?(this.L(t),console.info(ni+" starting")):this.stopRecording()}}stopRecording(){var t;null===(t=this.A)||void 0===t||t.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.A)||void 0===e?void 0:e.log)?this.A.log(t,i):console.warn(ni+" log called before recorder was ready")}updateConfig(t){var i;this.P=e({},this.P,t),null===(i=this.A)||void 0===i||i.updateConfig(this.P)}get D(){var t,i=this._instance.getConfig(),e=null!==(t=this.P.enabled)&&void 0!==t&&t,r=!i.disable_session_recording;return!!x&&e&&r}get U(){return"recorder"}L(t){var i,e,r,n;if(this.D)if((null===(e=null===(i=null==O?void 0:O.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(r=O.__VTiltExtensions__)||void 0===r?void 0:r.initSessionRecording))this.B(t);else{var s=null===(n=O.__VTiltExtensions__)||void 0===n?void 0:n.loadExternalDependency;s?s(this._instance,this.U,i=>{i?console.error(ni+" could not load recorder:",i):this.B(t)}):console.error(ni+" loadExternalDependency not available. Session recording cannot start.")}}B(t){var i,e=null===(i=O.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.A||(this.A=e(this._instance,this.P)),this.A.start(t)):console.error(ni+" initSessionRecording not available after script load")}}var oi=(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))(oi||{}),ai=Uint8Array,li=Uint16Array,hi=Int32Array,ui=new ai([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]),di=new ai([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]),vi=new ai([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ci=function(t,i){for(var e=new li(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new hi(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}},fi=ci(ui,2),gi=fi.b,pi=fi.r;gi[28]=258,pi[258]=28;for(var _i=ci(di,0).r,mi=new li(32768),wi=0;wi<32768;++wi){var yi=(43690&wi)>>1|(21845&wi)<<1;yi=(61680&(yi=(52428&yi)>>2|(13107&yi)<<2))>>4|(3855&yi)<<4,mi[wi]=((65280&yi)>>8|(255&yi)<<8)>>1}var bi=function(t,i,e){for(var r=t.length,n=0,s=new li(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new li(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new li(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var h=n<<4|t[n],u=i-t[n],d=a[t[n]-1]++<<u,v=d|(1<<u)-1;d<=v;++d)o[mi[d]>>l]=h}else for(o=new li(r),n=0;n<r;++n)t[n]&&(o[n]=mi[a[t[n]-1]++]>>15-t[n]);return o},Si=new ai(288);for(wi=0;wi<144;++wi)Si[wi]=8;for(wi=144;wi<256;++wi)Si[wi]=9;for(wi=256;wi<280;++wi)Si[wi]=7;for(wi=280;wi<288;++wi)Si[wi]=8;var xi=new ai(32);for(wi=0;wi<32;++wi)xi[wi]=5;var Ti=bi(Si,9,0),Ci=bi(xi,5,0),Ei=function(t){return(t+7)/8|0},Ii=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new ai(t.subarray(i,e))},ki=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Mi=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},$i=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:Ui,l:0};if(1==n){var o=new ai(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!=n-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(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new li(v+1),f=Ri(e[u-1],c,0);if(f>i){r=0;var g=0,p=f-i,_=1<<p;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});r<n;++r){var m=s[r].s;if(!(c[m]>i))break;g+=_-(1<<f-c[m]),c[m]=i}for(g>>=p;g>0;){var w=s[r].s;c[w]<i?g-=1<<i-c[w]++-1:++r}for(;r>=0&&g;--r){var y=s[r].s;c[y]==i&&(--c[y],++g)}f=i}return{t:new ai(c),l:f}},Ri=function(t,i,e){return-1==t.s?Math.max(Ri(t.l,i,e+1),Ri(t.r,i,e+1)):i[t.s]=e},Oi=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new li(++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}},Pi=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Ai=function(t,i,e){var r=e.length,n=Ei(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)},Di=function(t,i,e,r,n,s,o,a,l,h,u){ki(i,u++,e),++n[256];for(var d=$i(n,15),v=d.t,c=d.l,f=$i(s,15),g=f.t,p=f.l,_=Oi(v),m=_.c,w=_.n,y=Oi(g),b=y.c,S=y.n,x=new li(19),T=0;T<m.length;++T)++x[31&m[T]];for(T=0;T<b.length;++T)++x[31&b[T]];for(var C=$i(x,7),E=C.t,I=C.l,k=19;k>4&&!E[vi[k-1]];--k);var M,R,O,P,A=h+5<<3,D=Pi(n,Si)+Pi(s,xi)+o,L=Pi(n,v)+Pi(s,g)+o+14+3*k+Pi(x,E)+2*x[16]+3*x[17]+7*x[18];if(l>=0&&A<=D&&A<=L)return Ai(i,u,t.subarray(l,l+h));if(ki(i,u,1+(L<D)),u+=2,L<D){M=bi(v,c,0),R=v,O=bi(g,p,0),P=g;var U=bi(E,I,0);ki(i,u,w-257),ki(i,u+5,S-1),ki(i,u+10,k-4),u+=14;for(T=0;T<k;++T)ki(i,u+3*T,E[vi[T]]);u+=3*k;for(var B=[m,b],j=0;j<2;++j){var N=B[j];for(T=0;T<N.length;++T){var z=31&N[T];ki(i,u,U[z]),u+=E[z],z>15&&(ki(i,u,N[T]>>5&127),u+=N[T]>>12)}}}else M=Ti,R=Si,O=Ci,P=xi;for(T=0;T<a;++T){var q=r[T];if(q>255){Mi(i,u,M[(z=q>>18&31)+257]),u+=R[z+257],z>7&&(ki(i,u,q>>23&31),u+=ui[z]);var F=31&q;Mi(i,u,O[F]),u+=P[F],F>3&&(Mi(i,u,q>>5&8191),u+=di[F])}else Mi(i,u,M[q]),u+=R[q]}return Mi(i,u,M[256]),u+R[256]},Li=new hi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ui=new ai(0),Bi=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}(),ji=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new ai(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 ai(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),h=s.l,u=7&(s.r||0);if(i){u&&(l[0]=s.r>>3);for(var d=Li[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,g=s.p||new li(32768),p=s.h||new li(f+1),_=Math.ceil(e/3),m=2*_,w=function(i){return(t[i]^t[i+1]<<_^t[i+2]<<m)&f},y=new hi(25e3),b=new li(288),S=new li(32),x=0,T=0,C=s.i||0,E=0,I=s.w||0,k=0;C+2<o;++C){var M=w(C),R=32767&C,O=p[M];if(g[R]=O,p[M]=R,I<=C){var P=o-C;if((x>7e3||E>24576)&&(P>423||!h)){u=Di(t,l,0,y,b,S,T,E,k,C-k,u),E=x=T=0,k=C;for(var A=0;A<286;++A)b[A]=0;for(A=0;A<30;++A)S[A]=0}var D=2,L=0,U=c,B=R-O&32767;if(P>2&&M==w(C-B))for(var j=Math.min(v,P)-1,N=Math.min(32767,C),z=Math.min(258,P);B<=N&&--U&&R!=O;){if(t[C+D]==t[C+D-B]){for(var q=0;q<z&&t[C+q]==t[C+q-B];++q);if(q>D){if(D=q,L=B,q>j)break;var F=Math.min(B,q-2),W=0;for(A=0;A<F;++A){var V=C-B+A&32767,J=V-g[V]&32767;J>W&&(W=J,O=V)}}}B+=(R=O)-(O=g[R])&32767}if(L){y[E++]=268435456|pi[D]<<18|_i[L];var H=31&pi[D],X=31&_i[L];T+=ui[H]+di[X],++b[257+H],++S[X],I=C+D,++x}else y[E++]=t[C],++b[t[C]]}}for(C=Math.max(C,I);C<o;++C)y[E++]=t[C],++b[t[C]];u=Di(t,l,h,y,b,S,T,E,k,C-k,u),h||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=p,s.p=g,s.i=C,s.w=I)}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=Ai(l,u+1,t.subarray(C,K))}s.i=o}return Ii(a,0,r+Ei(u)+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)},Ni=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function zi(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=Bi[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=ji(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&&Ni(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),Ni(s,o-8,e.d()),Ni(s,o-4,r),s}var qi="undefined"!=typeof TextEncoder&&new TextEncoder,Fi="undefined"!=typeof TextDecoder&&new TextDecoder;try{Fi.decode(Ui,{stream:!0})}catch(t){}oi.MouseMove,oi.MouseInteraction,oi.Scroll,oi.ViewportResize,oi.Input,oi.TouchMove,oi.MediaInteraction,oi.Drag;var Wi="[Chat]";class Vi{constructor(t,i){void 0===i&&(i={}),this._instance=t,this.j=null,this.N=!1,this.q=!1,this.F=null,this.W=[],this.V=[],this.J=[],this.H=[],this.X=[],this.P=i}get isOpen(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.q||null!==(i=null===(t=this.K)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.K)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.K)||void 0===t||t.close()}toggle(){this.K?this.K.toggle():this.open()}show(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.K)||void 0===t||t.hide()}getChannels(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.G(()=>{var i;return null===(i=this.K)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.G(()=>{var t;return null===(t=this.K)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.K)||void 0===t||t.goToChannelList()}sendMessage(t){this.K?this.K.sendMessage(t):(this.W.push(t),this.G(()=>{this.W.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.sendMessage(t)}),this.W=[]}))}markAsRead(){var t;null===(t=this.K)||void 0===t||t.markAsRead()}onMessage(t){return this.J.push(t),this.K?this.K.onMessage(t):()=>{var i=this.J.indexOf(t);i>-1&&this.J.splice(i,1)}}onTyping(t){return this.H.push(t),this.K?this.K.onTyping(t):()=>{var i=this.H.indexOf(t);i>-1&&this.H.splice(i,1)}}onConnectionChange(t){return this.X.push(t),this.K?this.K.onConnectionChange(t):()=>{var i=this.X.indexOf(t);i>-1&&this.X.splice(i,1)}}startIfEnabled(){var t=this;return i(function*(){var i,e,r,n;!1!==t.P.enabled?t._instance.getConfig().disable_chat?console.info(Wi+" disabled by disable_chat config"):(!1!==t.P.autoConfig&&(yield t.Z()),t.Y?(null!==(r=null!==(i=t.P.preload)&&void 0!==i?i:null===(e=t.j)||void 0===e?void 0:e.enabled)&&void 0!==r&&r&&t.tt(),(null===(n=t.j)||void 0===n?void 0:n.enabled)&&t.it(),console.info(Wi+" ready (lazy-load on demand)")):console.info(Wi+" not enabled (check dashboard settings)")):console.info(Wi+" disabled by code config")})()}updateConfig(t){this.P=e({},this.P,t)}getMergedConfig(){var t,i,e,r,n,s,o,a,l,h,u,d,v,c,f,g,p,_,m=this.j,w=this.P;return{enabled:null!==(i=null!==(t=w.enabled)&&void 0!==t?t:null==m?void 0:m.enabled)&&void 0!==i&&i,autoConfig:null===(e=w.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=w.position)&&void 0!==r?r:null==m?void 0:m.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=w.greeting)&&void 0!==s?s:null==m?void 0:m.greeting,color:null!==(a=null!==(o=w.color)&&void 0!==o?o:null==m?void 0:m.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=w.aiMode)&&void 0!==l?l:null==m?void 0:m.ai_enabled)||void 0===h||h,aiGreeting:null!==(u=w.aiGreeting)&&void 0!==u?u:null==m?void 0:m.ai_greeting,preload:null!==(d=w.preload)&&void 0!==d&&d,theme:null!==(v=w.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=w.color)&&void 0!==c?c:null==m?void 0:m.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(g=w.offlineMessage)&&void 0!==g?g:null==m?void 0:m.offline_message,collectEmailOffline:null===(_=null!==(p=w.collectEmailOffline)&&void 0!==p?p:null==m?void 0:m.collect_email_offline)||void 0===_||_}}destroy(){var t;null===(t=this.K)||void 0===t||t.destroy(),this.K=void 0,this.W=[],this.V=[],this.J=[],this.H=[],this.X=[]}get Y(){var t;return!1!==this.P.enabled&&(!0===this.P.enabled||!0===(null===(t=this.j)||void 0===t?void 0:t.enabled))}Z(){var t=this;return i(function*(){if(!t.N){var i=t._instance.getConfig(),e=i.token,r=i.api_host;if(!e||!r)return console.warn(Wi+" Cannot fetch settings: missing token or api_host"),void(t.N=!0);try{var n=r+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(n);if(!s.ok)return console.warn(Wi+" Failed to fetch settings: "+s.status),void(t.N=!0);t.j=yield s.json(),t.N=!0,console.info(Wi+" Loaded settings from dashboard")}catch(i){console.warn(Wi+" Error fetching settings:",i),t.N=!0}}})()}it(){if((null==x?void 0:x.document)&&!document.getElementById("vtilt-chat-bubble")){var t=this.getMergedConfig(),i=t.position||"bottom-right",e=t.color||"#6366f1",r=document.createElement("div");r.id="vtilt-chat-bubble",r.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===i?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+e+";\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 U(){return"chat"}tt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.et(),{timeout:5e3}):setTimeout(()=>this.et(),3e3)}G(t){this.K?t():(this.V.push(t),this.et())}et(){var t,i;if(!(this.q||this.K||this.F))if(null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.B();else{this.q=!0;var e=null===(i=O.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Wi+" loadExternalDependency not available. Chat cannot start."),this.q=!1,void(this.F="loadExternalDependency not available");e(this._instance,this.U,t=>{if(this.q=!1,t)return console.error(Wi+" Failed to load:",t),void(this.F=String(t));this.B()})}}B(){var t,i=null===(t=O.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Wi+" initChat not available after script load"),void(this.F="initChat not available");if(!this.K){var e=this.getMergedConfig();this.K=i(this._instance,e),this.J.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onMessage(t)}),this.H.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onTyping(t)}),this.X.forEach(t=>{var i;return null===(i=this.K)||void 0===i?void 0:i.onConnectionChange(t)});var r=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");r&&r.remove()}this.V.forEach(t=>t()),this.V=[],console.info(Wi+" loaded and ready")}}var Ji,Hi="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ji||(Ji={}));var Xi=t=>{var{data:i,compression:e}=t;if(i){var r=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),n=new Blob([r]).size;if(e===Ji.GZipJS&&n>=1024)try{var s=zi(function(t,i){if(qi)return qi.encode(t);for(var e=t.length,r=new ai(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 ai(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 Ii(r,0,n)}(r),{mtime:0}),o=new Blob([s],{type:Hi});if(o.size<.95*n)return{contentType:Hi,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:r,estimatedSize:n}}},Ki=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var r=Xi(t);if(r){var{contentType:n,body:s,estimatedSize:o}=r,a=t.compression===Ji.GZipJS&&n===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,l=e({"Content-Type":n},t.headers||{}),h=new AbortController,u=t.timeout?setTimeout(()=>h.abort(),t.timeout):null;fetch(a,{method:t.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:h.signal}).then(function(){var e=i(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status)try{n.json=JSON.parse(r)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Xi(t);if(i){var{contentType:e,body:r}=i,n=t.compression===Ji.GZipJS&&e===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",n,!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(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Xi(t);if(i){var{contentType:e,body:r}=i;try{var n="string"==typeof r?new Blob([r],{type:e}):r,s=t.compression===Ji.GZipJS&&e===Hi?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,n)}catch(t){}}}}],Gi=t=>{var i,e=t.transport||"fetch",r=Ki.find(t=>t.name===e&&t.available)||Ki.find(t=>t.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));r.method(t)};class Qi{constructor(t,i){var e,r,n,s;this.rt=!0,this.nt=[],this.st=(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.ot=t}get length(){return this.nt.length}enqueue(t){this.nt.push(t),this.lt||this.ht()}unload(){if(this.ut(),0!==this.nt.length){var t=this.dt();for(var i in t){var r=t[i];this.ot(e({},r,{transport:"sendBeacon"}))}}}enable(){this.rt=!1,this.ht()}pause(){this.rt=!0,this.ut()}flush(){this.ut(),this.ct(),this.ht()}ht(){this.rt||(this.lt=setTimeout(()=>{this.ut(),this.ct(),this.nt.length>0&&this.ht()},this.st))}ut(){this.lt&&(clearTimeout(this.lt),this.lt=void 0)}ct(){if(0!==this.nt.length){var t=this.dt(),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.ot(r)}}}dt(){var t={};return this.nt.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.nt=[],t}}class Zi{constructor(t){this.ft=!1,this.gt=3e3,this.nt=[],this._t=!0,this.ot=t.sendRequest,this.wt=t.sendBeacon,x&&void 0!==C&&"onLine"in C&&(this._t=C.onLine,y(x,"online",()=>{this._t=!0,this.yt()}),y(x,"offline",()=>{this._t=!1}))}get length(){return this.nt.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,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.nt.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this._t||(n+=" (Browser is offline)"),console.warn(n),this.ft||(this.ft=!0,this.bt())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.ot(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}bt(){this.St&&clearTimeout(this.St),this.St=setTimeout(()=>{this._t&&this.nt.length>0&&this.yt(),this.nt.length>0?this.bt():this.ft=!1},this.gt)}yt(){var t=this,e=Date.now(),r=[],n=[];this.nt.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.nt=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.ot(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.St&&(clearTimeout(this.St),this.St=void 0),this.nt.forEach(t=>{var{request:i}=t;try{this.wt(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.nt=[]}}var Yi="vt_rate_limit";class te{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(Yi))&&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(Yi,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}var ie=Array.isArray;class ee{constructor(t){void 0===t&&(t={}),this.version="1.1.5",this.__loaded=!1,this.xt=!1,this.Tt=null,this.__request_queue=[],this.Ct=!1,this.Et=!1,this.configManager=new r(t);var i=this.configManager.getConfig();this.sessionManager=new U(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new Qt(i.persistence||"localStorage",i.cross_subdomain_cookie),this.webVitalsManager=new ii(i,this),this.rateLimiter=new te({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.It("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new Zi({sendRequest:t=>this.kt(t),sendBeacon:t=>this.Mt(t)}),this.requestQueue=new Qi(t=>this.$t(t),{flush_interval_ms:3e3})}init(t,i,e){var r;if(e&&e!==ne){var n=null!==(r=re[e])&&void 0!==r?r:new ee;return n._init(t,i,e),re[e]=n,re[ne][e]=n,n}return this._init(t,i,e)}_init(t,i,r){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(e({},i,{projectId:t||i.projectId,name:r})),this.__loaded=!0;var n=this.configManager.getConfig();return this.userManager.set_initial_person_info(n.mask_personal_data_properties,n.custom_personal_data_properties),this.historyAutocapture=new ri(this),this.historyAutocapture.startIfEnabled(),this.Rt(),this.Ot(),this.Pt(),this.At(),!1!==n.capture_pageview&&this.Dt(),this}At(){this.requestQueue.enable()}Pt(){if(x){var t=()=>{this.requestQueue.unload(),this.retryQueue.unload()};y(x,"beforeunload",t),y(x,"pagehide",t)}}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:ne;return i!==ne&&(i=ne+"."+i),i}getCurrentDomain(){if(!I)return"";var t=I.protocol,i=I.hostname,e=I.port;return t+"//"+i+(e?":"+e:"")}Lt(){var t=this.configManager.getConfig();return!(!t.projectId||!t.token)||(this.Ct||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this.Ct=!0),!1)}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:r,token:n}=t;return i||(e?e+"/api/tracking?token="+n:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+n:"/api/tracking?token="+n)}sendRequest(t,i,e){if(this.Lt()){if(e&&void 0!==x)if(x.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:t,event:i});this.requestQueue.enqueue({url:t,event:i})}}$t(t){var{transport:i}=t;"sendBeacon"!==i?this.retryQueue.retriableRequest(t):this.Mt(t)}kt(t){return new Promise(i=>{var{url:e,events:r}=t,n=1===r.length?r[0]:{events:r},s=this.configManager.getConfig().disable_compression?Ji.None:Ji.GZipJS;Gi({url:e,data:n,method:"POST",transport:"XHR",compression:s,callback:t=>{i({statusCode:t.statusCode})}})})}Mt(t){var{url:i,events:e}=t,r=1===e.length?e[0]:{events:e},n=this.configManager.getConfig().disable_compression?Ji.None:Ji.GZipJS;Gi({url:i,data:r,method:"POST",transport:"sendBeacon",compression:n})}Ut(t){this.sendRequest(t.url,t.event,!1)}capture(t,i,r){if(this.sessionManager.setSessionId(),C&&C.userAgent&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(C.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var n=this.buildUrl(),s=Gt(),o=this.userManager.getUserProperties(),a=this.userManager.get_initial_props(),l=this.sessionManager.getSessionId(),h=this.sessionManager.getWindowId(),u=this.userManager.getAnonymousId(),d={};!this.Et&&Object.keys(a).length>0&&Object.assign(d,a),i.$set_once&&Object.assign(d,i.$set_once);var v=e({},s,o,{$session_id:l,$window_id:h},u?{$anon_distinct_id:u}:{},Object.keys(d).length>0?{$set_once:d}:{},i.$set?{$set:i.$set}:{},i);!this.Et&&Object.keys(a).length>0&&(this.Et=!0),"$pageview"===t&&E&&(v.title=E.title);var c,f,g=this.configManager.getConfig();if(!1!==g.stringifyPayload){if(c=Object.assign({},v,g.globalAttributes),!m(c=JSON.stringify(c)))return}else if(c=Object.assign({},v,g.globalAttributes),!m(JSON.stringify(c)))return;f="$identify"===t?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var p={timestamp:(new Date).toISOString(),event:t,project_id:g.projectId||"",payload:c,distinct_id:f,anonymous_id:u};this.sendRequest(n,p,!0)}}It(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}identify(t,i,e){if("number"==typeof t&&(t=String(t),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.userManager.isDistinctIdStringLikePublic(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 r=this.userManager.getDistinctId(),n=this.userManager.getAnonymousId(),s=this.userManager.getDeviceId(),o="anonymous"===this.userManager.getUserState();if(!s){var a=r||n;this.userManager.ensureDeviceId(a)}t!==r&&o?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(i,e),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n,$set:i||{},$set_once:e||{}}),this.userManager.setDistinctId(t)):i||e?(o&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(i,e),this.capture("$set",{$set:i||{},$set_once:e||{}})):t!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(t))}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){this.userManager.setUserProperties(t,i)&&this.capture("$set",{$set:t||{},$set_once:i||{}})}resetUser(t){this.sessionManager.resetSessionId(),this.userManager.reset(t)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(t,i){var e=this.userManager.createAlias(t,i);e?this.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(t)}Dt(){E&&("visible"===E.visibilityState?this.xt||(this.xt=!0,setTimeout(()=>{if(E&&I){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this.Tt&&(E.removeEventListener("visibilitychange",this.Tt),this.Tt=null)):this.Tt||(this.Tt=()=>{this.Dt()},y(E,"visibilitychange",this.Tt)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.userManager.getDistinctId()||this.userManager.getAnonymousId()}getAnonymousId(){return this.userManager.getAnonymousId()}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new U(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new Qt(i.persistence||"localStorage",i.cross_subdomain_cookie),this.webVitalsManager=new ii(i,this),this.sessionRecording&&i.session_recording&&this.sessionRecording.updateConfig(this.Bt(i))}Rt(){var t=this.configManager.getConfig();if(!t.disable_session_recording){var i=this.Bt(t);this.sessionRecording=new si(this,i),i.enabled&&this.sessionRecording.startIfEnabledOrStop("recording_initialized")}}Bt(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,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}}startSessionRecording(){if(!this.sessionRecording){var t=this.configManager.getConfig(),i=this.Bt(t);i.enabled=!0,this.sessionRecording=new si(this,i)}this.sessionRecording.startIfEnabledOrStop("recording_initialized")}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stopRecording()}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}Ot(){var t=this.configManager.getConfig();if(!t.disable_chat){var i=this.jt(t);this.chat=new Vi(this,i),this.chat.startIfEnabled()}}jt(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}}_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);if("function"==typeof this[i])try{this[i](...e)}catch(t){console.error("vTilt: Error executing queued call "+i+":",t)}}})}_dom_loaded(){this.__request_queue.forEach(t=>{this.Ut(t)}),this.__request_queue=[],this.At()}}var re={},ne="vt",se=!(void 0!==M||void 0!==k)&&-1===(null==R?void 0:R.indexOf("MSIE"))&&-1===(null==R?void 0:R.indexOf("Mozilla"));null!=x&&(x.__VTILT_ENQUEUE_REQUESTS=se);var oe,ae,le=function(){function t(){t.done||(t.done=!0,se=!1,null!=x&&(x.__VTILT_ENQUEUE_REQUESTS=!1),w(re,function(t){t._dom_loaded()}))}E&&"function"==typeof E.addEventListener?"complete"===E.readyState?t():y(E,"DOMContentLoaded",t,{capture:!1}):x&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(oe=re[ne]=new ee,(ae=O.vt)&&w(ae._i,function(t){if(t&&ie(t)){var i=oe.init(t[0],t[1],t[2]),e=ae[t[2]||"vt"]||ae;i&&i._execute_array(e)}}),O.vt=oe,le());var he=function(){var t=re[ne]=new ee;return le(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=Zt,exports.VTilt=ee,exports.default=he,exports.vt=he;
2
2
  //# sourceMappingURL=main.js.map