@v-tilt/browser 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/constants.d.ts +172 -10
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +182 -50
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +182 -50
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/session.d.ts +2 -2
- package/dist/types.d.ts +154 -38
- package/dist/user-manager.d.ts +2 -2
- package/dist/vtilt.d.ts +19 -11
- package/lib/config.js +6 -13
- package/lib/constants.d.ts +172 -10
- package/lib/constants.js +644 -439
- package/lib/request.js +13 -13
- package/lib/session.d.ts +2 -2
- package/lib/session.js +3 -3
- package/lib/types.d.ts +154 -38
- package/lib/types.js +6 -0
- package/lib/user-manager.d.ts +2 -2
- package/lib/user-manager.js +38 -11
- package/lib/vtilt.d.ts +19 -11
- package/lib/vtilt.js +73 -42
- package/lib/web-vitals.js +1 -1
- package/package.json +13 -12
- package/LICENSE +0 -21
|
@@ -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({projectId:e.projectId||"",token:e.token||""},e);var t=document.currentScript,r=i({projectId:"",token:""},e);if(r.host=t.getAttribute("data-host")||e.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.webVitals="true"===t.getAttribute("web-vitals")||"true"===t.getAttribute("data-web-vitals")||e.webVitals,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("tb_")&&(r.globalAttributes[a.name.slice(3).replace(/-/g,"_")]=a.value),a.name.startsWith("data-tb-")&&(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_id",n="vt_window_id",s="vt_primary_window_exists",o="vt_anonymous_id",u="vt_distinct_id",c="vt_device_id",l="vt_user_properties",d="vt_user_state",h="$initial_person_info",g="localStorage",f="sessionStorage",p={"Asia/Barnaul":"RU","Africa/Nouakchott":"MR","Africa/Lusaka":"ZM","Asia/Pyongyang":"KP","Europe/Bratislava":"SK","America/Belize":"BZ","America/Maceio":"BR","Pacific/Chuuk":"FM","Indian/Comoro":"KM","Pacific/Palau":"PW","Asia/Jakarta":"ID","Africa/Windhoek":"NA","America/Chihuahua":"MX","America/Nome":"US","Africa/Mbabane":"SZ","Africa/Porto-Novo":"BJ","Europe/San_Marino":"SM","Pacific/Fakaofo":"TK","America/Denver":"US","Europe/Belgrade":"RS","America/Indiana/Tell_City":"US","America/Fortaleza":"BR","America/Halifax":"CA","Europe/Bucharest":"RO","America/Indiana/Petersburg":"US","Europe/Kirov":"RU","Europe/Athens":"GR","America/Argentina/Ushuaia":"AR","Europe/Monaco":"MC","Europe/Vilnius":"LT","Europe/Copenhagen":"DK","Pacific/Kanton":"KI","America/Caracas":"VE","Asia/Almaty":"KZ","Europe/Paris":"FR","Africa/Blantyre":"MW","Asia/Muscat":"OM","America/North_Dakota/Beulah":"US","America/Matamoros":"MX","Asia/Irkutsk":"RU","America/Costa_Rica":"CR","America/Araguaina":"BR","Atlantic/Canary":"ES","America/Santo_Domingo":"DO","America/Vancouver":"CA","Africa/Addis_Ababa":"ET","Africa/Accra":"GH","Pacific/Kwajalein":"MH","Asia/Baghdad":"IQ","Australia/Adelaide":"AU","Australia/Hobart":"AU","America/Guayaquil":"EC","America/Argentina/Tucuman":"AR","Australia/Lindeman":"AU","America/New_York":"US","Pacific/Fiji":"FJ","America/Antigua":"AG","Africa/Casablanca":"MA","America/Paramaribo":"SR","Africa/Cairo":"EG","America/Cayenne":"GF","America/Detroit":"US","Antarctica/Syowa":"AQ","Africa/Douala":"CM","America/Argentina/La_Rioja":"AR","Africa/Lagos":"NG","America/St_Barthelemy":"BL","Asia/Nicosia":"CY","Asia/Macau":"MO","Europe/Riga":"LV","Asia/Ashgabat":"TM","Indian/Antananarivo":"MG","America/Argentina/San_Juan":"AR","Asia/Aden":"YE","Asia/Tomsk":"RU","America/Asuncion":"PY","Pacific/Bougainville":"PG","Asia/Vientiane":"LA","America/Mazatlan":"MX","Africa/Luanda":"AO","Europe/Oslo":"NO","Africa/Kinshasa":"CD","Europe/Warsaw":"PL","America/Grand_Turk":"TC","Asia/Seoul":"KR","Africa/Tripoli":"LY","America/St_Thomas":"VI","Asia/Kathmandu":"NP","Pacific/Pitcairn":"PN","Pacific/Nauru":"NR","America/Curacao":"CW","Asia/Kabul":"AF","Pacific/Tongatapu":"TO","Europe/Simferopol":"UA","Asia/Ust-Nera":"RU","Africa/Mogadishu":"SO","Indian/Mayotte":"YT","Pacific/Niue":"NU","America/Thunder_Bay":"CA","Atlantic/Azores":"PT","Pacific/Gambier":"PF","Europe/Stockholm":"SE","Africa/Libreville":"GA","America/Punta_Arenas":"CL","America/Guatemala":"GT","America/Noronha":"BR","Europe/Helsinki":"FI","Asia/Gaza":"PS","Pacific/Kosrae":"FM","America/Aruba":"AW","America/Nassau":"BS","Asia/Choibalsan":"MN","America/Winnipeg":"CA","America/Anguilla":"AI","Asia/Thimphu":"BT","Asia/Beirut":"LB","Atlantic/Faroe":"FO","Europe/Berlin":"DE","Europe/Amsterdam":"NL","Pacific/Honolulu":"US","America/Regina":"CA","America/Scoresbysund":"GL","Europe/Vienna":"AT","Europe/Tirane":"AL","Africa/El_Aaiun":"EH","America/Creston":"CA","Asia/Qostanay":"KZ","Asia/Ho_Chi_Minh":"VN","Europe/Samara":"RU","Europe/Rome":"IT","Australia/Eucla":"AU","America/El_Salvador":"SV","America/Chicago":"US","Africa/Abidjan":"CI","Asia/Kamchatka":"RU","Pacific/Tarawa":"KI","America/Santiago":"CL","America/Bahia":"BR","Indian/Christmas":"CX","Asia/Atyrau":"KZ","Asia/Dushanbe":"TJ","Europe/Ulyanovsk":"RU","America/Yellowknife":"CA","America/Recife":"BR","Australia/Sydney":"AU","America/Fort_Nelson":"CA","Pacific/Efate":"VU","Europe/Saratov":"RU","Africa/Banjul":"GM","Asia/Omsk":"RU","Europe/Ljubljana":"SI","Europe/Budapest":"HU","Europe/Astrakhan":"RU","America/Argentina/Buenos_Aires":"AR","Pacific/Chatham":"NZ","America/Argentina/Salta":"AR","Africa/Niamey":"NE","Asia/Pontianak":"ID","Indian/Reunion":"RE","Asia/Hong_Kong":"HK","Antarctica/McMurdo":"AQ","Africa/Malabo":"GQ","America/Los_Angeles":"US","America/Argentina/Cordoba":"AR","Pacific/Pohnpei":"FM","America/Tijuana":"MX","America/Campo_Grande":"BR","America/Dawson_Creek":"CA","Asia/Novosibirsk":"RU","Pacific/Pago_Pago":"AS","Asia/Jerusalem":"IL","Europe/Sarajevo":"BA","Africa/Freetown":"SL","Asia/Yekaterinburg":"RU","America/Juneau":"US","Africa/Ouagadougou":"BF","Africa/Monrovia":"LR","Europe/Kiev":"UA","America/Argentina/San_Luis":"AR","Asia/Tokyo":"JP","Asia/Qatar":"QA","America/La_Paz":"BO","America/Bogota":"CO","America/Thule":"GL","Asia/Manila":"PH","Asia/Hovd":"MN","Asia/Tehran":"IR","Atlantic/Madeira":"PT","America/Metlakatla":"US","Europe/Vatican":"VA","Asia/Bishkek":"KG","Asia/Dili":"TL","Antarctica/Palmer":"AQ","Atlantic/Cape_Verde":"CV","Indian/Chagos":"IO","America/Kentucky/Monticello":"US","Africa/Algiers":"DZ","Africa/Maseru":"LS","Asia/Kuala_Lumpur":"MY","Africa/Khartoum":"SD","America/Argentina/Rio_Gallegos":"AR","America/Blanc-Sablon":"CA","Africa/Maputo":"MZ","America/Tortola":"VG","Atlantic/Bermuda":"BM","America/Argentina/Catamarca":"AR","America/Cayman":"KY","America/Puerto_Rico":"PR","Pacific/Majuro":"MH","Europe/Busingen":"DE","Pacific/Midway":"UM","Indian/Cocos":"CC","Asia/Singapore":"SG","America/Boise":"US","America/Nuuk":"GL","America/Goose_Bay":"CA","Australia/Broken_Hill":"AU","Africa/Dar_es_Salaam":"TZ","Africa/Asmara":"ER","Asia/Samarkand":"UZ","Asia/Tbilisi":"GE","America/Argentina/Jujuy":"AR","America/Indiana/Winamac":"US","America/Porto_Velho":"BR","Asia/Magadan":"RU","Europe/Zaporozhye":"UA","Antarctica/Casey":"AQ","Asia/Shanghai":"CN","Pacific/Norfolk":"NF","Europe/Guernsey":"GG","Australia/Brisbane":"AU","Antarctica/DumontDUrville":"AQ","America/Havana":"CU","America/Atikokan":"CA","America/Mexico_City":"MX","America/Rankin_Inlet":"CA","America/Cuiaba":"BR","America/Resolute":"CA","Africa/Ceuta":"ES","Arctic/Longyearbyen":"SJ","Pacific/Guam":"GU","Asia/Damascus":"SY","Asia/Colombo":"LK","Asia/Yerevan":"AM","America/Montserrat":"MS","America/Belem":"BR","Europe/Kaliningrad":"RU","Atlantic/South_Georgia":"GS","Asia/Tashkent":"UZ","Asia/Kolkata":"IN","America/St_Johns":"CA","Asia/Srednekolymsk":"RU","Asia/Yakutsk":"RU","Europe/Prague":"CZ","Africa/Djibouti":"DJ","Asia/Dubai":"AE","Europe/Uzhgorod":"UA","America/Edmonton":"CA","Asia/Famagusta":"CY","America/Indiana/Knox":"US","Asia/Hebron":"PS","Asia/Taipei":"TW","Europe/London":"GB","Africa/Dakar":"SN","Australia/Darwin":"AU","America/Glace_Bay":"CA","Antarctica/Vostok":"AQ","America/Indiana/Vincennes":"US","America/Nipigon":"CA","Asia/Kuwait":"KW","Pacific/Guadalcanal":"SB","America/Toronto":"CA","Africa/Gaborone":"BW","Africa/Bujumbura":"BI","Africa/Lubumbashi":"CD","America/Merida":"MX","America/Marigot":"MF","Europe/Zagreb":"HR","Pacific/Easter":"CL","America/Santarem":"BR","Pacific/Noumea":"NC","America/Sitka":"US","Atlantic/Stanley":"FK","Pacific/Funafuti":"TV","America/Iqaluit":"CA","America/Rainy_River":"CA","America/Anchorage":"US","America/Lima":"PE","Asia/Baku":"AZ","America/Indiana/Vevay":"US","Asia/Ulaanbaatar":"MN","America/Managua":"NI","Asia/Krasnoyarsk":"RU","Asia/Qyzylorda":"KZ","America/Eirunepe":"BR","Europe/Podgorica":"ME","Europe/Chisinau":"MD","Europe/Mariehamn":"AX","Europe/Volgograd":"RU","Africa/Nairobi":"KE","Europe/Isle_of_Man":"IM","America/Menominee":"US","Africa/Harare":"ZW","Asia/Anadyr":"RU","America/Moncton":"CA","Indian/Maldives":"MV","America/Whitehorse":"CA","Antarctica/Mawson":"AQ","Europe/Madrid":"ES","America/Argentina/Mendoza":"AR","America/Manaus":"BR","Africa/Bangui":"CF","Indian/Mauritius":"MU","Africa/Tunis":"TN","Australia/Lord_Howe":"AU","America/Kentucky/Louisville":"US","America/North_Dakota/Center":"US","Asia/Novokuznetsk":"RU","Asia/Makassar":"ID","America/Port_of_Spain":"TT","America/Bahia_Banderas":"MX","Pacific/Auckland":"NZ","America/Sao_Paulo":"BR","Asia/Dhaka":"BD","America/Pangnirtung":"CA","Europe/Dublin":"IE","Asia/Brunei":"BN","Africa/Brazzaville":"CG","America/Montevideo":"UY","America/Jamaica":"JM","America/Indiana/Indianapolis":"US","America/Kralendijk":"BQ","Europe/Gibraltar":"GI","Pacific/Marquesas":"PF","Pacific/Apia":"WS","Europe/Jersey":"JE","America/Phoenix":"US","Africa/Ndjamena":"TD","Asia/Karachi":"PK","Africa/Kampala":"UG","Asia/Sakhalin":"RU","America/Martinique":"MQ","Europe/Moscow":"RU","Africa/Conakry":"GN","America/Barbados":"BB","Africa/Lome":"TG","America/Ojinaga":"MX","America/Tegucigalpa":"HN","Asia/Bangkok":"TH","Africa/Johannesburg":"ZA","Europe/Vaduz":"LI","Africa/Sao_Tome":"ST","America/Cambridge_Bay":"CA","America/Lower_Princes":"SX","America/Miquelon":"PM","America/St_Kitts":"KN","Australia/Melbourne":"AU","Europe/Minsk":"BY","Asia/Vladivostok":"RU","Europe/Sofia":"BG","Antarctica/Davis":"AQ","Pacific/Galapagos":"EC","America/North_Dakota/New_Salem":"US","Asia/Amman":"JO","Pacific/Wallis":"WF","America/Hermosillo":"MX","Pacific/Kiritimati":"KI","Antarctica/Macquarie":"AU","America/Guyana":"GY","Asia/Riyadh":"SA","Pacific/Tahiti":"PF","America/St_Vincent":"VC","America/Cancun":"MX","America/Grenada":"GD","Pacific/Wake":"UM","America/Dawson":"CA","Europe/Brussels":"BE","Indian/Kerguelen":"TF","America/Yakutat":"US","Indian/Mahe":"SC","Atlantic/Reykjavik":"IS","America/Panama":"PA","America/Guadeloupe":"GP","Europe/Malta":"MT","Antarctica/Troll":"AQ","Asia/Jayapura":"ID","Asia/Bahrain":"BH","Asia/Chita":"RU","Europe/Tallinn":"EE","Asia/Khandyga":"RU","America/Rio_Branco":"BR","Atlantic/St_Helena":"SH","Africa/Juba":"SS","America/Adak":"US","Pacific/Saipan":"MP","America/St_Lucia":"LC","America/Inuvik":"CA","Europe/Luxembourg":"LU","Africa/Bissau":"GW","Asia/Oral":"KZ","America/Boa_Vista":"BR","Europe/Skopje":"MK","America/Port-au-Prince":"HT","Pacific/Port_Moresby":"PG","Europe/Andorra":"AD","America/Indiana/Marengo":"US","Africa/Kigali":"RW","Africa/Bamako":"ML","America/Dominica":"DM","Asia/Aqtobe":"KZ","Europe/Istanbul":"TR","Pacific/Rarotonga":"CK","America/Danmarkshavn":"GL","Europe/Zurich":"CH","Asia/Yangon":"MM","America/Monterrey":"MX","Europe/Lisbon":"PT","Asia/Kuching":"MY","Antarctica/Rothera":"AQ","Australia/Perth":"AU","Asia/Phnom_Penh":"KH","America/Swift_Current":"CA","Asia/Aqtau":"KZ","Asia/Urumqi":"CN","Asia/Calcutta":"IN"};function v(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function m(e){return!(!e||"string"!=typeof e)&&!(e.length<2||e.length>10240)}function A(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 _(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 y(e,t){if(!t)return e;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function S(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 w="undefined"!=typeof window?window:void 0,I="undefined"!=typeof globalThis?globalThis:w,b=null==I?void 0:I.navigator,M=null==I?void 0:I.document,P=null==I?void 0:I.location,E=null==I?void 0:I.fetch,C=(null==I?void 0:I.XMLHttpRequest)&&"withCredentials"in new I.XMLHttpRequest?I.XMLHttpRequest:void 0;null==I||I.AbortController;var R=null==b?void 0:b.userAgent;class U{constructor(e,t){void 0===e&&(e="cookie"),this.storageMethod=e,this.domain=t,this._windowId=void 0,this._initializeWindowId()}_isWebStorage(){return this.storageMethod===g||this.storageMethod===f}_getStorage(){return this._isWebStorage()?this.storageMethod===g?localStorage:sessionStorage:null}_createSessionData(e){return{value:e,expiry:(new Date).getTime()+18e5}}_storeSessionIdInWebStorage(e){var t=this._getStorage();if(t){var i=this._createSessionData(e);t.setItem(a,JSON.stringify(i))}}getSessionIdFromCookie(){var e={};return document.cookie.split(";").forEach(function(t){var[i,r]=t.split("=");e[i.trim()]=r}),e[a]||null}setSessionIdFromCookie(e){var t=a+"="+e+"; Max-Age=1800; path=/; secure";this.domain&&(t+="; domain="+this.domain),document.cookie=t}_storeSessionId(e){this._isWebStorage()?this._storeSessionIdInWebStorage(e):this.setSessionIdFromCookie(e)}_getSessionIdRaw(){var e=this._getStorage();if(e){var t=e.getItem(a);if(!t)return null;var i=null;try{i=JSON.parse(t)}catch(e){return null}return"object"!=typeof i||null===i?null:(new Date).getTime()>i.expiry?(e.removeItem(a),null):i.value}return this.getSessionIdFromCookie()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=v(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||v();return this._storeSessionId(e),e}_clearSessionId(){var e=this._getStorage();if(e)e.removeItem(a);else{var t="Thu, 01 Jan 1970 00:00:00 UTC";document.cookie=a+"=; expires="+t+"; path=/;",this.domain&&(document.cookie=a+"=; expires="+t+"; path=/; domain="+this.domain+";")}}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(v())}getWindowId(){if(this._windowId)return this._windowId;if(this._canUseSessionStorage()&&w){var e=w.sessionStorage.getItem(n);if(e)return this._windowId=e,e}var t=v();return this._setWindowId(t),t}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&w&&w.sessionStorage.setItem(n,e))}_canUseSessionStorage(){if(void 0===w||!w.sessionStorage)return!1;try{var e="__vt_session_storage_test__";return w.sessionStorage.setItem(e,"test"),w.sessionStorage.removeItem(e),!0}catch(e){return!1}}_initializeWindowId(){if(this._canUseSessionStorage()&&w){var e=w.sessionStorage.getItem(s),t=w.sessionStorage.getItem(n);t&&!e?this._windowId=t:(t&&w.sessionStorage.removeItem(n),this._setWindowId(v())),w.sessionStorage.setItem(s,"true"),this._listenToUnload()}else this._windowId=v()}_listenToUnload(){w&&this._canUseSessionStorage()&&_(w,"beforeunload",()=>{w&&w.sessionStorage&&w.sessionStorage.removeItem(s)},{capture:!1})}}function T(e){if(!M)return null;var t=M.createElement("a");return t.href=e,t}function k(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 B(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 L(e){return"function"==typeof e}var D="Mobile",O="iOS",x="Android",q="Tablet",N=x+" "+q,V="iPad",$="Apple",K=$+" Watch",G="Safari",F="BlackBerry",j="Samsung",W=j+"Browser",H=j+" Internet",z="Chrome",J=z+" OS",Q=z+" "+O,Z="Internet Explorer",X=Z+" "+D,Y="Opera",ee=Y+" Mini",te="Edge",ie="Microsoft "+te,re="Firefox",ae=re+" "+O,ne="Nintendo",se="PlayStation",oe="Xbox",ue=x+" "+D,ce=D+" "+G,le="Windows",de=le+" Phone",he="Nokia",ge="Ouya",fe="Generic",pe=fe+" "+D.toLowerCase(),ve=fe+" "+q.toLowerCase(),me="Konqueror",Ae="(\\d+(\\.\\d+)?)",_e=new RegExp("Version/"+Ae),ye=new RegExp(oe,"i"),Se=new RegExp(se+" \\w+","i"),we=new RegExp(ne+" \\w+","i"),Ie=new RegExp(F+"|PlayBook|BB10","i"),be={"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 Me(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Pe=(e,t)=>t&&Me(t,$)||function(e){return Me(e,G)&&!Me(e,z)&&!Me(e,x)}(e),Ee=function(e,t){return t=t||"",Me(e," OPR/")&&Me(e,"Mini")?ee:Me(e," OPR/")?Y:Ie.test(e)?F:Me(e,"IE"+D)||Me(e,"WPDesktop")?X:Me(e,W)?H:Me(e,te)||Me(e,"Edg/")?ie:Me(e,"FBIOS")?"Facebook "+D:Me(e,"UCWEB")||Me(e,"UCBrowser")?"UC Browser":Me(e,"CriOS")?Q:Me(e,"CrMo")||Me(e,z)?z:Me(e,x)&&Me(e,G)?ue:Me(e,"FxiOS")?ae:Me(e.toLowerCase(),me.toLowerCase())?me:Pe(e,t)?Me(e,D)?ce:G:Me(e,re)?re:Me(e,"MSIE")||Me(e,"Trident/")?Z:Me(e,"Gecko")?re:""},Ce={[X]:[new RegExp("rv:"+Ae)],[ie]:[new RegExp(te+"?\\/"+Ae)],[z]:[new RegExp("("+z+"|CrMo)\\/"+Ae)],[Q]:[new RegExp("CriOS\\/"+Ae)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ae)],[G]:[_e],[ce]:[_e],[Y]:[new RegExp("(Opera|OPR)\\/"+Ae)],[re]:[new RegExp(re+"\\/"+Ae)],[ae]:[new RegExp("FxiOS\\/"+Ae)],[me]:[new RegExp("Konqueror[:/]?"+Ae,"i")],[F]:[new RegExp(F+" "+Ae),_e],[ue]:[new RegExp("android\\s"+Ae,"i")],[H]:[new RegExp(W+"\\/"+Ae)],[Z]:[new RegExp("(rv:|MSIE )"+Ae)],Mozilla:[new RegExp("rv:"+Ae)]},Re=function(e,t){var i=Ee(e,t),r=Ce[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},Ue=[[new RegExp(oe+"; "+oe+" (.*?)[);]","i"),e=>[oe,e&&e[1]||""]],[new RegExp(ne,"i"),[ne,""]],[new RegExp(se,"i"),[se,""]],[Ie,[F,""]],[new RegExp(le,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[de,""];if(new RegExp(D).test(t)&&!/IEMobile\b/.test(t))return[le+" "+D,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],a=be[r]||"";return/arm/i.test(t)&&(a="RT"),[le,a]}return[le,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[O,t.join(".")]}return[O,""]}],[/(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("("+x+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+x+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[x,t.join(".")]}return[x,""]}],[/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/,[J,""]],[/Linux|debian/i,["Linux",""]]],Te=function(e){return we.test(e)?ne:Se.test(e)?se:ye.test(e)?oe:new RegExp(ge,"i").test(e)?ge:new RegExp("("+de+"|WPDesktop)","i").test(e)?de:/iPad/.test(e)?V:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?K:Ie.test(e)?F:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(he,"i").test(e)?he:/(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(D).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)?x:N:x:new RegExp("(pda|"+D+")","i").test(e)?pe:new RegExp(q,"i").test(e)&&!new RegExp(q+" pc","i").test(e)?ve:""},ke="https?://(.*)",Be=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Le=S(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Be),De="<masked>";function Oe(e){var t=function(e){return e?0===e.search(ke+"google.([^/?]*)")?"google":0===e.search(ke+"bing.com")?"bing":0===e.search(ke+"yahoo.com")?"yahoo":0===e.search(ke+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var a=M?k(M.referrer,i):"";a.length&&(r.ph_keyword=a)}return r}function xe(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function qe(){return(null==M?void 0:M.referrer)||"$direct"}function Ne(){var e;return(null==M?void 0:M.referrer)&&(null===(e=T(M.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=T(i))||void 0===t?void 0:t.host};if(r){a.$current_url=r;var n=T(r);a.$host=null==n?void 0:n.host,a.$pathname=null==n?void 0:n.pathname;var s=function(e){var t=Le.concat([]),i={};return A(t,function(t){var r=k(e,t);i[t]=r||null}),i}(r);y(a,s)}i&&y(a,Oe(i));return a}function $e(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ke(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Ge(e,t){if(!R)return{};var i,r,a,[n,s]=function(e){for(var t=0;t<Ue.length;t++){var[i,r]=Ue[t],a=i.exec(e),n=a&&(L(r)?r(a,e):r);if(n)return n}return["",""]}(R);return y(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:Ee(R,navigator.vendor),$device:Te(R),$device_type:(r=R,a=Te(r),a===V||a===N||"Kobo"===a||"Kindle Fire"===a||a===ve?q:a===ne||a===oe||a===se||a===ge?"Console":a===K?"Wearable":a?D:"Desktop"),$timezone:$e(),$timezone_offset:Ke()}),{$current_url:B(null==P?void 0:P.href,[],De),$host:null==P?void 0:P.host,$pathname:null==P?void 0:P.pathname,$raw_user_agent:R.length>1e3?R.substring(0,997)+"...":R,$browser_version:Re(R,navigator.vendor),$browser_language:xe(),$browser_language_prefix:(i=xe(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==w?void 0:w.screen.height,$screen_width:null==w?void 0:w.screen.width,$viewport_height:null==w?void 0:w.innerHeight,$viewport_width:null==w?void 0:w.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 Fe{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storageMethod=e,this.domain=t,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.saveUserIdentity()),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}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)}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}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()}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}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())}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}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)}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)}loadUserIdentity(){var e=this.getStoredValue(o)||this.generateAnonymousId(),t=this.getStoredValue(u)||null,i=this.getStoredValue(c)||this.generateDeviceId(),r=this.getStoredUserProperties(),a=this.getStoredValue(d)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:a}}saveUserIdentity(){this.setStoredValue(o,this.userIdentity.anonymous_id),this.setStoredValue(c,this.userIdentity.device_id),this.setStoredValue(d,this.userIdentity.user_state),this.userIdentity.distinct_id?this.setStoredValue(u,this.userIdentity.distinct_id):this.removeStoredValue(u),this.setStoredUserProperties(this.userIdentity.properties)}generateAnonymousId(){return"anon_"+v()}generateDeviceId(){return"device_"+v()}getStoredValue(e){try{return this.storageMethod===g?localStorage.getItem(e):this.storageMethod===f?sessionStorage.getItem(e):this.getCookieValue(e)}catch(e){return console.warn("Failed to access storage:",e),null}}setStoredValue(e,t){try{this.storageMethod===g?localStorage.setItem(e,t):this.storageMethod===f?sessionStorage.setItem(e,t):this.setCookieValue(e,t)}catch(e){console.warn("Failed to save to storage:",e)}}removeStoredValue(e){this.storageMethod===g?localStorage.removeItem(e):this.storageMethod===f?sessionStorage.removeItem(e):this.removeCookieValue(e)}getStoredUserProperties(){var e=this.getStoredValue(l);if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}setStoredUserProperties(e){this.setStoredValue(l,JSON.stringify(e))}getCookieValue(e){var t=document.cookie.split(";");for(var i of t){var[r,a]=i.trim().split("=");if(r===e)return decodeURIComponent(a)}return null}setCookieValue(e,t){var i=e+"="+encodeURIComponent(t)+"; Max-Age=31536000; path=/; secure; SameSite=Lax";this.domain&&(i+="; domain="+this.domain),document.cookie=i}removeCookieValue(e){var t=e+"=; Max-Age=0; path=/";this.domain&&(t+="; domain="+this.domain),document.cookie=t}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)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[h]){var i=function(e,t){var i=e?S([],Be,t||[]):[],r=null==P?void 0:P.href.substring(0,1e3);return{r:qe().substring(0,1e3),u:r?B(r,i,De):void 0}}(e,t);this.register_once({[h]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[h];return i?(e=Ve(i),t={},A(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:qe(),$referring_domain:Ne()};this.register_once(e,void 0)}}class je{constructor(e,t){if(this.instance=t,e.webVitals&&w)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(!(w&&M&&b&&P))return;var{country:t,locale:i}=function(){var e,t;if(!b)return{country:e,locale:t};try{var i=Intl.DateTimeFormat().resolvedOptions().timeZone;e=p[i],t=b.languages&&b.languages.length?b.languages[0]:b.userLanguage||b.language||b.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:P.pathname,href:P.href,"user-agent":b.userAgent,locale:i,location:t,referrer:M.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 We(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],a=i(r);return L(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class He{constructor(e){var t;this._instance=e,this._lastPathname=(null===(t=null==w?void 0:w.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(w&&P&&(this._lastPathname=P.pathname||"",w.history)){var i=this;(null===(e=w.history.pushState)||void 0===e?void 0:e.__vtilt_wrapped__)||We(w.history,"pushState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("pushState")}),(null===(t=w.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||We(w.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==w?void 0:w.location)||void 0===t?void 0:t.pathname;if(!i||!P||!M)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&&w){var e=()=>{this._capturePageview("popstate")};_(w,"popstate",e),this._popstateListener=()=>{w&&w.removeEventListener("popstate",e)}}}}var ze=Uint8Array,Je=Uint16Array,Qe=Int32Array,Ze=new ze([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]),Xe=new ze([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]),Ye=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),et=function(e,t){for(var i=new Je(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var a=new Qe(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}},tt=et(Ze,2),it=tt.b,rt=tt.r;it[28]=258,rt[258]=28;for(var at=et(Xe,0).r,nt=new Je(32768),st=0;st<32768;++st){var ot=(43690&st)>>1|(21845&st)<<1;ot=(61680&(ot=(52428&ot)>>2|(13107&ot)<<2))>>4|(3855&ot)<<4,nt[st]=((65280&ot)>>8|(255&ot)<<8)>>1}var ut=function(e,t,i){for(var r=e.length,a=0,n=new Je(t);a<r;++a)e[a]&&++n[e[a]-1];var s,o=new Je(t);for(a=1;a<t;++a)o[a]=o[a-1]+n[a-1]<<1;if(i){s=new Je(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[nt[d]>>u]=c}else for(s=new Je(r),a=0;a<r;++a)e[a]&&(s[a]=nt[o[e[a]-1]++]>>15-e[a]);return s},ct=new ze(288);for(st=0;st<144;++st)ct[st]=8;for(st=144;st<256;++st)ct[st]=9;for(st=256;st<280;++st)ct[st]=7;for(st=280;st<288;++st)ct[st]=8;var lt=new ze(32);for(st=0;st<32;++st)lt[st]=5;var dt=ut(ct,9,0),ht=ut(lt,5,0),gt=function(e){return(e+7)/8|0},ft=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new ze(e.subarray(t,i))},pt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},vt=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},mt=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:bt,l:0};if(1==a){var s=new ze(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 Je(h+1),f=At(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 A=n[r].s;if(!(g[A]>t))break;p+=m-(1<<f-g[A]),g[A]=t}for(p>>=v;p>0;){var _=n[r].s;g[_]<t?p-=1<<t-g[_]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;g[y]==t&&(--g[y],++p)}f=t}return{t:new ze(g),l:f}},At=function(e,t,i){return-1==e.s?Math.max(At(e.l,t,i+1),At(e.r,t,i+1)):t[e.s]=i},_t=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Je(++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}},yt=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},St=function(e,t,i){var r=i.length,a=gt(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)},wt=function(e,t,i,r,a,n,s,o,u,c,l){pt(t,l++,i),++a[256];for(var d=mt(a,15),h=d.t,g=d.l,f=mt(n,15),p=f.t,v=f.l,m=_t(h),A=m.c,_=m.n,y=_t(p),S=y.c,w=y.n,I=new Je(19),b=0;b<A.length;++b)++I[31&A[b]];for(b=0;b<S.length;++b)++I[31&S[b]];for(var M=mt(I,7),P=M.t,E=M.l,C=19;C>4&&!P[Ye[C-1]];--C);var R,U,T,k,B=c+5<<3,L=yt(a,ct)+yt(n,lt)+s,D=yt(a,h)+yt(n,p)+s+14+3*C+yt(I,P)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&B<=L&&B<=D)return St(t,l,e.subarray(u,u+c));if(pt(t,l,1+(D<L)),l+=2,D<L){R=ut(h,g,0),U=h,T=ut(p,v,0),k=p;var O=ut(P,E,0);pt(t,l,_-257),pt(t,l+5,w-1),pt(t,l+10,C-4),l+=14;for(b=0;b<C;++b)pt(t,l+3*b,P[Ye[b]]);l+=3*C;for(var x=[A,S],q=0;q<2;++q){var N=x[q];for(b=0;b<N.length;++b){var V=31&N[b];pt(t,l,O[V]),l+=P[V],V>15&&(pt(t,l,N[b]>>5&127),l+=N[b]>>12)}}}else R=dt,U=ct,T=ht,k=lt;for(b=0;b<o;++b){var $=r[b];if($>255){vt(t,l,R[(V=$>>18&31)+257]),l+=U[V+257],V>7&&(pt(t,l,$>>23&31),l+=Ze[V]);var K=31&$;vt(t,l,T[K]),l+=k[K],K>3&&(vt(t,l,$>>5&8191),l+=Xe[K])}else vt(t,l,R[$]),l+=U[$]}return vt(t,l,R[256]),l+U[256]},It=new Qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bt=new ze(0),Mt=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}(),Pt=function(e,t,i,r,a){if(!a&&(a={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),s=new ze(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 ze(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=It[t-1],h=d>>13,g=8191&d,f=(1<<i)-1,p=n.p||new Je(32768),v=n.h||new Je(f+1),m=Math.ceil(i/3),A=2*m,_=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<A)&f},y=new Qe(25e3),S=new Je(288),w=new Je(32),I=0,b=0,M=n.i||0,P=0,E=n.w||0,C=0;M+2<s;++M){var R=_(M),U=32767&M,T=v[R];if(p[U]=T,v[R]=U,E<=M){var k=s-M;if((I>7e3||P>24576)&&(k>423||!c)){l=wt(e,u,0,y,S,w,b,P,C,M-C,l),P=I=b=0,C=M;for(var B=0;B<286;++B)S[B]=0;for(B=0;B<30;++B)w[B]=0}var L=2,D=0,O=g,x=U-T&32767;if(k>2&&R==_(M-x))for(var q=Math.min(h,k)-1,N=Math.min(32767,M),V=Math.min(258,k);x<=N&&--O&&U!=T;){if(e[M+L]==e[M+L-x]){for(var $=0;$<V&&e[M+$]==e[M+$-x];++$);if($>L){if(L=$,D=x,$>q)break;var K=Math.min(x,$-2),G=0;for(B=0;B<K;++B){var F=M-x+B&32767,j=F-p[F]&32767;j>G&&(G=j,T=F)}}}x+=(U=T)-(T=p[U])&32767}if(D){y[P++]=268435456|rt[L]<<18|at[D];var W=31&rt[L],H=31&at[D];b+=Ze[W]+Xe[H],++S[257+W],++w[H],E=M+L,++I}else y[P++]=e[M],++S[e[M]]}}for(M=Math.max(M,E);M<s;++M)y[P++]=e[M],++S[e[M]];l=wt(e,u,c,y,S,w,b,P,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=E)}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=St(u,l+1,e.subarray(M,z))}n.i=s}return ft(o,0,r+gt(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)},Et=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Ct(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=Mt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var a,n=Pt(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&&Et(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),Et(n,s-8,i.d()),Et(n,s-4,r),n}var Rt="undefined"!=typeof TextEncoder&&new TextEncoder,Ut="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ut.decode(bt,{stream:!0})}catch(e){}var Tt,kt="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Tt||(Tt={}));var Bt=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===Tt.GZipJS&&a>=1024)try{var n=Ct(function(e,t){if(Rt)return Rt.encode(e);for(var i=e.length,r=new ze(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 ze(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 ft(r,0,a)}(r),{mtime:0}),s=new Blob([n],{type:kt});if(s.size<.95*a)return{contentType:kt,body:s,estimatedSize:s.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:a}}},Lt=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var r=Bt(e);if(r){var{contentType:a,body:n,estimatedSize:s}=r,o=i({"Content-Type":a},e.headers||{});a===kt&&e.compression===Tt.GZipJS&&(o["Content-Encoding"]="gzip");var u=new AbortController,c=e.timeout?setTimeout(()=>u.abort(),e.timeout):null;fetch(e.url,{method:e.method||"POST",headers:o,body:n,keepalive:s<52428.8,signal:u.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(()=>{c&&clearTimeout(c)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=new XMLHttpRequest;t.open(e.method||"POST",e.url,!0);var i=Bt(e);if(i){var{contentType:r,body:a}=i;e.headers&&Object.entries(e.headers).forEach(e=>{var[i,r]=e;t.setRequestHeader(i,r)}),t.setRequestHeader("Content-Type",r),r===kt&&e.compression===Tt.GZipJS&&t.setRequestHeader("Content-Encoding","gzip"),e.timeout&&(t.timeout=e.timeout),t.onreadystatechange=()=>{var i;if(4===t.readyState){var r={statusCode:t.status,text:t.responseText};if(200===t.status)try{r.json=JSON.parse(t.responseText)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,r)}},t.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},t.send(a)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Bt(e);if(t){var{contentType:i,body:r}=t;try{var a="string"==typeof r?new Blob([r],{type:i}):r,n=e.compression===Tt.GZipJS&&i===kt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,a)}catch(e){}}}}],Dt=e=>{var t,i=e.transport||"fetch",r=Lt.find(e=>e.name===i&&e.available)||Lt.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 Ot{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 xt{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._areWeOnline=!0,this._sendRequest=e.sendRequest,this._sendBeacon=e.sendBeacon,w&&void 0!==b&&"onLine"in b&&(this._areWeOnline=b.onLine,_(w,"online",()=>{this._areWeOnline=!0,this._flush()}),_(w,"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 qt="vt_rate_limit";class Nt{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(qt))&&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(qt,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._initialPageviewCaptured=!1,this._visibilityStateListener=null,this.__request_queue=[],this._hasWarnedAboutConfig=!1,this._setOncePropertiesSent=!1,this.configManager=new r(e);var t=this.configManager.getConfig(),i=t.domain;!i&&P&&(i=this.getCurrentDomain()),this.sessionManager=new U(t.storage||"cookie",i),this.userManager=new Fe(t.persistence||"localStorage",i),this.webVitalsManager=new je(t,this),this.rateLimiter=new Nt({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new xt({sendRequest:e=>this._sendHttpRequest(e),sendBeacon:e=>this._sendBeaconRequest(e)}),this.requestQueue=new Ot(e=>this._sendBatchedRequest(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==Kt){var a=null!==(r=$t[i])&&void 0!==r?r:new Vt;return a._init(e,t,i),$t[i]=a,$t[Kt][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 He(this),this.historyAutocapture.startIfEnabled(),this._setupUnloadHandler(),this._captureInitialPageview(),this}_setupUnloadHandler(){if(w){var e=()=>{this.requestQueue.unload(),this.retryQueue.unload()};_(w,"beforeunload",e),_(w,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:Kt;return t!==Kt&&(t=Kt+"."+t),t}getCurrentDomain(){if(!P)return"";var e=P.protocol,t=P.hostname,i=P.port;return e+"//"+t+(i?":"+i:"")}_isConfigured(){var e=this.configManager.getConfig();return!(!e.projectId||!e.token)||(this._hasWarnedAboutConfig||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this._hasWarnedAboutConfig=!0),!1)}buildUrl(){var e=this.configManager.getConfig(),{proxyUrl:t,proxy:i,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._isConfigured()){if(i&&void 0!==w)if(w.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:e,event:t});this.requestQueue.enqueue({url:e,event:t})}}_sendBatchedRequest(e){var{transport:t}=e;"sendBeacon"!==t?this.retryQueue.retriableRequest(e):this._sendBeaconRequest(e)}_sendHttpRequest(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?Tt.None:Tt.GZipJS;Dt({url:i,data:a,method:"POST",transport:"XHR",compression:n,callback:e=>{t({statusCode:e.statusCode})}})})}_sendBeaconRequest(e){var{url:t,events:i}=e,r=1===i.length?i[0]:{events:i},a=this.configManager.getConfig().disable_compression?Tt.None:Tt.GZipJS;Dt({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(),b&&b.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(b.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var a=this.buildUrl(),n=Ge(),s=this.userManager.getUserProperties(),o=this.userManager.get_initial_props(),u=this.sessionManager.getSessionId(),c=this.sessionManager.getWindowId(),l=this.userManager.getAnonymousId(),d={};!this._setOncePropertiesSent&&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._setOncePropertiesSent&&Object.keys(o).length>0&&(this._setOncePropertiesSent=!0),"$pageview"===e&&M&&(h.title=M.title);var g,f,p=this.configManager.getConfig();if(!1!==p.stringifyPayload){if(g=Object.assign({},h,p.globalAttributes),!m(g=JSON.stringify(g)))return}else if(g=Object.assign({},h,p.globalAttributes),!m(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)}}_captureInternal(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:r||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)}_captureInitialPageview(){M&&("visible"===M.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,setTimeout(()=>{if(M&&P){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this._visibilityStateListener&&(M.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=()=>{this._captureInitialPageview()},_(M,"visibilitychange",this._visibilityStateListener)))}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&&P&&(i=this.getCurrentDomain()),this.sessionManager=new U(t.storage||"cookie",i),this.userManager=new Fe(t.persistence||"localStorage",i),this.webVitalsManager=new je(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.requestQueue.enable(),this.__request_queue.forEach(e=>{this._send_retriable_request(e)}),this.__request_queue=[]}}var $t={},Kt="vt",Gt=!(void 0!==C||void 0!==E)&&-1===(null==R?void 0:R.indexOf("MSIE"))&&-1===(null==R?void 0:R.indexOf("Mozilla"));w&&(w.__VTILT_ENQUEUE_REQUESTS=Gt);var Ft,jt=(Ft=$t[Kt]=new Vt,function(){function e(){e.done||(e.done=!0,Gt=!1,void 0!==w&&(w.__VTILT_ENQUEUE_REQUESTS=!1),A($t,function(e){e._dom_loaded()}))}M&&"function"==typeof M.addEventListener?"complete"===M.readyState?e():_(M,"DOMContentLoaded",e,{capture:!1}):w&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),Ft);export{Vt as VTilt,jt as default,jt 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",_="$initial_person_info",v={"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,T=(null==M?void 0:M.XMLHttpRequest)&&"withCredentials"in new M.XMLHttpRequest?M.XMLHttpRequest:void 0;null==M||M.AbortController;var U=null==E?void 0:E.userAgent;class R{constructor(e,t){void 0===e&&(e="cookie"),this.storageMethod=e,this.domain=t,this._windowId=void 0,this._initializeWindowId()}_isWebStorage(){return this.storageMethod===h||this.storageMethod===f}_getStorage(){return this._isWebStorage()?this.storageMethod===h?localStorage:sessionStorage:null}_createSessionData(e){return{value:e,expiry:(new Date).getTime()+18e5}}_storeSessionIdInWebStorage(e){var t=this._getStorage();if(t){var i=this._createSessionData(e);t.setItem(a,JSON.stringify(i))}}getSessionIdFromCookie(){var e={};return document.cookie.split(";").forEach(function(t){var[i,r]=t.split("=");e[i.trim()]=r}),e[a]||null}setSessionIdFromCookie(e){var t=a+"="+e+"; Max-Age=1800; path=/; secure";this.domain&&(t+="; domain="+this.domain),document.cookie=t}_storeSessionId(e){this._isWebStorage()?this._storeSessionIdInWebStorage(e):this.setSessionIdFromCookie(e)}_getSessionIdRaw(){var e=this._getStorage();if(e){var t=e.getItem(a);if(!t)return null;var i=null;try{i=JSON.parse(t)}catch(e){return null}return"object"!=typeof i||null===i?null:(new Date).getTime()>i.expiry?(e.removeItem(a),null):i.value}return this.getSessionIdFromCookie()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=m(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||m();return this._storeSessionId(e),e}_clearSessionId(){var e=this._getStorage();if(e)e.removeItem(a);else{var t="Thu, 01 Jan 1970 00:00:00 UTC";document.cookie=a+"=; expires="+t+"; path=/;",this.domain&&(document.cookie=a+"=; expires="+t+"; path=/; domain="+this.domain+";")}}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(m())}getWindowId(){if(this._windowId)return this._windowId;if(this._canUseSessionStorage()&&b){var e=b.sessionStorage.getItem(n);if(e)return this._windowId=e,e}var t=m();return this._setWindowId(t),t}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&b&&b.sessionStorage.setItem(n,e))}_canUseSessionStorage(){if(void 0===b||!b.sessionStorage)return!1;try{var e="__vt_session_storage_test__";return b.sessionStorage.setItem(e,"test"),b.sessionStorage.removeItem(e),!0}catch(e){return!1}}_initializeWindowId(){if(this._canUseSessionStorage()&&b){var e=b.sessionStorage.getItem(s),t=b.sessionStorage.getItem(n);t&&!e?this._windowId=t:(t&&b.sessionStorage.removeItem(n),this._setWindowId(m())),b.sessionStorage.setItem(s,"true"),this._listenToUnload()}else this._windowId=m()}_listenToUnload(){b&&this._canUseSessionStorage()&&S(b,"beforeunload",()=>{b&&b.sessionStorage&&b.sessionStorage.removeItem(s)},{capture:!1})}}function B(e){if(!P)return null;var t=P.createElement("a");return t.href=e,t}function L(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 x(e){return"function"==typeof e}var O="Mobile",q="iOS",N="Android",V="Tablet",$=N+" "+V,K="iPad",G="Apple",F=G+" Watch",j="Safari",W="BlackBerry",H="Samsung",z=H+"Browser",J=H+" Internet",Q="Chrome",Z=Q+" OS",X=Q+" "+q,Y="Internet Explorer",ee=Y+" "+O,te="Opera",ie=te+" Mini",re="Edge",ae="Microsoft "+re,ne="Firefox",se=ne+" "+q,oe="Nintendo",ue="PlayStation",ce="Xbox",le=N+" "+O,de=O+" "+j,he="Windows",ge=he+" Phone",fe="Nokia",pe="Ouya",_e="Generic",ve=_e+" "+O.toLowerCase(),me=_e+" "+V.toLowerCase(),Ae="Konqueror",ye="(\\d+(\\.\\d+)?)",Se=new RegExp("Version/"+ye),we=new RegExp(ce,"i"),Ie=new RegExp(ue+" \\w+","i"),be=new RegExp(oe+" \\w+","i"),Me=new RegExp(W+"|PlayBook|BB10","i"),Ee={"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 Pe(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Ce=(e,t)=>t&&Pe(t,G)||function(e){return Pe(e,j)&&!Pe(e,Q)&&!Pe(e,N)}(e),ke=function(e,t){return t=t||"",Pe(e," OPR/")&&Pe(e,"Mini")?ie:Pe(e," OPR/")?te:Me.test(e)?W:Pe(e,"IE"+O)||Pe(e,"WPDesktop")?ee:Pe(e,z)?J:Pe(e,re)||Pe(e,"Edg/")?ae:Pe(e,"FBIOS")?"Facebook "+O:Pe(e,"UCWEB")||Pe(e,"UCBrowser")?"UC Browser":Pe(e,"CriOS")?X:Pe(e,"CrMo")||Pe(e,Q)?Q:Pe(e,N)&&Pe(e,j)?le:Pe(e,"FxiOS")?se:Pe(e.toLowerCase(),Ae.toLowerCase())?Ae:Ce(e,t)?Pe(e,O)?de:j:Pe(e,ne)?ne:Pe(e,"MSIE")||Pe(e,"Trident/")?Y:Pe(e,"Gecko")?ne:""},Te={[ee]:[new RegExp("rv:"+ye)],[ae]:[new RegExp(re+"?\\/"+ye)],[Q]:[new RegExp("("+Q+"|CrMo)\\/"+ye)],[X]:[new RegExp("CriOS\\/"+ye)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ye)],[j]:[Se],[de]:[Se],[te]:[new RegExp("(Opera|OPR)\\/"+ye)],[ne]:[new RegExp(ne+"\\/"+ye)],[se]:[new RegExp("FxiOS\\/"+ye)],[Ae]:[new RegExp("Konqueror[:/]?"+ye,"i")],[W]:[new RegExp(W+" "+ye),Se],[le]:[new RegExp("android\\s"+ye,"i")],[J]:[new RegExp(z+"\\/"+ye)],[Y]:[new RegExp("(rv:|MSIE )"+ye)],Mozilla:[new RegExp("rv:"+ye)]},Ue=function(e,t){var i=ke(e,t),r=Te[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},Re=[[new RegExp(ce+"; "+ce+" (.*?)[);]","i"),e=>[ce,e&&e[1]||""]],[new RegExp(oe,"i"),[oe,""]],[new RegExp(ue,"i"),[ue,""]],[Me,[W,""]],[new RegExp(he,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ge,""];if(new RegExp(O).test(t)&&!/IEMobile\b/.test(t))return[he+" "+O,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],a=Ee[r]||"";return/arm/i.test(t)&&(a="RT"),[he,a]}return[he,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[q,t.join(".")]}return[q,""]}],[/(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("("+N+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+N+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[N,t.join(".")]}return[N,""]}],[/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/,[Z,""]],[/Linux|debian/i,["Linux",""]]],Be=function(e){return be.test(e)?oe:Ie.test(e)?ue:we.test(e)?ce:new RegExp(pe,"i").test(e)?pe:new RegExp("("+ge+"|WPDesktop)","i").test(e)?ge:/iPad/.test(e)?K:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?F:Me.test(e)?W:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(fe,"i").test(e)?fe:/(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(O).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)?N:$:N:new RegExp("(pda|"+O+")","i").test(e)?ve:new RegExp(V,"i").test(e)&&!new RegExp(V+" pc","i").test(e)?me:""},Le="https?://(.*)",De=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],xe=I(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],De),Oe="<masked>";function qe(e){var t=function(e){return e?0===e.search(Le+"google.([^/?]*)")?"google":0===e.search(Le+"bing.com")?"bing":0===e.search(Le+"yahoo.com")?"yahoo":0===e.search(Le+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var a=P?L(P.referrer,i):"";a.length&&(r.ph_keyword=a)}return r}function Ne(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Ve(){return(null==P?void 0:P.referrer)||"$direct"}function $e(){var e;return(null==P?void 0:P.referrer)&&(null===(e=B(P.referrer))||void 0===e?void 0:e.host)||"$direct"}function Ke(e){var t,{r:i,u:r}=e,a={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=B(i))||void 0===t?void 0:t.host};if(r){a.$current_url=r;var n=B(r);a.$host=null==n?void 0:n.host,a.$pathname=null==n?void 0:n.pathname;var s=function(e){var t=xe.concat([]),i={};return y(t,function(t){var r=L(e,t);i[t]=r||null}),i}(r);w(a,s)}i&&w(a,qe(i));return a}function Ge(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Fe(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function je(e,t){if(!U)return{};var i,r,a,[n,s]=function(e){for(var t=0;t<Re.length;t++){var[i,r]=Re[t],a=i.exec(e),n=a&&(x(r)?r(a,e):r);if(n)return n}return["",""]}(U);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(U,navigator.vendor),$device:Be(U),$device_type:(r=U,a=Be(r),a===K||a===$||"Kobo"===a||"Kindle Fire"===a||a===me?V:a===oe||a===ce||a===ue||a===pe?"Console":a===F?"Wearable":a?O:"Desktop"),$timezone:Ge(),$timezone_offset:Fe()}),{$current_url:D(null==C?void 0:C.href,[],Oe),$host:null==C?void 0:C.host,$pathname:null==C?void 0:C.pathname,$raw_user_agent:U.length>1e3?U.substring(0,997)+"...":U,$browser_version:Ue(U,navigator.vendor),$browser_language:Ne(),$browser_language_prefix:(i=Ne(),"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 We{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storageMethod=e,this.domain=t,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.setStoredValue(c,this.userIdentity.anonymous_id)),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}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)}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}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()}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}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())}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}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)}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)}loadUserIdentity(){var e=this.getStoredValue(c)||this.generateAnonymousId(),t=this.getStoredValue(l)||null,i=this.getStoredValue(u)||this.generateDeviceId(),r=this.getStoredUserProperties(),a=this.getStoredValue(o)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:a}}saveUserIdentity(){this.setStoredValue(c,this.userIdentity.anonymous_id),this.setStoredValue(u,this.userIdentity.device_id),this.setStoredValue(o,this.userIdentity.user_state),this.userIdentity.distinct_id?this.setStoredValue(l,this.userIdentity.distinct_id):this.removeStoredValue(l),this.setStoredUserProperties(this.userIdentity.properties)}generateAnonymousId(){return"anon_"+m()}generateDeviceId(){return"device_"+m()}getStoredValue(e){try{if(this.storageMethod===p)return null;if(this.storageMethod===h||this.storageMethod===g){var t=localStorage.getItem(e);return null!==t?t:this.storageMethod===g?this.getCookieValue(e):null}return this.getCookieValue(e)}catch(e){return console.warn("Failed to access storage:",e),null}}setStoredValue(e,t){try{if(this.storageMethod===p)return;this.storageMethod===h?localStorage.setItem(e,t):this.storageMethod===g?(localStorage.setItem(e,t),this.setCookieValue(e,t)):this.setCookieValue(e,t)}catch(e){console.warn("Failed to save to storage:",e)}}removeStoredValue(e){this.storageMethod!==p&&(this.storageMethod===h?localStorage.removeItem(e):this.storageMethod===g?(localStorage.removeItem(e),this.removeCookieValue(e)):this.removeCookieValue(e))}getStoredUserProperties(){var e=this.getStoredValue(d);if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}setStoredUserProperties(e){this.setStoredValue(d,JSON.stringify(e))}getCookieValue(e){var t=document.cookie.split(";");for(var i of t){var[r,a]=i.trim().split("=");if(r===e)return decodeURIComponent(a)}return null}setCookieValue(e,t){var i=e+"="+encodeURIComponent(t)+"; Max-Age=31536000; path=/; secure; SameSite=Lax";this.domain&&(i+="; domain="+this.domain),document.cookie=i}removeCookieValue(e){var t=e+"=; Max-Age=0; path=/";this.domain&&(t+="; domain="+this.domain),document.cookie=t}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)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[_]){var i=function(e,t){var i=e?I([],De,t||[]):[],r=null==C?void 0:C.href.substring(0,1e3);return{r:Ve().substring(0,1e3),u:r?D(r,i,Oe):void 0}}(e,t);this.register_once({[_]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[_];return i?(e=Ke(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:$e()};this.register_once(e,void 0)}}class He{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=v[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 ze(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],a=i(r);return x(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class Je{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__)||ze(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__)||ze(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 Qe=Uint8Array,Ze=Uint16Array,Xe=Int32Array,Ye=new Qe([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]),et=new Qe([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]),tt=new Qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),it=function(e,t){for(var i=new Ze(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var a=new Xe(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}},rt=it(Ye,2),at=rt.b,nt=rt.r;at[28]=258,nt[258]=28;for(var st=it(et,0).r,ot=new Ze(32768),ut=0;ut<32768;++ut){var ct=(43690&ut)>>1|(21845&ut)<<1;ct=(61680&(ct=(52428&ct)>>2|(13107&ct)<<2))>>4|(3855&ct)<<4,ot[ut]=((65280&ct)>>8|(255&ct)<<8)>>1}var lt=function(e,t,i){for(var r=e.length,a=0,n=new Ze(t);a<r;++a)e[a]&&++n[e[a]-1];var s,o=new Ze(t);for(a=1;a<t;++a)o[a]=o[a-1]+n[a-1]<<1;if(i){s=new Ze(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[ot[d]>>u]=c}else for(s=new Ze(r),a=0;a<r;++a)e[a]&&(s[a]=ot[o[e[a]-1]++]>>15-e[a]);return s},dt=new Qe(288);for(ut=0;ut<144;++ut)dt[ut]=8;for(ut=144;ut<256;++ut)dt[ut]=9;for(ut=256;ut<280;++ut)dt[ut]=7;for(ut=280;ut<288;++ut)dt[ut]=8;var ht=new Qe(32);for(ut=0;ut<32;++ut)ht[ut]=5;var gt=lt(dt,9,0),ft=lt(ht,5,0),pt=function(e){return(e+7)/8|0},_t=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new Qe(e.subarray(t,i))},vt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},mt=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},At=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:Et,l:0};if(1==a){var s=new Qe(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 Ze(h+1),f=yt(i[l-1],g,0);if(f>t){r=0;var p=0,_=f-t,v=1<<_;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+=v-(1<<f-g[m]),g[m]=t}for(p>>=_;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 Qe(g),l:f}},yt=function(e,t,i){return-1==e.s?Math.max(yt(e.l,t,i+1),yt(e.r,t,i+1)):t[e.s]=i},St=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ze(++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}},wt=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},It=function(e,t,i){var r=i.length,a=pt(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)},bt=function(e,t,i,r,a,n,s,o,u,c,l){vt(t,l++,i),++a[256];for(var d=At(a,15),h=d.t,g=d.l,f=At(n,15),p=f.t,_=f.l,v=St(h),m=v.c,A=v.n,y=St(p),S=y.c,w=y.n,I=new Ze(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=At(I,7),E=M.t,P=M.l,C=19;C>4&&!E[tt[C-1]];--C);var k,T,U,R,B=c+5<<3,L=wt(a,dt)+wt(n,ht)+s,D=wt(a,h)+wt(n,p)+s+14+3*C+wt(I,E)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&B<=L&&B<=D)return It(t,l,e.subarray(u,u+c));if(vt(t,l,1+(D<L)),l+=2,D<L){k=lt(h,g,0),T=h,U=lt(p,_,0),R=p;var x=lt(E,P,0);vt(t,l,A-257),vt(t,l+5,w-1),vt(t,l+10,C-4),l+=14;for(b=0;b<C;++b)vt(t,l+3*b,E[tt[b]]);l+=3*C;for(var O=[m,S],q=0;q<2;++q){var N=O[q];for(b=0;b<N.length;++b){var V=31&N[b];vt(t,l,x[V]),l+=E[V],V>15&&(vt(t,l,N[b]>>5&127),l+=N[b]>>12)}}}else k=gt,T=dt,U=ft,R=ht;for(b=0;b<o;++b){var $=r[b];if($>255){mt(t,l,k[(V=$>>18&31)+257]),l+=T[V+257],V>7&&(vt(t,l,$>>23&31),l+=Ye[V]);var K=31&$;mt(t,l,U[K]),l+=R[K],K>3&&(mt(t,l,$>>5&8191),l+=et[K])}else mt(t,l,k[$]),l+=T[$]}return mt(t,l,k[256]),l+T[256]},Mt=new Xe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Et=new Qe(0),Pt=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}(),Ct=function(e,t,i,r,a){if(!a&&(a={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),s=new Qe(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 Qe(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=Mt[t-1],h=d>>13,g=8191&d,f=(1<<i)-1,p=n.p||new Ze(32768),_=n.h||new Ze(f+1),v=Math.ceil(i/3),m=2*v,A=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<m)&f},y=new Xe(25e3),S=new Ze(288),w=new Ze(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),T=32767&M,U=_[k];if(p[T]=U,_[k]=T,P<=M){var R=s-M;if((I>7e3||E>24576)&&(R>423||!c)){l=bt(e,u,0,y,S,w,b,E,C,M-C,l),E=I=b=0,C=M;for(var B=0;B<286;++B)S[B]=0;for(B=0;B<30;++B)w[B]=0}var L=2,D=0,x=g,O=T-U&32767;if(R>2&&k==A(M-O))for(var q=Math.min(h,R)-1,N=Math.min(32767,M),V=Math.min(258,R);O<=N&&--x&&T!=U;){if(e[M+L]==e[M+L-O]){for(var $=0;$<V&&e[M+$]==e[M+$-O];++$);if($>L){if(L=$,D=O,$>q)break;var K=Math.min(O,$-2),G=0;for(B=0;B<K;++B){var F=M-O+B&32767,j=F-p[F]&32767;j>G&&(G=j,U=F)}}}O+=(T=U)-(U=p[T])&32767}if(D){y[E++]=268435456|nt[L]<<18|st[D];var W=31&nt[L],H=31&st[D];b+=Ye[W]+et[H],++S[257+W],++w[H],P=M+L,++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=bt(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=_,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=It(u,l+1,e.subarray(M,z))}n.i=s}return _t(o,0,r+pt(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 Tt(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=Pt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var a,n=Ct(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 Ut="undefined"!=typeof TextEncoder&&new TextEncoder,Rt="undefined"!=typeof TextDecoder&&new TextDecoder;try{Rt.decode(Et,{stream:!0})}catch(e){}var Bt,Lt="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Bt||(Bt={}));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===Bt.GZipJS&&a>=1024)try{var n=Tt(function(e,t){if(Ut)return Ut.encode(e);for(var i=e.length,r=new Qe(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 Qe(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:Lt});if(s.size<.95*a)return{contentType:Lt,body:s,estimatedSize:s.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:a}}},xt=[{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===Bt.GZipJS&&a===Lt?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===Bt.GZipJS&&i===Lt?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===Bt.GZipJS&&i===Lt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,a)}catch(e){}}}}],Ot=e=>{var t,i=e.transport||"fetch",r=xt.find(e=>e.name===i&&e.available)||xt.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 qt{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 Nt{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 $t{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 Kt{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 R(t.storage||"cookie",i),this.userManager=new We(t.persistence||"localStorage",i),this.webVitalsManager=new He(t,this),this.rateLimiter=new $t({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new Nt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new qt(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==Ft){var a=null!==(r=Gt[i])&&void 0!==r?r:new Kt;return a._init(e,t,i),Gt[i]=a,Gt[Ft][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 Je(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:Ft;return t!==Ft&&(t=Ft+"."+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?Bt.None:Bt.GZipJS;Ot({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?Bt.None:Bt.GZipJS;Ot({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 _={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,_,!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 R(t.storage||"cookie",i),this.userManager=new We(t.persistence||"localStorage",i),this.webVitalsManager=new He(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 Gt={},Ft="vt",jt=!(void 0!==T||void 0!==k)&&-1===(null==U?void 0:U.indexOf("MSIE"))&&-1===(null==U?void 0:U.indexOf("Mozilla"));null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=jt);var Wt,Ht=(Wt=Gt[Ft]=new Kt,function(){function e(){e.done||(e.done=!0,jt=!1,null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=!1),y(Gt,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")}(),Wt);export{Kt as VTilt,Ht as default,Ht as vt};
|
|
2
2
|
//# sourceMappingURL=module.no-external.js.map
|