@v-tilt/browser 1.1.3 → 1.1.5

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.
@@ -28,7 +28,7 @@ interface VTiltConfig {
28
28
  name?: string;
29
29
  /** Project ID (set via init() first argument) */
30
30
  projectId?: string;
31
- /** Domain to track (auto-detected if not provided) */
31
+ /** Domain to track (auto-detected if not provided) - used in event properties */
32
32
  domain?: string;
33
33
  /** Storage method for session data */
34
34
  storage?: PersistenceMethod;
@@ -36,7 +36,12 @@ interface VTiltConfig {
36
36
  persistence?: PersistenceMethod;
37
37
  /** Persistence name prefix */
38
38
  persistence_name?: string;
39
- /** Enable cross-subdomain cookies */
39
+ /**
40
+ * Enable cross-subdomain cookies.
41
+ * When true, cookies are shared across subdomains (e.g., app.example.com and www.example.com).
42
+ * Auto-detects false for platforms like herokuapp.com, vercel.app, netlify.app.
43
+ * @default true (except for excluded platforms)
44
+ */
40
45
  cross_subdomain_cookie?: boolean;
41
46
  /**
42
47
  * Person profiles mode:
@@ -105,7 +110,6 @@ interface TrackingEvent {
105
110
  timestamp: string;
106
111
  event: string;
107
112
  project_id: string;
108
- domain: string;
109
113
  distinct_id: string;
110
114
  anonymous_id?: string;
111
115
  payload: EventPayload;
@@ -1,2 +1,2 @@
1
- function e(e,t,i,r,a,n,s){try{var o=e[n](s),u=o.value}catch(e){return void i(e)}o.done?t(u):Promise.resolve(u).then(r,a)}function t(t){return function(){var i=this,r=arguments;return new Promise(function(a,n){var s=t.apply(i,r);function o(t){e(s,a,n,o,u,"next",t)}function u(t){e(s,a,n,o,u,"throw",t)}o(void 0)})}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},i.apply(null,arguments)}class r{constructor(e){void 0===e&&(e={}),this.config=this.parseConfigFromScript(e)}parseConfigFromScript(e){if(!document.currentScript)return i({token:e.token||""},e);var t=document.currentScript,r=i({token:""},e);if(r.api_host=t.getAttribute("data-api-host")||t.getAttribute("data-host")||e.api_host,r.proxy=t.getAttribute("data-proxy")||e.proxy,r.proxyUrl=t.getAttribute("data-proxy-url")||e.proxyUrl,r.token=t.getAttribute("data-token")||e.token||"",r.projectId=t.getAttribute("data-project-id")||e.projectId||"",r.domain=t.getAttribute("data-domain")||e.domain,r.storage=t.getAttribute("data-storage")||e.storage,r.stringifyPayload="false"!==t.getAttribute("data-stringify-payload"),r.capture_performance="true"===t.getAttribute("data-capture-performance")||e.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 a of(r.globalAttributes=i({},e.globalAttributes),Array.from(t.attributes)))a.name.startsWith("data-vt-")&&(r.globalAttributes[a.name.slice(8).replace(/-/g,"_")]=a.value);return r}getConfig(){return i({},this.config)}updateConfig(e){this.config=i({},this.config,e)}}var a="__vt_session",n="__vt_window_id",s="__vt_primary_window",o="__vt_user_state",u="__vt_device_id",c="__vt_anonymous_id",l="__vt_distinct_id",d="__vt_user_properties",h="localStorage",g="localStorage+cookie",f="sessionStorage",p="memory",v="$initial_person_info",m={"Europe/Andorra":"AD","Asia/Dubai":"AE","Asia/Kabul":"AF","America/Antigua":"AG","America/Anguilla":"AI","Europe/Tirane":"AL","Asia/Yerevan":"AM","Africa/Luanda":"AO","Antarctica/Casey":"AQ","Antarctica/Davis":"AQ","Antarctica/DumontDUrville":"AQ","Antarctica/Mawson":"AQ","Antarctica/McMurdo":"AQ","Antarctica/Palmer":"AQ","Antarctica/Rothera":"AQ","Antarctica/Syowa":"AQ","Antarctica/Troll":"AQ","Antarctica/Vostok":"AQ","America/Argentina/Buenos_Aires":"AR","America/Argentina/Catamarca":"AR","America/Argentina/Cordoba":"AR","America/Argentina/Jujuy":"AR","America/Argentina/La_Rioja":"AR","America/Argentina/Mendoza":"AR","America/Argentina/Rio_Gallegos":"AR","America/Argentina/Salta":"AR","America/Argentina/San_Juan":"AR","America/Argentina/San_Luis":"AR","America/Argentina/Tucuman":"AR","America/Argentina/Ushuaia":"AR","Pacific/Pago_Pago":"AS","Europe/Vienna":"AT","Australia/Adelaide":"AU","Australia/Brisbane":"AU","Australia/Broken_Hill":"AU","Australia/Darwin":"AU","Australia/Eucla":"AU","Australia/Hobart":"AU","Australia/Lindeman":"AU","Australia/Lord_Howe":"AU","Australia/Melbourne":"AU","Australia/Perth":"AU","Australia/Sydney":"AU","America/Aruba":"AW","Europe/Mariehamn":"AX","Asia/Baku":"AZ","Europe/Sarajevo":"BA","America/Barbados":"BB","Asia/Dhaka":"BD","Europe/Brussels":"BE","Africa/Ouagadougou":"BF","Europe/Sofia":"BG","Asia/Bahrain":"BH","Africa/Bujumbura":"BI","Africa/Porto-Novo":"BJ","America/St_Barthelemy":"BL","Atlantic/Bermuda":"BM","Asia/Brunei":"BN","America/La_Paz":"BO","America/Kralendijk":"BQ","America/Araguaina":"BR","America/Bahia":"BR","America/Belem":"BR","America/Boa_Vista":"BR","America/Campo_Grande":"BR","America/Cuiaba":"BR","America/Eirunepe":"BR","America/Fortaleza":"BR","America/Maceio":"BR","America/Manaus":"BR","America/Noronha":"BR","America/Porto_Velho":"BR","America/Recife":"BR","America/Rio_Branco":"BR","America/Santarem":"BR","America/Sao_Paulo":"BR","America/Nassau":"BS","Asia/Thimphu":"BT","Africa/Gaborone":"BW","Europe/Minsk":"BY","America/Belize":"BZ","America/Atikokan":"CA","America/Blanc-Sablon":"CA","America/Cambridge_Bay":"CA","America/Creston":"CA","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Edmonton":"CA","America/Fort_Nelson":"CA","America/Glace_Bay":"CA","America/Goose_Bay":"CA","America/Halifax":"CA","America/Inuvik":"CA","America/Iqaluit":"CA","America/Moncton":"CA","America/Nipigon":"CA","America/Pangnirtung":"CA","America/Rainy_River":"CA","America/Rankin_Inlet":"CA","America/Regina":"CA","America/Resolute":"CA","America/St_Johns":"CA","America/Swift_Current":"CA","America/Thunder_Bay":"CA","America/Toronto":"CA","America/Vancouver":"CA","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yellowknife":"CA","Indian/Cocos":"CC","Africa/Kinshasa":"CD","Africa/Lubumbashi":"CD","Africa/Bangui":"CF","Africa/Brazzaville":"CG","Europe/Zurich":"CH","Africa/Abidjan":"CI","Pacific/Rarotonga":"CK","America/Punta_Arenas":"CL","America/Santiago":"CL","Pacific/Easter":"CL","Africa/Douala":"CM","Asia/Shanghai":"CN","Asia/Urumqi":"CN","America/Bogota":"CO","America/Costa_Rica":"CR","America/Havana":"CU","Atlantic/Cape_Verde":"CV","America/Curacao":"CW","Indian/Christmas":"CX","Asia/Famagusta":"CY","Asia/Nicosia":"CY","Europe/Prague":"CZ","Europe/Berlin":"DE","Europe/Busingen":"DE","Africa/Djibouti":"DJ","Europe/Copenhagen":"DK","America/Dominica":"DM","America/Santo_Domingo":"DO","Africa/Algiers":"DZ","America/Guayaquil":"EC","Pacific/Galapagos":"EC","Europe/Tallinn":"EE","Africa/Cairo":"EG","Africa/El_Aaiun":"EH","Africa/Asmara":"ER","Africa/Ceuta":"ES","Atlantic/Canary":"ES","Europe/Madrid":"ES","Africa/Addis_Ababa":"ET","Europe/Helsinki":"FI","Pacific/Fiji":"FJ","Atlantic/Stanley":"FK","Pacific/Chuuk":"FM","Pacific/Kosrae":"FM","Pacific/Pohnpei":"FM","Atlantic/Faroe":"FO","Europe/Paris":"FR","Africa/Libreville":"GA","Europe/London":"GB","America/Grenada":"GD","Asia/Tbilisi":"GE","America/Cayenne":"GF","Europe/Guernsey":"GG","Africa/Accra":"GH","Europe/Gibraltar":"GI","America/Danmarkshavn":"GL","America/Nuuk":"GL","America/Scoresbysund":"GL","America/Thule":"GL","Africa/Banjul":"GM","Africa/Conakry":"GN","America/Guadeloupe":"GP","Africa/Malabo":"GQ","Europe/Athens":"GR","Atlantic/South_Georgia":"GS","America/Guatemala":"GT","Pacific/Guam":"GU","Africa/Bissau":"GW","America/Guyana":"GY","Asia/Hong_Kong":"HK","America/Tegucigalpa":"HN","Europe/Zagreb":"HR","America/Port-au-Prince":"HT","Europe/Budapest":"HU","Asia/Jakarta":"ID","Asia/Jayapura":"ID","Asia/Makassar":"ID","Asia/Pontianak":"ID","Europe/Dublin":"IE","Asia/Jerusalem":"IL","Europe/Isle_of_Man":"IM","Asia/Kolkata":"IN","Indian/Chagos":"IO","Asia/Baghdad":"IQ","Asia/Tehran":"IR","Atlantic/Reykjavik":"IS","Europe/Rome":"IT","Europe/Jersey":"JE","America/Jamaica":"JM","Asia/Amman":"JO","Asia/Tokyo":"JP","Africa/Nairobi":"KE","Asia/Bishkek":"KG","Asia/Phnom_Penh":"KH","Pacific/Enderbury":"KI","Pacific/Kiritimati":"KI","Pacific/Tarawa":"KI","Indian/Comoro":"KM","America/St_Kitts":"KN","Asia/Pyongyang":"KP","Asia/Seoul":"KR","Asia/Kuwait":"KW","America/Cayman":"KY","Asia/Almaty":"KZ","Asia/Aqtau":"KZ","Asia/Aqtobe":"KZ","Asia/Atyrau":"KZ","Asia/Oral":"KZ","Asia/Qostanay":"KZ","Asia/Qyzylorda":"KZ","Asia/Vientiane":"LA","Asia/Beirut":"LB","America/St_Lucia":"LC","Europe/Vaduz":"LI","Asia/Colombo":"LK","Africa/Monrovia":"LR","Africa/Maseru":"LS","Europe/Vilnius":"LT","Europe/Luxembourg":"LU","Europe/Riga":"LV","Africa/Tripoli":"LY","Africa/Casablanca":"MA","Europe/Monaco":"MC","Europe/Chisinau":"MD","Europe/Podgorica":"ME","America/Marigot":"MF","Indian/Antananarivo":"MG","Pacific/Kwajalein":"MH","Pacific/Majuro":"MH","Europe/Skopje":"MK","Africa/Bamako":"ML","Asia/Yangon":"MM","Asia/Choibalsan":"MN","Asia/Hovd":"MN","Asia/Ulaanbaatar":"MN","Asia/Macau":"MO","Pacific/Saipan":"MP","America/Martinique":"MQ","Africa/Nouakchott":"MR","America/Montserrat":"MS","Europe/Malta":"MT","Indian/Mauritius":"MU","Indian/Maldives":"MV","Africa/Blantyre":"MW","America/Bahia_Banderas":"MX","America/Cancun":"MX","America/Chihuahua":"MX","America/Hermosillo":"MX","America/Matamoros":"MX","America/Mazatlan":"MX","America/Merida":"MX","America/Mexico_City":"MX","America/Monterrey":"MX","America/Ojinaga":"MX","America/Tijuana":"MX","Asia/Kuala_Lumpur":"MY","Asia/Kuching":"MY","Africa/Maputo":"MZ","Africa/Windhoek":"NA","Pacific/Noumea":"NC","Africa/Niamey":"NE","Pacific/Norfolk":"NF","Africa/Lagos":"NG","America/Managua":"NI","Europe/Amsterdam":"NL","Europe/Oslo":"NO","Asia/Kathmandu":"NP","Pacific/Nauru":"NR","Pacific/Niue":"NU","Pacific/Auckland":"NZ","Pacific/Chatham":"NZ","Asia/Muscat":"OM","America/Panama":"PA","America/Lima":"PE","Pacific/Gambier":"PF","Pacific/Marquesas":"PF","Pacific/Tahiti":"PF","Pacific/Bougainville":"PG","Pacific/Port_Moresby":"PG","Asia/Manila":"PH","Asia/Karachi":"PK","Europe/Warsaw":"PL","America/Miquelon":"PM","Pacific/Pitcairn":"PN","America/Puerto_Rico":"PR","Asia/Gaza":"PS","Asia/Hebron":"PS","Atlantic/Azores":"PT","Atlantic/Madeira":"PT","Europe/Lisbon":"PT","Pacific/Palau":"PW","America/Asuncion":"PY","Asia/Qatar":"QA","Indian/Reunion":"RE","Europe/Bucharest":"RO","Europe/Belgrade":"RS","Asia/Anadyr":"RU","Asia/Barnaul":"RU","Asia/Chita":"RU","Asia/Irkutsk":"RU","Asia/Kamchatka":"RU","Asia/Khandyga":"RU","Asia/Krasnoyarsk":"RU","Asia/Magadan":"RU","Asia/Novokuznetsk":"RU","Asia/Novosibirsk":"RU","Asia/Omsk":"RU","Asia/Sakhalin":"RU","Asia/Srednekolymsk":"RU","Asia/Tomsk":"RU","Asia/Ust-Nera":"RU","Asia/Vladivostok":"RU","Asia/Yakutsk":"RU","Asia/Yekaterinburg":"RU","Europe/Astrakhan":"RU","Europe/Kaliningrad":"RU","Europe/Kirov":"RU","Europe/Moscow":"RU","Europe/Samara":"RU","Europe/Saratov":"RU","Europe/Ulyanovsk":"RU","Europe/Volgograd":"RU","Africa/Kigali":"RW","Asia/Riyadh":"SA","Pacific/Guadalcanal":"SB","Indian/Mahe":"SC","Africa/Khartoum":"SD","Europe/Stockholm":"SE","Asia/Singapore":"SG","Atlantic/St_Helena":"SH","Europe/Ljubljana":"SI","Arctic/Longyearbyen":"SJ","Europe/Bratislava":"SK","Africa/Freetown":"SL","Europe/San_Marino":"SM","Africa/Dakar":"SN","Africa/Mogadishu":"SO","America/Paramaribo":"SR","Africa/Juba":"SS","Africa/Sao_Tome":"ST","America/El_Salvador":"SV","America/Lower_Princes":"SX","Asia/Damascus":"SY","Africa/Mbabane":"SZ","America/Grand_Turk":"TC","Africa/Ndjamena":"TD","Indian/Kerguelen":"TF","Africa/Lome":"TG","Asia/Bangkok":"TH","Asia/Dushanbe":"TJ","Pacific/Fakaofo":"TK","Asia/Dili":"TL","Asia/Ashgabat":"TM","Africa/Tunis":"TN","Pacific/Tongatapu":"TO","Europe/Istanbul":"TR","America/Port_of_Spain":"TT","Pacific/Funafuti":"TV","Asia/Taipei":"TW","Africa/Dar_es_Salaam":"TZ","Europe/Kiev":"UA","Europe/Simferopol":"UA","Europe/Uzhgorod":"UA","Europe/Zaporozhye":"UA","Africa/Kampala":"UG","Pacific/Midway":"UM","Pacific/Wake":"UM","America/Adak":"US","America/Anchorage":"US","America/Boise":"US","America/Chicago":"US","America/Denver":"US","America/Detroit":"US","America/Indiana/Indianapolis":"US","America/Indiana/Knox":"US","America/Indiana/Marengo":"US","America/Indiana/Petersburg":"US","America/Indiana/Tell_City":"US","America/Indiana/Vevay":"US","America/Indiana/Vincennes":"US","America/Indiana/Winamac":"US","America/Juneau":"US","America/Kentucky/Louisville":"US","America/Kentucky/Monticello":"US","America/Los_Angeles":"US","America/Menominee":"US","America/Metlakatla":"US","America/New_York":"US","America/Nome":"US","America/North_Dakota/Beulah":"US","America/North_Dakota/Center":"US","America/North_Dakota/New_Salem":"US","America/Phoenix":"US","America/Sitka":"US","America/Yakutat":"US","Pacific/Honolulu":"US","America/Montevideo":"UY","Asia/Samarkand":"UZ","Asia/Tashkent":"UZ","Europe/Vatican":"VA","America/St_Vincent":"VC","America/Caracas":"VE","America/Tortola":"VG","America/St_Thomas":"VI","Asia/Ho_Chi_Minh":"VN","Pacific/Efate":"VU","Pacific/Wallis":"WF","Pacific/Apia":"WS","Asia/Aden":"YE","Indian/Mayotte":"YT","Africa/Johannesburg":"ZA","Africa/Lusaka":"ZM","Africa/Harare":"ZW"};function _(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function A(e){return!(!e||"string"!=typeof e)&&!(e.length<2||e.length>10240)}function y(e,t,i){if(e)if(Array.isArray(e))e.forEach((e,r)=>{t.call(i,e,r)});else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(i,e[r],r)}function S(e,t,i,r){var{capture:a=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:a,passive:n})}function w(e,t){if(!t)return e;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function I(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a of i)for(var n of a)e.push(n);return e}var b="undefined"!=typeof window?window:void 0,M="undefined"!=typeof globalThis?globalThis:b,E=null==M?void 0:M.navigator,P=null==M?void 0:M.document,C=null==M?void 0:M.location,R=null==M?void 0:M.fetch,T=(null==M?void 0:M.XMLHttpRequest)&&"withCredentials"in new M.XMLHttpRequest?M.XMLHttpRequest:void 0;null==M||M.AbortController;var k=null==E?void 0:E.userAgent,U=31536e3;class L{constructor(e){var t;this.memoryStorage=new Map,this.method=e.method,this.domain=e.domain,this.sameSite=e.sameSite||"Lax",this.secure=null!==(t=e.secure)&&void 0!==t?t:"undefined"!=typeof location&&"https:"===location.protocol}get(e){var t;try{if(this.method===p)return null!==(t=this.memoryStorage.get(e))&&void 0!==t?t:null;if(this.usesLocalStorage()){var i=localStorage.getItem(e);return null!==i?i:this.method===g?this.getCookie(e):null}return this.usesSessionStorage()?sessionStorage.getItem(e):this.getCookie(e)}catch(t){return console.warn('[StorageManager] Failed to get "'+e+'":',t),null}}set(e,t,i){try{if(this.method===p)return void this.memoryStorage.set(e,t);if(this.usesLocalStorage())return localStorage.setItem(e,t),void(this.method===g&&this.setCookie(e,t,i||U));if(this.usesSessionStorage())return void sessionStorage.setItem(e,t);this.setCookie(e,t,i||U)}catch(t){console.warn('[StorageManager] Failed to set "'+e+'":',t)}}remove(e){try{if(this.method===p)return void this.memoryStorage.delete(e);if(this.usesLocalStorage())return localStorage.removeItem(e),void(this.method===g&&this.removeCookie(e));if(this.usesSessionStorage())return void sessionStorage.removeItem(e);this.removeCookie(e)}catch(t){console.warn('[StorageManager] Failed to remove "'+e+'":',t)}}getWithExpiry(e){var t=this.get(e);if(!t)return null;try{var i=JSON.parse(t);return i.expiry&&Date.now()>i.expiry?(this.remove(e),null):i.value}catch(e){return null}}setWithExpiry(e,t,r){var a=i({value:t},r?{expiry:Date.now()+r}:{});this.set(e,JSON.stringify(a))}getJSON(e){var t=this.get(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}setJSON(e,t,i){this.set(e,JSON.stringify(t),i)}getCookie(e){if("undefined"==typeof document)return null;var t=document.cookie.split(";");for(var i of t){var[r,...a]=i.trim().split("=");if(r===e){var n=a.join("=");try{return decodeURIComponent(n)}catch(e){return n}}}return null}setCookie(e,t,i){if("undefined"!=typeof document){var r=e+"="+encodeURIComponent(t);r+="; Max-Age="+i,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure"),this.domain&&(r+="; domain="+this.domain),document.cookie=r}}removeCookie(e){if("undefined"!=typeof document){var t=e+"=; Max-Age=0; path=/";this.domain&&(t+="; domain="+this.domain),document.cookie=t,document.cookie=e+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===h||this.method===g}usesSessionStorage(){return this.method===f}canUseSessionStorage(){if(void 0===b||!(null==b?void 0:b.sessionStorage))return!1;try{var e="__vt_storage_test__";return b.sessionStorage.setItem(e,"test"),b.sessionStorage.removeItem(e),!0}catch(e){return!1}}getSessionStorage(){var e;return this.canUseSessionStorage()&&null!==(e=null==b?void 0:b.sessionStorage)&&void 0!==e?e:null}setMethod(e){this.method=e}getMethod(){return this.method}}class B{constructor(e,t){void 0===e&&(e="cookie"),this.storage=new L({method:e,domain:t,sameSite:"Lax"}),this._windowId=void 0,this._initializeWindowId()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=_(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||_();return this._storeSessionId(e),e}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(_())}_getSessionIdRaw(){var e=this.storage.getWithExpiry(a);if(e)return e;var t=this.storage.get(a);if(t)try{var i=JSON.parse(t);return"object"==typeof i&&null!==i&&"value"in i?i.expiry&&Date.now()>i.expiry?(this.storage.remove(a),null):i.value:t}catch(e){return t}return null}_storeSessionId(e){this.storage.setWithExpiry(e,e,18e5),this.storage.set(a,e,1800)}_clearSessionId(){this.storage.remove(a)}getWindowId(){if(this._windowId)return this._windowId;var e=this.storage.getSessionStorage();if(e){var t=e.getItem(n);if(t)return this._windowId=t,t}var i=_();return this._setWindowId(i),i}_setWindowId(e){if(e!==this._windowId){this._windowId=e;var t=this.storage.getSessionStorage();t&&t.setItem(n,e)}}_initializeWindowId(){var e=this.storage.getSessionStorage();if(e){var t=e.getItem(s),i=e.getItem(n);i&&!t?this._windowId=i:(i&&e.removeItem(n),this._setWindowId(_())),e.setItem(s,"true"),this._listenToUnload()}else this._windowId=_()}_listenToUnload(){var e=this.storage.getSessionStorage();b&&e&&S(b,"beforeunload",()=>{var e=this.storage.getSessionStorage();e&&e.removeItem(s)},{capture:!1})}updateStorageMethod(e,t){this.storage=new L({method:e,domain:t,sameSite:"Lax"})}}function x(e){if(!P)return null;var t=P.createElement("a");return t.href=e,t}function O(e,t){for(var i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var a=i[r].split("=");if(a[0]===t){if(a.length<2)return"";var n=a[1];try{n=decodeURIComponent(n)}catch(e){}return n.replace(/\+/g," ")}}return""}function D(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",n=r[1],s=a.split("?"),o=s[1],u=s[0],c=(o||"").split("&"),l=[],d=0;d<c.length;d++){var h=c[d].split("="),g=h[0],f=h.slice(1).join("=");-1!==t.indexOf(g)?l.push(g+"="+i):g&&l.push(g+(f?"="+f:""))}var p=l.join("&");return u+(p?"?"+p:"")+(n?"#"+n:"")}function q(e){return"function"==typeof e}var N="Mobile",$="iOS",K="Android",G="Tablet",j=K+" "+G,V="iPad",F="Apple",W=F+" Watch",H="Safari",J="BlackBerry",z="Samsung",Q=z+"Browser",Z=z+" Internet",X="Chrome",Y=X+" OS",ee=X+" "+$,te="Internet Explorer",ie=te+" "+N,re="Opera",ae=re+" Mini",ne="Edge",se="Microsoft "+ne,oe="Firefox",ue=oe+" "+$,ce="Nintendo",le="PlayStation",de="Xbox",he=K+" "+N,ge=N+" "+H,fe="Windows",pe=fe+" Phone",ve="Nokia",me="Ouya",_e="Generic",Ae=_e+" "+N.toLowerCase(),ye=_e+" "+G.toLowerCase(),Se="Konqueror",we="(\\d+(\\.\\d+)?)",Ie=new RegExp("Version/"+we),be=new RegExp(de,"i"),Me=new RegExp(le+" \\w+","i"),Ee=new RegExp(ce+" \\w+","i"),Pe=new RegExp(J+"|PlayBook|BB10","i"),Ce={"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 Re(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Te=(e,t)=>t&&Re(t,F)||function(e){return Re(e,H)&&!Re(e,X)&&!Re(e,K)}(e),ke=function(e,t){return t=t||"",Re(e," OPR/")&&Re(e,"Mini")?ae:Re(e," OPR/")?re:Pe.test(e)?J:Re(e,"IE"+N)||Re(e,"WPDesktop")?ie:Re(e,Q)?Z:Re(e,ne)||Re(e,"Edg/")?se:Re(e,"FBIOS")?"Facebook "+N:Re(e,"UCWEB")||Re(e,"UCBrowser")?"UC Browser":Re(e,"CriOS")?ee:Re(e,"CrMo")||Re(e,X)?X:Re(e,K)&&Re(e,H)?he:Re(e,"FxiOS")?ue:Re(e.toLowerCase(),Se.toLowerCase())?Se:Te(e,t)?Re(e,N)?ge:H:Re(e,oe)?oe:Re(e,"MSIE")||Re(e,"Trident/")?te:Re(e,"Gecko")?oe:""},Ue={[ie]:[new RegExp("rv:"+we)],[se]:[new RegExp(ne+"?\\/"+we)],[X]:[new RegExp("("+X+"|CrMo)\\/"+we)],[ee]:[new RegExp("CriOS\\/"+we)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+we)],[H]:[Ie],[ge]:[Ie],[re]:[new RegExp("(Opera|OPR)\\/"+we)],[oe]:[new RegExp(oe+"\\/"+we)],[ue]:[new RegExp("FxiOS\\/"+we)],[Se]:[new RegExp("Konqueror[:/]?"+we,"i")],[J]:[new RegExp(J+" "+we),Ie],[he]:[new RegExp("android\\s"+we,"i")],[Z]:[new RegExp(Q+"\\/"+we)],[te]:[new RegExp("(rv:|MSIE )"+we)],Mozilla:[new RegExp("rv:"+we)]},Le=function(e,t){var i=ke(e,t),r=Ue[i];if(void 0===r)return null;for(var a=0;a<r.length;a++){var n=r[a],s=e.match(n);if(s)return parseFloat(s[s.length-2])}return null},Be=[[new RegExp(de+"; "+de+" (.*?)[);]","i"),e=>[de,e&&e[1]||""]],[new RegExp(ce,"i"),[ce,""]],[new RegExp(le,"i"),[le,""]],[Pe,[J,""]],[new RegExp(fe,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pe,""];if(new RegExp(N).test(t)&&!/IEMobile\b/.test(t))return[fe+" "+N,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],a=Ce[r]||"";return/arm/i.test(t)&&(a="RT"),[fe,a]}return[fe,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[$,t.join(".")]}return[$,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=void 0===e[2]?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+K+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+K+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[K,t.join(".")]}return[K,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Y,""]],[/Linux|debian/i,["Linux",""]]],xe=function(e){return Ee.test(e)?ce:Me.test(e)?le:be.test(e)?de:new RegExp(me,"i").test(e)?me:new RegExp("("+pe+"|WPDesktop)","i").test(e)?pe:/iPad/.test(e)?V:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?W:Pe.test(e)?J:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ve,"i").test(e)?ve:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(N).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?K:j:K:new RegExp("(pda|"+N+")","i").test(e)?Ae:new RegExp(G,"i").test(e)&&!new RegExp(G+" pc","i").test(e)?ye:""},Oe="https?://(.*)",De=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],qe=I(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],De),Ne="<masked>";function $e(e){var t=function(e){return e?0===e.search(Oe+"google.([^/?]*)")?"google":0===e.search(Oe+"bing.com")?"bing":0===e.search(Oe+"yahoo.com")?"yahoo":0===e.search(Oe+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var a=P?O(P.referrer,i):"";a.length&&(r.ph_keyword=a)}return r}function Ke(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Ge(){return(null==P?void 0:P.referrer)||"$direct"}function je(){var e;return(null==P?void 0:P.referrer)&&(null===(e=x(P.referrer))||void 0===e?void 0:e.host)||"$direct"}function Ve(e){var t,{r:i,u:r}=e,a={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=x(i))||void 0===t?void 0:t.host};if(r){a.$current_url=r;var n=x(r);a.$host=null==n?void 0:n.host,a.$pathname=null==n?void 0:n.pathname;var s=function(e){var t=qe.concat([]),i={};return y(t,function(t){var r=O(e,t);i[t]=r||null}),i}(r);w(a,s)}i&&w(a,$e(i));return a}function Fe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function We(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function He(e,t){if(!k)return{};var i,r,a,[n,s]=function(e){for(var t=0;t<Be.length;t++){var[i,r]=Be[t],a=i.exec(e),n=a&&(q(r)?r(a,e):r);if(n)return n}return["",""]}(k);return w(function(e){var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];null!=r&&""!==r&&(t[i]=r)}return t}({$os:n,$os_version:s,$browser:ke(k,navigator.vendor),$device:xe(k),$device_type:(r=k,a=xe(r),a===V||a===j||"Kobo"===a||"Kindle Fire"===a||a===ye?G:a===ce||a===de||a===le||a===me?"Console":a===W?"Wearable":a?N:"Desktop"),$timezone:Fe(),$timezone_offset:We()}),{$current_url:D(null==C?void 0:C.href,[],Ne),$host:null==C?void 0:C.host,$pathname:null==C?void 0:C.pathname,$raw_user_agent:k.length>1e3?k.substring(0,997)+"...":k,$browser_version:Le(k,navigator.vendor),$browser_language:Ke(),$browser_language_prefix:(i=Ke(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==b?void 0:b.screen.height,$screen_width:null==b?void 0:b.screen.width,$viewport_height:null==b?void 0:b.innerHeight,$viewport_width:null==b?void 0:b.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 Je{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storage=new L({method:e,domain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return i({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(c,this.userIdentity.anonymous_id,U)),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(e,t,r){if("number"==typeof e&&(e=e.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.")),e)if(this.isDistinctIdStringLike(e))console.error('The string "'+e+'" 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"!==e){var a=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=e,!this.userIdentity.device_id){var n=a||this.userIdentity.anonymous_id;this.userIdentity.device_id=n,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:n})}e!==a&&(this.userIdentity.distinct_id=e);var s="anonymous"===this.userIdentity.user_state;e!==a&&s?(this.userIdentity.user_state="identified",t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):t||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):e!==a&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+e+'" 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(e,t){if(!e&&!t)return!1;var r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,a=this.getPersonPropertiesHash(r,e,t);return this._cachedPersonProperties===a?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity(),this._cachedPersonProperties=a,!0)}reset(e){var t=this.generateAnonymousId(),r=this.userIdentity.device_id,a=e?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:t,device_id:a,properties:{},user_state:"anonymous"},this._cachedPersonProperties=null,this.saveUserIdentity(),this.userIdentity.properties=i({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(e){this.userIdentity.distinct_id=e,this.saveUserIdentity()}setUserState(e){this.userIdentity.user_state=e,this.saveUserIdentity()}updateUserProperties(e,t){e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity()}ensureDeviceId(e){this.userIdentity.device_id||(this.userIdentity.device_id=e,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:e}),this.saveUserIdentity())}createAlias(e,t){return this.isValidDistinctId(e)?(void 0===t&&(t=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(t)?e===t?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:e,original:t}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[v]){var i=function(e,t){var i=e?I([],De,t||[]):[],r=null==C?void 0:C.href.substring(0,1e3);return{r:Ge().substring(0,1e3),u:r?D(r,i,Ne):void 0}}(e,t);this.register_once({[v]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[v];return i?(e=Ve(i),t={},y(e,function(e,i){var r;t["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=e}),t):{}}update_referrer_info(){var e={$referrer:Ge(),$referring_domain:je()};this.register_once(e,void 0)}loadUserIdentity(){var e=this.storage.get(c)||this.generateAnonymousId(),t=this.storage.get(l)||null,i=this.storage.get(u)||this.generateDeviceId(),r=this.getStoredUserProperties(),a=this.storage.get(o)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:a}}saveUserIdentity(){this.storage.set(c,this.userIdentity.anonymous_id,U),this.storage.set(u,this.userIdentity.device_id,U),this.storage.set(o,this.userIdentity.user_state,U),this.userIdentity.distinct_id?this.storage.set(l,this.userIdentity.distinct_id,U):this.storage.remove(l),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(d)||{}}setStoredUserProperties(e){this.storage.setJSON(d,e,U)}register_once(e,t){var i=this.getStoredUserProperties(),r=!1;for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(a in i||(i[a]=e[a],r=!0));if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in i||(i[n]=t[n],r=!0));r&&this.setStoredUserProperties(i)}generateAnonymousId(){return"anon_"+_()}generateDeviceId(){return"device_"+_()}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}isValidDistinctId(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(t)&&0!==e.trim().length}isDistinctIdStringLike(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(t)}updateStorageMethod(e,t){this.storage=new L({method:e,domain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}class ze{constructor(e,t){if(this.instance=t,e.capture_performance&&b)try{this.webVitals=require("web-vitals"),this.initializeWebVitals()}catch(e){console.warn("web-vitals library not found. Please install it to enable web vitals tracking.",e)}}initializeWebVitals(){if(this.webVitals){var e=e=>{try{if(!(b&&P&&E&&C))return;var{country:t,locale:i}=function(){var e,t;if(!E)return{country:e,locale:t};try{var i=Intl.DateTimeFormat().resolvedOptions().timeZone;e=m[i],t=E.languages&&E.languages.length?E.languages[0]:E.userLanguage||E.language||E.browserLanguage||"en"}catch(e){}return{country:e,locale:t}}();this.instance.capture("web_vital",{name:e.name,value:e.value,delta:e.delta,rating:e.rating,id:e.id,navigationType:e.navigationType,pathname:C.pathname,href:C.href,"user-agent":E.userAgent,locale:i,location:t,referrer:P.referrer})}catch(e){console.error("Error sending web vital:",e)}};this.webVitals.onCLS&&this.webVitals.onCLS(e),this.webVitals.onFCP&&this.webVitals.onFCP(e),this.webVitals.onLCP&&this.webVitals.onLCP(e),this.webVitals.onTTFB&&this.webVitals.onTTFB(e),this.webVitals.onINP&&this.webVitals.onINP(e)}}}function Qe(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],a=i(r);return q(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class Ze{constructor(e){var t;this._instance=e,this._lastPathname=(null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0}monitorHistoryChanges(){var e,t;if(b&&C&&(this._lastPathname=C.pathname||"",b.history)){var i=this;(null===(e=b.history.pushState)||void 0===e?void 0:e.__vtilt_wrapped__)||Qe(b.history,"pushState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("pushState")}),(null===(t=b.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||Qe(b.history,"replaceState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("replaceState")}),this._setupPopstateListener()}}_capturePageview(e){var t;try{var i=null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname;if(!i||!C||!P)return;if(i!==this._lastPathname&&this.isEnabled){var r={navigation_type:e};this._instance.capture("$pageview",r)}this._lastPathname=i}catch(t){console.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener&&b){var e=()=>{this._capturePageview("popstate")};S(b,"popstate",e),this._popstateListener=()=>{b&&b.removeEventListener("popstate",e)}}}}var Xe=Uint8Array,Ye=Uint16Array,et=Int32Array,tt=new Xe([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]),it=new Xe([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]),rt=new Xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),at=function(e,t){for(var i=new Ye(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var a=new et(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)a[n]=n-i[r]<<5|r;return{b:i,r:a}},nt=at(tt,2),st=nt.b,ot=nt.r;st[28]=258,ot[258]=28;for(var ut=at(it,0).r,ct=new Ye(32768),lt=0;lt<32768;++lt){var dt=(43690&lt)>>1|(21845&lt)<<1;dt=(61680&(dt=(52428&dt)>>2|(13107&dt)<<2))>>4|(3855&dt)<<4,ct[lt]=((65280&dt)>>8|(255&dt)<<8)>>1}var ht=function(e,t,i){for(var r=e.length,a=0,n=new Ye(t);a<r;++a)e[a]&&++n[e[a]-1];var s,o=new Ye(t);for(a=1;a<t;++a)o[a]=o[a-1]+n[a-1]<<1;if(i){s=new Ye(1<<t);var u=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],l=t-e[a],d=o[e[a]-1]++<<l,h=d|(1<<l)-1;d<=h;++d)s[ct[d]>>u]=c}else for(s=new Ye(r),a=0;a<r;++a)e[a]&&(s[a]=ct[o[e[a]-1]++]>>15-e[a]);return s},gt=new Xe(288);for(lt=0;lt<144;++lt)gt[lt]=8;for(lt=144;lt<256;++lt)gt[lt]=9;for(lt=256;lt<280;++lt)gt[lt]=7;for(lt=280;lt<288;++lt)gt[lt]=8;var ft=new Xe(32);for(lt=0;lt<32;++lt)ft[lt]=5;var pt=ht(gt,9,0),vt=ht(ft,5,0),mt=function(e){return(e+7)/8|0},_t=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new Xe(e.subarray(t,i))},At=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},yt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8,e[r+2]|=i>>16},St=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var a=i.length,n=i.slice();if(!a)return{t:Ct,l:0};if(1==a){var s=new Xe(i[0].s+1);return s[i[0].s]=1,{t:s,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],u=i[1],c=0,l=1,d=2;for(i[0]={s:-1,f:o.f+u.f,l:o,r:u};l!=a-1;)o=i[i[c].f<i[d].f?c++:d++],u=i[c!=l&&i[c].f<i[d].f?c++:d++],i[l++]={s:-1,f:o.f+u.f,l:o,r:u};var h=n[0].s;for(r=1;r<a;++r)n[r].s>h&&(h=n[r].s);var g=new Ye(h+1),f=wt(i[l-1],g,0);if(f>t){r=0;var p=0,v=f-t,m=1<<v;for(n.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});r<a;++r){var _=n[r].s;if(!(g[_]>t))break;p+=m-(1<<f-g[_]),g[_]=t}for(p>>=v;p>0;){var A=n[r].s;g[A]<t?p-=1<<t-g[A]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;g[y]==t&&(--g[y],++p)}f=t}return{t:new Xe(g),l:f}},wt=function(e,t,i){return-1==e.s?Math.max(wt(e.l,t,i+1),wt(e.r,t,i+1)):t[e.s]=i},It=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ye(++t),r=0,a=e[0],n=1,s=function(e){i[r++]=e},o=1;o<=t;++o)if(e[o]==a&&o!=t)++n;else{if(!a&&n>2){for(;n>138;n-=138)s(32754);n>2&&(s(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(s(a),--n;n>6;n-=6)s(8304);n>2&&(s(n-3<<5|8208),n=0)}for(;n--;)s(a);n=1,a=e[o]}return{c:i.subarray(0,r),n:t}},bt=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Mt=function(e,t,i){var r=i.length,a=mt(t+2);e[a]=255&r,e[a+1]=r>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var n=0;n<r;++n)e[a+n+4]=i[n];return 8*(a+4+r)},Et=function(e,t,i,r,a,n,s,o,u,c,l){At(t,l++,i),++a[256];for(var d=St(a,15),h=d.t,g=d.l,f=St(n,15),p=f.t,v=f.l,m=It(h),_=m.c,A=m.n,y=It(p),S=y.c,w=y.n,I=new Ye(19),b=0;b<_.length;++b)++I[31&_[b]];for(b=0;b<S.length;++b)++I[31&S[b]];for(var M=St(I,7),E=M.t,P=M.l,C=19;C>4&&!E[rt[C-1]];--C);var R,T,k,U,L=c+5<<3,B=bt(a,gt)+bt(n,ft)+s,x=bt(a,h)+bt(n,p)+s+14+3*C+bt(I,E)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&L<=B&&L<=x)return Mt(t,l,e.subarray(u,u+c));if(At(t,l,1+(x<B)),l+=2,x<B){R=ht(h,g,0),T=h,k=ht(p,v,0),U=p;var O=ht(E,P,0);At(t,l,A-257),At(t,l+5,w-1),At(t,l+10,C-4),l+=14;for(b=0;b<C;++b)At(t,l+3*b,E[rt[b]]);l+=3*C;for(var D=[_,S],q=0;q<2;++q){var N=D[q];for(b=0;b<N.length;++b){var $=31&N[b];At(t,l,O[$]),l+=E[$],$>15&&(At(t,l,N[b]>>5&127),l+=N[b]>>12)}}}else R=pt,T=gt,k=vt,U=ft;for(b=0;b<o;++b){var K=r[b];if(K>255){yt(t,l,R[($=K>>18&31)+257]),l+=T[$+257],$>7&&(At(t,l,K>>23&31),l+=tt[$]);var G=31&K;yt(t,l,k[G]),l+=U[G],G>3&&(yt(t,l,K>>5&8191),l+=it[G])}else yt(t,l,R[K]),l+=T[K]}return yt(t,l,R[256]),l+T[256]},Pt=new et([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ct=new Xe(0),Rt=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),Tt=function(e,t,i,r,a){if(!a&&(a={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),s=new Xe(n.length+e.length);s.set(n),s.set(e,n.length),e=s,a.w=n.length}return function(e,t,i,r,a,n){var s=n.z||e.length,o=new Xe(r+s+5*(1+Math.ceil(s/7e3))+a),u=o.subarray(r,o.length-a),c=n.l,l=7&(n.r||0);if(t){l&&(u[0]=n.r>>3);for(var d=Pt[t-1],h=d>>13,g=8191&d,f=(1<<i)-1,p=n.p||new Ye(32768),v=n.h||new Ye(f+1),m=Math.ceil(i/3),_=2*m,A=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<_)&f},y=new et(25e3),S=new Ye(288),w=new Ye(32),I=0,b=0,M=n.i||0,E=0,P=n.w||0,C=0;M+2<s;++M){var R=A(M),T=32767&M,k=v[R];if(p[T]=k,v[R]=T,P<=M){var U=s-M;if((I>7e3||E>24576)&&(U>423||!c)){l=Et(e,u,0,y,S,w,b,E,C,M-C,l),E=I=b=0,C=M;for(var L=0;L<286;++L)S[L]=0;for(L=0;L<30;++L)w[L]=0}var B=2,x=0,O=g,D=T-k&32767;if(U>2&&R==A(M-D))for(var q=Math.min(h,U)-1,N=Math.min(32767,M),$=Math.min(258,U);D<=N&&--O&&T!=k;){if(e[M+B]==e[M+B-D]){for(var K=0;K<$&&e[M+K]==e[M+K-D];++K);if(K>B){if(B=K,x=D,K>q)break;var G=Math.min(D,K-2),j=0;for(L=0;L<G;++L){var V=M-D+L&32767,F=V-p[V]&32767;F>j&&(j=F,k=V)}}}D+=(T=k)-(k=p[T])&32767}if(x){y[E++]=268435456|ot[B]<<18|ut[x];var W=31&ot[B],H=31&ut[x];b+=tt[W]+it[H],++S[257+W],++w[H],P=M+B,++I}else y[E++]=e[M],++S[e[M]]}}for(M=Math.max(M,P);M<s;++M)y[E++]=e[M],++S[e[M]];l=Et(e,u,c,y,S,w,b,E,C,M-C,l),c||(n.r=7&l|u[l/8|0]<<3,l-=7,n.h=v,n.p=p,n.i=M,n.w=P)}else{for(M=n.w||0;M<s+c;M+=65535){var J=M+65535;J>=s&&(u[l/8|0]=c,J=s),l=Mt(u,l+1,e.subarray(M,J))}n.i=s}return _t(o,0,r+mt(l)+a)}(e,null==t.level?6:t.level,null==t.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,r,a)},kt=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Ut(e,t){t||(t={});var i=function(){var e=-1;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=Rt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var a,n=Tt(e,t,10+((a=t).filename?a.filename.length+1:0),8),s=n.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&kt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(n,t),kt(n,s-8,i.d()),kt(n,s-4,r),n}var Lt="undefined"!=typeof TextEncoder&&new TextEncoder,Bt="undefined"!=typeof TextDecoder&&new TextDecoder;try{Bt.decode(Ct,{stream:!0})}catch(e){}var xt,Ot="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(xt||(xt={}));var Dt=e=>{var{data:t,compression:i}=e;if(t){var r=(e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t))(t),a=new Blob([r]).size;if(i===xt.GZipJS&&a>=1024)try{var n=Ut(function(e,t){if(Lt)return Lt.encode(e);for(var i=e.length,r=new Xe(e.length+(e.length>>1)),a=0,n=function(e){r[a++]=e},s=0;s<i;++s){if(a+5>r.length){var o=new Xe(a+8+(i-s<<1));o.set(r),r=o}var u=e.charCodeAt(s);u<128||t?n(u):u<2048?(n(192|u>>6),n(128|63&u)):u>55295&&u<57344?(n(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>18),n(128|u>>12&63),n(128|u>>6&63),n(128|63&u)):(n(224|u>>12),n(128|u>>6&63),n(128|63&u))}return _t(r,0,a)}(r),{mtime:0}),s=new Blob([n],{type:Ot});if(s.size<.95*a)return{contentType:Ot,body:s,estimatedSize:s.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:a}}},qt=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var r=Dt(e);if(r){var{contentType:a,body:n,estimatedSize:s}=r,o=e.compression===xt.GZipJS&&a===Ot?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,u=i({"Content-Type":a},e.headers||{}),c=new AbortController,l=e.timeout?setTimeout(()=>c.abort(),e.timeout):null;fetch(o,{method:e.method||"POST",headers:u,body:n,keepalive:s<52428.8,signal:c.signal}).then(function(){var i=t(function*(t){var i,r=yield t.text(),a={statusCode:t.status,text:r};if(200===t.status)try{a.json=JSON.parse(r)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,a)});return function(e){return i.apply(this,arguments)}}()).catch(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=Dt(e);if(t){var{contentType:i,body:r}=t,a=e.compression===xt.GZipJS&&i===Ot?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,n=new XMLHttpRequest;n.open(e.method||"POST",a,!0),e.headers&&Object.entries(e.headers).forEach(e=>{var[t,i]=e;n.setRequestHeader(t,i)}),n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{var t;if(4===n.readyState){var i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},n.send(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Dt(e);if(t){var{contentType:i,body:r}=t;try{var a="string"==typeof r?new Blob([r],{type:i}):r,n=e.compression===xt.GZipJS&&i===Ot?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,a)}catch(e){}}}}],Nt=e=>{var t,i=e.transport||"fetch",r=qt.find(e=>e.name===i&&e.available)||qt.find(e=>e.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0}));r.method(e)};class $t{constructor(e,t){var i,r,a,n;this._isPaused=!0,this._queue=[],this._flushTimeoutMs=(i=(null==t?void 0:t.flush_interval_ms)||3e3,r=250,a=5e3,n=3e3,"number"!=typeof i||isNaN(i)?n:Math.min(Math.max(i,r),a)),this._sendRequest=e}get length(){return this._queue.length}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){if(this._clearFlushTimeout(),0!==this._queue.length){var e=this._formatQueue();for(var t in e){var r=e[t];this._sendRequest(i({},r,{transport:"sendBeacon"}))}}}enable(){this._isPaused=!1,this._setFlushTimeout()}pause(){this._isPaused=!0,this._clearFlushTimeout()}flush(){this._clearFlushTimeout(),this._flushNow(),this._setFlushTimeout()}_setFlushTimeout(){this._isPaused||(this._flushTimeout=setTimeout(()=>{this._clearFlushTimeout(),this._flushNow(),this._queue.length>0&&this._setFlushTimeout()},this._flushTimeoutMs))}_clearFlushTimeout(){this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0)}_flushNow(){if(0!==this._queue.length){var e=this._formatQueue(),t=Date.now();for(var i in e){var r=e[i];r.events.forEach(e=>{var i=new Date(e.timestamp).getTime();e.$offset=Math.abs(i-t)}),this._sendRequest(r)}}}_formatQueue(){var e={};return this._queue.forEach(t=>{var i=t.batchKey||t.url;e[i]||(e[i]={url:t.url,events:[],batchKey:t.batchKey}),e[i].events.push(t.event)}),this._queue=[],e}}class Kt{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._areWeOnline=!0,this._sendRequest=e.sendRequest,this._sendBeacon=e.sendBeacon,b&&void 0!==E&&"onLine"in E&&(this._areWeOnline=E.onLine,S(b,"online",()=>{this._areWeOnline=!0,this._flush()}),S(b,"offline",()=>{this._areWeOnline=!1}))}get length(){return this._queue.length}enqueue(e,t){if(void 0===t&&(t=0),t>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),a=(Math.random()-.5)*(r-i);return Math.ceil(r+a)}(t),r=Date.now()+i;this._queue.push({retryAt:r,request:e,retriesPerformedSoFar:t+1});var a="VTilt: Enqueued failed request for retry in "+Math.round(i/1e3)+"s";this._areWeOnline||(a+=" (Browser is offline)"),console.warn(a),this._isPolling||(this._isPolling=!0,this._poll())}}retriableRequest(e){var i=this;return t(function*(){try{var t=yield i._sendRequest(e);200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&i.enqueue(e,0)}catch(t){i.enqueue(e,0)}})()}_poll(){this._poller&&clearTimeout(this._poller),this._poller=setTimeout(()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._queue.length>0?this._poll():this._isPolling=!1},this._pollIntervalMs)}_flush(){var e=this,i=Date.now(),r=[],a=[];this._queue.forEach(e=>{e.retryAt<i?a.push(e):r.push(e)}),this._queue=r,a.forEach(function(){var i=t(function*(t){var{request:i,retriesPerformedSoFar:r}=t;try{var a=yield e._sendRequest(i);200!==a.statusCode&&(a.statusCode<400||a.statusCode>=500)&&e.enqueue(i,r)}catch(t){e.enqueue(i,r)}});return function(e){return i.apply(this,arguments)}}())}unload(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._queue.forEach(e=>{var{request:t}=e;try{this._sendBeacon(t)}catch(e){console.error("VTilt: Failed to send beacon on unload",e)}}),this._queue=[]}}var Gt="vt_rate_limit";class jt{constructor(e){var t,i;void 0===e&&(e={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(t=e.eventsPerSecond)&&void 0!==t?t:10,this.eventsBurstLimit=Math.max(null!==(i=e.eventsBurstLimit)&&void 0!==i?i:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=e.persistence,this.captureWarning=e.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(e){var t,i,r,a;void 0===e&&(e=!1);var n=Date.now(),s=null!==(i=null===(t=this.persistence)||void 0===t?void 0:t.get(Gt))&&void 0!==i?i:{tokens:this.eventsBurstLimit,last:n},o=(n-s.last)/1e3;s.tokens+=o*this.eventsPerSecond,s.last=n,s.tokens>this.eventsBurstLimit&&(s.tokens=this.eventsBurstLimit);var u=s.tokens<1;return u||e||(s.tokens=Math.max(0,s.tokens-1)),!u||this.lastEventRateLimited||e||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=u,null===(a=this.persistence)||void 0===a||a.set(Gt,s),{isRateLimited:u,remainingTokens:s.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Vt{constructor(e){void 0===e&&(e={}),this.__loaded=!1,this._initial_pageview_captured=!1,this._visibility_state_listener=null,this.__request_queue=[],this._has_warned_about_config=!1,this._set_once_properties_sent=!1,this.configManager=new r(e);var t=this.configManager.getConfig(),i=t.domain;!i&&C&&(i=this.getCurrentDomain()),this.sessionManager=new B(t.storage||"cookie",i),this.userManager=new Je(t.persistence||"localStorage",i),this.webVitalsManager=new ze(t,this),this.rateLimiter=new jt({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new Kt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new $t(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==Wt){var a=null!==(r=Ft[i])&&void 0!==r?r:new Vt;return a._init(e,t,i),Ft[i]=a,Ft[Wt][i]=a,a}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(i({},t,{projectId:e||t.projectId,name:r})),this.__loaded=!0;var a=this.configManager.getConfig();return this.userManager.set_initial_person_info(a.mask_personal_data_properties,a.custom_personal_data_properties),this.historyAutocapture=new Ze(this),this.historyAutocapture.startIfEnabled(),this._setup_unload_handler(),this._start_queue_if_opted_in(),!1!==a.capture_pageview&&this._capture_initial_pageview(),this}_start_queue_if_opted_in(){this.requestQueue.enable()}_setup_unload_handler(){if(b){var e=()=>{this.requestQueue.unload(),this.retryQueue.unload()};S(b,"beforeunload",e),S(b,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:Wt;return t!==Wt&&(t=Wt+"."+t),t}getCurrentDomain(){if(!C)return"";var e=C.protocol,t=C.hostname,i=C.port;return e+"//"+t+(i?":"+i:"")}_is_configured(){var e=this.configManager.getConfig();return!(!e.projectId||!e.token)||(this._has_warned_about_config||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this._has_warned_about_config=!0),!1)}buildUrl(){var e=this.configManager.getConfig(),{proxyUrl:t,proxy:i,api_host:r,token:a}=e;return t||(i?i+"/api/tracking?token="+a:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+a:"/api/tracking?token="+a)}sendRequest(e,t,i){if(this._is_configured()){if(i&&void 0!==b)if(b.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:e,event:t});this.requestQueue.enqueue({url:e,event:t})}}_send_batched_request(e){var{transport:t}=e;"sendBeacon"!==t?this.retryQueue.retriableRequest(e):this._send_beacon_request(e)}_send_http_request(e){return new Promise(t=>{var{url:i,events:r}=e,a=1===r.length?r[0]:{events:r},n=this.configManager.getConfig().disable_compression?xt.None:xt.GZipJS;Nt({url:i,data:a,method:"POST",transport:"XHR",compression:n,callback:e=>{t({statusCode:e.statusCode})}})})}_send_beacon_request(e){var{url:t,events:i}=e,r=1===i.length?i[0]:{events:i},a=this.configManager.getConfig().disable_compression?xt.None:xt.GZipJS;Nt({url:t,data:r,method:"POST",transport:"sendBeacon",compression:a})}_send_retriable_request(e){this.sendRequest(e.url,e.event,!1)}capture(e,t,r){if(this.sessionManager.setSessionId(),E&&E.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(E.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var a=this.buildUrl(),n=He(),s=this.userManager.getUserProperties(),o=this.userManager.get_initial_props(),u=this.sessionManager.getSessionId(),c=this.sessionManager.getWindowId(),l=this.userManager.getAnonymousId(),d={};!this._set_once_properties_sent&&Object.keys(o).length>0&&Object.assign(d,o),t.$set_once&&Object.assign(d,t.$set_once);var h=i({},n,s,{$session_id:u,$window_id:c},l?{$anon_distinct_id:l}:{},Object.keys(d).length>0?{$set_once:d}:{},t.$set?{$set:t.$set}:{},t);!this._set_once_properties_sent&&Object.keys(o).length>0&&(this._set_once_properties_sent=!0),"$pageview"===e&&P&&(h.title=P.title);var g,f,p=this.configManager.getConfig();if(!1!==p.stringifyPayload){if(g=Object.assign({},h,p.globalAttributes),!A(g=JSON.stringify(g)))return}else if(g=Object.assign({},h,p.globalAttributes),!A(JSON.stringify(g)))return;f="$identify"===e?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var v={timestamp:(new Date).toISOString(),event:e,project_id:p.projectId||"",domain:p.domain||this.getCurrentDomain(),payload:g,distinct_id:f,anonymous_id:l};this.sendRequest(a,v,!0)}}_capture_internal(e,t){this.capture(e,t,{skip_client_rate_limiting:!0})}trackEvent(e,t){void 0===t&&(t={}),this.capture(e,t)}identify(e,t,i){if("number"==typeof e&&(e=String(e),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.userManager.isDistinctIdStringLikePublic(e))console.error('The string "'+e+'" 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"!==e){var r=this.userManager.getDistinctId(),a=this.userManager.getAnonymousId(),n=this.userManager.getDeviceId(),s="anonymous"===this.userManager.getUserState();if(!n){var o=r||a;this.userManager.ensureDeviceId(o)}e!==r&&s?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$identify",{distinct_id:e,$anon_distinct_id:a,$set:t||{},$set_once:i||{}}),this.userManager.setDistinctId(e)):t||i?(s&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$set",{$set:t||{},$set_once:i||{}})):e!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(e))}else console.error('The string "'+e+'" 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(e,t){this.userManager.setUserProperties(e,t)&&this.capture("$set",{$set:e||{},$set_once:t||{}})}resetUser(e){this.sessionManager.resetSessionId(),this.userManager.reset(e)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(e,t){var i=this.userManager.createAlias(e,t);i?this.capture("$alias",{$original_id:i.original,$alias_id:i.distinct_id}):e===(t||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(e)}_capture_initial_pageview(){P&&("visible"===P.visibilityState?this._initial_pageview_captured||(this._initial_pageview_captured=!0,setTimeout(()=>{if(P&&C){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this._visibility_state_listener&&(P.removeEventListener("visibilitychange",this._visibility_state_listener),this._visibility_state_listener=null)):this._visibility_state_listener||(this._visibility_state_listener=()=>{this._capture_initial_pageview()},S(P,"visibilitychange",this._visibility_state_listener)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}updateConfig(e){this.configManager.updateConfig(e);var t=this.configManager.getConfig(),i=t.domain;!i&&C&&(i=this.getCurrentDomain()),this.sessionManager=new B(t.storage||"cookie",i),this.userManager=new Je(t.persistence||"localStorage",i),this.webVitalsManager=new ze(t,this)}_execute_array(e){Array.isArray(e)&&e.forEach(e=>{if(e&&Array.isArray(e)&&e.length>0){var t=e[0],i=e.slice(1);if("function"==typeof this[t])try{this[t](...i)}catch(e){console.error("vTilt: Error executing queued call "+t+":",e)}}})}_dom_loaded(){this.__request_queue.forEach(e=>{this._send_retriable_request(e)}),this.__request_queue=[],this._start_queue_if_opted_in()}}var Ft={},Wt="vt",Ht=!(void 0!==T||void 0!==R)&&-1===(null==k?void 0:k.indexOf("MSIE"))&&-1===(null==k?void 0:k.indexOf("Mozilla"));null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=Ht);var Jt,zt=(Jt=Ft[Wt]=new Vt,function(){function e(){e.done||(e.done=!0,Ht=!1,null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=!1),y(Ft,function(e){e._dom_loaded()}))}P&&"function"==typeof P.addEventListener?"complete"===P.readyState?e():S(P,"DOMContentLoaded",e,{capture:!1}):b&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),Jt);export{Vt as VTilt,zt as default,zt as vt};
1
+ function e(e,t,i,r,a,n,s){try{var o=e[n](s),u=o.value}catch(e){return void i(e)}o.done?t(u):Promise.resolve(u).then(r,a)}function t(t){return function(){var i=this,r=arguments;return new Promise(function(a,n){var s=t.apply(i,r);function o(t){e(s,a,n,o,u,"next",t)}function u(t){e(s,a,n,o,u,"throw",t)}o(void 0)})}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},i.apply(null,arguments)}class r{constructor(e){void 0===e&&(e={}),this.config=this.parseConfigFromScript(e)}parseConfigFromScript(e){if(!document.currentScript)return i({token:e.token||""},e);var t=document.currentScript,r=i({token:""},e);if(r.api_host=t.getAttribute("data-api-host")||t.getAttribute("data-host")||e.api_host,r.proxy=t.getAttribute("data-proxy")||e.proxy,r.proxyUrl=t.getAttribute("data-proxy-url")||e.proxyUrl,r.token=t.getAttribute("data-token")||e.token||"",r.projectId=t.getAttribute("data-project-id")||e.projectId||"",r.domain=t.getAttribute("data-domain")||e.domain,r.storage=t.getAttribute("data-storage")||e.storage,r.stringifyPayload="false"!==t.getAttribute("data-stringify-payload"),r.capture_performance="true"===t.getAttribute("data-capture-performance")||e.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 a of(r.globalAttributes=i({},e.globalAttributes),Array.from(t.attributes)))a.name.startsWith("data-vt-")&&(r.globalAttributes[a.name.slice(8).replace(/-/g,"_")]=a.value);return r}getConfig(){return i({},this.config)}updateConfig(e){this.config=i({},this.config,e)}}var a="__vt_session",n="__vt_window_id",s="__vt_primary_window",o="__vt_user_state",u="__vt_device_id",c="__vt_anonymous_id",l="__vt_distinct_id",d="__vt_user_properties",h="localStorage",g="localStorage+cookie",f="sessionStorage",p="memory",v="$initial_person_info",_={"Europe/Andorra":"AD","Asia/Dubai":"AE","Asia/Kabul":"AF","America/Antigua":"AG","America/Anguilla":"AI","Europe/Tirane":"AL","Asia/Yerevan":"AM","Africa/Luanda":"AO","Antarctica/Casey":"AQ","Antarctica/Davis":"AQ","Antarctica/DumontDUrville":"AQ","Antarctica/Mawson":"AQ","Antarctica/McMurdo":"AQ","Antarctica/Palmer":"AQ","Antarctica/Rothera":"AQ","Antarctica/Syowa":"AQ","Antarctica/Troll":"AQ","Antarctica/Vostok":"AQ","America/Argentina/Buenos_Aires":"AR","America/Argentina/Catamarca":"AR","America/Argentina/Cordoba":"AR","America/Argentina/Jujuy":"AR","America/Argentina/La_Rioja":"AR","America/Argentina/Mendoza":"AR","America/Argentina/Rio_Gallegos":"AR","America/Argentina/Salta":"AR","America/Argentina/San_Juan":"AR","America/Argentina/San_Luis":"AR","America/Argentina/Tucuman":"AR","America/Argentina/Ushuaia":"AR","Pacific/Pago_Pago":"AS","Europe/Vienna":"AT","Australia/Adelaide":"AU","Australia/Brisbane":"AU","Australia/Broken_Hill":"AU","Australia/Darwin":"AU","Australia/Eucla":"AU","Australia/Hobart":"AU","Australia/Lindeman":"AU","Australia/Lord_Howe":"AU","Australia/Melbourne":"AU","Australia/Perth":"AU","Australia/Sydney":"AU","America/Aruba":"AW","Europe/Mariehamn":"AX","Asia/Baku":"AZ","Europe/Sarajevo":"BA","America/Barbados":"BB","Asia/Dhaka":"BD","Europe/Brussels":"BE","Africa/Ouagadougou":"BF","Europe/Sofia":"BG","Asia/Bahrain":"BH","Africa/Bujumbura":"BI","Africa/Porto-Novo":"BJ","America/St_Barthelemy":"BL","Atlantic/Bermuda":"BM","Asia/Brunei":"BN","America/La_Paz":"BO","America/Kralendijk":"BQ","America/Araguaina":"BR","America/Bahia":"BR","America/Belem":"BR","America/Boa_Vista":"BR","America/Campo_Grande":"BR","America/Cuiaba":"BR","America/Eirunepe":"BR","America/Fortaleza":"BR","America/Maceio":"BR","America/Manaus":"BR","America/Noronha":"BR","America/Porto_Velho":"BR","America/Recife":"BR","America/Rio_Branco":"BR","America/Santarem":"BR","America/Sao_Paulo":"BR","America/Nassau":"BS","Asia/Thimphu":"BT","Africa/Gaborone":"BW","Europe/Minsk":"BY","America/Belize":"BZ","America/Atikokan":"CA","America/Blanc-Sablon":"CA","America/Cambridge_Bay":"CA","America/Creston":"CA","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Edmonton":"CA","America/Fort_Nelson":"CA","America/Glace_Bay":"CA","America/Goose_Bay":"CA","America/Halifax":"CA","America/Inuvik":"CA","America/Iqaluit":"CA","America/Moncton":"CA","America/Nipigon":"CA","America/Pangnirtung":"CA","America/Rainy_River":"CA","America/Rankin_Inlet":"CA","America/Regina":"CA","America/Resolute":"CA","America/St_Johns":"CA","America/Swift_Current":"CA","America/Thunder_Bay":"CA","America/Toronto":"CA","America/Vancouver":"CA","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yellowknife":"CA","Indian/Cocos":"CC","Africa/Kinshasa":"CD","Africa/Lubumbashi":"CD","Africa/Bangui":"CF","Africa/Brazzaville":"CG","Europe/Zurich":"CH","Africa/Abidjan":"CI","Pacific/Rarotonga":"CK","America/Punta_Arenas":"CL","America/Santiago":"CL","Pacific/Easter":"CL","Africa/Douala":"CM","Asia/Shanghai":"CN","Asia/Urumqi":"CN","America/Bogota":"CO","America/Costa_Rica":"CR","America/Havana":"CU","Atlantic/Cape_Verde":"CV","America/Curacao":"CW","Indian/Christmas":"CX","Asia/Famagusta":"CY","Asia/Nicosia":"CY","Europe/Prague":"CZ","Europe/Berlin":"DE","Europe/Busingen":"DE","Africa/Djibouti":"DJ","Europe/Copenhagen":"DK","America/Dominica":"DM","America/Santo_Domingo":"DO","Africa/Algiers":"DZ","America/Guayaquil":"EC","Pacific/Galapagos":"EC","Europe/Tallinn":"EE","Africa/Cairo":"EG","Africa/El_Aaiun":"EH","Africa/Asmara":"ER","Africa/Ceuta":"ES","Atlantic/Canary":"ES","Europe/Madrid":"ES","Africa/Addis_Ababa":"ET","Europe/Helsinki":"FI","Pacific/Fiji":"FJ","Atlantic/Stanley":"FK","Pacific/Chuuk":"FM","Pacific/Kosrae":"FM","Pacific/Pohnpei":"FM","Atlantic/Faroe":"FO","Europe/Paris":"FR","Africa/Libreville":"GA","Europe/London":"GB","America/Grenada":"GD","Asia/Tbilisi":"GE","America/Cayenne":"GF","Europe/Guernsey":"GG","Africa/Accra":"GH","Europe/Gibraltar":"GI","America/Danmarkshavn":"GL","America/Nuuk":"GL","America/Scoresbysund":"GL","America/Thule":"GL","Africa/Banjul":"GM","Africa/Conakry":"GN","America/Guadeloupe":"GP","Africa/Malabo":"GQ","Europe/Athens":"GR","Atlantic/South_Georgia":"GS","America/Guatemala":"GT","Pacific/Guam":"GU","Africa/Bissau":"GW","America/Guyana":"GY","Asia/Hong_Kong":"HK","America/Tegucigalpa":"HN","Europe/Zagreb":"HR","America/Port-au-Prince":"HT","Europe/Budapest":"HU","Asia/Jakarta":"ID","Asia/Jayapura":"ID","Asia/Makassar":"ID","Asia/Pontianak":"ID","Europe/Dublin":"IE","Asia/Jerusalem":"IL","Europe/Isle_of_Man":"IM","Asia/Kolkata":"IN","Indian/Chagos":"IO","Asia/Baghdad":"IQ","Asia/Tehran":"IR","Atlantic/Reykjavik":"IS","Europe/Rome":"IT","Europe/Jersey":"JE","America/Jamaica":"JM","Asia/Amman":"JO","Asia/Tokyo":"JP","Africa/Nairobi":"KE","Asia/Bishkek":"KG","Asia/Phnom_Penh":"KH","Pacific/Enderbury":"KI","Pacific/Kiritimati":"KI","Pacific/Tarawa":"KI","Indian/Comoro":"KM","America/St_Kitts":"KN","Asia/Pyongyang":"KP","Asia/Seoul":"KR","Asia/Kuwait":"KW","America/Cayman":"KY","Asia/Almaty":"KZ","Asia/Aqtau":"KZ","Asia/Aqtobe":"KZ","Asia/Atyrau":"KZ","Asia/Oral":"KZ","Asia/Qostanay":"KZ","Asia/Qyzylorda":"KZ","Asia/Vientiane":"LA","Asia/Beirut":"LB","America/St_Lucia":"LC","Europe/Vaduz":"LI","Asia/Colombo":"LK","Africa/Monrovia":"LR","Africa/Maseru":"LS","Europe/Vilnius":"LT","Europe/Luxembourg":"LU","Europe/Riga":"LV","Africa/Tripoli":"LY","Africa/Casablanca":"MA","Europe/Monaco":"MC","Europe/Chisinau":"MD","Europe/Podgorica":"ME","America/Marigot":"MF","Indian/Antananarivo":"MG","Pacific/Kwajalein":"MH","Pacific/Majuro":"MH","Europe/Skopje":"MK","Africa/Bamako":"ML","Asia/Yangon":"MM","Asia/Choibalsan":"MN","Asia/Hovd":"MN","Asia/Ulaanbaatar":"MN","Asia/Macau":"MO","Pacific/Saipan":"MP","America/Martinique":"MQ","Africa/Nouakchott":"MR","America/Montserrat":"MS","Europe/Malta":"MT","Indian/Mauritius":"MU","Indian/Maldives":"MV","Africa/Blantyre":"MW","America/Bahia_Banderas":"MX","America/Cancun":"MX","America/Chihuahua":"MX","America/Hermosillo":"MX","America/Matamoros":"MX","America/Mazatlan":"MX","America/Merida":"MX","America/Mexico_City":"MX","America/Monterrey":"MX","America/Ojinaga":"MX","America/Tijuana":"MX","Asia/Kuala_Lumpur":"MY","Asia/Kuching":"MY","Africa/Maputo":"MZ","Africa/Windhoek":"NA","Pacific/Noumea":"NC","Africa/Niamey":"NE","Pacific/Norfolk":"NF","Africa/Lagos":"NG","America/Managua":"NI","Europe/Amsterdam":"NL","Europe/Oslo":"NO","Asia/Kathmandu":"NP","Pacific/Nauru":"NR","Pacific/Niue":"NU","Pacific/Auckland":"NZ","Pacific/Chatham":"NZ","Asia/Muscat":"OM","America/Panama":"PA","America/Lima":"PE","Pacific/Gambier":"PF","Pacific/Marquesas":"PF","Pacific/Tahiti":"PF","Pacific/Bougainville":"PG","Pacific/Port_Moresby":"PG","Asia/Manila":"PH","Asia/Karachi":"PK","Europe/Warsaw":"PL","America/Miquelon":"PM","Pacific/Pitcairn":"PN","America/Puerto_Rico":"PR","Asia/Gaza":"PS","Asia/Hebron":"PS","Atlantic/Azores":"PT","Atlantic/Madeira":"PT","Europe/Lisbon":"PT","Pacific/Palau":"PW","America/Asuncion":"PY","Asia/Qatar":"QA","Indian/Reunion":"RE","Europe/Bucharest":"RO","Europe/Belgrade":"RS","Asia/Anadyr":"RU","Asia/Barnaul":"RU","Asia/Chita":"RU","Asia/Irkutsk":"RU","Asia/Kamchatka":"RU","Asia/Khandyga":"RU","Asia/Krasnoyarsk":"RU","Asia/Magadan":"RU","Asia/Novokuznetsk":"RU","Asia/Novosibirsk":"RU","Asia/Omsk":"RU","Asia/Sakhalin":"RU","Asia/Srednekolymsk":"RU","Asia/Tomsk":"RU","Asia/Ust-Nera":"RU","Asia/Vladivostok":"RU","Asia/Yakutsk":"RU","Asia/Yekaterinburg":"RU","Europe/Astrakhan":"RU","Europe/Kaliningrad":"RU","Europe/Kirov":"RU","Europe/Moscow":"RU","Europe/Samara":"RU","Europe/Saratov":"RU","Europe/Ulyanovsk":"RU","Europe/Volgograd":"RU","Africa/Kigali":"RW","Asia/Riyadh":"SA","Pacific/Guadalcanal":"SB","Indian/Mahe":"SC","Africa/Khartoum":"SD","Europe/Stockholm":"SE","Asia/Singapore":"SG","Atlantic/St_Helena":"SH","Europe/Ljubljana":"SI","Arctic/Longyearbyen":"SJ","Europe/Bratislava":"SK","Africa/Freetown":"SL","Europe/San_Marino":"SM","Africa/Dakar":"SN","Africa/Mogadishu":"SO","America/Paramaribo":"SR","Africa/Juba":"SS","Africa/Sao_Tome":"ST","America/El_Salvador":"SV","America/Lower_Princes":"SX","Asia/Damascus":"SY","Africa/Mbabane":"SZ","America/Grand_Turk":"TC","Africa/Ndjamena":"TD","Indian/Kerguelen":"TF","Africa/Lome":"TG","Asia/Bangkok":"TH","Asia/Dushanbe":"TJ","Pacific/Fakaofo":"TK","Asia/Dili":"TL","Asia/Ashgabat":"TM","Africa/Tunis":"TN","Pacific/Tongatapu":"TO","Europe/Istanbul":"TR","America/Port_of_Spain":"TT","Pacific/Funafuti":"TV","Asia/Taipei":"TW","Africa/Dar_es_Salaam":"TZ","Europe/Kiev":"UA","Europe/Simferopol":"UA","Europe/Uzhgorod":"UA","Europe/Zaporozhye":"UA","Africa/Kampala":"UG","Pacific/Midway":"UM","Pacific/Wake":"UM","America/Adak":"US","America/Anchorage":"US","America/Boise":"US","America/Chicago":"US","America/Denver":"US","America/Detroit":"US","America/Indiana/Indianapolis":"US","America/Indiana/Knox":"US","America/Indiana/Marengo":"US","America/Indiana/Petersburg":"US","America/Indiana/Tell_City":"US","America/Indiana/Vevay":"US","America/Indiana/Vincennes":"US","America/Indiana/Winamac":"US","America/Juneau":"US","America/Kentucky/Louisville":"US","America/Kentucky/Monticello":"US","America/Los_Angeles":"US","America/Menominee":"US","America/Metlakatla":"US","America/New_York":"US","America/Nome":"US","America/North_Dakota/Beulah":"US","America/North_Dakota/Center":"US","America/North_Dakota/New_Salem":"US","America/Phoenix":"US","America/Sitka":"US","America/Yakutat":"US","Pacific/Honolulu":"US","America/Montevideo":"UY","Asia/Samarkand":"UZ","Asia/Tashkent":"UZ","Europe/Vatican":"VA","America/St_Vincent":"VC","America/Caracas":"VE","America/Tortola":"VG","America/St_Thomas":"VI","Asia/Ho_Chi_Minh":"VN","Pacific/Efate":"VU","Pacific/Wallis":"WF","Pacific/Apia":"WS","Asia/Aden":"YE","Indian/Mayotte":"YT","Africa/Johannesburg":"ZA","Africa/Lusaka":"ZM","Africa/Harare":"ZW"};function m(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function A(e){return!(!e||"string"!=typeof e)&&!(e.length<2||e.length>10240)}function y(e,t,i){if(e)if(Array.isArray(e))e.forEach((e,r)=>{t.call(i,e,r)});else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(i,e[r],r)}function S(e,t,i,r){var{capture:a=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:a,passive:n})}function w(e,t){if(!t)return e;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function I(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a of i)for(var n of a)e.push(n);return e}var b="undefined"!=typeof window?window:void 0,M="undefined"!=typeof globalThis?globalThis:b,E=null==M?void 0:M.navigator,P=null==M?void 0:M.document,C=null==M?void 0:M.location,k=null==M?void 0:M.fetch,R=(null==M?void 0:M.XMLHttpRequest)&&"withCredentials"in new M.XMLHttpRequest?M.XMLHttpRequest:void 0;null==M||M.AbortController;var T=null==E?void 0:E.userAgent,U=31536e3,L=["herokuapp.com","vercel.app","netlify.app"];function B(e){var t;if(!e)return"";if("undefined"==typeof document)return"";var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return"";var r=i.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class x{constructor(e){var t,i;this.memoryStorage=new Map,this.method=e.method,this.cross_subdomain=null!==(t=e.cross_subdomain)&&void 0!==t?t:function(){var e;if("undefined"==typeof document)return!1;var t=null===(e=document.location)||void 0===e?void 0:e.hostname;if(!t)return!1;var i=t.split(".").slice(-2).join(".");for(var r of L)if(i===r)return!1;return!0}(),this.sameSite=e.sameSite||"Lax",this.secure=null!==(i=e.secure)&&void 0!==i?i:"undefined"!=typeof location&&"https:"===location.protocol}get(e){var t;try{if(this.method===p)return null!==(t=this.memoryStorage.get(e))&&void 0!==t?t:null;if(this.usesLocalStorage()){var i=localStorage.getItem(e);return null!==i?i:this.method===g?this.getCookie(e):null}return this.usesSessionStorage()?sessionStorage.getItem(e):this.getCookie(e)}catch(t){return console.warn('[StorageManager] Failed to get "'+e+'":',t),null}}set(e,t,i){try{if(this.method===p)return void this.memoryStorage.set(e,t);if(this.usesLocalStorage())return localStorage.setItem(e,t),void(this.method===g&&this.setCookie(e,t,i||U));if(this.usesSessionStorage())return void sessionStorage.setItem(e,t);this.setCookie(e,t,i||U)}catch(t){console.warn('[StorageManager] Failed to set "'+e+'":',t)}}remove(e){try{if(this.method===p)return void this.memoryStorage.delete(e);if(this.usesLocalStorage())return localStorage.removeItem(e),void(this.method===g&&this.removeCookie(e));if(this.usesSessionStorage())return void sessionStorage.removeItem(e);this.removeCookie(e)}catch(t){console.warn('[StorageManager] Failed to remove "'+e+'":',t)}}getWithExpiry(e){var t=this.get(e);if(!t)return null;try{var i=JSON.parse(t);return i.expiry&&Date.now()>i.expiry?(this.remove(e),null):i.value}catch(e){return null}}setWithExpiry(e,t,r){var a=i({value:t},r?{expiry:Date.now()+r}:{});this.set(e,JSON.stringify(a))}getJSON(e){var t=this.get(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}setJSON(e,t,i){this.set(e,JSON.stringify(t),i)}getCookie(e){if("undefined"==typeof document)return null;var t=document.cookie.split(";");for(var i of t){var[r,...a]=i.trim().split("=");if(r===e){var n=a.join("=");try{return decodeURIComponent(n)}catch(e){return n}}}return null}setCookie(e,t,i){if("undefined"!=typeof document){var r=e+"="+encodeURIComponent(t);r+="; Max-Age="+i,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure");var a=B(this.cross_subdomain);a&&(r+="; domain="+a),document.cookie=r}}removeCookie(e){if("undefined"!=typeof document){var t=B(this.cross_subdomain),i=e+"=; Max-Age=0; path=/";t&&(i+="; domain="+t),document.cookie=i,document.cookie=e+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===h||this.method===g}usesSessionStorage(){return this.method===f}canUseSessionStorage(){if(void 0===b||!(null==b?void 0:b.sessionStorage))return!1;try{var e="__vt_storage_test__";return b.sessionStorage.setItem(e,"test"),b.sessionStorage.removeItem(e),!0}catch(e){return!1}}getSessionStorage(){var e;return this.canUseSessionStorage()&&null!==(e=null==b?void 0:b.sessionStorage)&&void 0!==e?e:null}setMethod(e){this.method=e}getMethod(){return this.method}}class O{constructor(e,t){void 0===e&&(e="cookie"),this.storage=new x({method:e,cross_subdomain:t,sameSite:"Lax"}),this._windowId=void 0,this._initializeWindowId()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=m(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||m();return this._storeSessionId(e),e}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(m())}_getSessionIdRaw(){return this.storage.get(a)}_storeSessionId(e){this.storage.set(a,e,1800)}_clearSessionId(){this.storage.remove(a)}getWindowId(){if(this._windowId)return this._windowId;var e=this.storage.getSessionStorage();if(e){var t=e.getItem(n);if(t)return this._windowId=t,t}var i=m();return this._setWindowId(i),i}_setWindowId(e){if(e!==this._windowId){this._windowId=e;var t=this.storage.getSessionStorage();t&&t.setItem(n,e)}}_initializeWindowId(){var e=this.storage.getSessionStorage();if(e){var t=e.getItem(s),i=e.getItem(n);i&&!t?this._windowId=i:(i&&e.removeItem(n),this._setWindowId(m())),e.setItem(s,"true"),this._listenToUnload()}else this._windowId=m()}_listenToUnload(){var e=this.storage.getSessionStorage();b&&e&&S(b,"beforeunload",()=>{var e=this.storage.getSessionStorage();e&&e.removeItem(s)},{capture:!1})}updateStorageMethod(e,t){this.storage=new x({method:e,cross_subdomain:t,sameSite:"Lax"})}}function D(e){if(!P)return null;var t=P.createElement("a");return t.href=e,t}function q(e,t){for(var i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var a=i[r].split("=");if(a[0]===t){if(a.length<2)return"";var n=a[1];try{n=decodeURIComponent(n)}catch(e){}return n.replace(/\+/g," ")}}return""}function N(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",n=r[1],s=a.split("?"),o=s[1],u=s[0],c=(o||"").split("&"),l=[],d=0;d<c.length;d++){var h=c[d].split("="),g=h[0],f=h.slice(1).join("=");-1!==t.indexOf(g)?l.push(g+"="+i):g&&l.push(g+(f?"="+f:""))}var p=l.join("&");return u+(p?"?"+p:"")+(n?"#"+n:"")}function $(e){return"function"==typeof e}var K="Mobile",G="iOS",j="Android",V="Tablet",F=j+" "+V,W="iPad",H="Apple",z=H+" Watch",J="Safari",Q="BlackBerry",Z="Samsung",X=Z+"Browser",Y=Z+" Internet",ee="Chrome",te=ee+" OS",ie=ee+" "+G,re="Internet Explorer",ae=re+" "+K,ne="Opera",se=ne+" Mini",oe="Edge",ue="Microsoft "+oe,ce="Firefox",le=ce+" "+G,de="Nintendo",he="PlayStation",ge="Xbox",fe=j+" "+K,pe=K+" "+J,ve="Windows",_e=ve+" Phone",me="Nokia",Ae="Ouya",ye="Generic",Se=ye+" "+K.toLowerCase(),we=ye+" "+V.toLowerCase(),Ie="Konqueror",be="(\\d+(\\.\\d+)?)",Me=new RegExp("Version/"+be),Ee=new RegExp(ge,"i"),Pe=new RegExp(he+" \\w+","i"),Ce=new RegExp(de+" \\w+","i"),ke=new RegExp(Q+"|PlayBook|BB10","i"),Re={"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 Te(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Ue=(e,t)=>t&&Te(t,H)||function(e){return Te(e,J)&&!Te(e,ee)&&!Te(e,j)}(e),Le=function(e,t){return t=t||"",Te(e," OPR/")&&Te(e,"Mini")?se:Te(e," OPR/")?ne:ke.test(e)?Q:Te(e,"IE"+K)||Te(e,"WPDesktop")?ae:Te(e,X)?Y:Te(e,oe)||Te(e,"Edg/")?ue:Te(e,"FBIOS")?"Facebook "+K:Te(e,"UCWEB")||Te(e,"UCBrowser")?"UC Browser":Te(e,"CriOS")?ie:Te(e,"CrMo")||Te(e,ee)?ee:Te(e,j)&&Te(e,J)?fe:Te(e,"FxiOS")?le:Te(e.toLowerCase(),Ie.toLowerCase())?Ie:Ue(e,t)?Te(e,K)?pe:J:Te(e,ce)?ce:Te(e,"MSIE")||Te(e,"Trident/")?re:Te(e,"Gecko")?ce:""},Be={[ae]:[new RegExp("rv:"+be)],[ue]:[new RegExp(oe+"?\\/"+be)],[ee]:[new RegExp("("+ee+"|CrMo)\\/"+be)],[ie]:[new RegExp("CriOS\\/"+be)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+be)],[J]:[Me],[pe]:[Me],[ne]:[new RegExp("(Opera|OPR)\\/"+be)],[ce]:[new RegExp(ce+"\\/"+be)],[le]:[new RegExp("FxiOS\\/"+be)],[Ie]:[new RegExp("Konqueror[:/]?"+be,"i")],[Q]:[new RegExp(Q+" "+be),Me],[fe]:[new RegExp("android\\s"+be,"i")],[Y]:[new RegExp(X+"\\/"+be)],[re]:[new RegExp("(rv:|MSIE )"+be)],Mozilla:[new RegExp("rv:"+be)]},xe=function(e,t){var i=Le(e,t),r=Be[i];if(void 0===r)return null;for(var a=0;a<r.length;a++){var n=r[a],s=e.match(n);if(s)return parseFloat(s[s.length-2])}return null},Oe=[[new RegExp(ge+"; "+ge+" (.*?)[);]","i"),e=>[ge,e&&e[1]||""]],[new RegExp(de,"i"),[de,""]],[new RegExp(he,"i"),[he,""]],[ke,[Q,""]],[new RegExp(ve,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[_e,""];if(new RegExp(K).test(t)&&!/IEMobile\b/.test(t))return[ve+" "+K,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],a=Re[r]||"";return/arm/i.test(t)&&(a="RT"),[ve,a]}return[ve,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[G,t.join(".")]}return[G,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=void 0===e[2]?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+j+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+j+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[j,t.join(".")]}return[j,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[te,""]],[/Linux|debian/i,["Linux",""]]],De=function(e){return Ce.test(e)?de:Pe.test(e)?he:Ee.test(e)?ge:new RegExp(Ae,"i").test(e)?Ae:new RegExp("("+_e+"|WPDesktop)","i").test(e)?_e:/iPad/.test(e)?W:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?z:ke.test(e)?Q:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(me,"i").test(e)?me:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(K).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?j:F:j:new RegExp("(pda|"+K+")","i").test(e)?Se:new RegExp(V,"i").test(e)&&!new RegExp(V+" pc","i").test(e)?we:""},qe="https?://(.*)",Ne=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$e=I(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ne),Ke="<masked>";function Ge(e){var t=function(e){return e?0===e.search(qe+"google.([^/?]*)")?"google":0===e.search(qe+"bing.com")?"bing":0===e.search(qe+"yahoo.com")?"yahoo":0===e.search(qe+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var a=P?q(P.referrer,i):"";a.length&&(r.ph_keyword=a)}return r}function je(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Ve(){return(null==P?void 0:P.referrer)||"$direct"}function Fe(){var e;return(null==P?void 0:P.referrer)&&(null===(e=D(P.referrer))||void 0===e?void 0:e.host)||"$direct"}function We(e){var t,{r:i,u:r}=e,a={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=D(i))||void 0===t?void 0:t.host};if(r){a.$current_url=r;var n=D(r);a.$host=null==n?void 0:n.host,a.$pathname=null==n?void 0:n.pathname;var s=function(e){var t=$e.concat([]),i={};return y(t,function(t){var r=q(e,t);i[t]=r||null}),i}(r);w(a,s)}i&&w(a,Ge(i));return a}function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Je(e,t){if(!T)return{};var i,r,a,[n,s]=function(e){for(var t=0;t<Oe.length;t++){var[i,r]=Oe[t],a=i.exec(e),n=a&&($(r)?r(a,e):r);if(n)return n}return["",""]}(T);return w(function(e){var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];null!=r&&""!==r&&(t[i]=r)}return t}({$os:n,$os_version:s,$browser:Le(T,navigator.vendor),$device:De(T),$device_type:(r=T,a=De(r),a===W||a===F||"Kobo"===a||"Kindle Fire"===a||a===we?V:a===de||a===ge||a===he||a===Ae?"Console":a===z?"Wearable":a?K:"Desktop"),$timezone:He(),$timezone_offset:ze()}),{$current_url:N(null==C?void 0:C.href,[],Ke),$host:null==C?void 0:C.host,$pathname:null==C?void 0:C.pathname,$raw_user_agent:T.length>1e3?T.substring(0,997)+"...":T,$browser_version:xe(T,navigator.vendor),$browser_language:je(),$browser_language_prefix:(i=je(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==b?void 0:b.screen.height,$screen_width:null==b?void 0:b.screen.width,$viewport_height:null==b?void 0:b.innerHeight,$viewport_width:null==b?void 0:b.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 Qe{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storage=new x({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return i({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(c,this.userIdentity.anonymous_id,U)),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(e,t,r){if("number"==typeof e&&(e=e.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.")),e)if(this.isDistinctIdStringLike(e))console.error('The string "'+e+'" 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"!==e){var a=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=e,!this.userIdentity.device_id){var n=a||this.userIdentity.anonymous_id;this.userIdentity.device_id=n,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:n})}e!==a&&(this.userIdentity.distinct_id=e);var s="anonymous"===this.userIdentity.user_state;e!==a&&s?(this.userIdentity.user_state="identified",t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):t||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):e!==a&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+e+'" 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(e,t){if(!e&&!t)return!1;var r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,a=this.getPersonPropertiesHash(r,e,t);return this._cachedPersonProperties===a?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity(),this._cachedPersonProperties=a,!0)}reset(e){var t=this.generateAnonymousId(),r=this.userIdentity.device_id,a=e?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:t,device_id:a,properties:{},user_state:"anonymous"},this._cachedPersonProperties=null,this.saveUserIdentity(),this.userIdentity.properties=i({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(e){this.userIdentity.distinct_id=e,this.saveUserIdentity()}setUserState(e){this.userIdentity.user_state=e,this.saveUserIdentity()}updateUserProperties(e,t){e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity()}ensureDeviceId(e){this.userIdentity.device_id||(this.userIdentity.device_id=e,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:e}),this.saveUserIdentity())}createAlias(e,t){return this.isValidDistinctId(e)?(void 0===t&&(t=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(t)?e===t?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:e,original:t}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[v]){var i=function(e,t){var i=e?I([],Ne,t||[]):[],r=null==C?void 0:C.href.substring(0,1e3);return{r:Ve().substring(0,1e3),u:r?N(r,i,Ke):void 0}}(e,t);this.register_once({[v]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[v];return i?(e=We(i),t={},y(e,function(e,i){var r;t["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=e}),t):{}}update_referrer_info(){var e={$referrer:Ve(),$referring_domain:Fe()};this.register_once(e,void 0)}loadUserIdentity(){var e=this.storage.get(c)||this.generateAnonymousId(),t=this.storage.get(l)||null,i=this.storage.get(u)||this.generateDeviceId(),r=this.getStoredUserProperties(),a=this.storage.get(o)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:a}}saveUserIdentity(){this.storage.set(c,this.userIdentity.anonymous_id,U),this.storage.set(u,this.userIdentity.device_id,U),this.storage.set(o,this.userIdentity.user_state,U),this.userIdentity.distinct_id?this.storage.set(l,this.userIdentity.distinct_id,U):this.storage.remove(l),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(d)||{}}setStoredUserProperties(e){this.storage.setJSON(d,e,U)}register_once(e,t){var i=this.getStoredUserProperties(),r=!1;for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(a in i||(i[a]=e[a],r=!0));if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in i||(i[n]=t[n],r=!0));r&&this.setStoredUserProperties(i)}generateAnonymousId(){return"anon_"+m()}generateDeviceId(){return"device_"+m()}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}isValidDistinctId(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(t)&&0!==e.trim().length}isDistinctIdStringLike(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(t)}updateStorageMethod(e,t){this.storage=new x({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}class Ze{constructor(e,t){if(this.instance=t,e.capture_performance&&b)try{this.webVitals=require("web-vitals"),this.initializeWebVitals()}catch(e){console.warn("web-vitals library not found. Please install it to enable web vitals tracking.",e)}}initializeWebVitals(){if(this.webVitals){var e=e=>{try{if(!(b&&P&&E&&C))return;var{country:t,locale:i}=function(){var e,t;if(!E)return{country:e,locale:t};try{var i=Intl.DateTimeFormat().resolvedOptions().timeZone;e=_[i],t=E.languages&&E.languages.length?E.languages[0]:E.userLanguage||E.language||E.browserLanguage||"en"}catch(e){}return{country:e,locale:t}}();this.instance.capture("web_vital",{name:e.name,value:e.value,delta:e.delta,rating:e.rating,id:e.id,navigationType:e.navigationType,pathname:C.pathname,href:C.href,"user-agent":E.userAgent,locale:i,location:t,referrer:P.referrer})}catch(e){console.error("Error sending web vital:",e)}};this.webVitals.onCLS&&this.webVitals.onCLS(e),this.webVitals.onFCP&&this.webVitals.onFCP(e),this.webVitals.onLCP&&this.webVitals.onLCP(e),this.webVitals.onTTFB&&this.webVitals.onTTFB(e),this.webVitals.onINP&&this.webVitals.onINP(e)}}}function Xe(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],a=i(r);return $(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class Ye{constructor(e){var t;this._instance=e,this._lastPathname=(null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0}monitorHistoryChanges(){var e,t;if(b&&C&&(this._lastPathname=C.pathname||"",b.history)){var i=this;(null===(e=b.history.pushState)||void 0===e?void 0:e.__vtilt_wrapped__)||Xe(b.history,"pushState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("pushState")}),(null===(t=b.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||Xe(b.history,"replaceState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("replaceState")}),this._setupPopstateListener()}}_capturePageview(e){var t;try{var i=null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname;if(!i||!C||!P)return;if(i!==this._lastPathname&&this.isEnabled){var r={navigation_type:e};this._instance.capture("$pageview",r)}this._lastPathname=i}catch(t){console.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener&&b){var e=()=>{this._capturePageview("popstate")};S(b,"popstate",e),this._popstateListener=()=>{b&&b.removeEventListener("popstate",e)}}}}var et=Uint8Array,tt=Uint16Array,it=Int32Array,rt=new et([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]),at=new et([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]),nt=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),st=function(e,t){for(var i=new tt(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var a=new it(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)a[n]=n-i[r]<<5|r;return{b:i,r:a}},ot=st(rt,2),ut=ot.b,ct=ot.r;ut[28]=258,ct[258]=28;for(var lt=st(at,0).r,dt=new tt(32768),ht=0;ht<32768;++ht){var gt=(43690&ht)>>1|(21845&ht)<<1;gt=(61680&(gt=(52428&gt)>>2|(13107&gt)<<2))>>4|(3855&gt)<<4,dt[ht]=((65280&gt)>>8|(255&gt)<<8)>>1}var ft=function(e,t,i){for(var r=e.length,a=0,n=new tt(t);a<r;++a)e[a]&&++n[e[a]-1];var s,o=new tt(t);for(a=1;a<t;++a)o[a]=o[a-1]+n[a-1]<<1;if(i){s=new tt(1<<t);var u=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],l=t-e[a],d=o[e[a]-1]++<<l,h=d|(1<<l)-1;d<=h;++d)s[dt[d]>>u]=c}else for(s=new tt(r),a=0;a<r;++a)e[a]&&(s[a]=dt[o[e[a]-1]++]>>15-e[a]);return s},pt=new et(288);for(ht=0;ht<144;++ht)pt[ht]=8;for(ht=144;ht<256;++ht)pt[ht]=9;for(ht=256;ht<280;++ht)pt[ht]=7;for(ht=280;ht<288;++ht)pt[ht]=8;var vt=new et(32);for(ht=0;ht<32;++ht)vt[ht]=5;var _t=ft(pt,9,0),mt=ft(vt,5,0),At=function(e){return(e+7)/8|0},yt=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new et(e.subarray(t,i))},St=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},wt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8,e[r+2]|=i>>16},It=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var a=i.length,n=i.slice();if(!a)return{t:Rt,l:0};if(1==a){var s=new et(i[0].s+1);return s[i[0].s]=1,{t:s,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],u=i[1],c=0,l=1,d=2;for(i[0]={s:-1,f:o.f+u.f,l:o,r:u};l!=a-1;)o=i[i[c].f<i[d].f?c++:d++],u=i[c!=l&&i[c].f<i[d].f?c++:d++],i[l++]={s:-1,f:o.f+u.f,l:o,r:u};var h=n[0].s;for(r=1;r<a;++r)n[r].s>h&&(h=n[r].s);var g=new tt(h+1),f=bt(i[l-1],g,0);if(f>t){r=0;var p=0,v=f-t,_=1<<v;for(n.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});r<a;++r){var m=n[r].s;if(!(g[m]>t))break;p+=_-(1<<f-g[m]),g[m]=t}for(p>>=v;p>0;){var A=n[r].s;g[A]<t?p-=1<<t-g[A]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;g[y]==t&&(--g[y],++p)}f=t}return{t:new et(g),l:f}},bt=function(e,t,i){return-1==e.s?Math.max(bt(e.l,t,i+1),bt(e.r,t,i+1)):t[e.s]=i},Mt=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new tt(++t),r=0,a=e[0],n=1,s=function(e){i[r++]=e},o=1;o<=t;++o)if(e[o]==a&&o!=t)++n;else{if(!a&&n>2){for(;n>138;n-=138)s(32754);n>2&&(s(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(s(a),--n;n>6;n-=6)s(8304);n>2&&(s(n-3<<5|8208),n=0)}for(;n--;)s(a);n=1,a=e[o]}return{c:i.subarray(0,r),n:t}},Et=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Pt=function(e,t,i){var r=i.length,a=At(t+2);e[a]=255&r,e[a+1]=r>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var n=0;n<r;++n)e[a+n+4]=i[n];return 8*(a+4+r)},Ct=function(e,t,i,r,a,n,s,o,u,c,l){St(t,l++,i),++a[256];for(var d=It(a,15),h=d.t,g=d.l,f=It(n,15),p=f.t,v=f.l,_=Mt(h),m=_.c,A=_.n,y=Mt(p),S=y.c,w=y.n,I=new tt(19),b=0;b<m.length;++b)++I[31&m[b]];for(b=0;b<S.length;++b)++I[31&S[b]];for(var M=It(I,7),E=M.t,P=M.l,C=19;C>4&&!E[nt[C-1]];--C);var k,R,T,U,L=c+5<<3,B=Et(a,pt)+Et(n,vt)+s,x=Et(a,h)+Et(n,p)+s+14+3*C+Et(I,E)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&L<=B&&L<=x)return Pt(t,l,e.subarray(u,u+c));if(St(t,l,1+(x<B)),l+=2,x<B){k=ft(h,g,0),R=h,T=ft(p,v,0),U=p;var O=ft(E,P,0);St(t,l,A-257),St(t,l+5,w-1),St(t,l+10,C-4),l+=14;for(b=0;b<C;++b)St(t,l+3*b,E[nt[b]]);l+=3*C;for(var D=[m,S],q=0;q<2;++q){var N=D[q];for(b=0;b<N.length;++b){var $=31&N[b];St(t,l,O[$]),l+=E[$],$>15&&(St(t,l,N[b]>>5&127),l+=N[b]>>12)}}}else k=_t,R=pt,T=mt,U=vt;for(b=0;b<o;++b){var K=r[b];if(K>255){wt(t,l,k[($=K>>18&31)+257]),l+=R[$+257],$>7&&(St(t,l,K>>23&31),l+=rt[$]);var G=31&K;wt(t,l,T[G]),l+=U[G],G>3&&(wt(t,l,K>>5&8191),l+=at[G])}else wt(t,l,k[K]),l+=R[K]}return wt(t,l,k[256]),l+R[256]},kt=new it([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Rt=new et(0),Tt=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),Ut=function(e,t,i,r,a){if(!a&&(a={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),s=new et(n.length+e.length);s.set(n),s.set(e,n.length),e=s,a.w=n.length}return function(e,t,i,r,a,n){var s=n.z||e.length,o=new et(r+s+5*(1+Math.ceil(s/7e3))+a),u=o.subarray(r,o.length-a),c=n.l,l=7&(n.r||0);if(t){l&&(u[0]=n.r>>3);for(var d=kt[t-1],h=d>>13,g=8191&d,f=(1<<i)-1,p=n.p||new tt(32768),v=n.h||new tt(f+1),_=Math.ceil(i/3),m=2*_,A=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&f},y=new it(25e3),S=new tt(288),w=new tt(32),I=0,b=0,M=n.i||0,E=0,P=n.w||0,C=0;M+2<s;++M){var k=A(M),R=32767&M,T=v[k];if(p[R]=T,v[k]=R,P<=M){var U=s-M;if((I>7e3||E>24576)&&(U>423||!c)){l=Ct(e,u,0,y,S,w,b,E,C,M-C,l),E=I=b=0,C=M;for(var L=0;L<286;++L)S[L]=0;for(L=0;L<30;++L)w[L]=0}var B=2,x=0,O=g,D=R-T&32767;if(U>2&&k==A(M-D))for(var q=Math.min(h,U)-1,N=Math.min(32767,M),$=Math.min(258,U);D<=N&&--O&&R!=T;){if(e[M+B]==e[M+B-D]){for(var K=0;K<$&&e[M+K]==e[M+K-D];++K);if(K>B){if(B=K,x=D,K>q)break;var G=Math.min(D,K-2),j=0;for(L=0;L<G;++L){var V=M-D+L&32767,F=V-p[V]&32767;F>j&&(j=F,T=V)}}}D+=(R=T)-(T=p[R])&32767}if(x){y[E++]=268435456|ct[B]<<18|lt[x];var W=31&ct[B],H=31&lt[x];b+=rt[W]+at[H],++S[257+W],++w[H],P=M+B,++I}else y[E++]=e[M],++S[e[M]]}}for(M=Math.max(M,P);M<s;++M)y[E++]=e[M],++S[e[M]];l=Ct(e,u,c,y,S,w,b,E,C,M-C,l),c||(n.r=7&l|u[l/8|0]<<3,l-=7,n.h=v,n.p=p,n.i=M,n.w=P)}else{for(M=n.w||0;M<s+c;M+=65535){var z=M+65535;z>=s&&(u[l/8|0]=c,z=s),l=Pt(u,l+1,e.subarray(M,z))}n.i=s}return yt(o,0,r+At(l)+a)}(e,null==t.level?6:t.level,null==t.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,r,a)},Lt=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Bt(e,t){t||(t={});var i=function(){var e=-1;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=Tt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var a,n=Ut(e,t,10+((a=t).filename?a.filename.length+1:0),8),s=n.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Lt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(n,t),Lt(n,s-8,i.d()),Lt(n,s-4,r),n}var xt="undefined"!=typeof TextEncoder&&new TextEncoder,Ot="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ot.decode(Rt,{stream:!0})}catch(e){}var Dt,qt="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Dt||(Dt={}));var Nt=e=>{var{data:t,compression:i}=e;if(t){var r=(e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t))(t),a=new Blob([r]).size;if(i===Dt.GZipJS&&a>=1024)try{var n=Bt(function(e,t){if(xt)return xt.encode(e);for(var i=e.length,r=new et(e.length+(e.length>>1)),a=0,n=function(e){r[a++]=e},s=0;s<i;++s){if(a+5>r.length){var o=new et(a+8+(i-s<<1));o.set(r),r=o}var u=e.charCodeAt(s);u<128||t?n(u):u<2048?(n(192|u>>6),n(128|63&u)):u>55295&&u<57344?(n(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>18),n(128|u>>12&63),n(128|u>>6&63),n(128|63&u)):(n(224|u>>12),n(128|u>>6&63),n(128|63&u))}return yt(r,0,a)}(r),{mtime:0}),s=new Blob([n],{type:qt});if(s.size<.95*a)return{contentType:qt,body:s,estimatedSize:s.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:a}}},$t=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var r=Nt(e);if(r){var{contentType:a,body:n,estimatedSize:s}=r,o=e.compression===Dt.GZipJS&&a===qt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,u=i({"Content-Type":a},e.headers||{}),c=new AbortController,l=e.timeout?setTimeout(()=>c.abort(),e.timeout):null;fetch(o,{method:e.method||"POST",headers:u,body:n,keepalive:s<52428.8,signal:c.signal}).then(function(){var i=t(function*(t){var i,r=yield t.text(),a={statusCode:t.status,text:r};if(200===t.status)try{a.json=JSON.parse(r)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,a)});return function(e){return i.apply(this,arguments)}}()).catch(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=Nt(e);if(t){var{contentType:i,body:r}=t,a=e.compression===Dt.GZipJS&&i===qt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,n=new XMLHttpRequest;n.open(e.method||"POST",a,!0),e.headers&&Object.entries(e.headers).forEach(e=>{var[t,i]=e;n.setRequestHeader(t,i)}),n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{var t;if(4===n.readyState){var i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},n.send(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Nt(e);if(t){var{contentType:i,body:r}=t;try{var a="string"==typeof r?new Blob([r],{type:i}):r,n=e.compression===Dt.GZipJS&&i===qt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,a)}catch(e){}}}}],Kt=e=>{var t,i=e.transport||"fetch",r=$t.find(e=>e.name===i&&e.available)||$t.find(e=>e.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0}));r.method(e)};class Gt{constructor(e,t){var i,r,a,n;this._isPaused=!0,this._queue=[],this._flushTimeoutMs=(i=(null==t?void 0:t.flush_interval_ms)||3e3,r=250,a=5e3,n=3e3,"number"!=typeof i||isNaN(i)?n:Math.min(Math.max(i,r),a)),this._sendRequest=e}get length(){return this._queue.length}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){if(this._clearFlushTimeout(),0!==this._queue.length){var e=this._formatQueue();for(var t in e){var r=e[t];this._sendRequest(i({},r,{transport:"sendBeacon"}))}}}enable(){this._isPaused=!1,this._setFlushTimeout()}pause(){this._isPaused=!0,this._clearFlushTimeout()}flush(){this._clearFlushTimeout(),this._flushNow(),this._setFlushTimeout()}_setFlushTimeout(){this._isPaused||(this._flushTimeout=setTimeout(()=>{this._clearFlushTimeout(),this._flushNow(),this._queue.length>0&&this._setFlushTimeout()},this._flushTimeoutMs))}_clearFlushTimeout(){this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0)}_flushNow(){if(0!==this._queue.length){var e=this._formatQueue(),t=Date.now();for(var i in e){var r=e[i];r.events.forEach(e=>{var i=new Date(e.timestamp).getTime();e.$offset=Math.abs(i-t)}),this._sendRequest(r)}}}_formatQueue(){var e={};return this._queue.forEach(t=>{var i=t.batchKey||t.url;e[i]||(e[i]={url:t.url,events:[],batchKey:t.batchKey}),e[i].events.push(t.event)}),this._queue=[],e}}class jt{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._areWeOnline=!0,this._sendRequest=e.sendRequest,this._sendBeacon=e.sendBeacon,b&&void 0!==E&&"onLine"in E&&(this._areWeOnline=E.onLine,S(b,"online",()=>{this._areWeOnline=!0,this._flush()}),S(b,"offline",()=>{this._areWeOnline=!1}))}get length(){return this._queue.length}enqueue(e,t){if(void 0===t&&(t=0),t>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),a=(Math.random()-.5)*(r-i);return Math.ceil(r+a)}(t),r=Date.now()+i;this._queue.push({retryAt:r,request:e,retriesPerformedSoFar:t+1});var a="VTilt: Enqueued failed request for retry in "+Math.round(i/1e3)+"s";this._areWeOnline||(a+=" (Browser is offline)"),console.warn(a),this._isPolling||(this._isPolling=!0,this._poll())}}retriableRequest(e){var i=this;return t(function*(){try{var t=yield i._sendRequest(e);200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&i.enqueue(e,0)}catch(t){i.enqueue(e,0)}})()}_poll(){this._poller&&clearTimeout(this._poller),this._poller=setTimeout(()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._queue.length>0?this._poll():this._isPolling=!1},this._pollIntervalMs)}_flush(){var e=this,i=Date.now(),r=[],a=[];this._queue.forEach(e=>{e.retryAt<i?a.push(e):r.push(e)}),this._queue=r,a.forEach(function(){var i=t(function*(t){var{request:i,retriesPerformedSoFar:r}=t;try{var a=yield e._sendRequest(i);200!==a.statusCode&&(a.statusCode<400||a.statusCode>=500)&&e.enqueue(i,r)}catch(t){e.enqueue(i,r)}});return function(e){return i.apply(this,arguments)}}())}unload(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._queue.forEach(e=>{var{request:t}=e;try{this._sendBeacon(t)}catch(e){console.error("VTilt: Failed to send beacon on unload",e)}}),this._queue=[]}}var Vt="vt_rate_limit";class Ft{constructor(e){var t,i;void 0===e&&(e={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(t=e.eventsPerSecond)&&void 0!==t?t:10,this.eventsBurstLimit=Math.max(null!==(i=e.eventsBurstLimit)&&void 0!==i?i:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=e.persistence,this.captureWarning=e.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(e){var t,i,r,a;void 0===e&&(e=!1);var n=Date.now(),s=null!==(i=null===(t=this.persistence)||void 0===t?void 0:t.get(Vt))&&void 0!==i?i:{tokens:this.eventsBurstLimit,last:n},o=(n-s.last)/1e3;s.tokens+=o*this.eventsPerSecond,s.last=n,s.tokens>this.eventsBurstLimit&&(s.tokens=this.eventsBurstLimit);var u=s.tokens<1;return u||e||(s.tokens=Math.max(0,s.tokens-1)),!u||this.lastEventRateLimited||e||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=u,null===(a=this.persistence)||void 0===a||a.set(Vt,s),{isRateLimited:u,remainingTokens:s.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Wt{constructor(e){void 0===e&&(e={}),this.__loaded=!1,this._initial_pageview_captured=!1,this._visibility_state_listener=null,this.__request_queue=[],this._has_warned_about_config=!1,this._set_once_properties_sent=!1,this.configManager=new r(e);var t=this.configManager.getConfig();this.sessionManager=new O(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Qe(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new Ze(t,this),this.rateLimiter=new Ft({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new jt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new Gt(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==zt){var a=null!==(r=Ht[i])&&void 0!==r?r:new Wt;return a._init(e,t,i),Ht[i]=a,Ht[zt][i]=a,a}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(i({},t,{projectId:e||t.projectId,name:r})),this.__loaded=!0;var a=this.configManager.getConfig();return this.userManager.set_initial_person_info(a.mask_personal_data_properties,a.custom_personal_data_properties),this.historyAutocapture=new Ye(this),this.historyAutocapture.startIfEnabled(),this._setup_unload_handler(),this._start_queue_if_opted_in(),!1!==a.capture_pageview&&this._capture_initial_pageview(),this}_start_queue_if_opted_in(){this.requestQueue.enable()}_setup_unload_handler(){if(b){var e=()=>{this.requestQueue.unload(),this.retryQueue.unload()};S(b,"beforeunload",e),S(b,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:zt;return t!==zt&&(t=zt+"."+t),t}getCurrentDomain(){if(!C)return"";var e=C.protocol,t=C.hostname,i=C.port;return e+"//"+t+(i?":"+i:"")}_is_configured(){var e=this.configManager.getConfig();return!(!e.projectId||!e.token)||(this._has_warned_about_config||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this._has_warned_about_config=!0),!1)}buildUrl(){var e=this.configManager.getConfig(),{proxyUrl:t,proxy:i,api_host:r,token:a}=e;return t||(i?i+"/api/tracking?token="+a:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+a:"/api/tracking?token="+a)}sendRequest(e,t,i){if(this._is_configured()){if(i&&void 0!==b)if(b.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:e,event:t});this.requestQueue.enqueue({url:e,event:t})}}_send_batched_request(e){var{transport:t}=e;"sendBeacon"!==t?this.retryQueue.retriableRequest(e):this._send_beacon_request(e)}_send_http_request(e){return new Promise(t=>{var{url:i,events:r}=e,a=1===r.length?r[0]:{events:r},n=this.configManager.getConfig().disable_compression?Dt.None:Dt.GZipJS;Kt({url:i,data:a,method:"POST",transport:"XHR",compression:n,callback:e=>{t({statusCode:e.statusCode})}})})}_send_beacon_request(e){var{url:t,events:i}=e,r=1===i.length?i[0]:{events:i},a=this.configManager.getConfig().disable_compression?Dt.None:Dt.GZipJS;Kt({url:t,data:r,method:"POST",transport:"sendBeacon",compression:a})}_send_retriable_request(e){this.sendRequest(e.url,e.event,!1)}capture(e,t,r){if(this.sessionManager.setSessionId(),E&&E.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(E.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var a=this.buildUrl(),n=Je(),s=this.userManager.getUserProperties(),o=this.userManager.get_initial_props(),u=this.sessionManager.getSessionId(),c=this.sessionManager.getWindowId(),l=this.userManager.getAnonymousId(),d={};!this._set_once_properties_sent&&Object.keys(o).length>0&&Object.assign(d,o),t.$set_once&&Object.assign(d,t.$set_once);var h=i({},n,s,{$session_id:u,$window_id:c},l?{$anon_distinct_id:l}:{},Object.keys(d).length>0?{$set_once:d}:{},t.$set?{$set:t.$set}:{},t);!this._set_once_properties_sent&&Object.keys(o).length>0&&(this._set_once_properties_sent=!0),"$pageview"===e&&P&&(h.title=P.title);var g,f,p=this.configManager.getConfig();if(!1!==p.stringifyPayload){if(g=Object.assign({},h,p.globalAttributes),!A(g=JSON.stringify(g)))return}else if(g=Object.assign({},h,p.globalAttributes),!A(JSON.stringify(g)))return;f="$identify"===e?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var v={timestamp:(new Date).toISOString(),event:e,project_id:p.projectId||"",payload:g,distinct_id:f,anonymous_id:l};this.sendRequest(a,v,!0)}}_capture_internal(e,t){this.capture(e,t,{skip_client_rate_limiting:!0})}trackEvent(e,t){void 0===t&&(t={}),this.capture(e,t)}identify(e,t,i){if("number"==typeof e&&(e=String(e),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.userManager.isDistinctIdStringLikePublic(e))console.error('The string "'+e+'" 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"!==e){var r=this.userManager.getDistinctId(),a=this.userManager.getAnonymousId(),n=this.userManager.getDeviceId(),s="anonymous"===this.userManager.getUserState();if(!n){var o=r||a;this.userManager.ensureDeviceId(o)}e!==r&&s?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$identify",{distinct_id:e,$anon_distinct_id:a,$set:t||{},$set_once:i||{}}),this.userManager.setDistinctId(e)):t||i?(s&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$set",{$set:t||{},$set_once:i||{}})):e!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(e))}else console.error('The string "'+e+'" 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(e,t){this.userManager.setUserProperties(e,t)&&this.capture("$set",{$set:e||{},$set_once:t||{}})}resetUser(e){this.sessionManager.resetSessionId(),this.userManager.reset(e)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(e,t){var i=this.userManager.createAlias(e,t);i?this.capture("$alias",{$original_id:i.original,$alias_id:i.distinct_id}):e===(t||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(e)}_capture_initial_pageview(){P&&("visible"===P.visibilityState?this._initial_pageview_captured||(this._initial_pageview_captured=!0,setTimeout(()=>{if(P&&C){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this._visibility_state_listener&&(P.removeEventListener("visibilitychange",this._visibility_state_listener),this._visibility_state_listener=null)):this._visibility_state_listener||(this._visibility_state_listener=()=>{this._capture_initial_pageview()},S(P,"visibilitychange",this._visibility_state_listener)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}updateConfig(e){this.configManager.updateConfig(e);var t=this.configManager.getConfig();this.sessionManager=new O(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Qe(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new Ze(t,this)}_execute_array(e){Array.isArray(e)&&e.forEach(e=>{if(e&&Array.isArray(e)&&e.length>0){var t=e[0],i=e.slice(1);if("function"==typeof this[t])try{this[t](...i)}catch(e){console.error("vTilt: Error executing queued call "+t+":",e)}}})}_dom_loaded(){this.__request_queue.forEach(e=>{this._send_retriable_request(e)}),this.__request_queue=[],this._start_queue_if_opted_in()}}var Ht={},zt="vt",Jt=!(void 0!==R||void 0!==k)&&-1===(null==T?void 0:T.indexOf("MSIE"))&&-1===(null==T?void 0:T.indexOf("Mozilla"));null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=Jt);var Qt,Zt=(Qt=Ht[zt]=new Wt,function(){function e(){e.done||(e.done=!0,Jt=!1,null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=!1),y(Ht,function(e){e._dom_loaded()}))}P&&"function"==typeof P.addEventListener?"complete"===P.readyState?e():S(P,"DOMContentLoaded",e,{capture:!1}):b&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),Qt);export{Wt as VTilt,Zt as default,Zt as vt};
2
2
  //# sourceMappingURL=module.no-external.js.map