PageSourceSearch

https://help.revelry.ai/assets/js/3052.faa6b16d.js

js revelry.ai collected 2026-10-05 14:56:42 UTC 240,067 bytes, 1 lines download raw bytes

vendor: 7,567 bytes, line 1
1(globalThis.webpackChunkrevelry_ai_docsite||=[]).push([[3052],{3052(e,t,n){"use strict";n.d(t,{init:()=>Ka});var r,i=n(1635);!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(r||(r={}));var o=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},a=function(e){return function(){var t=(0,i.Cl)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},s=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var o=(0,i.Ju)(t.split(".")),a=o.next();!a.done;a=o.next()){var s=a.value;if(!(s in e))return;e=e[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e},u=function(e,t){return function(){var n,r,o={};try{for(var a=(0,i.Ju)(t),u=a.next();!u.done;u=a.next()){var l=u.value;o[l]=s(e,l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}},l=function(e,t,n,i,a){return void 0===a&&(a=null),function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var l=n(),c=l.logger,d=l.logLevel;if(d&&d<r.Debug||!d||!c)return e.apply(a,s);var f={type:"invoke public method",name:t,args:s,stacktrace:o(1),time:{start:(new Date).toISOString()},states:{}};i&&f.states&&(f.states.before=i());var v=e.apply(a,s);return v&&v.promise?v.promise.then(function(){i&&f.states&&(f.states.after=i()),f.time&&(f.time.end=(new Date).toISOString()),c.debug(JSON.stringify(f,null,2))}):(i&&f.states&&(f.states.after=i()),f.time&&(f.time.end=(new Date).toISOString()),c.debug(JSON.stringify(f,null,2))),v}},c=function(e){return{promise:e||Promise.resolve()}},d="Amplitude Logger ",f=function(){function e(){this.logLevel=r.None}return e.prototype.disable=function(){this.logLevel=r.None},e.prototype.enable=function(e){void 0===e&&(e=r.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.Verbose||console.log("".concat(d,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.Warn||console.warn("".concat(d,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.Error||console.error("".concat(d,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.Debug||console.log("".concat(d,"[Debug]: ").concat(e.join(" ")))},e}(),v=n(1401),h=n.n(v)()||v,p=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t;try{this.isSupported="undefined"!=typeof localStorage}catch(n){this.logger.debug("Remote config localstorage failed to access: ",n),this.isSupported=!1}}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};if(!this.isSupported)return Promise.resolve(t);try{e=localStorage.getItem(this.key)}catch(r){return this.logger.debug("Remote config localstorage failed to access: ",r),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(h(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(r){return this.logger.debug("Remote config localstorage failed to parse: ",r),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){if(!this.isSupported)return Promise.resolve(!1);try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(t){this.logger.debug("Remote config localstorage failed to set: ",t)}return Promise.resolve(!1)},e}(),g=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof globalThis?globalThis:void 0},m=(0,i.fX)([],(0,i.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,n=g();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,y)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,i.fX)([],(0,i.zs)(r.entries()),!1).map(function(e){var t=(0,i.zs)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(m[r]):m[r]}).join("")};var b=401,w=403,E=429,S=function(){function e(t,n,r,i,o,a,s){void 0===r&&(r="US"),void 0===a&&(a=e.DEFAULT_CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.configGroup=a,this.serverUrl=i||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=n,this.storage=s||new p(t,n),this.customFetch=o}return e.prototype.subscribe=function(e,t,n){var r=y(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t=this;return(0,i.YH)(this,function(n){switch(n.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),o.sendCallback(e,t,"remote"),o.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){var n,r;return(0,i.YH)(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,i.sH)(this,void 0,void 0,function(){var n,r,o,a,s,u,l=this;return(0,i.YH)(this,function(c){switch(c.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},o=function(r){var o,s,u,c,d,f,v,h,p;return(0,i.YH)(this,function(i){switch(i.label){case 0:o=!0,s=new AbortController,u=setTimeout(function(){return s.abort()},t),i.label=1;case 1:return i.trys.push([1,10,11,12]),c=a.getUrlParams(),d={Accept:"*/*"},a.customFetch?[4,(g=a.customFetch({url:c,method:"GET",headers:d,signal:s.signal}),m=s.signal,new Promise(function(e,t){var n=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};m.addEventListener("abort",n,{once:!0}),g.then(function(t){m.removeEventListener("abort",n),e(t)},function(e){m.removeEventListener("abort",n),t(e)})}))]:[3,3];case 2:return v=i.sent(),[3,5];case 3:return[4,fetch(c,{method:"GET",headers:d,signal:s.signal})];case 4:v=i.sent(),i.label=5;case 5:return(f=v).ok||f.status>=200&&f.status<300?[3,7]:[4,f.text()];case 6:return h=i.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(f.status,": ").concat(h)),f.status===b||f.status===w?(a.logger.error("Remote config client fetch failed with ".concat(f.status,". Invalid API key; future fetches will be skipped.")),a.isLastFetchInvalidApiKey=!0,o=!1):f.status>=400&&f.status<500&&f.status!==E&&(o=!1),[3,9];case 7:return[4,f.json()];case 8:return[2,{value:{remoteConfig:i.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(p=i.sent())instanceof Error&&"AbortError"===p.name?a.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),p),[3,12];case 11:return clearTimeout(u),[7];case 12:return o?r<e-1?[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(n))})]:[3,14]:[2,"break"];case 13:i.sent(),i.label=14;case 14:return[2]}var g,m})},a=this,s=0,c.label=1;case 1:return s<e?[5,o(s)]:[3,4];case 2:if("object"==typeof(u=c.sent()))return[2,u.value];if("break"===u)return[3,4];c.label=3;case 3:return s++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.DEFAULT_CONFIG_GROUP="browser",e}(),T="tags",k="counters",C="histograms",x="events",P="internal",I="last_flush_timestamp",A=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=g())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;
vendor: 15,644 bytes, line 1
1n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(){var t=r.result;t?e.createTables(t):e.logger.debug("DiagnosticsStorage: Missing DB during upgrade.")}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains(T)||e.createObjectStore(T,{keyPath:"key"}),e.objectStoreNames.contains(k)||e.createObjectStore(k,{keyPath:"key"}),e.objectStoreNames.contains(C)||e.createObjectStore(C,{keyPath:"key"}),e.objectStoreNames.contains(x))||e.createObjectStore(x,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(P)||e.createObjectStore(P,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a=this;return(0,i.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([T],"readwrite"),r=n.objectStore(T),[2,new Promise(function(t){var o=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},o.forEach(function(e){var t=(0,i.zs)(e,2),n=t[0],o=t[1];r.put({key:n,value:o}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tag",n,o,e)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a=this;return(0,i.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([k],"readwrite"),r=n.objectStore(k),[2,new Promise(function(t){var o=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},o.forEach(function(e){var t=(0,i.zs)(e,2),n=t[0],o=t[1],s=r.get(n);s.onsuccess=function(){var e=s.result,t=e?e.value:0;r.put({key:n,value:t+o}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},s.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a=this;return(0,i.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([C],"readwrite"),r=n.objectStore(C),[2,new Promise(function(t){var o=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},o.forEach(function(e){var t=(0,i.zs)(e,2),n=t[0],o=t[1],s=r.get(n);s.onsuccess=function(){var e,t=s.result;e=t?{key:n,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:n,count:o.count,min:o.min,max:o.max,sum:o.sum},r.put(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},s.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=i.sent(),n=t.transaction([x],"readwrite"),r=n.objectStore(x),[2,new Promise(function(t){n.oncomplete=function(){t()},n.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach(function(e){r.add(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return o=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){var n,r,o,a;return(0,i.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=i.sent(),r=n.transaction([P],"readwrite"),o=r.objectStore(P),[2,new Promise(function(n,i){r.onabort=function(){return i(new Error("Failed to set internal value"))};var a=o.put({key:e,value:t});a.onsuccess=function(){return n()},a.onerror=function(){return i(new Error("Failed to set internal value"))}})];case 2:return a=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o;return(0,i.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=i.sent(),n=t.transaction([P],"readonly"),r=n.objectStore(P),[2,new Promise(function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}})];case 2:return o=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(I)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(I,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t,n,r,o,a,s,u;return(0,i.YH)(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([T,k,C,x],"readwrite"),[4,Promise.all([this.getAllFromStore(t,T),this.getAllFromStore(t,k),this.getAllFromStore(t,C),this.getAllFromStore(t,x)])];case 2:return n=i.zs.apply(void 0,[l.sent(),4]),r=n[0],o=n[1],a=n[2],s=n[3],[4,Promise.all([this.clearTable(t,k),this.clearTable(t,C),this.clearTable(t,x)])];case 3:return l.sent(),[2,{tags:r,counters:o,histogramStats:a,events:s}];case 4:return u=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",u),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}})},e}(),O=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t},_=function(e,t){var n=O(e.toString());return 31*Math.abs(n)%1e5/1e5<t},R="__AMPLITUDE_SCRIPT_URL__",D=function(){var e=g();if(!e)return[];var t=e[R];return Array.isArray(t)?t:"string"==typeof t?[t]:[]},H=function(e){var t,n,r=D();if(0!==r.length)try{for(var o=(0,i.Ju)(r),a=o.next();!a.done;a=o.next()){var s=a.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},L=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},N=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(Ln){return"[object Object]"}},M=3e5,j=1e4,U=function(){function e(e,t,n,r,o){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=(0,i.Cl)({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=_(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,o?this.storage=o:A.isSupported()?this.storage=new A(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=g();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,i.Cl)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=H({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=L(i),a=H({filename:o,stack:i});a&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:N(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=j?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=j?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=j)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},M))},e.prototype.saveAllDataToStorage=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t,n,r;return(0,i.YH)(this,function(o){switch(o.label){case 0:return this.storage?(e=(0,i.Cl)({},this.inMemoryTags),t=(0,i.Cl)({},this.inMemoryCounters),n=(0,i.Cl)({},this.inMemoryHistograms),r=(0,i.fX)([],(0,i.zs)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t,n,r,o,a,s,u,l,c;return(0,i.YH)(this,function(i){switch(i.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return i.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=i.sent(),t=e.tags,n=e.counters,r=e.histogramStats,o=e.events,this.storage.setLastFlushTimestamp(Date.now()),a={},t.forEach(function(e){a[e.key]=e.value}),s={},n.forEach(function(e){s[e.key]=e.value}),u={},r.forEach(function(e){u[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),l=o.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(u).length&&0===l.length?[2]:(c={tags:a,histogram:u,counters:s,events:l},this.fetch(c),[2])}})})},e.prototype.fetch=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!g())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t,n;return(0,i.YH)(this,function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(M),[2]):(n=e-t)>=M?(this._flush(),[2]):(this._setFlushTimer(M-n),[2])}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=_(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),F=function(){var e,t=g();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(
1Boolean).reduce(function(e,t){var n=t.split("=",2),r=q(n[0]),i=q(n[1]);return i?(e[r]=i,e):e},{}):{}},q=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(Ln){return""}};class Y{getApplicationContext(){return{versionName:this.versionName,language:z(),platform:"Web",os:void 0,deviceModel:void 0}}}const z=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class B{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}const J=(e,t)=>{const n=["string","number","boolean","undefined"],r=typeof e;if(r!==typeof t)return!1;for(const a of n)if(a===r)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const i=Array.isArray(e),o=Array.isArray(t);if(i!==o)return!1;if(!i||!o){const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(!J(n,r))return!1;let i=!0;return Object.keys(e).forEach(n=>{J(e[n],t[n])||(i=!1)}),i}for(let a=0;a<e.length;a++)if(!J(e[a],t[a]))return!1;return!0};Object.entries||(Object.entries=function(e){const t=Object.keys(e);let n=t.length;const r=new Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r});class V{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,t=Object.assign({},this.identity.userProperties),n=Object.assign(Object.assign({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut(e){return n.optOut=e,this},updateUserProperties:function(e){let t=n.userProperties||{};for(const[n,r]of Object.entries(e))switch(n){case"$set":for(const[e,n]of Object.entries(r))t[e]=n;break;case"$unset":for(const e of Object.keys(r))delete t[e];break;case"$clearAll":t={}}return n.userProperties=t,this},commit:function(){return e.setIdentity(n),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const t=Object.assign({},this.identity);this.identity=Object.assign({},e),J(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const W="undefined"!=typeof globalThis||"undefined"!=typeof globalThis?globalThis:self;class X{constructor(){this.identityStore=new V,this.eventBridge=new B,this.applicationContextProvider=new Y}static getInstance(e){return W.analyticsConnectorInstances||(W.analyticsConnectorInstances={}),W.analyticsConnectorInstances[e]||(W.analyticsConnectorInstances[e]=new X),W.analyticsConnectorInstances[e]}}var $,K="AMP",G="".concat(K,"_unsent"),Q="$default_instance",Z="https://api2.amplitude.com/2/httpapi",ee="https://api.eu.amplitude.com/2/httpapi",te="https://api2.amplitude.com/batch",ne="https://api.eu.amplitude.com/batch",re="dclid",ie="fbclid",oe="gbraid",ae="gclid",se="ko_click_id",ue="li_fat_id",le="msclkid",ce="rdt_cid",de="ttclid",fe="twclid",ve="wbraid",he={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0}
vendor: 22,711 bytes, line 1
1,pe=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],ge=["authorization","cookie","set-cookie"],me=function(e){return void 0===e||""===e?Q:e},ye=function(e){return X.getInstance(me(e))};!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}($||($={}));var be="Event skipped due to empty event type",we=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=$.Unknown),{event:e,code:t,message:n}},Ee=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Q,logLevel:r.Warn,loggerProvider:new f,offline:!1,optOut:!1,serverUrl:Z,serverZone:"US",useBatch:!1}},Se=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=Ee();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=me(e.instanceName),this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=ke(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),Te=function(e,t){return"EU"===e?t?ne:ee:t?te:Z},ke=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=Ee().serverZone),void 0===n&&(n=Ee().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:Ee().serverZone;return{serverZone:r,serverUrl:Te(r,n)}},Ce=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function xe(e){return e>=200&&e<300}var Pe=new Set([Z,ee,te,ne]);function Ie(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(Ln){}return t}var Ae,Oe=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,i.sH)(this,void 0,void 0,function(){var n,r=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(G,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=y()),new Promise(function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,i.sH)(this,void 0,void 0,function(){var t,n,r=this;return(0,i.YH)(this,function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),a=t,s=this.config.flushQueueSize,u=Math.max(s,1),[4,a.reduce(function(e,t,n){var r=Math.floor(n/u);return e[r]||(e[r]=[]),e[r].push(t),e},[]).reduce(function(t,n){return(0,i.sH)(r,void 0,void 0,function(){return(0,i.YH)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var a,s,u})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,i.sH)(this,void 0,void 0,function(){var r,a,s,u,l,c;return(0,i.YH)(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;t.extra;return(0,i.Tt)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Ce,d.label=1;case 1:return d.trys.push([1,3,,4]),a=ke(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,s=function(e,t){return void 0===t&&(t=!1),!!Pe.has(e)||t}(a,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(a,r,s)];case 2:return null===(u=d.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(u,e),[3,4]):("body"in u?this.fulfillRequest(e,u.statusCode,"".concat(u.status,": ").concat(Ie(u))):this.fulfillRequest(e,u.statusCode,u.status),[2]);case 3:return l=d.sent(),c=(f=l)instanceof Error?f.message:String(f),this.config.loggerProvider.error(c),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:c,stack_trace:o()}),this.handleResponse({status:$.Failed,statusCode:0},e),[3,4];case 4:return[2]}var f})})},e.prototype.handleResponse=function(e,t){var n;xe(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:Ie(e),stack_trace:o()});var r=e.status;switch(r){case $.Success:this.handleSuccessResponse(e,t);break;case $.Invalid:this.handleInvalidResponse(e,t);break;case $.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case $.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=(0,i.fX)((0,i.fX)((0,i.fX)((0,i.fX)([],(0,i.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,i.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,i.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,i.zs)(e.body.silencedEvents),!1).flat(),o=new Set(r),a=t.filter(function(t,r){if(!o.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)});a.length>0&&this.config.loggerProvider.warn(Ie(e));var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(Ie(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(r),s=new Set(i),u=new Set(o),l=t.filter(function(t,r){if(!(t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)))return u.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)});l.length>0&&this.config.loggerProvider.warn(Ie(e));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,a;xe(t)?null===(a=this.diagnosticsClient)||void 0===a||a.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:o()})),this.removeEvents(e),e.forEach(function(e){return e.callback(we(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),_e=function(){function e(){this.name="identity",this.type="before",this.identityStore=ye().identityStore}return e.prototype.execute=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(t){return e.instanceName&&(this.identityStore=ye(e.instanceName).identityStore),[2]})})},e}(),Re=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!De(t,n))return!1}return!0},De=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var o=!0;try{for(var a=(0,i.Ju)(t),s=a.next();!s.done;s=a.next()){var u=s.value;if(Array.isArray(u))return!1;if("object"==typeof u)o=o&&Re(u);else if(!["number","string"].includes(typeof u))return!1;if(!o)return!1}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return Re(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},He=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,i.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(Ae.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(Ae.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(Ae.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(Ae.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(Ae.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(Ae.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(Ae.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(Ae.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(Ae.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[Ae.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[Ae.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===Ae.ADD?"number"==typeof n:e===Ae.UNSET||e===Ae.REMOVE||De(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Ae||(Ae={}));var Le,Ne,Me=[Ae.CLEAR_ALL,Ae.UNSET,Ae.SET,Ae.SET_ONCE,Ae.ADD,Ae.APPEND,Ae.PREPEND,Ae.PREINSERT,Ae.POSTINSERT,Ae.REMOVE];!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Le||(Le={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Ne||(Ne={}));var je,Ue=function(e,t){return(0,i.Cl)((0,i.Cl)({},t),{event_type:Ne.IDENTIFY,user_properties:e.getUserProperties()})},Fe=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));Re(t)&&(this.properties=t)}catch(Ln){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,i.Cl)({},this.properties):{};return e[je.REVENUE_PRODUCT_ID]=this.productId,e[je.REVENUE_QUANTITY]=this.quantity,e[je.REVENUE_PRICE]=this.price,e[je.REVENUE_TYPE]=this.revenueType,e[je.REVENUE_CURRENCY]=this.currency,e[je.REVENUE]=this.revenue,e[je.RECEIPT]=this.receipt,e[je.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(je||(je={}));var qe=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Ye=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return(0,i.sH)(this,void 0,void 0,function(){var o;return(0,i.YH)(this,function(i){switch(i.label){case 0:return void 0===e.name&&(e.name=y(),this.loggerProvider.warn("Plugin name is undefined.\n      Generating a random UUID for plugin name: ".concat(e.name,".\n      Set a name for the plugin to prevent it from being added multiple times."))),o=e.name,this.pluginStatus.has(o)?(this.loggerProvider.warn("Plugin with name ".concat(o," already exists, skipping registration")),[2]):(e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",this.pluginStatus.set(o,"locked"),[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),"locked"!==this.pluginStatus.get(o)?[2]:(this.plugins.push(e),this.pluginStatus.set(o,"installed"),[2])}})})},e.prototype.deregister=function(e,t){var n;return(0,i.sH)(this,void 0,void 0,function(){var r,o;return(0,i.YH)(this,function(i){switch(i.label){case 0:return this.pluginStatus.delete(e),r=this.plugins.findIndex(function(t){return t.name===e}),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=o.teardown)||void 0===n?void 0:n.call(o)]);case 1:return i.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a,s,u,l,c,d,f,v,p,g,m,y,b,w,E,S;return(0,i.YH)(this,function(T){switch(T.label){case 0:if(!e)return[2];t=(0,i.zs)(e,1),n=t[0],r=(0,i.zs)(e,2),o=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),a=this.plugins.filter(function(e){return"before"===e.type}),T.label=1;case 1:T.trys.push([1,6,7,8]),s=(0,i.Ju)(a),u=s.next(),T.label=2;case 2:return u.done?[3,5]:(v=u.value).execute?[4,v.execute((0,i.Cl)({},n))]:[3,4];case 3:if(null===(p=T.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(v.name),"', event: ").concat(h(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(v.name),"', event: ").concat(h(n))),T.label=4;case 4:return u=s.next(),[3,2];case 5:return[3,8];case 6:return l=T.sent(),b={error:l},[3,8];case 7:try{u&&!u.done&&(w=s.return)&&w.call(s)}finally{if(b)throw b.error}return[7];case 8:c=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),T.label=9;case 9:T.trys.push([9,14,15,16]),d=(0,i.Ju)(c),f=d.next(),T.label=10;case 10:return f.done?[3,13]:(v=f.value).execute?[4,v.execute((0,i.Cl)({},n))]:[3,12];case 11:if(null===(p=T.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(v.name),"', event: ").concat(h(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(v.name),"', event: ").concat(h(n))),T.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return g=T.sent(),E={error:g},[3,16];case 15:try{f&&!f.done&&(S=d.return)&&S.call(d)}finally{if(E)throw E.error}return[7];case 16:return m=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(h(n))),y=m.map(function(e){var t=(0,i.Cl)({},n);return e.execute(t).catch(function(e){return we(t,0,String(e))})}),Promise.all(y).then(function(e){var t=(0,i.zs)(e,1)[0]||we(n,100,"Event not tracked, no destination plugins on the instance");o(t)}),[2]}})})},e.prototype.flush=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t,n,r=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return r.apply(e)}))];case 1:return i.sent(),t=this.plugins.filter(function(e){return"destination"===e.type}),n=t.map(function(e){return e.flush&&e.flush()}),[4,Promise.all(n)];case 2:return i.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a,s,u;return(0,i.YH)(this,function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),t=(0,i.Ju)(this._optOutListeners),n=t.next(),l.label=1;case 1:if(n.done)return[3,6];r=n.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,r(e)];case 3:return l.sent(),[3,5];case 4:return o=l.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return a=l.sent(),s={error:a},[3,9];case 8:try{n&&!n.done&&(u=t.return)&&u.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}(),ze=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Ye(this),this.name=e}return e.prototype._init=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t=this;return(0,i.YH)(this,function(n){switch(n.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q",function(){return t.isReady=!0})];case 1:return n.sent(),[2]}})})},e.prototype.runQueuedFunctions=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){var n,r,o,a,s,u,l,c;return(0,i.YH)(this,function(d){switch(d.label){case 0:n=this[e],this[e]=[],d.label=1;case 1:d.trys.push([1,8,9,10]),r=(0,i.Ju)(n),o=r.next(),d.label=2;case 2:return o.done?[3,7]:(a=o.value,(s=a())&&"promise"in s?[4,s.promise]:[3,4]);case 3:return d.sent(),[3,6];case 4:return[4,s];case 5:d.sent(),d.label=6;case 6:return o=r.next(),[3,2];case 7:return[3,10];case 8:return u=d.sent(),l={error:u},[3,10];case 9:try{o&&!o.done&&(c=r.return)&&c.call(r)}finally{if(l)throw l.error}
1return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e,t)]:[3,12];case 11:return d.sent(),[3,13];case 12:null==t||t(),d.label=13;case 13:return[2]}})})},e.prototype.track=function(e,t,n){var r=function(e,t,n){var r="string"==typeof e?{event_type:e}:e;return(0,i.Cl)((0,i.Cl)((0,i.Cl)({},r),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),c(this.dispatch(r))},e.prototype.identify=function(e,t){var n=Ue(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),c(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var o=function(e,t,n,r){var o;return(0,i.Cl)((0,i.Cl)({},r),{event_type:Ne.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=t,o)})}(e,t,n,r);return c(this.dispatch(o))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,o=new He;return o.set(e,t),(0,i.Cl)((0,i.Cl)({},n),{event_type:Ne.IDENTIFY,user_properties:o.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),c(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return(0,i.Cl)((0,i.Cl)({},t),{event_type:Ne.REVENUE,event_properties:e.getEventProperties()})}(e,t);return c(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),c())},e.prototype._addPlugin=function(e){return c(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),c())},e.prototype._removePlugin=function(e){return c(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(we(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t=this;return(0,i.YH)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=(0,i.Cl)({},n);if(void 0===e)return r;var o={};return Object.keys(e).forEach(function(t){Object.values(Le).includes(t)||(o[t]=e[t])}),Me.forEach(function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case Le.CLEAR_ALL:Object.keys(r).forEach(function(e){delete r[e]});break;case Le.UNSET:Object.keys(n).forEach(function(e){delete r[e]});break;case Le.SET:Object.assign(r,n)}}}),Object.assign(r,o),r},e.prototype.process=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o;return(0,i.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,we(e,0,"Event skipped due to optOut config")]:"string"!=typeof(t=e.event_type)||0===t.trim().length?(this.config.loggerProvider.error(be),[2,we(e,0,be)]):(e.event_type===Ne.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(o=i.sent()).code?this.config.loggerProvider.log(o.message):100===o.code?this.config.loggerProvider.warn(o.message):this.config.loggerProvider.error(o.message),[2,o];case 2:return n=i.sent(),r=String(n),this.config.loggerProvider.error(r),[2,o=we(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return c(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}();var Be=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])&&(!function(){var e,t,n=g();return"string"==typeof(null===(t=null===(e=null==n?void 0:n.chrome)||void 0===e?void 0:e.runtime)||void 0===t?void 0:t.id)}()||!!(null==e?void 0:e[t]))},Je=function(e){return Be(e,"attribution")},Ve=function(e){return Be(e,"formInteractions")},We=function(e){return Be(e,"pageViews")},Xe=function(e){return Be(e,"sessions")},$e=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Ke=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},Ge=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.webVitals;return"object"==typeof t&&null!==t?t:void 0}},Qe=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},Ze=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;return!0===t?{mainThreadBlock:!0}:"object"==typeof t&&null!==t?t:void 0}},et=function(e){if(Ke(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tt=function(e){if(Qe(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},nt=function(e){if($e(e.autocapture)){var t=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
vendor: 22,657 bytes, line 1
1networkTracking?t=e.autocapture.networkTracking:e.networkTrackingOptions&&(t=e.networkTrackingOptions),(0,i.Cl)((0,i.Cl)({},t),{captureRules:(n=null==t?void 0:t.captureRules,r=e.loggerProvider,null==n?void 0:n.map(function(e){var t,n;if((null===(t=e.urls)||void 0===t?void 0:t.length)&&(null===(n=e.hosts)||void 0===n?void 0:n.length)){var o=JSON.stringify(e.hosts),a=JSON.stringify(e.urls);return null==r||r.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,i.Cl)((0,i.Cl)({},e),{hosts:void 0})}return e}))})}var n,r},rt=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return We(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},it=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,a=r.resolve,s=e&&e[i];if("function"==typeof s){var u=s.apply(e,o);"function"==typeof a&&a(null==u?void 0:u.promise)}}return e},ot=function(e){return e&&void 0!==e._q};var at=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},st="2.47.1",ut="amplitude-ts",lt=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(ut,"/").concat(st),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return(0,i.sH)(this,void 0,void 0,function(){var r,o,a;return(0,i.YH)(this,function(s){return r=(new Date).getTime(),o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,a=null!==(n=e.event_id)&&void 0!==n?n:o+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=r),[2,(0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:at()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:y(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:a,library:this.library,user_agent:this.userAgent})]})})},e}(),ct=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),dt=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,i.Cl)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r,o,a=this;return(0,i.YH)(this,function(s){switch(s.label){case 0:return t="AMP_TEST",n=(0,i.Cl)({},this.options),r=new e(n),o=String(Date.now()),[4,r.transaction(t,function(e){var n,r;try{e.set(o);var i=e.get()===o;return!i&&a.config.diagnosticsClient&&(null===(n=a.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:o,sync:!0})),i}catch(jo){if(a.config.diagnosticsClient){var s=jo instanceof Error?jo.message:String(jo);null===(r=a.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:o,error:s,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,s.sent()]}})})},e.prototype.get=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=ft(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(Ln){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return(0,i.sH)(this,void 0,void 0,function(){var r,o,a,s,u,l,c,d,f;return(0,i.YH)(this,function(v){switch(v.label){case 0:r=g(),o=r,v.label=1;case 1:return v.trys.push([1,4,,5]),(a=null==o?void 0:o.cookieStore)?[4,a.getAll(e)]:[3,3];case 2:if(s=v.sent()){s.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:s.map(function(e){return e.domain})}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(u=(0,i.Ju)(s),l=u.next();!l.done;l=u.next())if(c=l.value,vt(c.domain,this.options.domain))return[2,c.value]}catch(h){d={error:h}}finally{try{l&&!l.done&&(f=u.return)&&f.call(u)}finally{if(d)throw d.error}}}v.label=3;case 3:return[3,5];case 4:return v.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=g(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(o){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=g();if(!r||!r.document||"function"!=typeof r.btoa||"function"!=typeof r.encodeURIComponent)return;var i=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=null!==t?i:-1,a=void 0;if(o){var s=new Date;s.setTime(s.getTime()+24*o*60*60*1e3),a=s}var u="".concat(e,"=").concat(r.btoa(r.encodeURIComponent(JSON.stringify(t))));a&&(u+="; expires=".concat(a.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),r.document.cookie=u}catch(c){var l=c instanceof Error?c.message:String(c);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,i.sH)(this,void 0,void 0,function(){var n,r;return(0,i.YH)(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",r=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,i.sH)(this,void 0,void 0,function(){var n,r,o=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:if(n=function(){var e,t=g();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),r=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!n)return[2,r()];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,i.sent()];case 3:return i.sent(),[2,r()];case 4:return[2]}})})},e.cachedTlds={},e}(),ft=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(t){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(t){return}}(e)},vt=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},ht=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[K,t,e.substring(0,n)].filter(Boolean).join("_")},pt=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r;return(0,i.YH)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(i){}return[2]})})},e.prototype.remove=function(e){var t;return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(r){}return[2]})})},e.prototype.reset=function(){var e;return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(n){}return[2]})})},e}(),gt=1e3,mt=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=g())||void 0===n?void 0:n.localStorage}catch(jo){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(jo))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,i.C6)(t,e),t.prototype.set=function(t,n){var r;return(0,i.sH)(this,void 0,void 0,function(){var o;return(0,i.YH)(this,function(i){switch(i.label){case 0:return Array.isArray(n)&&n.length>gt?(o=n.length-gt,[4,e.prototype.set.call(this,t,n.slice(0,gt))]):[3,2];case 1:return i.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(gt,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:i.sent(),i.label=4;case 4:return[2]}})})},t}(pt),yt=function(e){function t(){var t;return e.call(this,null===(t=g())||void 0===t?void 0:t.sessionStorage)||this}return(0,i.C6)(t,e),t}(pt);function bt(){return"undefined"!=typeof CompressionStream}function wt(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n;return(0,i.YH)(this,function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var Et=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,a,s,u,l,c,d,f,v,h,p,g,m,y,b,w,E,S;if("object"!=typeof e)return null;var T=e.code||0,k=this.buildStatus(T);switch(k){case $.Success:return{status:k,statusCode:T,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case $.Invalid:return{status:k,statusCode:T,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(a=e.events_with_invalid_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(l=e.eps_threshold)&&void 0!==l?l:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case $.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!==(p=e.error)&&void 0!==p?p:""}};case $.RateLimit:return{status:k,statusCode:T,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(E=e.exceeded_daily_quota_users)&&void 0!==E?E:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case $.Timeout:default:return{status:k,statusCode:T}}},e.prototype.buildStatus=function(e){return xe(e)?$.Success:429===e?$.RateLimit:413===e?$.PayloadTooLarge:408===e?$.Timeout:e>=400&&e<500?$.Invalid:e>=500?$.Failed:$.Unknown},e}(),St=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return(0,i.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,i.sH)(this,void 0,void 0,function(){var r=this;return(0,i.YH)(this,function(o){return[2,new Promise(function(a,s){"undefined"==typeof XMLHttpRequest&&s(new Error("XHRTransport is not supported."));var u=new XMLHttpRequest;u.open("POST",e,!0),u.onreadystatechange=function(){if(u.readyState===r.state.done){var e=u.responseText;try{a(r.buildResponse(JSON.parse(e)))}catch(o){a(r.buildResponse({code:u.status}))}}};var l={"Content-Type":"application/json",Accept:"*/*"},c=JSON.stringify(t),d=n&&c.length>=2048&&bt(),f=function(e){var t,n;l=(0,i.Cl)((0,i.Cl)({},r.customHeaders),l);try{for(var o=(0,i.Ju)(Object.entries(l)),a=o.next();!a.done;a=o.next()){var s=(0,i.zs)(a.value,2),c=s[0],d=s[1];u.setRequestHeader(c,d)}}catch(f){t={error:f}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}u.send(e)};(0,i.sH)(r,void 0,void 0,function(){var e;return(0,i.YH)(this,function(t){switch(t.label){case 0:return d?[4,wt(c)]:[3,2];case 1:return(e=t.sent())?(l["Content-Encoding"]="gzip",f(e)):f(c),[3,3];case 2:f(c),t.label=3;case 3:return[2]}})}).catch(s)})]})})},t}(Et),Tt=function(e){function t(t,n,r){void 0===t&&(t={});var i=e.call(this)||this;return i.customHeaders=t,i.enableKeepalive=!1!==n,i.referrerPolicy=r,i}return(0,i.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,i.sH)(this,void 0,void 0,function(){var r,o,a,s,u,l,c,d,f;return(0,i.YH)(this,function(v){switch(v.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r=JSON.stringify(t),o=n&&r.length>=2048&&bt(),a=r,s={"Content-Type":"application/json",Accept:"*/*"},o?[4,wt(r)]:[3,2];case 1:(u=v.sent())&&(s["Content-Encoding"]="gzip",a=u),v.label=2;case 2:return s=(0,i.Cl)((0,i.Cl)({},this.customHeaders),s),l="string"==typeof a?a.length:a.byteLength,c={headers:s,body:a,method:"POST",keepalive:this.enableKeepalive&&l<=16384},this.referrerPolicy&&(c.referrerPolicy=this.referrerPolicy),[4,fetch(e,c)];case 3:return[4,(d=v.sent()).text()];case 4:f=v.sent();try{return[2,this.buildResponse(JSON.parse(f))]}catch(h){return[2,this.buildResponse({code:d.status})]}}})})},t}(Et),kt=function(e){function t(){return e.call(this)||this}return(0,i.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,i.sH)(this,void 0,void 0,function(){var n=this;return(0,i.YH)(this,function(r){return[2,new Promise(function(r,i){var o=g();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);return r(o.navigator.sendBeacon(e,a)?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(jo){i(jo)}})]})})},t}(Et),Ct=function(e,t,n){return void 0===n&&(n=!0),(0,i.sH)(void 0,void 0,void 0,function(){var r,o,a,s,u,l,c,d,f;return(0,i.YH)(this,function(v){switch(v.label){case 0:return r=function(e){return"".concat(K.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(o=v.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;case 3:return a=(0,i.zs)(o.split("."),6),s=a[0],u=a[1],l=a[2],c=a[3],d=a[4],f=a[5],[2,{deviceId:s,userId:Pt(u),sessionId:xt(c),lastEventId:xt(f),lastEventTime:xt(d),optOut:Boolean(l)}]}})})},xt=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Pt=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(Ln){return}},It="[Amplitude]",At=("".concat(It," Page Viewed"),"".concat(It," Form Started")),Ot="".concat(It," Form Submitted"),_t="".concat(It," File Downloaded"),Rt="session_start",Dt="session_end",Ht="".concat(It," File Extension"),Lt="".concat(It," File Name"),Nt="".concat(It," Link ID"),Mt="".concat(It," Link Text"),jt="".concat(It," Link URL"),Ut="".concat(It," Form ID"),Ft="".concat(It," Form Name"),qt="".concat(It," Form Destination"),Yt="cookie",zt={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},Bt=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Jt=function(e,t,n,r,o,a){void 0===o&&(o=!0);e.referrer;var s,u,l=e.referring_domain,c=(0,i.Tt)(e,["referrer","referring_domain"]),d=t||{},f=(d.referrer,d.referring_domain),v=(0,i.Tt)(d,["referrer","referring_domain"]),h=n.excludeInternalReferrers;if(h){var p=Wt(h,r);if(!(p instanceof TypeError)&&e.referring_domain&&Gt(e.referring_domain,a)){if("always"===p)return Xt(p,e.referring_domain,r),!1;if("ifEmptyCampaign"===p&&(s=e,u=(0,i.Cl)((0,i.Cl)({},s),{referring_domain:void 0,referrer:void 0}),Object.values(u).every(function(e){return!e})))return Xt(p,e.referring_domain,r),!1}}if(Vt(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!o&&function(e){return Object.values(e).every(function(e){return!e})}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var g=JSON.stringify(c)!==JSON.stringify(v),m=Bt(l||"")!==Bt(f||""),y=!t||g||m;return y?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),y},Vt=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},Wt=function(e,t){if(!0===e)return zt.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(zt).includes(n))return n;if(void 0===n)return zt.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function Xt(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?n.debug(r):"ifEmptyCampaign"===e&&n.debug("".concat(r," with empty campaign parameters"))}var $t=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],Kt=function(e){var t,n,r=e||(null===(n=null===(t=g())||void 0===t?void 0:t.location)||void 0===n?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],a=i[i.length-2];
1return $t.find(function(e){return r.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a?"".concat(a,".").concat(o):o},Gt=function(e,t){var n=g();if(!n)return!1;var r,i,o,a=(t||"").trim()||Kt(n.location.hostname);return r=e,o=(i=a).startsWith(".")?i:".".concat(i),!!(r.startsWith(".")?r:".".concat(r)).endsWith(o)},Qt=function(e){function t(t,n,i,o,a,s,u,l,c,d,v,h,p,g,m,y,b,w,E,S,T,k,C,x,P,I,A,O,_,R,D,H,L,N,M,j,U,F,q,Y,z,B,J,V){void 0===i&&(i=new ct),void 0===o&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===c&&(c=5),void 0===d&&(d=30),void 0===v&&(v=Yt),void 0===y&&(y=new f),void 0===b&&(b=r.Warn),void 0===E&&(E=!1),void 0===S&&(S=!1),void 0===C&&(C=""),void 0===x&&(x="US"),void 0===A&&(A=18e5),void 0===O&&(O=new mt({loggerProvider:y})),void 0===_&&(_={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===D&&(D=!1),void 0===H&&(H=!0),void 0===F&&(F=!0),void 0===q&&(q=0),void 0===J&&(J=!1);var W,X=this;(X=e.call(this,{apiKey:t,instanceName:p,storageProvider:O,transportProvider:tn(R)})||this).apiKey=t,X.appVersion=n,X.cookieOptions=o,X.defaultTracking=a,X.autocapture=s,X.flushIntervalMillis=l,X.flushMaxRetries=c,X.flushQueueSize=d,X.identityStorage=v,X.ingestionMetadata=h,X.loggerProvider=y,X.logLevel=b,X.minIdLength=w,X.offline=E,X.partnerId=T,X.plan=k,X.serverUrl=C,X.serverZone=x,X.sessionTimeout=A,X.storageProvider=O,X.trackingOptions=_,X.transport=R,X.useBatch=D,X.fetchRemoteConfig=H,X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=F,X.diagnosticsSampleRate=q,X.diagnosticsClient=Y,X.remoteConfig=z,X.topLevelDomain=B,X.enableRequestBodyCompression=J,X.customEnrichment=V,X.version=st,X._optOut=!1,X._cookieStorage=i,X.deviceId=u,X.lastEventId=g,X.lastEventTime=m,X.optOut=S,X.deferredSessionId=I,X.sessionId=P,X.pageCounter=N,X.userId=L,X.debugLogsEnabled=M,X.loggerProvider.enable(M?r.Debug:X.logLevel),X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=F,X.diagnosticsSampleRate=q,X.diagnosticsClient=Y;var $=null!==(W=null==z?void 0:z.fetchRemoteConfig)&&void 0!==W?W:H;return X.remoteConfig=X.remoteConfig||{},X.remoteConfig.fetchRemoteConfig=$,X.fetchRemoteConfig=$,X.topLevelDomain=B||Kt(),X}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())}
vendor: 9,438 bytes, line 1
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof dt&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(ht(this.apiKey),e)},t}(Se),Zt=function(e,t,n,r,o){return void 0===t&&(t={}),(0,i.sH)(void 0,void 0,void 0,function(){var a,s,u,l,c,d,f,v,h,p,g,m,b,w,E,S,T,k,C,x,P,I,A,O,_,R,D,H,L,N,M,j,U,q,Y,z,B,J,V,W,X,$,K,G,Q,Z,ee,te,ne,re,ie;return(0,i.YH)(this,function(oe){switch(oe.label){case 0:return a=t.identityStorage||Yt,s="",a!==Yt||(null===(I=t.cookieOptions)||void 0===I?void 0:I.domain)||""===(null===(A=t.cookieOptions)||void 0===A?void 0:A.domain)?[3,2]:[4,nn(void 0,r)];case 1:s=oe.sent(),oe.label=2;case 2:return u=(0,i.Cl)({domain:null!==(_=null===(O=t.cookieOptions)||void 0===O?void 0:O.domain)&&void 0!==_?_:s,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),l={duplicateResolverFn:function(e){var t=ft(e);if(!t)return!1;var n=JSON.parse(t);return vt(n.cookieDomain,u.domain)},diagnosticsClient:r},c=en(t.identityStorage,u,l),[4,Ct(e,c,null===(D=null===(R=t.cookieOptions)||void 0===R?void 0:R.upgrade)||void 0===D||D)];case 3:return d=oe.sent(),[4,c.get(ht(e))];case 4:return f=oe.sent(),v=F(),h=v.ampTimestamp?Number(v.ampTimestamp):void 0,p=!h||Date.now()<h,g=null!==(j=null!==(M=null!==(N=null!==(H=t.deviceId)&&void 0!==H?H:p?null!==(L=v.ampDeviceId)&&void 0!==L?L:v.deviceId:void 0)&&void 0!==N?N:null==f?void 0:f.deviceId)&&void 0!==M?M:d.deviceId)&&void 0!==j?j:y(),m=null!==(U=null==f?void 0:f.lastEventId)&&void 0!==U?U:d.lastEventId,b=null!==(q=null==f?void 0:f.lastEventTime)&&void 0!==q?q:d.lastEventTime,w=null!==(z=null!==(Y=t.optOut)&&void 0!==Y?Y:null==f?void 0:f.optOut)&&void 0!==z?z:d.optOut,E=null!==(B=null==f?void 0:f.sessionId)&&void 0!==B?B:d.sessionId,S=null==f?void 0:f.deferredSessionId,T=null!==(V=null!==(J=t.userId)&&void 0!==J?J:null==f?void 0:f.userId)&&void 0!==V?V:d.userId,n.previousSessionDeviceId=null!==(W=null==f?void 0:f.deviceId)&&void 0!==W?W:d.deviceId,n.previousSessionUserId=null!==(X=null==f?void 0:f.userId)&&void 0!==X?X:d.userId,k={ipAddress:null===(K=null===($=t.trackingOptions)||void 0===$?void 0:$.ipAddress)||void 0===K||K,language:null===(Q=null===(G=t.trackingOptions)||void 0===G?void 0:G.language)||void 0===Q||Q,platform:null===(ee=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===ee||ee},C=null==f?void 0:f.pageCounter,x=null==f?void 0:f.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(P=new Qt(e,t.appVersion,c,u,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,a,t.ingestionMetadata,t.instanceName,m,b,null!==(te=null==o?void 0:o.loggerProvider)&&void 0!==te?te:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,w,t.partnerId,t.plan,t.serverUrl,null!==(ne=null==o?void 0:o.serverZone)&&void 0!==ne?ne:t.serverZone,E,S,t.sessionTimeout,t.storageProvider,k,t.transport,t.useBatch,t.fetchRemoteConfig,T,C,x,t.networkTrackingOptions,t.identify,null!==(re=null==o?void 0:o.enableDiagnostics)&&void 0!==re?re:t.enableDiagnostics,null!==(ie=null==o?void 0:o.diagnosticsSampleRate)&&void 0!==ie?ie:n._diagnosticsSampleRate,r,t.remoteConfig,s,t.enableRequestBodyCompression,t.customEnrichment)).storageProvider.isEnabled()];case 5:return oe.sent()||(P.loggerProvider.warn("Storage provider ".concat(P.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),P.storageProvider=new ct),[2,P]}})})},en=function(e,t,n){switch(void 0===e&&(e=Yt),void 0===t&&(t={}),e){case"localStorage":return new mt;case"sessionStorage":return new yt;case"none":return new ct;default:return new dt((0,i.Cl)((0,i.Cl)({},t),{expirationDays:t.expiration}),n)}},tn=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0,r="object"==typeof e?e.enableKeepalive:void 0,i="object"==typeof e?e.referrerPolicy:void 0;return"xhr"===t?new St(n):"beacon"===t?new kt:new Tt(n,r,i)},nn=function(e,t){return(0,i.sH)(void 0,void 0,void 0,function(){var n,r,o,a,s,u,l;return(0,i.YH)(this,function(i){switch(i.label){case 0:return[4,new dt(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!i.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];if(n=null!=e?e:location.hostname,1===(r=n.split(".")).length)return[2,""];for(o=[],a=1,$t.find(function(e){return n.endsWith(".".concat(e))})&&(a=2),s=r.length-a-1;s>=0;--s)o.push(r.slice(s).join("."));s=0,i.label=2;case 2:if(!(s<o.length))return[3,7];u=o[s],i.label=3;case 3:return i.trys.push([3,5,,6]),[4,dt.isDomainWritable(u)];case 4:return i.sent()?[2,"."+u]:[3,6];case 5:return l=i.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(u),error:l instanceof Error?l.message:String(l)}),[3,6];case 6:return s++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(n)}),[2,""]}})})},rn="data-amp-mask",on="*****",an=/\b(?:\d[ -]*?){13,16}\b/,sn=/(\d{3}-?\d{2}-?\d{4})/g,un=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,ln=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var o=e;o=(o=(o=o.replace(an,on)).replace(sn,on)).replace(un,on);try{for(var a=(0,i.Ju)(t),s=a.next();!s.done;s=a.next()){var u=s.value;try{o=o.replace(u,on)}catch(l){}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},cn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(rn)?on:e?e(document.title):document.title},dn=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},fn=function(){function e(){}return e.prototype.parse=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){return[2,(0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)({},he),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=F();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(r){}return n},e.prototype.getClickIds=function(){var e,t=F();return(e={})[re]=t[re],e[ie]=t[ie],e[oe]=t[oe],e[ae]=t[ae],e[se]=t[se],e[ue]=t[ue],e[le]=t[le],e[ce]=t[ce],e[de]=t[de],e[fe]=t[fe],e[ve]=t[ve],e},e}(),vn="AMP_PAGE_VIEW",hn=function(e){var t;void 0===e&&(e={});var n,r,o=g(),a=void 0,s=!1,u=e.trackOn,l=e.trackHistoryChanges,c=e.eventType,d=void 0===c?"[Amplitude] Page Viewed":c,f=function(e){var t=e;try{t=decodeURI(e)}catch(jo){null==a||a.error("Malformed URI sequence: ",jo)}return t},v=function(e){return(0,i.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,i.YH)(this,function(o){switch(o.label){case 0:return t=f("undefined"!=typeof location&&location.href||""),r={event_type:d},n=[{}],[4,pn()];case 1:return[2,(r.event_properties=i.Cl.apply(void 0,[i.Cl.apply(void 0,n.concat([o.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&f(location.pathname)||"","[Amplitude] Page Title":cn(ln),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),r)]}})})},h=function(){return void 0===u||"function"==typeof u&&u()},p="undefined"!=typeof location?location.href:null,m=function(){(0,i.sH)(void 0,void 0,void 0,function(){var e,n,o,s,u;return(0,i.YH)(this,function(i){switch(i.label){case 0:return e=location.href,n=mn(l,e,p||"")&&h(),p=e,n?(o=void 0,r&&(o=y(),r.set(vn,{pageViewId:o})),null==a||a.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return u=(s=t).track,[4,v(o)];case 2:u.apply(s,[i.sent()]),i.label=3;case 3:i.label=4;case 4:return[2]}})})},b={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,u){return(0,i.sH)(void 0,void 0,void 0,function(){var l,c,d;return(0,i.YH)(this,function(f){switch(f.label){case 0:if(t=u,n=e,(a=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,o){try{r=new pt(o.sessionStorage)}catch(p){null==a||a.debug("sessionStorage is not available in this environment.")}o.addEventListener("popstate",m),o.history.pushState=new Proxy(o.history.pushState,{apply:function(e,t,n){var r=(0,i.zs)(n,3),o=r[0],a=r[1],u=r[2];e.apply(t,[o,a,u]),s&&m()}})}return h()?(a.log("Tracking page view event"),l=void 0,r&&(l=y(),r.set(vn,{pageViewId:l})),d=(c=t).track,[4,v(l)]):[3,2];case 1:d.apply(c,[f.sent()]),f.label=2;case 2:return[2]}})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){var t,o,s;return(0,i.YH)(this,function(l){switch(l.label){case 0:return"attribution"===u&&gn(e)?(null==a||a.log("Enriching c
1ampaign event to page view event with campaign parameters"),t=void 0,r?[4,r.get(vn)]:[3,2]):[3,4];case 1:o=l.sent(),t=null==o?void 0:o.pageViewId,l.label=2;case 2:return[4,v(t)];case 3:s=l.sent(),e.event_type=s.event_type,e.event_properties=(0,i.Cl)((0,i.Cl)({},e.event_properties),s.event_properties),l.label=4;case 4:return n&&e.event_type===d&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,i.Cl)((0,i.Cl)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(e){return o&&(o.removeEventListener("popstate",m),s=!1),[2]})})}};return b},pn=function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e;return(0,i.YH)(this,function(t){switch(t.label){case 0:return e=dn,[4,(new fn).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},gn=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[Le.SET]||{},r=t[Le.UNSET]||{},o=(0,i.fX)((0,i.fX)([],(0,i.zs)(Object.keys(n)),!1),(0,i.zs)(Object.keys(r)),!1);return Object.keys(he).every(function(e){return o.includes(e)})}return!1},mn=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},yn=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,o){return(0,i.sH)(void 0,void 0,void 0,function(){var a,s;return(0,i.YH)(this,function(i){return t=function(e){if(Ve(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(n),a=function(){if(o){if("undefined"!=typeof document){var i=new WeakSet,a=function(e){if(!i.has(e)){i.add(e);var a=!1;r(e,"change",function(){var t,n=wn(e);a||o.track(At,((t={})[Ut]=bn(e.id),t[Ft]=bn(e.name),t[qt]=n,t)),a=!0}),r(e,"submit",function(r){var i,s,u=wn(e);if(a||o.track(At,((i={})[Ut]=bn(e.id),i[Ft]=bn(e.name),i[qt]=u,i)),a=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(jo){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");o.track(Ot,((s={})[Ut]=bn(e.id),s[Ft]=bn(e.name),s[qt]=u,s)),a=!1})}};Array.from(document.getElementsByTagName("form")).forEach(a),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("FORM"===e.nodeName&&a(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var t=e.querySelectorAll("form");null==t||t.forEach(a)}}catch(r){n.loggerProvider.warn("Failed to track form interactions for an added node: ".concat(String(r)))}})})})).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?a():(s=g())?s.addEventListener("load",a):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return null==e||e.disconnect(),n.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),n=[],[2]})})}}},bn=function(e){if("string"==typeof e)return e},wn=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(Ln){}return t},En=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return(0,i.sH)(void 0,void 0,void 0,function(){var o,a;return(0,i.YH)(this,function(i){return o=function(){if(r){if("undefined"!=typeof document){var o=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(i){return}var o=a.exec(n.href),s=null==o?void 0:o[1];s&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",function(){var t;s&&r.track(_t,((t={})[Ht]=s,t[Lt]=n.pathname,t[Nt]=e.id,t[Mt]=e.text,t[jt]=e.href,t))})},a=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;
1Array.from(document.getElementsByTagName("a")).forEach(o),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("A"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var t=e.querySelectorAll("a");null==t||t.forEach(o)}}catch(r){n.loggerProvider.warn("Failed to track file downloads for an added node: ".concat(String(r)))}})})})).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?o():(a=g())?a.addEventListener("load",o):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(n){return null==e||e.disconnect(),t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[],[2]})})}}},Sn=!1,Tn=function(){var e=g(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",function(){!1!==e.offline&&(e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis))}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0}),[2])})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(n){return t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[],[2]})})}}};function kn(e,t,n){var r,o,a=[];try{for(var s=(0,i.Ju)(null!=t?t:[]),u=s.next();!u.done;u=s.next()){var l=u.value;try{a.push(new RegExp(l))}catch(c){n.warn("Invalid regex pattern: ".concat(l),c)}}}catch(d){r={error:d}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return e.concat(a)}function Cn(e){var t,n,r,o,a,s,u,l,c,d,f,v,h;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var g=(0,i.Ju)(p),m=g.next();!m.done;m=g.next()){var y=m.value;try{var b=e[y];"boolean"==typeof(null==b?void 0:b.enabled)&&(b.enabled?(delete b.enabled,0===Object.keys(b).length&&(e[y]=!0)):e[y]=!1),Cn(b)}catch(jo){}}}catch(R){t={error:R}}finally{try{m&&!m.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}try{if(null===(c=null===(l=null===(u=e.autocapture)||void 0===u?void 0:u.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===c?void 0:c.length)try{for(var w=(0,i.Ju)(e.autocapture.networkTracking.captureRules),E=w.next();!E.done;E=w.next()){var S=E.value;try{for(var T=(a=void 0,(0,i.Ju)(["responseHeaders","requestHeaders"])),k=T.next();!k.done;k=T.next()){var C=k.value,x=null!==(d=S[C])&&void 0!==d?d:{},P=x.captureSafeHeaders,I=x.allowlist;(P||I)&&(void 0===I||Array.isArray(I)?S[C]=(0,i.fX)((0,i.fX)([],(0,i.zs)(P?pe:[]),!1),(0,i.zs)(null!=I?I:[]),!1):delete S[C])}}catch(D){a={error:D}}finally{try{k&&!k.done&&(s=T.return)&&s.call(T)}finally{if(a)throw a.error}}}}catch(H){r={error:H}}
1finally{try{E&&!E.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}}catch(jo){}void 0!==(null===(f=e.autocapture)||void 0===f?void 0:f.pageViews)&&(e.autocapture.screenViews=e.autocapture.pageViews);var A=null===(v=e.autocapture)||void 0===v?void 0:v.frustrationInteractions;A&&(A.rageClick&&(A.rageClicks=A.rageClick,delete A.rageClick),A.deadClick&&(A.deadClicks=A.deadClick,delete A.deadClick));try{var O=null===(h=e.autocapture)||void 0===h?void 0:h.elementInteractions;if(O&&"object"==typeof O&&(!0===O.viewportContentUpdated&&(O.viewportContentUpdated={}),!1===O.viewportContentUpdated&&(O.viewportContentUpdated={enabled:!1}),void 0!==O.exposureDuration)){var _=O.viewportContentUpdated;void 0===_?O.viewportContentUpdated={exposureDuration:O.exposureDuration}:"object"==typeof _&&void 0===_.exposureDuration&&!1!==_.enabled&&(_.exposureDuration=O.exposureDuration),delete O.exposureDuration}}catch(jo){}}}function xn(e,t){var n,r;if(e){Cn(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",h(e));var o=e;if(o&&"autocapture"in o){if("boolean"==typeof o.autocapture&&(t.autocapture=o.autocapture),"object"==typeof o.autocapture&&null!==o.autocapture){var a=(0,i.Cl)({},o.autocapture);if(void 0===t.autocapture&&(t.autocapture=o.autocapture),"object"==typeof o.autocapture.elementInteractions&&null!==o.autocapture.elementInteractions&&(null===(n=o.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===n?void 0:n.length)){a.elementInteractions=(0,i.Cl)({},o.autocapture.elementInteractions);var s=a.elementInteractions,u=null!==(r=s.pageUrlAllowlist)&&void 0!==r?r:[],l=o.autocapture.elementInteractions.pageUrlAllowlistRegex;s.pageUrlAllowlist=kn(u,l,t.loggerProvider),delete s.pageUrlAllowlistRegex}var c=function(e,t){var n,r,o,a,s;if("object"==typeof e&&null!==e&&(null===(o=e.captureRules)||void 0===o?void 0:o.length)){var u=(0,i.Cl)({},e),l=null!==(a=u.captureRules)&&void 0!==a?a:[];try{for(var c=(0,i.Ju)(l),d=c.next();!d.done;d=c.next()){var f=d.value;f.urls=kn(null!==(s=f.urls)&&void 0!==s?s:[],f.urlsRegex,t),delete f.urlsRegex}}catch(v){n={error:v}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return u}}(o.autocapture.networkTracking,t.loggerProvider);c&&(a.networkTracking=c),"boolean"==typeof t.autocapture&&(t.autocapture=(0,i.Cl)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},a)),"object"==typeof t.autocapture&&(t.autocapture=(0,i.Cl)((0,i.Cl)({},t.autocapture),a))}t.defaultTracking=t.autocapture}"customEnrichment"in o&&null!==o.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=o.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",h(t))}catch(jo){t.loggerProvider.error("Failed to apply remote configuration because of error: ",jo)}}}var Pn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],In="data-amp-track-",An=["div","span","h1","h2","h3","h4","h5","h6"],On=n(6064),_n=n.n(On);function Rn(e,t){return new(_n())(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function Dn(e,t){return new(_n())(function(n){var r=!1,o=new Set,a=function(){var e,t;r=!0;try{for(var n=(0,i.Ju)(o),a=n.next();!a.done;a=n.next()){var s=a.value;try{s.unsubscribe()}catch(u){}}}catch(l){e={error:l}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}o.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),a())},complete:function(){o.delete(t),r||0!==o.size||(n.complete(),a(),r=!0)}});o.add(t)};return s(e),s(t),a})}function Hn(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new(_n())(function(o){return t.add(o),null===n&&(n=e.subscribe({next:function(e){var n,r,o;try{for(var a=(0,i.Ju)(t),s=a.next();!s.done;s=a.next()){var u=s.value;null===(o=u.next)||void 0===o||o.call(u,e)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},error:function(e){var n,o,a;try{for(var s=(0,i.Ju)(t),u=s.next();!u.done;u=s.next()){var l=u.value;null===(a=l.error)||void 0===a||a.call(l,e)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,o;try{for(var a=(0,i.Ju)(t),s=a.next();!s.done;s=a.next()){var u=s.value;null===(o=u.complete)||void 0===o||o.call(u)}}catch(l){e={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}r()}})),function(){t.delete(o),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var Ln,Nn="https://app.amplitude.com",Mn={US:Nn,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var jn="__AMPLITUDE_MESSENGER_INSTANCE__",Un="__AMPLITUDE_MESSENGER__",Fn=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?Nn:t;this[Ln]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),n.timeout>0&&setTimeout(function(){a(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,o,a;this.actionHandlers.has(e)&&(null===(a=null===(o=this.logger)||void 0===o?void 0:o.warn)||void 0===a||a.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var u=(0,i.Ju)(s),l=u.next();!l.done;l=u.next()){t(l.value)}}catch(c){n={error:c}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r;return(0,i.YH)(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(o){n(o)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}})})},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===Nn&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,a;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var s=e.data,u=null==s?void 0:s.action;if(u)if("id"in s&&s.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(s);else{if("ping"===u)return void r.notify({action:"pong"});var l=r.actionHandlers.get(u);if(l)l(s.data);else{var c=null!==(a=r.pendingMessages.get(u))&&void 0!==a?a:[];c.push(s.data),r.pendingMessages.set(u,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=g();(null==e?void 0:e[Un])===this&&delete e[Un]},e}();function qn(e){var t,n=g(),r=null==n?void 0:n[Un];if("object"==typeof(t=r)&&null!==t&&jn in t&&!0===t[jn])return r;var i=new Fn(e);return n&&(n[Un]=i),i}Ln=jn;var Yn=["desktop","tablet","mobile"],zn="__AMPLITUDE_BACKGROUND_CAPTURE__";function Bn(e,t){var n,r=e;if(!0!==r[zn]){r[zn]=!0;var o=null!==(n=null==t?void 0:t.scriptUrl)&&void 0!==n?n:"https://cdn.amplitude.com/libs/background-capture-1.1.0.js.gz",a=null,s=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Backgroun
1d capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",function(t){var n,r;null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Initializing background capture (external script)");var u=new URL(o,e.endpoint).toString(),l=t&&"object"==typeof t?function(e){if("string"==typeof e)return Yn.includes(e)?e:void 0}(t.deviceMode):void 0;e.loadScriptOnce(u).then(function(){var t,n,r;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),a=null===(r=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===r?void 0:r.call(window,(0,i.Cl)({messenger:e,onBackgroundCapture:s},void 0!==l?{initialDeviceMode:l}:{})),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a),a=null})}}var Jn="1.29.4",Vn="[Amplitude] Element Clicked",Wn="[Amplitude] Element Tag",Xn="[Amplitude] Element Text",$n="[Amplitude] Page URL",Kn="[Amplitude] Viewport Height",Gn="[Amplitude] Viewport Width",Qn="[Amplitude] Page View ID",Zn="data-amp-mask-attributes",er="data-amp-internal-shadow",tr=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},nr=function(e,t){var n=e;try{n=decodeURI(e)}catch(jo){null==t||t.error("Malformed URI sequence: ",jo)}return n},rr=" >>> ",ir=":scope > ";function or(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function ar(e){var t,n=e.getRootNode();return or(n)?n:null!==(t=e.ownerDocument)&&void 0!==t?t:document}function sr(e,t){var n,r,o,a;return(0,i.YH)(this,function(i){switch(i.label){case 0:n=e,r=0,o=0,i.label=1;case 1:return null!==n&&o<1024?(o+=1,[4,n]):[3,3];case 2:return i.sent(),n.parentElement?(n=n.parentElement,[3,1]):r<t&&"function"==typeof n.getRootNode&&(a=function(e){if(e.parentElement)return e.parentElement;var t=e.getRootNode();return or(t)?t.host:null}(n))&&a!==n?(r+=1,n=a,[3,1]):[3,3];case 3:return[2]}})}function ur(e,t){var n=[];if(t<=0)return n;for(var r=[[e,0]],o=0;r.length&&o<5e4;){o+=1;var a=(0,i.zs)(r.pop(),2),s=a[0],u=a[1],l=s.shadowRoot;if(l&&u+1<=t){n.push({root:l,depth:u+1});for(var c=l.children,d=0;d<c.length;d++)r.push([c[d],u+1])}var f=s.children;for(d=0;d<f.length;d++)r.push([f[d],u])}return n}function lr(e,t){for(var n=[],r=e,i=0;null!==r&&i<1024;){i+=1;var o=ar(r);n.push({root:o,target:r});var a=r.getRootNode();if(!or(a))break;r=a.host}var s=n.length-1,u=!1,l=n;return s>t&&(l=n.slice(s-t),u=!0),{segments:l.reverse(),truncated:u}}function cr(e,t){var n=e.tagName.toLowerCase(),r=e.parentElement;if(null===r){var i=e.getRootNode();return t&&or(i)?"".concat(n,":nth-of-type(").concat(dr(e,i.children),")"):n}return"".concat(n,":nth-of-type(").concat(dr(e,r.children),")")}function dr(e,t){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}var fr,vr=Object.freeze({enabled:!1,maxDepth:0}),hr=function(){var e=vr,t=new Set;return{get:function(){return e},arm:function(n){return e.enabled||!n.enabled||(e=n,function(e){var n,r;try{for(var o=(0,i.Ju)((0,i.fX)([],(0,i.zs)(t),!1)),a=o.next();!a.done;a=o.next()){var s=a.value;try{s(e)}catch(u){}}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}t.clear()}(n)),e},onArm:function(n){if(e.enabled){var r=e;try{n(r)}catch(Ln){}return function(){}}return t.add(n),function(){t.delete(n)}}}},pr=["input","select","textarea"],gr=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&tr(window.location.href,n))&&!!tr(window.location.href,t)},mr=function(e,t){return function(n,r){var i,o,a=e.shouldTrackEventResolver,s=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!s)return!1;if(a)return a(n,r);if(!gr(e))return!1;var u=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}if(t){var l=t.some(function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))});if(!l)return!1}switch(s){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return"click"===n}}},yr=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},br=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t},{})},wr=function(){var e;try{var t=g(),n=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(i){}},Er=function(e,t,n){return void 0===n&&(n=vr),n.enabled?Tr(e,t,n.maxDepth):Sr(e,t)},Sr=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:Sr(null==e?void 0:e.parentElement,t):null},Tr=function(e,t,n){var r,o;
1if(!e)return null;var a=function(e){if(t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))return{value:e}};try{for(var s=(0,i.Ju)(sr(e,n)),u=s.next();!u.done;u=s.next()){var l=a(u.value);if("object"==typeof l)return l.value}}catch(c){r={error:c}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return null},kr=function(e,t,n){return void 0===n&&(n=vr),n.enabled?xr(e,t,n.maxDepth):Cr(e,t)},Cr=function(e,t){var n=[];return t?(e.querySelectorAll(t).forEach(function(e){return n.push(e)}),n):n},xr=function(e,t,n){var r=Cr(e,t),i=e instanceof Document?e.documentElement:e;return i?(ur(i,n).forEach(function(e){e.root.querySelectorAll(t).forEach(function(e){return r.push(e)})}),r):r};var Pr,Ir=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};function Ar(e){if(!e)return"";try{var t=new URL(e);return t.search="",nr(t.href)}catch(Ln){return nr(e)}}function Or(e){var t,n;return void 0===e&&(e=g()),Ar(null!==(n=null===(t=null==e?void 0:e.location)||void 0===t?void 0:t.href)&&void 0!==n?n:"")}!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Pr||(Pr={}));var _r="__AMPLITUDE_VISUAL_TAGGING__";var Rr=g(),Dr=null==Rr?void 0:Rr.console,Hr={},Lr={},Nr=!1;var Mr={addListener:function(e,t){var n,r=(n=e,!!Dr&&"function"==typeof Dr[n]&&(Lr[n]||(Lr[n]=Dr[n],Dr[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(Hr[n]&&!Nr){Nr=!0;var r=Hr[n];r&&r.forEach(function(t){try{t(n,e)}catch(Ln){}})}}catch(Ln){}return Nr=!1,Lr[n].apply(Dr,e)}),!0));if(!r)return new Error("Console override failed");Hr[e]?Hr[e].push(t):Hr[e]=[t]},removeListener:function(e){var t,n;try{for(var r=(0,i.Ju)(Object.values(Hr)),o=r.next();!o.done;o=r.next())for(var a=o.value,s=a.length-1;s>=0;s--)if(a[s]===e){a.splice(s,1);break}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=(0,i.Ju)(Object.entries(Lr)),r=n.next();!r.done;r=n.next()){var o=(0,i.zs)(r.value,2),a=o[0],s=o[1];s&&(Dr[a]=s)}}catch(u){e={error:u}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}Lr={},Hr={}}},jr=g(),Ur=function(e){return e.get()},Fr={childList:!0,attributes:!0,characterData:!0,subtree:!0},qr=function(e){return e?new(_n())(function(t){var n,r=new WeakSet,o=new WeakMap,a=function(e,t){r.has(e)||(r.add(e),or(e)&&o.set(e,t),u.observe(e,Fr))},s=function(e,t,n){var r=n-t;r<=0||ur(e,r).forEach(function(e){var n=e.root,r=e.depth;return a(n,t+r)})},u=new MutationObserver(function(n){var r,a;t.next(n);try{var u=Ur(e);if(!u.enabled)return;var l=function(e){var t=function(e){var t=e.getRootNode();if(!or(t))return 0;var n=o.get(t);return null!=n?n:0}(e.target);e.addedNodes.forEach(function(e){e instanceof Element&&s(e,t,u.maxDepth)})};try{for(var c=(0,i.Ju)(n),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(f){r={error:f}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}}catch(v){}});if(document.body){var l=document.body;a(l,0),n=e.onArm(function(e){s(l,0,e.maxDepth)})}return function(){null==n||n(),u.disconnect()}}):new(_n())(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Yr=function(e){return void 0===e&&(e="click"),new(_n())(function(t){var n,r=function(e){t.next(e)};return null===(n=g())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=g())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}})},zr=function(){var e=Dn(new(_n())(function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=(0,i.Cl)((0,i.Cl)({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return jr.addEventListener("error",t),function(){jr.removeEventListener("error",t)}}),new(_n())(function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return jr.addEventListener("unhandledrejection",t),function(){jr.removeEventListener("unhandledrejection",t)}}));return Dn(e,new(_n())(function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return Mr.addListener("error",t),function(){Mr.removeListener(t)}}))},Br=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},Jr={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Vr=function(e){var t,n,r,o,a=Object.values(Jr).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return a;try{for(var s=(0,i.Ju)(e),u=s.next();!u.done;u=s.next()){var l=u.value;try{try{for(var c=(r=void 0,(0,i.Ju)(l.definition)),d=c.next();!d.done;d=c.next()){var f=d.value,v=Jr[f.event_type];v&&a[v].add(l.id)}}catch(h){r={error:h}}
vendor: 2,255 bytes, line 1
1finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}catch(jo){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,jo)}}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},Wr=function(e){var t,n,r,o,a=new Map;try{for(var s=(0,i.Ju)(e),u=s.next();!u.done;u=s.next()){var l=u.value;try{for(var c=(r=void 0,(0,i.Ju)(l.conditions)),d=c.next();!d.done;d=c.next()){var f=d.value;if("LABELED_EVENT"===f.type){var v=f.match.eventId,h=a.get(v);h||(h=[],a.set(v,h)),h.push(l)}}}catch(p){r={error:p}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(g){t={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},Xr=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Jr[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1}(e,t)})})})},$r=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var o=function(e,t){var n,r,o,a,s=new Set;try{for(var u=(0,i.Ju)(e),l=u.next();!l.done;l=u.next()){var c=l.value,d=t.get(c.id);if(d)try{for(var f=(o=void 0,(0,i.Ju)(d)),v=f.next();!v.done;v=f.next()){var h=v.value;s.add(h)}}catch(p){o={error:p}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}catch(g){n={error:g}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return Array.from(s)}(Xr(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var a=(0,i.Ju)(o),s=a.next();!s.done;s=a.next()){var u=s.value;Br(u.actions,e,this.dataExtractor)}}
1catch(l){t={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),Kr=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Zn,rn,er]),Gr=["type"],Qr=["svg","path","g"],Zr=["password","hidden"];function ei(e,t,n){var r,o,a,s,u;if(void 0===n&&(n=vr),null===e)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},d=Array.from(function(e,t){if(e.parentElement)return e.parentElement.children;var n=e.getRootNode();return t&&or(n)?n.children:[]}(e,n.enabled));d.length&&(c.index=d.indexOf(e),c.indexOfType=d.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var f=null===(u=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===u?void 0:u.toLowerCase();f&&(c.prevSib=String(f));var v=e.getAttribute("id");v&&(c.id=String(v));var h=Array.from(e.classList);h.length&&(c.classes=h);var p={},g=Array.from(e.attributes).filter(function(e){return!Kr.has(e.name)}),m=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!pr.includes(i)&&!o}(e);if(!Zr.includes(String(e.getAttribute("type")))&&!Qr.includes(l))try{for(var y=(0,i.Ju)(g),b=y.next();!b.done;b=y.next()){var w=b.value;m&&!Gr.includes(w.name)||(t.has(w.name)?p[w.name]=on:p[w.name]=String(w.value).substring(0,128))}}catch(E){r={error:E}}finally{try{b&&!b.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}return Object.keys(p).length&&(c.attrs=p),e.shadowRoot&&(c.attrs=(0,i.Cl)((0,i.Cl)({},c.attrs||{}),((a={})[er]="true",a)),c.shadow=!0),c}function ti(e,t){return void 0===t&&(t=vr),e?t.enabled?function(e,t){var n,r,o=[];try{for(var a=(0,i.Ju)(sr(e,t)),s=a.next();!s.done;s=a.next()){var u=s.value;if("HTML"===u.tagName)break;o.push(u)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e,t.maxDepth):function(e){var t=[];t.push(e);var n=e.parentElement;for(;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e):[]}var ni=!1,ri=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:(0,i.fX)([],(0,i.zs)([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:(0,i.fX)([],(0,i.zs)([/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/]),!1),maxAncestorWalkDepth:void 0,shadowDomEnabled:ni,maxShadowDomDepth:1});function ii(e){var t;return(0,i.Cl)((0,i.Cl)({},e),{shadowDomEnabled:null!==(t=e.shadowDomEnabled)&&void 0!==t?t:ni,maxShadowDomDepth:ai(e.maxShadowDomDepth)})}function oi(e,t){if(!e)return si();var n,r=si();return"boolean"==typeof e.enabled&&(r.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(r.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(r.autogeneratedIdPatterns=function(e,t){var n,r,o=[];try{for(var a=(0,i.Ju)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{o.push(new RegExp(u))}catch(jo){var l=jo instanceof Error?jo.message:String(jo);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(u,'" (').concat(l,")"))}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(r.unstableClassPatterns=function(e,t){var n,r,o=[];try{for(var a=(0,i.Ju)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{o.push(new RegExp(u))}catch(jo){var l=jo instanceof Error?jo.message:String(jo);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(u,'" (').concat(l,")"))}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.unstableClassPatterns,t)),r.maxAncestorWalkDepth="number"!=typeof(n=e.maxAncestorWalkDepth)?void 0:Number.isFinite(n)?n<=0?void 0:Math.floor(n):void 0,"boolean"==typeof e.shadowDomEnabled&&(r.shadowDomEnabled=e.shadowDomEnabled),r.maxShadowDomDepth=ai(e.maxShadowDomDepth),ii(r)}function ai(e){return"number"==typeof e&&Number.isFinite(e)?Math.min(Math.max(Math.floor(e),1),10):1}
1function si(){return{enabled:ri.enabled,explicitTrackingAttribute:ri.explicitTrackingAttribute,autogeneratedIdPatterns:(0,i.fX)([],(0,i.zs)(ri.autogeneratedIdPatterns),!1),unstableClassPatterns:(0,i.fX)([],(0,i.zs)(ri.unstableClassPatterns),!1),maxAncestorWalkDepth:ri.maxAncestorWalkDepth,shadowDomEnabled:ri.shadowDomEnabled,maxShadowDomDepth:ri.maxShadowDomDepth}}function ui(e,t){var n=e.getAttribute(t.explicitTrackingAttribute);if(null!==n&&""===n)return null;var r=e.getAttribute("id");return null===r||""===r?null:function(e,t){var n,r;if(null==e||""===e)return!1;try{for(var o=(0,i.Ju)(t),a=o.next();!a.done;a=o.next())if(a.value.test(e))return!1}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}(r,t.autogeneratedIdPatterns)?r:null}function li(e){var t=globalThis.CSS;if(t&&"function"==typeof t.escape)return t.escape(e);for(var n=String(e),r=n.length,i="",o=0;o<r;o++){var a=n.charCodeAt(o);0!==a?a>=1&&a<=31||127===a||0===o&&a>=48&&a<=57||1===o&&a>=48&&a<=57&&45===n.charCodeAt(0)?i+="\\".concat(a.toString(16)," "):i+=0!==o||1!==r||45!==a?a>=128||45===a||95===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n.charAt(o):"\\".concat(n.charAt(o)):"\\-":i+="\ufffd"}return i}function ci(e){return li(e)}function di(e,t){return t.map(fi).join(" > ")}function fi(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}var vi=[{name:"explicitTrackingAttribute",try:function(e,t){var n=t.config.explicitTrackingAttribute,r=e.getAttribute(n);return null===r||""===r?null:"[".concat(n,"=").concat(JSON.stringify(r),"]")}},{name:"stableId",try:function(e,t){var n=ui(e,t.config);return null===n?null:"".concat(e.tagName.toLowerCase(),"#").concat(ci(n))}}];function hi(e,t,n){var r,o,a,s,u;void 0===n&&(n={});var l=ii(t),c=null!==(a=n.strategies)&&void 0!==a?a:vi,d=null!==(u=null!==(s=n.scope)&&void 0!==s?s:e.ownerDocument)&&void 0!==u?u:document,f={scope:d,config:l},v=function(e,t){var n=[],r=e;for(;null!==r&&(n.push(r),!(void 0!==t&&n.length>t));)r=r.parentElement;return n}(e,l.maxAncestorWalkDepth);try{for(var h=(0,i.Ju)(c),p=h.next();!p.done;p=h.next())for(var g=p.value,m=0;m<v.length;m++){var y=v[m],b=g.try(y,f);if(null!==b)if(0!==m){var w=di(0,v.slice(0,m).reverse()),E="".concat(b," > ").concat(w);if(pi(d,E,e,g.name,n.logger))return E}else if(pi(d,b,e,g.name,n.logger))return b}}catch(S){r={error:S}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}return null}function pi(e,t,n,r,i){var o;try{o=e.querySelectorAll(t)}catch(jo){var a=jo instanceof Error?jo.message:String(jo);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(t,'" (').concat(a,")")),!1}return 1===o.length&&o[0]===n}function gi(e,t,n){var r;try{r=e.querySelectorAll(t)}catch(i){return!1}return 1===r.length&&r[0]===n}var mi=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),yi=function(e,t,n){var r,o;if(e.nodeType!==Node.ELEMENT_NODE)return null;var a=e.getAttribute("id");if(t){if(a)return new mi(wi(a),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new mi(s,!0)}var u=e.tagName.toLowerCase();if(a)return new mi(u+wi(a),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new mi(u,!0);for(var c=bi(e),d=!1,f=!1,v=-1,h=-1,p=l.children,g=0;p&&(-1===v||!f)&&g<p.length;++g){var m=p[g];if(m.nodeType===Node.ELEMENT_NODE)if(h+=1,m!==e){if(!f&&m.tagName.toLowerCase()===u){d=!0;var y=new Set(c);if(y.size)for(var b=bi(m),w=0;w<b.length;++w){var E=b[w];if(y.has(E)&&(y.delete(E),!y.size)){f=!0;break}}else f=!0}}else v=h}var S=u;if(n&&"input"===u.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(S+="[type="+li(e.getAttribute("type")||"")+"]"),f)S+=":nth-child("+String(v+1)+")";else if(d)try{for(var T=(0,i.Ju)(c),k=T.next();!k.done;k=T.next()){S+="."+li(k.value.slice(1))}}catch(C){r={error:C}}
1finally{try{k&&!k.done&&(o=T.return)&&o.call(T)}finally{if(r)throw r.error}}return new mi(S,!1)},bi=function(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},wi=function(e){return"#"+li(e)};function Ei(e,t){try{return function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=yi(r,Boolean(t),r===e);if(!i)break;if(n.push(i),i.optimized)break;r=r.parentElement}return n.reverse(),n.join(" > ")}(e)}catch(jo){var n=jo instanceof Error?jo.message:String(jo);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw \u2014 emitting empty selector: ".concat(n)),""}}function Si(e,t){void 0===t&&(t={});var n=ii(e),r=new Set,o=t.logger,a=function(e){return Ei(e,o)},s=function(e,r){var a;return null!==(a=hi(e,n,{strategies:t.strategies,scope:r,logger:o}))&&void 0!==a?a:function(e,t,n){var r,o;void 0===n&&(n={});for(var a=ii(t),s=null!==(o=null!==(r=n.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==o?o:document,u=or(s),l=[],c=e,d=0,f=!(a.shadowDomEnabled&&u);null!==c&&!(f&&void 0!==a.maxAncestorWalkDepth&&d>a.maxAncestorWalkDepth);){var v=ui(c,a);if(null!==v){var h="".concat(c.tagName.toLowerCase(),"#").concat(ci(v)),p=(0,i.fX)([h],(0,i.zs)(l),!1).join(" > ");if(gi(s,p,e))return p}l.unshift(cr(c,a.shadowDomEnabled)),c=c.parentElement,d+=1}var g=l.join(" > ");return a.shadowDomEnabled&&u&&null===c?"".concat(ir).concat(g):g}(e,n,{scope:r})},u=function(e,t){return function(e,t,n){return e&&n&&or(t)?"".concat(ir).concat(e):e}(a(e),t,function(e){for(var t=e;null!==t;t=t.parentElement)if(t.getAttribute("id"))return!1;return!0}(e))};return{generate:function(e){var r,i;try{return n.shadowDomEnabled?function(e,t){var r=lr(e,n.maxShadowDomDepth),i=r.segments;return r.truncated&&(null==o||o.debug("@amplitude/element-selector: target is nested deeper than maxShadowDomDepth (".concat(n.maxShadowDomDepth,") \u2014 emitting a best-effort selector for the outermost in-budget shadow host"))),i.map(function(e){var n=e.target,r=e.root;return t(n,r)}).join(rr)}(e,n.enabled?s:u):(n.enabled?s:a)(e,null!==(i=null!==(r=t.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document)}catch(jo){var l=jo instanceof Error?jo.message:String(jo);return null==o||o.warn("@amplitude/element-selector: selector generation threw \u2014 falling back to legacy cssPath: ".concat(l)),Ei(e,o)}},getConfig:function(){return n},updateConfig:function(e){var t,a;n=ii(e);try{for(var s=(0,i.Ju)(r),u=s.next();!u.done;u=s.next()){var l=u.value;try{l(n)}catch(jo){var c=jo instanceof Error?jo.message:String(jo);null==o||o.warn("@amplitude/element-selector: onConfigChange subscriber threw \u2014 ".concat(c))}}}catch(d){t={error:d}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(t)throw t.error}}},onConfigChange:function(e){return r.add(e),function(){r.delete(e)}}}}var Ti;var ki=function(e,t){var n,r,o,a=this;this.replaceSensitiveString=function(e){return ln(e,a.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,o,s,u=performance.now();if(!e)return[];for(var l=a.getShadowMode(),c=ti(e,l),d=new Map,f=c.length-1;f>=0;f--){var v=c[f];if(v){var h=yr(v.getAttribute(Zn)),p=f===c.length-1?[]:null!==(r=d.get(c[f+1]))&&void 0!==r?r:new Set,g=new Set((0,i.fX)((0,i.fX)([],(0,i.zs)(p),!1),(0,i.zs)(h),!1));d.set(v,g)}}s=c.map(function(e){var t;return ei(e,null!==(t=d.get(e))&&void 0!==t?t:new Set,l)});var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=(0,i.zs)(t,2),r=n[0],o=n[1];e.attrs&&(e.attrs[r]=a.replaceSensitiveString(o))})};try{for(var y=(0,i.Ju)(s),b=y.next();!b.done;b=y.next())m(b.value)}catch(E){t={error:E}}finally{try{b&&!b.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}var w=performance.now();return null===(o=a.diagnosticsClient)||void 0===o||o.recordHistogram("autocapturePlugin.getHierarchy",w-u),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(r){t=null}return t?a.getText(t):a.getNearestLabel(n)},this.getElementPath=function(e){var t;if(!e)return"";var n=performance.now(),r=a.selectorEngine.generate(e),i=performance.now();return null===(t=a.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.updateSelectorConfig=function(e,t){var n;if(null!=e){var r="boolean"==typeof e.enabled,o="boolean"==typeof e.shadowDomEnabled;if(r||o){var s=oi(e,t),u=a.selectorEngine.getConfig().enabled,l=a.shadowGate.get().enabled,c=a.shadowGate.arm(function(e){var t,n=null!==(t=e.maxShadowDomDepth)&&void 0!==t?t:1;return!e.shadowDomEnabled||n<=0?vr:Object.freeze({enabled:!0,maxDepth:n})}(s));a.selectorEngine.updateConfig((0,i.Cl)((0,i.Cl)((0,i.Cl)({},r?s:a.selectorEngine.getConfig()),{shadowDomEnabled:c.enabled}),c.enabled&&{maxShadowDomDepth:c.maxDepth})),r&&u!==s.enabled&&(null==t||t.debug(s.enabled?"@amplitude/element-selector: engine enabled \u2014 now emitting new element-selector element paths for autocapture events.":"@amplitude/element-selector: engine disabled \u2014 reverting to legacy cssPath for element paths.")),!l&&c.enabled&&(null===(n=a.diagnosticsClient)||void 0===n||n.setTag("plugin.autocapture.shadowDom","enabled:".concat(c.maxDepth)))}else null==t||t.debug("@amplitude/element-selector: ignoring remote-config delivery without an explicit `enabled` or `shadowDomEnabled` flag \u2014 keeping current engine state.")}}
1,this.getShadowMode=function(){return a.shadowGate.get()},this.getEventProperties=function(e,t,n){var r,o,s,u,l,c,d=null===(s=null===(o=null==t?void 0:t.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o),f="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},v=a.getHierarchy(t),h=null===(u=v[0])||void 0===u?void 0:u.attrs,p=a.getNearestLabel(t),g=(l=null!=h?h:{},c=n,Object.entries(l).reduce(function(e,t){var n=(0,i.zs)(t,2),r=n[0],o=n[1];if(r.startsWith(c)){var a=r.replace(c,"");a&&(e[a]=o||"")}return e},{})),m=((r={})["[Amplitude] Element Hierarchy"]=v,r[Wn]=d,r[Xn]=a.getText(t),r["[Amplitude] Element Position Left"]=null==f.left?null:Math.round(f.left),r["[Amplitude] Element Position Top"]=null==f.top?null:Math.round(f.top),r["[Amplitude] Element Attributes"]=g,r["[Amplitude] Element Path"]=a.getElementPath(t),r["[Amplitude] Element Parent Label"]=p,r[$n]=nr(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=cn(a.replaceSensitiveString),r[Kn]=window.innerHeight,r[Gn]=window.innerWidth,r),y=wr();if(y&&(m[Qn]=y),m["[Amplitude] Element ID"]=t.getAttribute("id")||"",m["[Amplitude] Element Class"]=t.getAttribute("class"),m["[Amplitude] Element Aria Label"]=null==h?void 0:h["aria-label"],"a"===d&&"click"===e&&t instanceof HTMLAnchorElement){var b=t.href.substring(0,128);m["[Amplitude] Element Href"]=a.replaceSensitiveString(b)}return br(m)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,i,o){void 0===o&&(o=!1);var s=a.addTypeAndTimestamp(e,t);try{if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){var u=a.getShadowMode(),l=function(e,t){var n,r;if(void 0===t&&(t=vr),!t.enabled)return e.target;var i=null===(n=e.composedPath)||void 0===n?void 0:n.call(e),o=null!==(r=e.target)&&void 0!==r?r:null;if(!i||0===i.length)return o;var a=i[0];if(!(a instanceof Element))return null!=a?a:o;var s=lr(a,t.maxDepth),u=s.segments;return s.truncated&&u.length>0?u[u.length-1].target:a}(s.event,u);if(o){var c=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t}(l,s.type);if(c)return s.closestTrackedAncestor=l,s.targetElementProperties=a.getEventProperties(s.type,s.closestTrackedAncestor,i),s}var d=Er(l,n,u);d&&(s.closestTrackedAncestor=d,s.targetElementProperties=a.getEventProperties(s.type,d,i))}}catch(r){}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(r){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?a.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(rn,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var o="",s=Array.from(e.childNodes);try{for(var u=(0,i.Ju)(s),l=u.next();!l.done;l=u.next()){var c=l.value;c.nodeType!==Node.TEXT_NODE?c instanceof Element&&(c.hasAttribute(rn)||c.hasAttribute("contenteditable")?o+=on:o+=a.getTextWithMaskedDescendants(c)):o+=c.textContent||""}}catch(d){t={error:d}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return o},this.hasMaskedAncestor=function(e){var t=a.getShadowMode();return t.enabled?function(e,t){var n,r;return!!ti(e,t).some(function(e){return e.hasAttribute(rn)})||null!==(r=null===(n=document.documentElement)||void 0===n?void 0:n.hasAttribute(rn))&&void 0!==r&&r}(e,t):function(e){return null!==e.closest("[".concat(rn,"]"))}(e)},this.getText=function(e){if(a.hasMaskedAncestor(e))return on;var t="";return t=e.querySelector("[".concat(rn,"], [contenteditable]"))?a.getTextWithMaskedDescendants(e):e.innerText||"",a.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((t={})[Wn]=i,t[Xn]=a.getText(e),t[$n]=window.location.href.split("?")[0],t);return br(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(Ti||(Ti=Si(oi())),Ti),this.shadowGate=(fr||(fr=hr()),fr);var s=null!==(o=e.maskTextRegex)&&void 0!==o?o:[],u=[];try{for(var l=(0,i.Ju)(s),c=l.next();!c.done;c=l.next()){var d=c.value;if(u.length>=25)break;if(d instanceof RegExp)u.push(d);else if("pattern"in d&&"string"==typeof d.pattern)try{u.push(new RegExp(d.pattern,"i"))}catch(f){}}}catch(v){n={error:v}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=u};function Ci(e,t){var n=e.remoteConfigClient;if(e.fetchRemoteConfig&&n){var r=n.subscribe("configs.analyticsSDK.browserSDK.autocapture.elementSelector","all",function(n,r){e.loggerProvider.debug("@amplitude/element-selector: remote-config delivery (source=".concat(String(r),") ").concat(JSON.stringify(n))),t.updateSelectorConfig(n,e.loggerProvider)});return function(){n.unsubscribe(r)}}}var xi,Pi=function(e,t){return("fixed"===t||"absolute"===t)&&e instanceof HTMLElement?e.offsetParent:function(e){var t;return e.assignedSlot||e.parentElement||(null===(t=e.parentNode)||void 0===t?void 0:t.host)||null}(e)};function Ii(e){var t=e.allObservables,n=e.onExposure,r=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,a=new Map,s=new Map,u=new Set,l=function(e){var t=s.get(e);t&&(clearTimeout(t),s.set(e,null))},c=function(e){if(function(e){var t=g(),n=t.document.documentElement.clientHeight||t.innerHe
1ight,r=t.document.documentElement.clientWidth||t.innerWidth,i=e.getBoundingClientRect(),o=i.top+.5*i.height,a=Math.max(i.left,0),s=Math.min(i.right,r);if(o<-1||o>n+1||a>=s||i.width<=0)return!1;for(var u=Pi(e,t.getComputedStyle(e).position);u;){var l=t.getComputedStyle(u),c=l.overflowY&&"visible"!==l.overflowY,d=l.overflowX&&"visible"!==l.overflowX;if(c||d){var f=u.getBoundingClientRect();if(c&&(o<f.top-1||o>f.bottom+1))return!1;if(d&&(a=Math.max(a,f.left))>=(s=Math.min(s,f.right)))return!1}u=Pi(u,l.position)}return!0}(e)){if(!a.get(e)&&!s.get(e)){var t=setTimeout(function(){a.set(e,!0);var t=r.getElementPath(e);n(t),s.set(e,null)},o);s.set(e,t)}}else l(e)},d=t.exposureObservable,f=t.scrollObservable,v=d.subscribe(function(e){var t=e,n=t.target;t.isIntersecting?(u.add(n),c(n)):(u.delete(n),l(n))}),h=f.subscribe(function(){u.forEach(c)}),p=function(){s.forEach(function(e){e&&clearTimeout(e)}),s.clear(),a.clear()};return{unsubscribe:function(){v.unsubscribe(),h.unsubscribe(),p(),u.clear()},reset:function(){p(),u.forEach(c)}}}function Ai(e){var t,n,r,i,o,a=e.mutationObservable,s=e.onRescan,u=e.onFlush,l=e.exposureDuration,c=e.quietMs,d=void 0===c?150:c,f=e.maxWaitMs,v=void 0===f?4e3:f,h=!1,p=function(){t&&(clearTimeout(t),t=void 0),n&&(clearTimeout(n),n=void 0),r&&(clearTimeout(r),r=void 0)},g=function(){o&&(document.removeEventListener("DOMContentLoaded",o),o=void 0)},m=function(){h||("undefined"!=typeof document&&"loading"!==document.readyState?(h=!0,p(),g(),s(),r=setTimeout(function(){r=void 0,u()},l+50)):o||(o=function(){o=void 0,y()},document.addEventListener("DOMContentLoaded",o)))},y=function(){h||(t&&clearTimeout(t),t=setTimeout(m,d))},b=function(){p(),g(),h=!1,y(),n=setTimeout(m,v)};return{start:function(){i||(i=a.subscribe(function(){y()}),b())},reset:function(){b()},stop:function(){null==i||i.unsubscribe(),i=void 0,p(),g()}}}!function(e){e.ClickObservable="clickObservable",e.PointerDownObservable="pointerDownObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(xi||(xi={}));var Oi=function(e,t){var n,r,o,a,s,u,l,c,d,f,v,h;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",Jn);var p=e.dataAttributePrefix,m=void 0===p?In:p,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0}:y;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:Pn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:An,e.debounceTime=null!==(o=e.debounceTime)&&void 0!==o?o:0;var w=!1!==(null===(a=e.viewportContentUpdated)||void 0===a?void 0:a.enabled),E=null!==(l=null!==(u=null===(s=e.viewportContentUpdated)||void 0===s?void 0:s.exposureDuration)&&void 0!==u?u:e.exp
1osureDuration)&&void 0!==l?l:150;e.viewportContentUpdated=(0,i.Cl)((0,i.Cl)({},e.viewportContentUpdated),{exposureDuration:E}),e.pageUrlExcludelist=null===(c=e.pageUrlExcludelist)||void 0===c?void 0:c.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e},[]);var S,T,k="@amplitude/plugin-autocapture-browser",C=[],x=new ki(e,t),P=new Set,I=new Set,A=new Set,O=function(){var t,n,r=Hn(Yr().map(function(t){return x.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,m)})),i=Hn(new(_n())(function(t){var n,r=function(n){var r=x.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,m);t.next(r)};return null===(n=g())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=g())||void 0===e?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(n=Hn(new(_n())(function(t){var n=function(n){var r=x.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,m);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var o=x.shadowGate,a=Hn(qr(o).map(function(t){return x.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,m)})),s=new(_n())(function(e){var t,n,r=function(t){e.next(t)};return null===(t=g())||void 0===t||t.addEventListener("scroll",r,{capture:!0,passive:!0}),null===(n=g())||void 0===n||n.addEventListener("resize",r,{passive:!0}),function(){var e,t;null===(e=g())||void 0===e||e.removeEventListener("scroll",r,{capture:!0}),null===(t=g())||void 0===t||t.removeEventListener("resize",r)}}),u=function(e,n,r,i){var o="function"==typeof r?r:void 0,a="function"==typeof r?i:r;return new(_n())(function(r){var i=g();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var s=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:0}),u=n.join(","),l=function(e){e instanceof Element&&e.matches(u)&&s.observe(e),e.querySelectorAll(u).forEach(function(e){s.observe(e)})},c=function(e){if(a)try{kr(e,u,Ur(a)).forEach(function(e){s.observe(e)})}catch(t){}},d=function(){var e=null==i?void 0:i.document;if(e){var n=[];try{n=a&&Ur(a).enabled?kr(e,u,Ur(a)):e.querySelectorAll(u)}catch(t){return}Array.from(n).forEach(function(e){s.unobserve(e),s.observe(e)})}};null==o||o(d),d();var f=null==a?void 0:a.onArm(function(){(null==i?void 0:i.document)&&c(i.document)}),v=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(t){if(t instanceof DocumentFragment)l(t);else if(t instanceof Element)if(a&&Ur(a).enabled){try{t.matches(u)&&s.observe(t)}catch(e){}c(t)}else l(t)})})});return function(){null==o||o(void 0),null==f||f(),v.unsubscribe(),s.disconnect()}})}(a,e.cssSelectorAllowlist,function(e){T=e},o);return(t={})[xi.ChangeObservable]=i,t[xi.ClickObservable]=r,t[xi.MutationObservable]=a,t[xi.NavigateObservable]=n,t[xi.ScrollObservable]=s,t[xi.ExposureObservable]=u,t},_=Vr(Object.values(null!==(f=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==f?f:{})),R=Wr(null!==(h=null===(v=e.pageActions)||void 0===v?void 0:v.triggers)&&void 0!==h?h:[]),D=function(e,t,n,r){return new $r(e,t,n,r)}(_,R,x,e);return{name:k,type:"enrichment",setup:function(t,n){return(0,i.sH)(void 0,void 0,void 0,function(){var r,o,a,s,u,l,c,d,f,v,h,p,y,H,L,N,M,j,U,F,q,Y,z,B,J,V,W;return(0,i.YH)(this,function(X){return"undefined"==typeof document||(r=!1,t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(t){!function(t){var n,r;t&&(e.pageActions=(0,i.Cl)((0,i.Cl)({},e.pageActions),t),_=Vr(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),R=Wr(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),D.update(_,R,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(o=Ci(t,x))&&C.push({unsubscribe:o}),a=mr(e,e.cssSelectorAllowlist),s=mr(e,e.actionClickAllowlist),u=O(),l=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(Ir).filter(function(e){return r("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(Vn,e.targetElementProperties)})}({allObservables:u,amplitude:n,shouldTrackEvent:a,evaluateTriggers:D.evaluate.bind(D)}),C.push(l),c=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(Ir).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))})}({allObservables:u,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return x.getEventProperties.apply(x,(0,i.fX)((0,i.fX)([],(0,i.zs)(e),!1),[m],!1))},amplitude:n,shouldTrackEvent:a,evaluateTriggers:D.evaluate.bind(D)}),C.push(c),d=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=n.clickObservable,u=n.mutationObservable,l=n.navigateObservable,c=s.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=Er(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(Ir).filter(function(e){return a("click",e.closestTrackedAncestor)}),d=l?Dn(u,l):u,f=Dn(c,d),v=null,h=null;return Rn(f,function(e){if(v&&(clearTimeout(v),v=null),"click"===e.type)return h=e,v=setTimeout(function(){v=null,h=null},500),Promise.resolve(null);if(h){var t=h;return h=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(Vn,i("click",e.closestTrackedAncestor)))})}({allObservables:u,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return x.getEventProperties.apply(x,(0,i.fX)((0,i.fX)([],(0,i.zs)(e),!1),[m],!1))},amplitude:n,shouldTrackEvent:a,shouldTrackActionClick:s}),d&&C.push(d),f=function(e){e.amplitude;var t=e.allObservables.scrollObservable,n={maxX:0,maxY:0}
1,r=t.subscribe(function(){var e,t,r,i,o=g(),a=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),s=Math.floor(null!==(i=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);n.maxX=Math.max(n.maxX,a),n.maxY=Math.max(n.maxY,s)});return{unsubscribe:function(){r.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}({allObservables:u,amplitude:n}),C.push(f),v=(0,i.Cl)({},f.getState()),h={},p=g(),H=function(e){e&&(null==y||y.reset()),e&&r||(e&&(r=!0,setTimeout(function(){r=!1},100)),function(e){var t,n,r,i=e.amplitude,o=e.scrollTracker,a=e.currentElementExposed,s=e.elementExposedForPage,u=e.elementExposedInSentEvents,l=e.exposureTracker,c=e.isPageEnd,d=e.lastScroll,f=o.getState(),v=g(),h=null!==(n=null==v?void 0:v.innerWidth)&&void 0!==n?n:0,p=null!==(r=null==v?void 0:v.innerHeight)&&void 0!==r?r:0,m=Array.from(a).filter(function(e){return!u.has(e)}),y=((t={})[$n]=Or(v),t["[Amplitude] Max Page X"]=f.maxX+h,t["[Amplitude] Max Page Y"]=f.maxY+p,t[Kn]=p,t[Gn]=h,t["[Amplitude] Element Exposed"]=m,t),b=wr();b&&(y[Qn]=b);var w=function(){o.reset();var e=o.getState();d.maxX=e.maxX,d.maxY=e.maxY,s.clear(),u.clear(),null==l||l.reset()};0!==m.length||f.maxX!==d.maxX||f.maxY!==d.maxY?(null==i||i.track("[Amplitude] Viewport Content Updated",y),d.maxX=f.maxX,d.maxY=f.maxY,m.forEach(function(e){u.add(e)}),a.clear(),c&&w()):c&&w()}({amplitude:n,scrollTracker:f,currentElementExposed:A,elementExposedForPage:P,elementExposedInSentEvents:I,exposureTracker:h.exposure,isPageEnd:e,lastScroll:v}))},L=Or(p),N=function(){var e=Or(p);e!==L&&(L=e,H(!0))},M=function(e,t){var n=Or(p),r=function(e,t){var n;if(void 0===t&&(t=g()),null==e||""===e)return Or(t);var r=(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.href)||"http://localhost/";try{return Ar(new URL(e,r).href)}catch(X){return Or(t)}}(t,p);n!==r?(L=r,H(!0),e()):e()},j=function(e){!function(e,t,n,r,i){if(!t.has(e)&&!n.has(e)){t.add(e),r.add(e);var o=Array.from(r);JSON.stringify(o).length>=18e3&&i(!1)}}(e,P,I,A,H)},w&&(h.exposure=Ii({allObservables:u,onExposure:j,dataExtractor:x,exposureDuration:E}),h.exposure&&C.push(h.exposure),y=Ai({mutationObservable:u[xi.MutationObservable],onRescan:function(){var e,n;null===(n=null===(e=t.loggerProvider)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"@amplitude/plugin-autocapture-browser: initial exposure snapshot \u2014 rescanning DOM"),null==T||T()},onFlush:function(){var e,n;null===(n=null===(e=t.loggerProvider)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"@amplitude/plugin-autocapture-browser: initial exposure snapshot \u2014 flushing viewport content updated"),H(!1)},exposureDuration:E}),y.start(),C.push({unsubscribe:function(){null==y||y.stop()}}),U=function(){H(!0)},null==p||p.addEventListener("beforeunload",U),S=function(){null==p||p.removeEventListener("beforeunload",U)},C.push({unsubscribe:function(){return S()}}),(F=u[xi.NavigateObservable])?C.push(F.subscribe(function(e){var t,n,r=null===(n=null===(t=e.event)||void 0===t?void 0:t.destination)||void 0===n?void 0:n.url;if(r){var i=Ar(r);if(i===L)return;return L=i,void H(!0)}N()})):p&&(q=function(){N()},p.addEventListener("popstate",q),Y=p.history.pushState,z=p.history.replaceState,p.history&&Y&&(p.history.pushState=new Proxy(Y,{apply:function(e,t,n){M(function(){e.apply(t,n)},n[2])}})),p.history&&z&&(p.history.replaceState=new Proxy(z,{apply:function(e,t,n){M(function(){e.apply(t,n)},n[2])}})),C.push({unsubscribe:function(){p.removeEventListener("popstate",q),p.history&&Y&&(p.history.pushState=Y),p.history&&z&&(p.history.replaceState=z)}}))),null===(W=null==t?void 0:t.loggerProvider)||void 0===W||W.log("".concat(k," has been successfully added.")),window.opener&&b.enabled&&(B=e.cssSelectorAllowlist,J=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n[_r]){n[_r]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,a=t.actionClickAllowlist,s=null,u=function(t){e.notify({action:"element-selected",data:t})},l=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var n;s=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:l,onSelect:u,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:Jn}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==s?void 0:s.close)||void 0===e||e.call(s)})}}(V=qn(),{dataExtractor:x,isElementSelectable:mr(e,(0,i.fX)((0,i.fX)([],(0,i.zs)(B),!1),(0,i.zs)(J),!1)),cssSelectorAllowlist:B,actionClickAllowlist:J}),Bn(V),V.setup((0,i.Cl)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:Mn[t.serverZone]})))),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,i.YH)(this,function(o){try{for(e=(0,i.Ju)(C),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(a){n={error:a}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},_i=(0,i.fX)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,i.zs)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),Ri=_i,Di=_i,Hi=["*"],Li=["mutation","navigate"];function Ni(e,t){var n,r,i,o,a=t.event,s=a.pageX,u=a.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:u,u),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:u,u),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:s,s),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function Mi(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:(0,i.Cl)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function ji(e){var t=this,n=e.amplitude,r=e.allObservables,o=e.shouldTrackRageClick,a=r.pointerDownObservable,s=r.selectionObservable,u=[],l={},c=null;function d(e){u=[],l={},e&&(Ni(l,e),u.push(e))}var f=Rn(a.filter(function(e){return o("click",e.closestTrackedAncestor)}),function(e){return(0,i.sH)(t,void 0,void 0,function(){var t;return(0,i.YH)(this,function(n){return Ni(l,e),t=null,0===u.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(u,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(u,e)||l.isOutOfBounds?(c&&(t=Mi(u)),d(e)):u.push(e),c&&(clearTimeout(c.timerId),c.resolve(t),c=null),u.length>=4?[2,new Promise(function(e){c={resolve:e,timerId:setTimeout(function(){e(Mi(u))},1e3)}})]:[2,null]})})}),v=null==s?void 0:s.subscribe(function(){d()}),h=f.subscribe(function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){h.unsubscribe(),null==v||v.unsubscribe()}}}var Ui,Fi;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(Ui||(Ui={})),function(e){e.X="x",e.Y="y"}(Fi||(Fi={}));function qi(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function Yi(e){e.changes=[],e.startTime=void 0}function zi(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var Bi=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new(_n())(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},a=void 0,s=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==s&&clearTimeout(s),Yi(n),Yi(i))}return t.subscribe(function(e){null!==s&&clearTimeout(s),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===Fi.X?n:i);var t=function(e,t){var n=void 0;if(qi(e)&&(n=e.startTime),qi(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(a=a||t,s=setTimeout(function(){u(),s=null},o)):u(),zi(n),zi(i),function(){null!==s&&(clearTimeout(s),s=null)}})})},Ji=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,a=e.thresholdMs,s=void 0===a?2e3:a,u=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new(_n())(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===Ui.DECREASING&&e.next(Fi.X),r=Ui.INCREASING):o.x<n.x&&(r===Ui.INCREASING&&e.next(Fi.X),r=Ui.DECREASING),o.y>n.y?(i===Ui.DECREASING&&e.next(Fi.Y),i=Ui.INCREASING):o.y<n.y&&(i===Ui.INCREASING&&e.next(Fi.Y),i=Ui.DECREASING),n=o):n=o})})}({allWindowObservables:r});return Bi({mouseDirectionChangeObservable:u,directionChanges:o,thresholdMs:s}).subscribe(function(e){gr(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function Vi(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var Wi=4e3,Xi=function(e){var t;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",r=[],o=!1!==e.errorClicks;e.errorClicks||(o=!1);var a=!1!==e.deadClicks&&null!==e.deadClicks,s=!1!==e.rageClicks&&null!==e.rageClicks,u=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(u=!1);var l=Vi(e,"rageClicks",Hi,s),c=Vi(e,"deadClicks",Ri,a),d=Vi(e,"errorClicks",Di,o),f=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:In,v=new ki(e),h=(0,i.fX)([],(0,i.zs)(new Set((0,i.fX)((0,i.fX)((0,i.fX)([],(0,i.zs)(l),
vendor: 4,193 bytes, line 1
1!1),(0,i.zs)(c),!1),(0,i.zs)(d),!1))),!1),p=function(){var e,t,n=function(e){return Hn(Yr(e).map(function(e){return v.addAdditionalEventProperties(e,"click",h,f,!0)}))},r=n("click"),o=n("pointerdown"),a=Hn(zr().map(function(e){return v.addTypeAndTimestamp(e,"error")})),s=Hn(qr(v.shadowGate).map(function(e){return v.addAdditionalEventProperties(e,"mutation",h,f)}));window.navigation&&(t=Hn(new(_n())(function(e){var t=function(t){e.next((0,i.Cl)((0,i.Cl)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return v.addAdditionalEventProperties(e,"navigate",h,f)})));var u=Hn(new(_n())(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(r){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),l=Hn(new(_n())(function(e){var t=function(t){e.next(t)},n={capture:!0};return jr.document.addEventListener("mousemove",t,n),function(){jr.document.removeEventListener("mousemove",t,n)}}));return(e={})[xi.ClickObservable]=r,e[xi.PointerDownObservable]=o,e[xi.MutationObservable]=s,e[xi.NavigateObservable]=t,e[xi.BrowserErrorObservable]=a,e[xi.SelectionObservable]=u,e[xi.MouseMoveObservable]=l,e};return{name:n,type:"enrichment",setup:function(t,h){return(0,i.sH)(void 0,void 0,void 0,function(){var g,m,y,b,w,E,S,T,k,C,x,P;return(0,i.YH)(this,function(I){return"undefined"==typeof document||(g=p(),(m=Ci(t,v))&&r.push({unsubscribe:m}),s&&(y=mr(e,l),b=ji({allObservables:g,amplitude:h,shouldTrackRageClick:y}),r.push(b)),a&&(w=mr(e,c),E=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,o=e.shouldTrackDeadClick,a=n.clickObservable,s=n.mutationObservable,u=n.navigateObservable,l=a.filter(function(e){return Ir(e)&&o("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Pr.LEFT_OR_TOUCH_CONTACT}),c=u?Dn(s,u):s,d=Dn(l,c),f=null;return Rn(d,function(e){return f&&Li.includes(e.type)?(clearTimeout(f),f=null,Promise.resolve(null)):"click"===e.type?f?Promise.resolve(null):new Promise(function(t){f=setTimeout(function(){t(e),f=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",(0,i.Cl)((0,i.Cl)({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}})}({amplitude:h,allObservables:g,getEventProperties:function(e,t){return v.getEventProperties(e,t,f)},shouldTrackDeadClick:w}),r.push(E)),o&&(S=mr(e,d),T=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,o=n.pointerDownObservable,a=n.browserErrorObservable,s=o.filter(function(e){return Ir(e)&&r("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Pr.LEFT_OR_TOUCH_CONTACT}),u=null,l=null,c=function(){null!==u&&(clearTimeout(u),u=null),l=null};return Dn(s,a).subscribe(function(e){var n;if("click"===e.type)return c(),l=e,void(u=setTimeout(c,2e3));"error"===e.type&&l&&(t.track("[Amplitude] Error Click",(0,i.Cl)(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),l.targetElementProperties)),c())})}({amplitude:h,allObservables:g,shouldTrackErrorClick:S}),r.push(T)),u&&(k=void 0,C=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,C=e.thrashedCursor.threshold,k&&k<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),C&&C>Wi&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(C," is above the maximum of ").concat(Wi,", setting to ").concat(Wi)),C=Wi)
1),x=Ji({amplitude:h,options:e,allObservables:g,directionChanges:k,thresholdMs:C}),r.push(x)),null===(P=null==t?void 0:t.loggerProvider)||void 0===P||P.log("".concat(n," has been successfully added."))),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e,t,n,o;return(0,i.YH)(this,function(a){try{for(e=(0,i.Ju)(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(s){n={error:s}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function $i(e,t){var n=e.startTime+e.duration;return t.filter(function(t){return t.startTime<n&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function Ki(e,t){var n,r=$i(e,t),o=null!==(n=e.scripts)&&void 0!==n?n:[],a=o.map(function(e){return e.sourceURL}).filter(Boolean),s=o.map(function(e){return e.sourceFunctionName}).filter(Boolean),u=o.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),l=o.map(function(e){return e.invokerType}).filter(Boolean),c=o.map(function(e){return e.invoker}).filter(Boolean);return(0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)((0,i.Cl)({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":o.length}),a.length>0&&{"[Amplitude] Main Thread Block Script URLs":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Functions":s}),u.length>0&&{"[Amplitude] Main Thread Block Script Positions":u}),l.length>0&&{"[Amplitude] Main Thread Block Invoker Types":l}),c.length>0&&{"[Amplitude] Main Thread Block Invokers":c})}function Gi(e,t){var n,r=$i(e,t),o=null!==(n=e.attribution)&&void 0!==n?n:[];return(0,i.Cl)((0,i.Cl)({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),o.length>0&&{"[Amplitude] Main Thread Block Attribution":o.map(function(e){return e.name})})}function Qi(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,o=void 0===r?100:r,a=function(){if("undefined"==typeof PerformanceObserver)return null;try{var t=PerformanceObserver.supportedEntryTypes;if(t.includes("long-animation-frame"))return"long-animation-frame";if(t.includes("longtask"))return"longtask"}catch(e){}return null}();if(!a)return{unsubscribe:function(){}};var s=[],u=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var o=(0,i.Ju)(e.getEntries()),a=o.next();!a.done;a=o.next()){var u=a.value;s.push(u)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}for(var l=r-1e4;s.length>0&&s[0].startTime<l;)s.shift()});try{u.observe({entryTypes:["measure"]})}catch(c){}var l=new PerformanceObserver(function(e){var r,u;try{for(var l=(0,i.Ju)(e.getEntries()),c=l.next();!c.done;c=l.next()){var d=c.value;if(!gr(n))return;if(!(d.duration<o)){var f="long-animation-frame"===a?Ki(d,s):Gi(d,s);t.track("[Amplitude] Main Thread Block",f)}}}catch(v){r={error:v}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(r)throw r.error}}});try{l.observe({entryTypes:[a]})}catch(d){return u.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){l.disconnect(),u.disconnect()}}}var Zi=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",n=[],r=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(o,a){return(0,i.sH)(void 0,void 0,void 0,function(){var s,u,l;return(0,i.YH)(this,function(i){return"undefined"==typeof document||(r&&(s=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(s=e.mainThreadBlock.durationThreshold),u=Qi({amplitude:a,options:e,durationThreshold:s}),n.push(u)),null===(l=null==o?void 0:o.loggerProvider)||void 0===l||l.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e,t,r,o;return(0,i.YH)(this,function(a){try{for(e=(0,i.Ju)(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(s){r={error:s}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function eo(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function to(e,t,n){e&&no({json:e,allowlist:t.map(ro),excludelist:n.map(ro),ancestors:[]})}function no(e){var t,n,r=e.json,o=e.targetObject,a=e.allowlist,s=e.excludelist,u=e.ancestors,l=e.parentObject,c=e.targetKey;o||(o=r);var d=Object.keys(o);try{for(var f=(0,i.Ju)(d),v=f.next();!v.done;v=f.next()){var h=v.value,p=(0,i.fX)((0,i.fX)([],(0,i.zs)(u),!1),[h],!1);eo(o[h])?oo(p,a)&&!oo(p,s)||delete o[h]:no({json:r,targetObject:o[h],allowlist:a,excludelist:s,ancestors:p,parentObject:o,targetKey:h})}}catch(g){t={error:g}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}0===Object.keys(o).length&&l&&c&&delete l[c]}function ro(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function io(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&"**"===t[r];)r++;return r===t.length}var i=t[r];
vendor: 12,754 bytes, line 1
1if("**"===i){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(io(e,t,o,r+1))return!0;return!1}return("*"===i||i===e[n])&&io(e,t,n+1,r+1)}function oo(e,t){return t.some(function(t){return io(e,t)})}var ao=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,o={};if(Array.isArray(r))r.forEach(function(e){var t=(0,i.zs)(e,2),n=t[0],r=t[1];o[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){o[t]=e});else if("object"==typeof r&&null!==r)try{for(var a=(0,i.Ju)(Object.entries(r)),s=a.next();!s.done;s=a.next()){var u=(0,i.zs)(s.value,2),l=u[0],c=u[1];o[l]=c}}catch(d){t={error:d}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return po(o,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=g();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=uo(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return 0===e.length?[2,null]:[2,vo(this.body,e,t)]})})},e}(),so=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),po(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return uo(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return 0===e.length?[2,null]:[2,vo(this.body,e,t)]})})},e}();function uo(e,t){var n,r,o,a=g(),s=null==a?void 0:a.TextEncoder;if(s&&null!=e){var u;if("string"==typeof e)u=e,o=(new s).encode(u).length;else if("undefined"!=typeof Blob&&e instanceof Blob)o=(u=e).size;else if("undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams)u=e,o=(new s).encode(u.toString()).length;else if(ArrayBuffer.isView(e))o=(u=e).byteLength;else if(e instanceof ArrayBuffer)o=(u=e).byteLength;else if("undefined"!=typeof FormData&&e instanceof FormData){var l=e,c=0,d=0;try{for(var f=(0,i.Ju)(l.entries()),v=f.next();!v.done;v=f.next()){var h=(0,i.zs)(v.value,2),p=h[0],m=h[1];if(c+=p.length,"string"==typeof m)c+=(new s).encode(m).length;else{if(!("undefined"!=typeof Blob&&m instanceof Blob))return;c+=m.size}if(++d>=t)return}}catch(y){n={error:y}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}o=c}else if("undefined"!=typeof ReadableStream&&e instanceof ReadableStream)return void(u=e);return o}}var lo,co=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,function(e,t){r[t]=e}),po(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t;return(0,i.YH)(this,function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise(function(e){return setTimeout(function(){return e(null)},500)}),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,vo(n.sent(),e,t)]}})})},e}(),fo=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},o=this.headersString.split("\r\n");try{for(var a=(0,i.Ju)(o),s=a.next();!s.done;s=a.next()){var u=s.value,l=(0,i.zs)(u.split(": "),2),c=l[0],d=l[1];c&&d&&(r[c]=d)}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return po(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){var n;return(0,i.YH)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(to(n,e,t),[2,n]):[2,null]})})},e}();function vo(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return to(r,t,n),r}catch(i){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(lo||(lo={}));var ho="[REDACTED]",po=function(e,t){var n,r,o=t.allow,a=void 0===o?[]:o,s=t.strategy,u=void 0===s?lo.REMOVE:s,l=(0,i.fX)([],(0,i.zs)(ge),!1),c={},d=function(t){var n=t.toLowerCase();l.find(function(e){return e.toLowerCase()===n})?u===lo.REDACT&&(c[t]=ho):a.find(function(e){return e.toLowerCase()===n})?c[t]=e[t]:u===lo.REDACT&&(c[t]=ho)};try{for(var f=(0,i.Ju)(Object.keys(e)),v=f.next();!v.done;v=f.next()){d(v.value)}}catch(h){n={error:h}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return c},go=function(){function e(e,t,n,r,i,o,a,s,u,l,c){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=a,this.duration=s,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,n,r,o={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers((0,i.fX)([],(0,i.zs)(pe),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers((0,i.fX)([],(0,i.zs)(pe),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(o).filter(function(e){var t=(0,i.zs)(e,2);t[0];return void 0!==t[1]}))},e}();var mo=function(e,t){void 0===t&&(t=y()),this.callback=e,this.id=t};function yo(e){try{e()}catch(t){}}var bo,wo,Eo=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=g();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=g();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,a,s,u,l,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,v=null===(s=null===(a=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===a?void 0:a.prototype)||void 0===s?void 0:s.send,h=null===(c=null===(l=null===(u=this.globalScope)||void 0===u?void 0:u.XMLHttpRequest)||void 0===l?void 0:l.prototype)||void 0===c?void 0:c.setRequestHeader;f&&v&&h&&this.observeXhr(f,v,h);var p=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;p&&this.observeFetch(p),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){try{n.callback(e)}catch(r){yo(function(){var e;null===(e=t.logger)||void 0===e||e.debug("an unexpected error occurred while triggering event callbacks",r)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,a){var s;if(void 0!==o&&void 0!==a){var u,l,c,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?u=null===(s=null==t?void 0:t.toString)||void 0===s?void 0:s.call(t):(u=t.url,d=t.method),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(g){}d=(null==n?void 0:n.method)||d,r&&(l=r.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},l=0);var v=Math.floor(performance.now()-a),h=Math.floor(o+v),p=new go(e,d,o,o,u,n,l,v,r,c,h);this.triggerEventCallbacks(p)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,i.sH)(t,void 0,void 0,function(){var t,o,a,s,u=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:try{t=this.getTimestamps()}catch(l){yo(function(){var e;return null===(e=u.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while retrieving timestamps",l)})}i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e(n,r)];case 2:return o=i.sent(),[3,4];case 3:return s=i.sent(),a=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new ao(r):void 0,o?new co(o):void 0,a,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(c){yo(function(){var e;return null===(e=u.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while handling fetch",c)})}if(o)return[2,o];throw a}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&yo(function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var o=this.globalScope.XMLHttpRequest.prototype,a=this;o.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=(0,i.zs)(n,2),s=o[0],u=o[1];try{this.$$AmplitudeAnalyticsEvent=(0,i.Cl)({method:s,url:null===(e=null==u?void 0:u.toString)||void 0===e?void 0:e.call(u),headers:{}},a.getTimestamps())}catch(l){yo(function(){var e;return null===(e=a.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while calling xhr open",l)})}return t.apply(this,n)},o.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,o=e.createXhrJsonParser(this,a),s=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new fo(i.status,e,t?parseInt(t,10):void 0,o),r=i.$$AmplitudeAnalyticsEvent.headers,l=new so(s,r);u.status=i.status,a.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,n,void 0,u.startTime,u.durationStart)}catch(c){yo(function(){var e;return null===(e=a.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while handling xhr send",c)})}}),n.apply(i,t)},o.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(i){yo(function(){var e;return null===(e=a.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while calling xhr setRequestHeader",i)})}r.apply(this,[e,t])}}},e}(),So=new Eo,To="[Amplitude] Network Request",ko="500-599";function Co(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function xo(e,t){var n,r,o=t.split(",");try{for(var a=(0,i.Ju)(o),s=a.next();!s.done;s=a.next()){var u=s.value,l=(0,i.zs)(u.split("-").map(Number),2),c=l[0],d=l[1];if(e===c&&void 0===d)return!0;
1if(e>=c&&e<=d)return!0}}catch(f){n={error:f}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1}function Po(e){var t;if(e)try{var n=null===(t=g())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),a=r.href,s=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:r.href,host:s}}catch(u){try{return function(e){var t,n=e.indexOf("#"),r=n>=0?e.slice(n+1):"",i=n>=0?e.slice(0,n):e,o=i.indexOf("?"),a=o>=0?i.slice(o+1):"",s=o>=0?i.slice(0,o):i,u=s.match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i);return{query:a,fragment:r,href:e,hrefWithoutQueryOrHash:s,host:null!==(t=null==u?void 0:u[1])&&void 0!==t?t:""}}(e)}catch(l){return}}}function Io(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return(0,i.fX)([],(0,i.zs)(pe),!1);if(void 0===e){return}}}function Ao(e){var t,n,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)&&!(null===(r=null==e?void 0:e.excludelist)||void 0===r?void 0:r.length)}function Oo(e,t){var n;void 0===t&&(t={});var r=Po(e.url);if(!r)return!1;var o,a=r.host;if(!1!==t.ignoreAmplitudeRequests&&(Co(a,"*.amplitude.com")||Co(a,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find(function(e){return Co(a,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!xo(e.status,ko))return!1;if(t.captureRules&&((0,i.fX)([],(0,i.zs)(t.captureRules),!1).reverse().find(function(t){if(o=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return Co(t,e)}))&&(!r||!e.urls||tr(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((n||0===n)&&!xo(n,e.statusCodeRange||ko))}(t,a,e.status,e.url,e.method),o){var n=Io(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var i=Io(t.requestHeaders);if(e.requestWrapper&&i){var s=e.requestWrapper.headers(i);s&&(e.requestHeaders=s)}if(e.responseWrapper&&t.responseBody&&!Ao(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!Ao(t.requestBody)){u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==o}),!o))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===To}))return!0}catch(jo){}return!1}(a,e.requestWrapper)}function _o(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,o=e.loggerProvider;return t.networkObservable.filter(function(e){return Oo(e.event,n)}).subscribe(function(e){var t,n,a,s=e.event,u=Po(s.url);if(u){var l=null===(n=s.responseWrapper)||void 0===n?void 0:n.bodySize,c=null===(a=s.requestWrapper)||void 0===a?void 0:a.bodySize;!function(e,t,n,r){(0,i.sH)(this,void 0,void 0,function(){var o,a,s;return(0,i.YH)(this,function(u){switch(u.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(o=i.zs.apply(void 0,[u.sent(),2]),a=o[0],s=o[1],a)try{e["[Amplitude] Request Body"]=JSON.stringify(a)}catch(jo){null==r||r.debug("Failed to stringify request body",jo)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(jo){null==r||r.debug("Failed to stringify response body")}u.label=2;case 2:return null==n||n.track(To,e),[2]}})})}(((t={})["[Amplitude] URL"]=u.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=u.query,t["[Amplitude] URL Fragment"]=u.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=c,t["[Amplitude] Response Body Size"]=l,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,r,o)}})}!function(e){e.NetworkObservable="networkObservable"}(bo||(bo={}));var Ro=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new(_n())(function(e){var n=new mo(function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)});return So.subscribe(n,t),function(){So.unsubscribe(n)}});return(e={})[bo.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(o,a){return(0,i.sH)(void 0,void 0,void 0,function(){var s;return(0,i.YH)(this,function(i){return"undefined"!=typeof document||function(){var e,t=g();return"ReactNative"===(null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.product)}()?(s=r(),t=null==o?void 0:o.loggerProvider,wo=_o({allObservables:s,networkTrackingOptions:e,amplitude:a,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added.")),[2]):[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(e){return wo.unsubscribe(),[2]})})}}},Do="web-vitals-browser",Ho="[Amplitude] Web Vitals",Lo={LCP:"[Amplitude] LCP",FCP:"[Amplitude] FCP",INP:"[Amplitude] INP",CLS:"[Amplitude] CLS",TTFB:"[Amplitude] TTFB"};let No=-1;const Mo=()=>No,jo=e=>{addEventListener("pageshow",t=>
vendor: 5,126 bytes, line 1
1{t.persisted&&(No=t.timeStamp,e(t))},!0)},Uo=(e,t,n,r)=>{let i,o;return a=>{t.value>=0&&(a||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Fo=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},qo=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Yo=()=>qo()?.activationStart??0;let zo=-1;const Bo=new Set,Jo=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Vo=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of Bo)e();isFinite(zo)||(zo="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Vo,!0))}},Wo=(e=!1)=>{if(e&&(zo=1/0),zo<0){const e=Yo(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;zo=t??Jo(),addEventListener("visibilitychange",Vo,!0),addEventListener("prerenderingchange",Vo,!0),jo(()=>{setTimeout(()=>{zo=Jo()})})}return{get firstHiddenTime(){return zo},onHidden(e){Bo.add(e)}}},Xo=(e,t=-1,n,r=0,i,o,a)=>{const s=qo(),u=s?.navigationId||0;let l="navigate";return n?l=n:Mo()>=0?l="back-forward-cache":s&&(document.prerendering||Yo()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:l,navigationId:r||u,navigationInteractionId:i,navigationURL:o||s?.name,navigationStartTime:a||0}},$o=new WeakMap;function Ko(e,t){let n=$o.get(t);return n||(n=new WeakMap,$o.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}class Go{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const Qo=(e,t,n={})=>{try{const r=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(r.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();r.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of r)e.observe({type:t,buffered:!0,...n});return e}}catch{}},Zo=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,ea=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},ta=e=>{let t=!1;return()=>{t||(e(),t=!0)}};class na{l}const ra=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},ia=[1800,3e3],oa=(e,t={})=>{const n=Zo(t);ra(()=>{const r=Ko(t,na),i=Wo();let o,a=Xo("FCP");const s=Qo(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(a.value=Math.max(t.startTime-Yo(),0),a.entries.push(t),a.navigationId=t.navigationId||a.navigationId,o(!0)))});s&&(o=Uo(e,a,ia,t.reportAllChanges),jo(n=>{a=Xo("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Mo()),o=Uo(e,a,ia,t.reportAllChanges),Fo(()=>{a.value=performance.now()-n.timeStamp,o(!0)})})),n&&Qo(["soft-navigation"],n=>{n.forEach(n=>{r.l&&n.navigationId&&ea(r.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);a=Xo("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=Uo(e,a,ia,t.reportAllChanges),o(!0)})},t)})},aa=[.1,.25],sa=(e,t={})=>{const n=Wo();oa(ta(()=>{let r,i=Xo("CLS",0);const o=Ko(t,Go),a=(n,a,s,u,l)=>{i=Xo("CLS",0,n,a,s,u,l),o.i=0,r=Uo(e,i,aa,t.reportAllChanges)},s=(e=!1)=>{o.i>i.value&&(i.value=o.i,i.entries=o.o),r(e)},u=e=>{s(!0),a("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(const t of e)"soft-navigation"!==t.entryType?o.h(t):u(t);s()},c=["layout-shift"];Zo(t)&&c.push("soft-navigation");const d=Qo(c,l);d&&(r=Uo(e,i,aa,t.reportAllChanges),n.onHidden(()=>{l(d.takeRecords()),r(!0)}),jo(()=>{a("back-forward-cache",i.navigationId,i.navigationInteractionId,i.navigationURL,Mo()),Fo(r)}),setTimeout(r))}))};let ua=0,la=1/0,ca=0;const da=e=>{for(const t of e)t.interactionId&&(la=Math.min(la,t.interactionId),ca=Math.max(ca,t.interactionId),ua=ca?(ca-la)/7+1:0)};let fa;const va=()=>fa?ua:performance.interactionCount??0;class ha{u=0;v=[];m=new Map;p;T;_(){return va()-this.u}M(){this.u=va(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>
1t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}}const pa=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const i=ta(e);let o=-1;const a=()=>{r(o),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()},{timeout:t})}},ga=[200,500],ma=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Wo();ra(()=>{"interactionCount"in performance||fa||(fa=Qo(["event"],da,{durationThreshold:0}));let r,i=Xo("INP");const o=Ko(t,ha),a=(n,a,s,u,l)=>{o.M(),i=Xo("INP",-1,n,a,s,u,l),r=Uo(e,i,ga,t.reportAllChanges)},s=()=>{const e=o.L(i.navigationType);e&&e.P!==i.value&&(i.value=e.P,i.entries=e.entries,r())},u=e=>{s(),r(!0),a("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=(e,t=!1)=>{pa(()=>{for(const t of e)"soft-navigation"!==t.entryType?o.h(t):u(t);s(),t&&r(!0)})},c=["event","first-input"];Zo(t)&&c.push("soft-navigation");const d=Qo(c,l,{...t,durationThreshold:t.durationThreshold??40});r=Uo(e,i,ga,t.reportAllChanges),d&&(n.onHidden(()=>{l(d.takeRecords(),!0)}),jo(()=>{a("back-forward-cache",i.navigationId,i.navigationInteractionId,i.navigationURL,Mo())}))})};class ya{p;l;h(e){this.p?.(e)}}const ba=[2500,4e3],wa=(e,t={})=>{let n=!1;const r=Zo(t);ra(()=>{let i,o=Wo(),a=Xo("LCP");const s=Ko(t,ya),u=(r,s,u,l,c)=>{a=Xo("LCP",-1,r,s,u,l,c),i=Uo(e,a,ba,t.reportAllChanges),n=!1,"soft-navigation"===r&&(o=Wo(!0))},l=e=>{s.l&&e.navigationId&&ea(s.l,e),n||i(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&c([t])},c=e=>{t.reportAllChanges||r||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){l(t);continue}let e=0,n=[],r=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-Yo(),0),s.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const i=t;if(!a.navigationId)continue;if("interactionId"in i&&i.interactionId!=a.navigationInteractionId)continue;r=i.largestContentfulPaint?.renderTime||0,e=Math.max(r-t.startTime,0),i.largestContentfulPaint&&(s.h(i.largestContentfulPaint),n=[i.largestContentfulPaint])}r<o.firstHiddenTime&&(a.value=e,a.entries=n,i())}},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");const f=Qo(d,c);if(f){i=Uo(e,a,ba,t.reportAllChanges);const o=["keydown","click","visibilitychange"],s=e=>{if(e.isTrusted&&!n){const e=a.id;pa(()=>{if(!n){if(!r){f.disconnect();for(const e of o)removeEventListener(e,s,{capture:!0})}e===a.id&&(n=!0,i(!0))}})}};for(const e of o)addEventListener(e,s,{capture:!0});jo(r=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Mo()),i=Uo(e,a,ba,t.reportAllChanges),Fo(()=>{a.value=performance.now()-r.timeStamp,n=!0,i(!0)})})}})},Ea=[800,1800],Sa=e=>{document.prerendering?ra(()=>Sa(e)):"complete"!==document.readyState?addEventListener("load",()=>Sa(e),!0):setTimeout(e)},Ta=(e,t={})=>{const n=Zo(t);let r=Xo("TTFB"),i=Uo(e,r,Ea,t.reportAllChanges);Sa(()=>{const o=qo();if(o){const a=o.responseStart;r.value=Math.max(a-Yo(),0),r.entries=[o],i(!0),jo(()=>{r=Xo("TTFB",0,"back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Mo()),i=Uo(e,r,Ea,t.reportAllChanges),i(!0)}),n&&Qo(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(r=Xo("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),r.entries=[n],i=Uo(e,r,Ea,t.reportAllChanges),i(!0))})},t)}})};function ka(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function Ca(e,t){void 0===t&&(t=!1);var n={value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(ka(e)),navigationStart:t?Math.floor(performance.timeOrigin+(e.navigationStartTime||0)):Math.floor(performance.timeOrigin)};return t&&(n.navigationId=e.navigationId),n}var xa=Object.values(Lo);var Pa,Ia=function(){var e,t=null,n=g(),r=null==n?void 0:n.document,o=null==n?void 0:n.location,a=!1,s=new Set;return{name:Do,type:"enrichment",setup:function(n,u){return(0,i.sH)(void 0,void 0,void 0,function(){var l,c,d,f,v,h,p,g;return(0,i.YH)(this,function(m){return void 0===r||(a=!0,l=new Map,c=-1,d=function(e){var t=e.navigationId,i=l.get(t);
1return i||(i=function(e,t,n){var r="",i="";try{var o=new URL(e);r=o.hostname,i=o.pathname}catch(jo){n.debug("Web vitals plugin is unable to parse page URL: ",jo)}var a=nr(e,n);return{"[Amplitude] Page Domain":r,"[Amplitude] Page Location":a,"[Amplitude] Page Path":nr(i,n),"[Amplitude] Page Title":t,"[Amplitude] Page URL":nr(a.split("?")[0],n)}}(e.navigationURL||(null==o?void 0:o.href)||"",r.title||"",n.loggerProvider),l.set(t,i)),i},f=function(e){s.add(e);var t=l.get(e);t&&(l.delete(e),function(e){return xa.some(function(t){return t in e})}(t)&&u.track(Ho,t))},v=function(){var e,t;try{for(var n=(0,i.Ju)(Array.from(l.keys())),r=n.next();!r.done;r=n.next()){var o=r.value;f(o)}}catch(a){e={error:a}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},h=function(t){void 0!==e&&clearTimeout(e),e=setTimeout(function(){var n,r;e=void 0;try{for(var o=(0,i.Ju)(Array.from(l.keys())),a=o.next();!a.done;a=o.next()){var s=a.value;s<t&&f(s)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},1e3)},g={reportSoftNavs:!0},wa((p=function(e){return function(t){a&&!s.has(t.navigationId)&&(d(t)[e]=Ca(t,!0),t.navigationId>c&&(-1!==c&&h(t.navigationId),c=t.navigationId))}})(Lo.LCP),g),oa(p(Lo.FCP),g),ma(p(Lo.INP),g),sa(p(Lo.CLS),g),Ta(p(Lo.TTFB),g),t=function(){"hidden"===r.visibilityState&&t&&v()},r.addEventListener("visibilitychange",t)),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(n){return a=!1,void 0!==e&&(clearTimeout(e),e=void 0),t&&(null==r||r.removeEventListener("visibilitychange",t),t=null),[2]})})}}},Aa=function(e){return void 0===e&&(e={}),!0===e.reportSoftNav&&function(){var e=g();return e&&"PerformanceSoftNavigation"in e}()?Ia():function(){var e=null,t=g(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:Do,type:"enrichment",setup:function(t,o){return(0,i.sH)(void 0,void 0,void 0,function(){var a,s;return(0,i.YH)(this,function(i){return void 0===n||(a=nr((null==r?void 0:r.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":nr((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":nr(a.split("?")[0],t.loggerProvider)},wa(function(e){s["[Amplitude] LCP"]=Ca(e)}),oa(function(e){s["[Amplitude] FCP"]=Ca(e)}),ma(function(e){s["[Amplitude] INP"]=Ca(e)}),sa(function(e){s["[Amplitude] CLS"]=Ca(e)}),Ta(function(e){s["[Amplitude] TTFB"]=Ca(e)}),e=function(){"hidden"===n.visibilityState&&e&&(o.track(Ho,s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}}()},Oa=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[K,t,e.substring(0,n)].filter(Boolean).join("_")},_a=function(){function e(e,t){var n,r,o;this.shouldTrackNewCampaign=!1,this.options=(0,i.Cl)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=(null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)||t.topLevelDomain,o=r,o?(o.startsWith(".")&&(o=o.substring(1)),[new RegExp("".concat(o.replace(".","\\."),"$"))]):[]),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=Oa(t.apiKey,"MKTG"),this.webExpStorageKey=Oa(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=he,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,i.sH)(this,void 0,void 0,function(){var e,t;return(0,i.YH)(this,function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=i.zs.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||qe(this.sessionTimeout,this.lastEventTime),Jt(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,i.sH)(this,void 0,void 0,function(){var e;return(0,i.YH)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new fn).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,o,a=(t=this.currentCampaign,n=this.options,r=(0,i.Cl)((0,i.Cl)({},he),t),o=Object.entries(r).reduce(function(e,t){var r,o=(0,i.zs)(t,2),a=o[0],s=o[1];return e.setOnce("initial_".concat(a),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(a,s):e.unset(a)},new He),Ue(o));return e&&(a.event_id=e),a},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Ra=new Set([Ne.IDENTIFY,Ne.GROUP_IDENTIFY]),Da=function(e){var t;void 0===e&&(e={});var n,r,o,a,s,u,l=null!==(t=e.fallbackAttributionEvent)&&void 0!==t&&t,c=g(),d={},f=!1,v=!1,h=function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e;return(0,i.YH)(this,function(t){switch(t.label){case 0:return[4,(ne
1w fn).parse()];case 1:return e=t.sent(),d=dn(e),l&&(null==r||r.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",d)),[2]}})})},p=function(){h()},m=function(e){return new Proxy(e,{apply:function(e,t,n){Reflect.apply(e,t,n),f&&p()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(i){switch(i.label){case 0:return n=t,r=e.loggerProvider,f=!0,r.log("Installing event property attribution tracking."),[4,h()];case 1:if(i.sent(),!c)return[2];if(c.addEventListener("popstate",p),!v){if(o=Reflect.get(c.history,"pushState"),a=Reflect.get(c.history,"replaceState"),!o||!a)return[2];s=m(o),c.history.pushState=s,u=m(a),c.history.replaceState=u,v=!0}return[2]}})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(t){return Ra.has(e.event_type)||(e.event_properties=(0,i.Cl)((0,i.Cl)({},d),e.event_properties)),[2,e]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e,t;return(0,i.YH)(this,function(n){return c&&(c.removeEventListener("popstate",p),e=Reflect.get(c.history,"pushState"),t=Reflect.get(c.history,"replaceState"),v&&e===s&&o&&(c.history.pushState=o),v&&t===u&&a&&(c.history.replaceState=a)),f=!1,v=!1,o=void 0,a=void 0,s=void 0,u=void 0,d={},[2]})})}}},Ha="AMP_CURRENT_PAGE",La="AMP_PREVIOUS_PAGE",Na="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Pa||(Pa={}));var Ma=new Set([Ne.IDENTIFY,Ne.GROUP_IDENTIFY,Ne.REVENUE]),ja=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=g(),o=void 0,a=!1,s=void 0,u=!1,l=!1,c=function(e){var t;try{var n=nr(e,s);t=new URL(n).hostname}catch(jo){null==s||s.error("Could not parse URL: ",jo)}return t},d=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?c(e):void 0;if(!r)return Pa.Direct;var i=n.some(function(e){return-1!==t.indexOf(e)}),o=n.some(function(e){return-1!==r.indexOf(e)});return t===r||o&&i?Pa.Internal:Pa.External},f=function(){return(0,i.sH)(void 0,void 0,void 0,function(){var e,t,n,r,s;return(0,i.YH)(this,function(i){switch(i.label){case 0:return o&&a?[4,o.get(Na)]:[3,3];case 1:return e=i.sent(),t=nr("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Ha])||"",r=void 0,r=t===n?(null==e?void 0:e[La])||"":n||(document.referrer||""),[4,o.set(Na,(s={},s[Ha]=t,s[La]=r,s))];case 2:i.sent(),i.label=3;case 3:return[2]}})})},v=function(){f()},h={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,i.sH)(void 0,void 0,void 0,function(){var t,n,d,h,p,g,m,y;return(0,i.YH)(this,function(b){switch(b.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,!r)return[3,7];try{o=new pt(r.sessionStorage)}catch(w){null==s||s.debug("sessionStorage is not available in this environment.")}return[4,null==o?void 0:o.isEnabled()];case 1:return a=null!==(y=b.sent())&&void 0!==y&&y,o&&a?(t="undefined"!=typeof document&&document.referrer||"",n=t?c(t):void 0,d="undefined"!=typeof location&&location.hostname||"",h=nr("undefined"!=typeof location&&location.href||""),[4,o.get(Na)]):[3,6];case 2:return p=b.sent(),g=(null==p?void 0:p[Ha])||"",!!n&&n!==d&&g!==h?[4,o.set(Na,(m={},m[Ha]=h,m[La]=t,m))]:[3,4];case 3:return b.sent(),[3,6];case 4:return[4,f()];case 5:b.sent(),b.label=6;case 6:r.addEventListener("popstate",v),u||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,i.zs)(n,3),o=r[0],a=r[1],s=r[2];e.apply(t,[o,a,s]),l&&v()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=(0,i.zs)(n,3),o=r[0],a=r[1],s=r[2];e.apply(t,[o,a,s]),l&&v()}}),u=!0),b.label=7;case 7:return[2]}})})},execute:function(e){return(0,i.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,i.YH)(this,function(s){switch(s.label){case 0:return t=nr("undefined"!=typeof location&&location.href||""),o&&a?[4,o.get(Na)]:[3,2];case 1:if(n=s.sent(),r=(null==n?void 0:n[La])||"",Ma.has(e.event_type))return[2,e];e.event_properties=(0,i.Cl)((0,i.Cl)({},e.event_properties||{}),{"[Amplitude] Page Domain":Ua(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":Ua(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":Ua(e,"[Amplitude] Page Path","undefined"!=typeof location&&nr(location.pathname)||""),"[Amplitude] Page Title":Ua(e,"[Amplitude] Page Title",cn(ln)),"[Amplitude] Page URL":Ua(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":r,"[Amplitude] Previous Page Type":d(r)}),s.label=2;case 2:return[2,e]}})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",v),l=!1),o&&a?[4,o.set(Na,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}};return h};function Ua(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var Fa=function(){var e,t,n;function r(t){if(t)try{var n=new Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(r){null==e||e.error("Could not create custom enrichment function",r)}return function(e){return e}}var o={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(o,a){return(0,i.sH)(void 0,void 0,void 0,function(){var a,s;return(0,i.YH)(this,function(i){return null==(e=o.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(s=o.remoteConfig)||void 0===s?void 0:s.fetchRemoteConfig)&&(o.remoteConfigClient?(a=o.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){n=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?r(e.body||""):r("")}),t=function(){var e;return null===(e=o.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(a)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return(0,i.sH)(void 0,void 0,void 0,function(){var r;return(0,i.YH)(this,function(i){if(n)try{return[2,null!==(r=n(t))&&void 0!==r?r:null]}catch(o){return null==e||e.error("Could not execute custom enrichment function",o),[2,t]}return[2,t]})})},teardown:function(){return(0,i.sH)(void 0,void 0,void 0,function(){return(0,i.YH)(this,function(e){return t&&t(),[2]})})}};return o},qa="userProperty",Ya="eventProperty",za=function(e){return e===qa||e===Ya},Ba=[qa,Ya],Ja=function(e,t){return function(e){var t=(0,i.fX)([],(0,i.zs)(new Set((Array.isArray(e)?e:[e]).filter(za))),!1);return t.length>0?t:(0,i.fX)([],(0,i.zs)(Ba),!1)}(e.trackingMethod).includes(t)},Va=function(e){return Ja(e,qa)},Wa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,i.C6)(t,e),t.prototype.init=function(e,t,n){var r,o;return void 0===e&&(e=""),arguments.length>2?(r=t,o=n):"string"==typeof t?(r=t,o=void 0):(r=null==t?void 0:t.userId,o=t),
1c(this._init((0,i.Cl)((0,i.Cl)({},o),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,o,a,s,u,l,c,d;return(0,i.sH)(this,void 0,void 0,function(){var v,h,p,m,y,b,w,E,T,k,C,x,P,I,A,O=this;return(0,i.YH)(this,function(_){switch(_.label){case 0:return this.initializing?[2]:(this.initializing=!0,v=function(e){var t,n;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),h=null!==(n=t.loggerProvider)&&void 0!==n?n:new f,t.loggerProvider||h.enable(null!==(o=t.logLevel)&&void 0!==o?o:r.Warn),p=null!==(a=t.serverZone)&&void 0!==a?a:"US",y=this._diagnosticsSampleRate,b=null===(s=t.enableDiagnostics)||void 0===s||s,v?(m=new S(t.apiKey,h,p,null===(u=t.remoteConfig)||void 0===u?void 0:u.serverUrl),[4,new Promise(function(e){null==m||m.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(h.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(y=i);var o=t.enabled;"boolean"==typeof o&&(b=o)}e()})})]):[3,2]);case 1:_.sent(),_.label=2;case 2:return(w=new U(t.apiKey,h,p,{enabled:b,sampleRate:y})).setTag("library","".concat(ut,"/").concat(st)),w.setTag("platform","Web"),w.setTag("web_environment",function(){var e=g();if(!e)return"unknown";var t=function(e){var t,n;return"string"==typeof(null===(n=null===(t=e.chrome)||void 0===t?void 0:t.runtime)||void 0===n?void 0:n.id)}(e);return function(e){var t=e.ServiceWorkerGlobalScope;return"function"==typeof t&&e instanceof t}(e)?t?"chrome_extension_service_worker":"service_worker":function(e){var t=e.WorkerGlobalScope;return"function"==typeof t&&e instanceof t}(e)?"web_worker":function(e){return void 0!==e.document}(e)?t?"chrome_extension":"browser":function(e){var t,n;return"string"==typeof(null===(n=null===(t=e.process)||void 0===t?void 0:t.versions)||void 0===n?void 0:n.node)}(e)?"node":"unknown"}()),"undefined"!=typeof navigator&&w.setTag("user_agent",navigator.userAgent),[4,Zt(t.apiKey,t,this,w,{loggerProvider:h,serverZone:p,enableDiagnostics:b,diagnosticsSampleRate:y})];case 3:return E=_.sent(),v&&m?[4,new Promise(function(e){null==m||m.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){E.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&xn(t,E),e()})})]:[3,5];case 4:_.sent(),_.label=5;case 5:return[4,e.prototype._init.call(this,E)];case 6:return _.sent(),this.logBrowserOptions(E),this.config.remoteConfigClient=m,H=this.config,T=Je(H.defaultTracking)&&H.defaultTracking&&"object"==typeof H.defaultTracking&&H.defaultTracking.attribution&&"object"==typeof H.defaultTracking.attribution?(0,i.Cl)({},H.defaultTracking.attribution):{},Je(this.config.defaultTracking)&&Va(T)?(this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,i.sH)(O,void 0,void 0,function(){return(0,i.YH)(this,function(t){switch(t.label){case 0:return e?[3,2]:(this.webAttribution=new _a(T,this.config),[4,this.webAttribution.init()]);case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new _a(T,this.config),[4,this.webAttribution.init()]):[3,8];case 7:_.sent(),_.label=8;case 8:return k=F(),C=k.ampTimestamp?Number(k.ampTimestamp):void 0,x=!C||Date.now()<C,P=x&&!Number.isNaN(Number(k.ampSessionId))?Number(k.ampSessionId):void 0,-1!==(I=this.config.deferredSessionId)||this.config.optOut||(I=Date.now()),this.setSessionId(null!==(d=null!==(c=null!==(l=t.sessionId)&&void 0!==l?l:P)&&void 0!==c?c:I)&&void 0!==d?d:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,i.sH)(O,void 0,void 0,function(){return(0,i.YH)(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(A=ye(this.config.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,10]:[4,this.add(Tn()).promise];case 9:_.sent(),_.label=10;case 10:return[4,this.add(new Oe({diagnosticsClient:w})).promise];case 11:return _.sent(),[4,this.add(new lt).promise];case 12:return _.sent(),[4,this.add(new _e).promise];
1case 13:return _.sent(),function(e){Sn||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n  defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Sn=!0)}(this.config),D=this.config.defaultTracking,Be(D,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(En()).promise]):[3,15];case 14:_.sent(),_.label=15;case 15:return Ve(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(yn()).promise]):[3,17];case 16:_.sent(),_.label=17;case 17:return We(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(hn(rt(this.config))).promise]):[3,20];case 18:return _.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return(0,i.sH)(O,void 0,void 0,function(){return(0,i.YH)(this,function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(hn(rt(this.config))).promise]);case 1:return t.sent(),[2]}})})}),_.label=20;case 20:return Je(this.config.defaultTracking)&&function(e){return Ja(e,Ya)}(T)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(Da(T)).promise]):[3,22];case 21:_.sent(),_.label=22;case 22:return Ke(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Oi(et(this.config),{diagnosticsClient:w})).promise]):[3,24];case 23:_.sent(),_.label=24;case 24:return Qe(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Xi(tt(this.config))).promise]):[3,26];case 25:_.sent(),_.label=26;case 26:return $e(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Ro(nt(this.config))).promise]):[3,28];case 27:_.sent(),_.label=28;case 28:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.webVitals||"object"==typeof e.webVitals&&null!==e.webVitals)}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(Aa(Ge(this.config))).promise]):[3,30];case 29:_.sent(),_.label=30;case 30:return function(e){return"object"==typeof e&&(!0===e.performanceTracking||"object"==typeof e.performanceTracking)}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(Zi(Ze(this.config))).promise]):[3,32];case 31:_.sent(),_.label=32;case 32:return function(e){return Be(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(ja()).promise]):[3,34];case 33:_.sent(),_.label=34;case 34:return("boolean"==typeof(R=this.config.customEnrichment)?R:"object"==typeof R&&null!==R&&!1!==R.enabled)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(Fa()).promise]):[3,36];case 35:_.sent(),_.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return _.sent(),A.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=(0,i.Tt)(t,["time"]),o="number"==typeof n?{time:n}:void 0;O.track(e.eventType,r,o)}),[2]}var R,D,H})})},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){ye(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){ye(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(y()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){var t,n,r;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var o=new He,a=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var s=(0,i.Ju)(Object.entries(a)),u=s.next();!u.done;u=s.next()){var l=(0,i.zs)(u.value,2),c=l[0],d=l[1];o.set(c,d)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(o)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),c(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,c(Promise.resolve());
vendor: 10,817 bytes, line 1
1if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return c(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Xe(this.config.defaultTracking)&&(r&&i&&n.push(this.track(Dt,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(Ue(this.config.identify)).promise),Xe(this.config.defaultTracking)&&n.push(this.track(Rt,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,c(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=tn(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(ot(t)){var r=t._q;t._q=[],t=it(new He,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(ot(r)){var o=r._q;r._q=[],r=it(new He,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(ot(t)){var r=t._q;t._q=[],t=it(new Fe,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!Va(this.webAttribution.options))return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,i.sH)(this,void 0,void 0,function(){var n,r,o;return(0,i.YH)(this,function(i){return n=Date.now(),r=qe(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Rt||t.event_type===Dt||t.session_id&&t.session_id!==this.getSessionId()||(r||o?(this.setSessionId(n),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,i.Cl)((0,i.Cl)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",h(t))}catch(jo){this.config.loggerProvider.error("Error logging browser config",jo)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(ze);const Xa=($a=new Wa,{init:l($a.init.bind($a),"init",a($a),u($a,["config"])),add:l($a.add.bind($a),"add",a($a),u($a,["config.apiKey","timeline.plugins"])),remove:l($a.remove.bind($a),"remove",a($a),u($a,["config.apiKey","timeline.plugins"])),track:l($a.track.bind($a),"track",a($a),u($a,["config.apiKey","timeline.queue.length"])),logEvent:l($a.logEvent.bind($a),"logEvent",a($a),u($a,["config.apiKey","timeline.queue.length"])),identify:l($a.identify.bind($a),"identify",a($a),u($a,["config.apiKey","timeline.queue.length"])),groupIdentify:l($a.groupIdentify.bind($a),"groupIdentify",a($a),u($a,["config.apiKey","timeline.queue.length"])),setGroup:l($a.setGroup.bind($a),"setGroup",a($a),u($a,["config.apiKey","timeline.queue.length"])),revenue:l($a.revenue.bind($a),"revenue",a($a),u($a,["config.apiKey","timeline.queue.length"])),flush:l($a.flush.bind($a),"flush",a($a),u($a,["config.apiKey","timeline.queue.length"])),getUserId:l($a.getUserId.bind($a),"getUserId",a($a),u($a,["config","config.userId"])),setUserId:l($a.setUserId.bind($a),"setUserId",a($a),u($a,["config","config.userId"])),getDeviceId:l($a.getDeviceId.bind($a),"getDeviceId",a($a),u($a,["config","config.deviceId"])),setDeviceId:l($a.setDeviceId.bind($a),"setDeviceId",a($a),u($a,["config","config.deviceId"])),reset:l($a.reset.bind($a),"reset",a($a),u($a,["config","config.userId","config.deviceId"])),getSessionId:l($a.getSessionId.bind($a),"getSessionId",a($a),u($a,["config"])),setSessionId:l($a.setSessionId.bind($a),"setSessionId",a($a),u($a,["config"])),extendSession:l($a.extendSession.bind($a),"extendSession",a($a),u($a,["config"])),setOptOut:l($a.setOptOut.bind($a),"setOptOut",a($a),u($a,["config"])),setTransport:l($a.setTransport.bind($a),"setTransport",a($a),u($a,["config"])),getIdentity:l($a.getIdentity.bind($a),"getIdentity",a($a),u($a,["config"])),setIdentity:l($a.setIdentity.bind($a),"setIdentity",a($a),u($a,["config","config.userId","config.deviceId"])),getOptOut:l($a.getOptOut.bind($a),"getOptOut",a($a),u($a,["config"])),_setDiagnosticsSampleRate:l($a._setDiagnosticsSampleRate.bind($a),"_setDiagnosticsSampleRate",a($a),u($a,["config"]))});var $a,Ka=Xa.init},1401(e){var t=Object.prototype.hasOwnProperty;function n(e){return"[Throws: "+(e?e.message:"?")+"]"}function r(e){var r=[];return function e(i){if(null===i||"object"!=typeof i)return i;if(-1!==r.indexOf(i))return"[Circular]";if(r.push(i),"function"==typeof i.toJSON)try{var o=e(i.toJSON());return r.pop(),o}catch(u){return n(u)}if(Array.isArray(i)){var a=i.map(e);return r.pop(),a}var s=Object.keys(i).reduce(function(r,o){return r[o]=e(function(e,r){if(t.call(e,r))try{return e[r]}catch(u){return n(u)}return e[r]}(i,o)),r},{});return r.pop(),s}(e)}e.exports=function(e,t,n){return JSON.stringify(r(e),t,n)},e.exports.ensureProperties=r},6064(e,t,n){e.exports=n(3619).Observable},3619(e,t){"use strict";t.Observable=void 0;const n=e=>Boolean(Symbol[e]),r=e=>n(e)?Symbol[e]:"@@"+e,i=r("iterator"),o=r("observable"),a=r("species");function s(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function u(e){let t=e.constructor;return void 0!==t&&(t=t[a],null===t&&(t=void 0)),void 0!==t?t:g}function l(e){l.log?l.log(e):setTimeout(()=>{throw e})}function c(e){Promise.resolve().then(()=>{try{e()}catch(t){l(t)}})}function d(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=s(t,"unsubscribe");e&&e.call(t)}}catch(n){l(n)}}function f(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function v(e,t,n){e._state="running";let r=e._observer;try{let i=s(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(f(e),!i)throw n;i.call(r,n);break;case"complete":f(e),i&&i.call(r)}}catch(i){l(i)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function h(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void c(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(v(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e))):void v(e,t,n);e._queue.push({type:t,value:n})}}class p{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){h(n,"next",e)},error(e){h(n,"error",e)},complete(){h(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(i){r.error(i)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(f(this),d(this))}}class g{constructor(e){if(!(this instanceof g))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new p(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(o){n(o),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(r){return t.error(r)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(r){return t.error(r)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=u(this),n=arguments.length>1,r=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let a=!r;if(r=!0,!a||n)try{i=e(i,o)}catch(s){return t.error(s)}else i=o},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=u(this);return new t(n=>{let r,i=0;return function o(a){r=a.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=u(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(s){return n.error(s)}let a=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(a);e>=0&&r.splice(e,1),o()}});r.push(a)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(e){let t="function"==typeof this?this:g;if(null==e)throw new TypeError(e+" is not an object");let r=s(e,o);if(r){let n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof g}(n)&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=s(e,i),r))return new t(t=>{c(()=>{if(!t.closed){for(let n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{c(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:g)(t=>{c(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[a](){return this}}t.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:o,hostReportError:l},configurable:!0})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.